2222#include " SimulationDataFormat/MCTruthContainer.h"
2323#include " TPCBase/Sector.h"
2424#include " TPCSimulation/Digitizer.h"
25+ #include " Steer/HitProcessingManager.h"
2526
2627namespace o2
2728{
@@ -46,6 +47,9 @@ class DigitizerTask : public FairTask
4647 // / Inititializes the digitizer and connects input and output container
4748 InitStatus Init () override ;
4849
50+ // / Inititializes the digitizer and connects input and output container
51+ InitStatus Init2 ();
52+
4953 // / Sets the debug flags for the sub-tasks
5054 // / \param debugsString String containing the debug flags
5155 // / o PRFdebug - Debug output after application of the PRF
@@ -60,12 +64,48 @@ class DigitizerTask : public FairTask
6064 // / \param nTimeBinsMax Maximal number of time bins to be written out
6165 void setMaximalTimeBinWriteOut (int i) { mTimeBinMax = i; }
6266
67+ // / Setter for time-chunk wise processing
68+ // / \param isTimeChunk Process time-chunk wise
69+ void setTimeChunkProcessing (bool isTimeChunk) { mProcessTimeChunks = isTimeChunk; }
70+
71+ // / Setup a sector for processing
72+ // / \param s Sector to be processed
73+ void setupSector (int s);
74+
75+ void setStartTime (double tstart) { mStartTime = tstart; }
76+ void setEndTime (double tend) { mEndTime = tend; }
77+
6378 // / Digitization
6479 // / \param option Option
6580 void Exec (Option_t* option) override ;
6681
82+ // / Digitization
83+ // / \param option Option
84+ void Exec2 (Option_t* option);
85+
6786 void FinishTask () override ;
6887
88+ void FinishTask2 ();
89+
90+ void setData (const std::vector<std::vector<o2::TPC::HitGroup>*>* lefthits,
91+ const std::vector<std::vector<o2::TPC::HitGroup>*>* righthits,
92+ const std::vector<o2::TPC::TPCHitGroupID>* leftids, const std::vector<o2::TPC::TPCHitGroupID>* rightids,
93+ const o2::steer::RunContext* context)
94+ {
95+ mAllSectorHitsLeft = lefthits;
96+ mAllSectorHitsRight = righthits;
97+ mHitIdsLeft = leftids;
98+ mHitIdsRight = rightids;
99+ mRunContext = context;
100+ }
101+
102+ void setOutputData (std::vector<o2::TPC::Digit>* digitsArray,
103+ o2::dataformats::MCTruthContainer<o2::MCCompLabel>* mcTruthArray)
104+ {
105+ mDigitsArray = digitsArray;
106+ mMCTruthArray = mcTruthArray;
107+ }
108+
69109 // / Temporary stuff for bunch train simulation
70110 // /
71111 // / Initialise the event times using a bunch train structure
@@ -84,12 +124,21 @@ class DigitizerTask : public FairTask
84124
85125 int mTimeBinMax ; // /< Maximum time bin to be written out
86126 bool mIsContinuousReadout ; // /< Switch for continuous readout
127+ bool mProcessTimeChunks ; // /< Switch for time-chunk wise processing
87128 bool mDigitDebugOutput ; // /< Switch for the debug output of the DigitMC
88129 int mHitSector = -1 ; // /< which sector to treat
89130
90131 const std::vector<o2::TPC::HitGroup>* mSectorHitsArrayLeft ;
91132 const std::vector<o2::TPC::HitGroup>* mSectorHitsArrayRight ;
92133
134+ const std::vector<std::vector<o2::TPC::HitGroup>*>* mAllSectorHitsLeft = nullptr ;
135+ const std::vector<std::vector<o2::TPC::HitGroup>*>* mAllSectorHitsRight = nullptr ;
136+ const std::vector<o2::TPC::TPCHitGroupID>* mHitIdsLeft = nullptr ;
137+ const std::vector<o2::TPC::TPCHitGroupID>* mHitIdsRight = nullptr ;
138+ const o2::steer::RunContext* mRunContext = nullptr ;
139+ double mStartTime ; // = tstart [ns]
140+ double mEndTime ; // = tend [ns]
141+
93142 // Temporary stuff for bunch train structure simulation
94143 std::vector<float > mEventTimes ; // /< Simulated event times in us
95144 int mCurrentEvent = 0 ; // /< Current event
@@ -112,6 +161,18 @@ inline void DigitizerTask::setContinuousReadout(bool isContinuous)
112161 mIsContinuousReadout = isContinuous;
113162 o2::TPC::Digitizer::setContinuousReadout (isContinuous);
114163}
164+
165+ inline void DigitizerTask::setupSector (int s)
166+ {
167+ mDigitContainer ->setup (s);
168+ if (mDigitsArray )
169+ mDigitsArray ->clear ();
170+ if (mMCTruthArray )
171+ mMCTruthArray ->clear ();
172+ if (mDigitsDebugArray )
173+ mDigitsDebugArray ->clear ();
174+ mHitSector = s;
175+ }
115176}
116177}
117178
0 commit comments