@@ -136,9 +136,9 @@ void DigitReader::run(ProcessingContext& pc)
136136 ent++;
137137 }
138138 o2::utils::IRFrameSelector irfSel;
139- irfSel.setSelectedIRFrames (irFrames, 0 , 0 , mROFBiasInBC , true );
140- const auto irMin = irFrames. front ().getMin ();
141- const auto irMax = irFrames .back ().getMax ();
139+ irfSel.setSelectedIRFrames (irFrames, 0 , 0 , - mROFBiasInBC , true );
140+ const auto irMin = irfSel. getIRFrames (). front ().getMin (); // use processed IRframes for rough comparisons (possible shift!)
141+ const auto irMax = irfSel. getIRFrames () .back ().getMax ();
142142 LOGP (info, " Selecting IRFrame {}-{}" , irMin.asString (), irMax.asString ());
143143 while (ent < mTree ->GetEntries ()) {
144144 // do we need to read a new entry?
@@ -159,7 +159,7 @@ void DigitReader::run(ProcessingContext& pc)
159159 std::vector<int > rofOld2New;
160160 rofOld2New.resize (mDigROFRec .size (), -1 );
161161
162- if (mDigROFRec .front ().getBCData () <= irMax && mDigROFRec .back ().getBCData () >= irMin) { // there is an overlap
162+ if (mDigROFRec .front ().getBCData () <= irMax && ( mDigROFRec .back ().getBCData () + mROFLengthInBC - 1 ) >= irMin) { // there is an overlap
163163 for (int irof = 0 ; irof < (int )mDigROFRec .size (); irof++) {
164164 const auto & rof = mDigROFRec [irof];
165165 if (irfSel.check ({rof.getBCData (), rof.getBCData () + mROFLengthInBC - 1 }) != -1 ) {
@@ -198,7 +198,7 @@ void DigitReader::run(ProcessingContext& pc)
198198 mc2rof.maxROF = mx;
199199 }
200200 }
201- if (mDigROFRec .back ().getBCData () < irMax) { // need to check the next entry
201+ if (mDigROFRec .back ().getBCData () + mROFLengthInBC - 1 < irMax) { // need to check the next entry
202202 ent++;
203203 continue ;
204204 }
0 commit comments