forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRawDecoderSpec.h
More file actions
100 lines (90 loc) · 3.03 KB
/
RawDecoderSpec.h
File metadata and controls
100 lines (90 loc) · 3.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#ifndef O2_CTP_RAWDECODER_H
#define O2_CTP_RAWDECODER_H
#include <vector>
#include <deque>
#include "Framework/DataProcessorSpec.h"
#include "Framework/Task.h"
#include "Framework/WorkflowSpec.h"
#include "DataFormatsCTP/Digits.h"
#include "DataFormatsCTP/LumiInfo.h"
#include "CTPReconstruction/RawDataDecoder.h"
namespace o2
{
namespace ctp
{
namespace reco_workflow
{
/// \class RawDecoderSpec
/// \brief Coverter task for Raw data to CTP digits
/// \author Roman Lietava from CPV example
///
class RawDecoderSpec : public framework::Task
{
public:
/// \brief Constructor
/// \param propagateMC If true the MCTruthContainer is propagated to the output
RawDecoderSpec(bool digits, bool lumi) : mDoDigits(digits), mDoLumi(lumi) {}
/// \brief Destructor
~RawDecoderSpec() override = default;
/// \brief Initializing the RawDecoderSpec
/// \param ctx Init context
void init(framework::InitContext& ctx) final;
void endOfStream(o2::framework::EndOfStreamContext& ec) final;
/// \brief Run conversion of raw data to cells
/// \param ctx Processing context
///
/// The following branches are linked:
/// Input RawData: {"ROUT", "RAWDATA", 0, Lifetime::Timeframe}
/// Output HW errors: {"CTP", "RAWHWERRORS", 0, Lifetime::Timeframe} -later
void run(framework::ProcessingContext& ctx) final;
void updateTimeDependentParams(framework::ProcessingContext& pc);
protected:
private:
// for digits
bool mDoDigits = true;
o2::pmr::vector<CTPDigit> mOutputDigits;
int mMaxInputSize = 0;
bool mMaxInputSizeFatal = 0;
// for lumi
bool mDoLumi = true;
//
LumiInfo mOutputLumiInfo;
bool mVerbose = false;
uint64_t mCountsT = 0;
uint64_t mCountsV = 0;
uint32_t mNTFToIntegrate = 1;
uint32_t mNHBIntegratedT = 0;
uint32_t mNHBIntegratedV = 0;
bool mDecodeinputs = 0;
std::deque<size_t> mHistoryT;
std::deque<size_t> mHistoryV;
RawDataDecoder mDecoder;
// Errors
int mLostDueToShiftInps = 0;
int mErrorIR = 0;
int mErrorTCR = 0;
int mIRRejected = 0;
int mTCRRejected = 0;
std::array<uint64_t, o2::ctp::CTP_NCLASSES> mClsEA{};
std::array<uint64_t, o2::ctp::CTP_NCLASSES> mClsEB{}; // from inputs
std::array<uint64_t, o2::ctp::CTP_NCLASSES> mClsA{};
std::array<uint64_t, o2::ctp::CTP_NCLASSES> mClsB{}; // from inputs
bool mCheckConsistency = false;
};
/// \brief Creating DataProcessorSpec for the CTP
///
o2::framework::DataProcessorSpec getRawDecoderSpec(bool askSTFDist, bool digits, bool lumi);
} // namespace reco_workflow
} // namespace ctp
} // namespace o2
#endif