@@ -109,18 +109,6 @@ void CompressedDecodingTask::postData(ProcessingContext& pc)
109109 DigitHeader& digitH = mDecoder .getDigitHeader ();
110110 pc.outputs ().snapshot (Output{o2::header::gDataOriginTOF , " DIGITHEADER" , 0 , Lifetime::Timeframe}, digitH);
111111
112- // RS this is a hack to be removed once we have correct propagation of the firstTForbit by the framework
113- auto setFirstTFOrbit = [&](const Output& spec, uint32_t orb) {
114- auto * hd = pc.outputs ().findMessageHeader (spec);
115- if (!hd) {
116- throw std::runtime_error (o2::utils::concat_string (" failed to find output message header for " , spec.origin .str , " /" , spec.description .str , " /" , std::to_string (spec.subSpec )));
117- }
118- hd->firstTForbit = orb;
119- };
120-
121- setFirstTFOrbit (Output{o2::header::gDataOriginTOF , " DIGITS" , 0 , Lifetime::Timeframe}, mInitOrbit );
122- setFirstTFOrbit (Output{o2::header::gDataOriginTOF , " READOUTWINDOW" , 0 , Lifetime::Timeframe}, mInitOrbit );
123-
124112 mDecoder .clear ();
125113
126114 mNTF ++;
@@ -132,13 +120,10 @@ void CompressedDecodingTask::run(ProcessingContext& pc)
132120{
133121 mTimer .Start (false );
134122
135- if (pc.inputs ().getNofParts (0 ) && !mConetMode && 0 ) { // it doesn't work
136- // RS set the 1st orbit of the TF from the O2 header, relying on rdhHandler is not good (in fact, the RDH might be eliminated in the derived data)
137- const auto * dh = o2::header::get<o2::header::DataHeader*>(pc.inputs ().getByPos (0 ).header );
138- mInitOrbit = dh->firstTForbit ;
139- }
140-
141- // mDecoder.setFirstIR({0, mInitOrbit});
123+ // RS set the 1st orbit of the TF from the O2 header, relying on rdhHandler is not good (in fact, the RDH might be eliminated in the derived data)
124+ const auto * dh = o2::header::get<o2::header::DataHeader*>(pc.inputs ().getByPos (0 ).header );
125+ mInitOrbit = dh->firstTForbit ;
126+ mDecoder .setFirstIR ({0 , mInitOrbit });
142127
143128 /* * loop over inputs routes **/
144129 for (auto iit = pc.inputs ().begin (), iend = pc.inputs ().end (); iit != iend; ++iit) {
@@ -178,16 +163,6 @@ void CompressedDecodingTask::headerHandler(const CrateHeader_t* crateHeader, con
178163{
179164 if (mConetMode ) {
180165 LOG (DEBUG) << " Crate found" << crateHeader->drmID ;
181-
182- mInitOrbit = crateOrbit->orbitID ;
183- if (mCurrentOrbit > 0 ) {
184- mInitOrbit = mCurrentOrbit ;
185- }
186-
187- if (mNCrateOpenTF == 0 ) {
188- mDecoder .setFirstIR ({0 , mInitOrbit });
189- }
190-
191166 mNCrateOpenTF ++;
192167 }
193168}
@@ -350,10 +325,6 @@ void CompressedDecodingTask::rdhHandler(const o2::header::RAWDataHeader* rdh)
350325 const auto & rdhr = *rdh;
351326 // set first orbtìt here (to be check in future), please not remove this!!!
352327 mCurrentOrbit = RDHUtils::getHeartBeatOrbit (rdhr);
353- if (mNCrateOpenTF == 0 ) {
354- mInitOrbit = mCurrentOrbit ;
355- mDecoder .setFirstIR ({0 , mInitOrbit });
356- }
357328
358329 // rdh close
359330 if (RDHUtils::getStop (rdhr) && RDHUtils::getHeartBeatOrbit (rdhr) == o2::raw::HBFUtils::Instance ().getNOrbitsPerTF () - 1 + mInitOrbit ) {
0 commit comments