Project
Loading...
Searching...
No Matches
STFDecoderSpec.h
Go to the documentation of this file.
1// Copyright 2019-2026 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
15
16#ifndef O2_ITSMFT_STFDECODER_
17#define O2_ITSMFT_STFDECODER_
18
19#include <memory>
20#include <string>
21#include <vector>
22#include <TStopwatch.h>
24#include "Framework/Task.h"
30
31using namespace o2::framework;
32
33namespace o2
34{
35namespace base
36{
37class GRPGeomRequest;
38}
39namespace itsmft
40{
41class Clusterer;
42
44 bool doClusters = true;
45 bool doPatterns = true;
46 bool doDigits = false;
47 bool doCalib = false;
48 bool doSquashing = false;
49 bool doStaggering = false;
50 bool askSTFDist = true;
51 bool allowReporting = true;
52 bool verifyDecoder = false;
54 std::string deviceName{};
55 std::string inputSpec{};
56};
57
58template <class Mapping>
59class STFDecoder : public Task
60{
61 using AlpideParam = DPLAlpideParam<Mapping::getDetID()>;
62
63 public:
64 STFDecoder(const STFDecoderInp& inp, std::shared_ptr<o2::base::GRPGeomRequest> gr);
65 STFDecoder() = default;
66 ~STFDecoder() override = default;
67 void init(InitContext& ic) final;
68 void run(ProcessingContext& pc) final;
69 void endOfStream(EndOfStreamContext& ec) final { finalize(); }
70 void stop() final { finalize(); }
71 void finaliseCCDB(ConcreteDataMatcher& matcher, void* obj) final;
72
73 private:
74 void updateTimeDependentParams(ProcessingContext& pc);
75 void finalize();
76 void reset();
77 std::unique_ptr<o2::itsmft::Clusterer> setupClusterer(const std::string& dictName);
78 bool ensureContinuousROF(const std::vector<ROFRecord>& in, std::vector<ROFRecord>& out, int lr, int nROFsTF, const char* name);
79 void rectifyDigits(std::vector<ROFRecord>& rofVec, std::vector<Digit>& digVec);
80 void rectifyClusters(std::vector<ROFRecord>& rofVec, std::vector<CompClusterExt>& clusVec, std::vector<unsigned char>& pattVec);
81
82 TStopwatch mTimer;
83 bool mDoClusters = false;
84 bool mDoPatterns = false;
85 bool mDoDigits = false;
86 bool mDoCalibData = false;
87 bool mDoStaggering = false;
88 bool mUnmutExtraLanes = false;
89 bool mFinalizeDone = false;
90 bool mAllowReporting = true;
91 bool mApplyNoiseMap = true;
92 bool mUseClusterDictionary = true;
93 bool mVerifyDecoder = false;
94 bool mDumpFrom1stPipeline = false;
95 bool mRunEnsureContinuousROF = true;
96 bool mDisableRectifyContinuousROF = false;
97 int mDumpOnError = 0;
98 int mNThreads = 1;
99 int mVerbosity = 0;
100 int mLayers = 1;
101 long mROFErrRepIntervalMS = 0;
102 size_t mTFCounter = 0;
103 uint32_t mFirstTFOrbit = 0;
104 o2::InteractionRecord mFirstIR;
105 std::vector<size_t> mEstNDig{0};
106 std::vector<size_t> mEstNClus{0};
107 std::vector<size_t> mEstNClusPatt{0};
108 std::vector<size_t> mEstNCalib{0};
109 size_t mMaxRawDumpsSize = 0;
110 size_t mRawDumpedSize = 0;
111 std::string mInputSpec;
112 std::string mSelfName;
113 std::vector<std::unique_ptr<RawPixelDecoder<Mapping>>> mDecoder;
114 std::unique_ptr<Clusterer> mClusterer;
115 std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
116};
117
120
122
123} // namespace itsmft
124} // namespace o2
125
126#endif /* O2_ITS_DIGITREADER */
Definition of the ITSMFT ROFrame (trigger) record.
Definition of the Alpide pixel reader for raw data processing.
void endOfStream(EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
void run(ProcessingContext &pc) final
void finaliseCCDB(ConcreteDataMatcher &matcher, void *obj) final
void init(InitContext &ic) final
void stop() final
This is invoked on stop.
~STFDecoder() override=default
GLuint const GLchar * name
Definition glcorearb.h:781
Defining ITS Vertex explicitly as messageable.
Definition Cartesian.h:288
o2::framework::DataProcessorSpec getSTFDecoderSpec(const STFDecoderInp &inp)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
o2::header::DataOrigin origin
std::vector< unsigned char > pattVec