@@ -56,9 +56,23 @@ class CalibRawBase
5656
5757 // / Update function called once per digit
5858 // /
59- // / \param sector
60- virtual Int_t Update (const Int_t roc, const Int_t row, const Int_t pad,
61- const Int_t timeBin, const Float_t signal) = 0;
59+ // / \param roc readout chamber
60+ // / \param row row in roc
61+ // / \param pad pad in row
62+ // / \param timeBin time bin
63+ // / \param signal ADC signal
64+ virtual Int_t UpdateROC (const Int_t roc, const Int_t row, const Int_t pad,
65+ const Int_t timeBin, const Float_t signal) = 0;
66+
67+ // / Update function called once per digit
68+ // /
69+ // / \param cru CRU
70+ // / \param row row in CRU
71+ // / \param pad pad in row
72+ // / \param timeBin time bin
73+ // / \param signal ADC signal
74+ virtual Int_t UpdateCRU (const CRU& cru, const Int_t row, const Int_t pad,
75+ const Int_t timeBin, const Float_t signal) = 0;
6276
6377 // / add GBT frame container to process
6478 void addGBTFrameContainer (GBTFrameContainer *cont) { mGBTFrameContainers .push_back (std::unique_ptr<GBTFrameContainer>(cont)); }
@@ -86,6 +100,9 @@ class CalibRawBase
86100 // / Dump the relevant data to file
87101 virtual void dumpToFile (TString filename) {}
88102
103+ // / number of processed events
104+ size_t getNumberOfProcessedEvents () const { return mNevents ; }
105+
89106 protected:
90107 const Mapper& mMapper ; // !< TPC mapper
91108
@@ -97,7 +114,7 @@ class CalibRawBase
97114 std::vector<std::unique_ptr<RawReader>> mRawReaders ; // ! raw reader pointer
98115
99116 virtual void ResetEvent () = 0;
100- virtual void EndEvent () {++ mNevents ; }
117+ virtual void EndEvent () = 0;
101118
102119 // / Process one event with mTimeBinsPerCall length using GBTFrameContainers
103120 ProcessStatus ProcessEventGBT ();
@@ -144,7 +161,7 @@ inline CalibRawBase::ProcessStatus CalibRawBase::ProcessEventGBT()
144161 if (reader->getData (digits)) {
145162 for (auto & digi : digits) {
146163 CRU cru (digi.getCRU ());
147- const int sector = cru.sector (). getSector ();
164+ const int roc = cru.roc ();
148165 // TODO: OROC case needs subtraction of number of pad rows in IROC
149166 const PadRegionInfo& regionInfo = mMapper .getPadRegionInfo (cru.region ());
150167 const PartitionInfo& partInfo = mMapper .getPartitionInfo (cru.partition ());
@@ -174,9 +191,10 @@ inline CalibRawBase::ProcessStatus CalibRawBase::ProcessEventGBT()
174191 // modify row depending on the calibration type used
175192 const int timeBin= i; // digi.getTimeStamp();
176193 const float signal = digi.getChargeFloat ();
177- // const FECInfo& fecInfo = mTPCmapper.getFECInfo(PadSecPos(sector, row, pad));
178- // printf("Call update: %d, %d, %d, %d (%d), %.3f -- reg: %02d -- FEC: %02d, Chip: %02d, Chn: %02d\n", sector, row, pad, timeBin, i, signal, cru.region(), fecInfo.getIndex(), fecInfo.getSampaChip(), fecInfo.getSampaChannel());
179- Update (sector, row+rowOffset, pad, timeBin, signal );
194+ // const FECInfo& fecInfo = mTPCmapper.getFECInfo(PadSecPos(roc, row, pad));
195+ // printf("Call update: %d, %d, %d, %d (%d), %.3f -- reg: %02d -- FEC: %02d, Chip: %02d, Chn: %02d\n", roc, row, pad, timeBin, i, signal, cru.region(), fecInfo.getIndex(), fecInfo.getSampaChip(), fecInfo.getSampaChannel());
196+ UpdateCRU (cru, row, pad, timeBin, signal );
197+ UpdateROC (roc, row+rowOffset, pad, timeBin, signal );
180198 }
181199 ++readTimeBins;
182200 }
@@ -225,7 +243,7 @@ inline CalibRawBase::ProcessStatus CalibRawBase::ProcessEventRawReader()
225243 if (!data) continue ;
226244
227245 CRU cru (reader->getRegion ());
228- const int sector = cru.sector (). getSector ();
246+ const int roc = cru.roc ();
229247 // TODO: OROC case needs subtraction of number of pad rows in IROC
230248 const PadRegionInfo& regionInfo = mMapper .getPadRegionInfo (cru.region ());
231249 const PartitionInfo& partInfo = mMapper .getPartitionInfo (cru.partition ());
@@ -257,9 +275,10 @@ inline CalibRawBase::ProcessStatus CalibRawBase::ProcessEventRawReader()
257275
258276 // modify row depending on the calibration type used
259277 const float signal = float (signalI);
260- // const FECInfo& fecInfo = mTPCmapper.getFECInfo(PadSecPos(sector, row, pad));
261- // printf("Call update: %d, %d, %d, %d (%d), %.3f -- reg: %02d -- FEC: %02d, Chip: %02d, Chn: %02d\n", sector, row, pad, timeBin, i, signal, cru.region(), fecInfo.getIndex(), fecInfo.getSampaChip(), fecInfo.getSampaChannel());
262- Update (sector, row+rowOffset, pad, timeBin, signal );
278+ // const FECInfo& fecInfo = mTPCmapper.getFECInfo(PadSecPos(roc, row, pad));
279+ // printf("Call update: %d, %d, %d, %d (%d), %.3f -- reg: %02d -- FEC: %02d, Chip: %02d, Chn: %02d\n", roc, row, pad, timeBin, i, signal, cru.region(), fecInfo.getIndex(), fecInfo.getSampaChip(), fecInfo.getSampaChannel());
280+ UpdateCRU (cru, row, pad, timeBin, signal );
281+ UpdateROC (roc, row+rowOffset, pad, timeBin, signal );
263282 ++timeBin;
264283 hasData=true ;
265284 }
0 commit comments