@@ -136,7 +136,7 @@ int RawPixelDecoder<Mapping>::decodeNextTrigger()
136136// /______________________________________________________________
137137// / prepare for new TF
138138template <class Mapping >
139- void RawPixelDecoder<Mapping>::startNewTF(InputRecord& inputs)
139+ void RawPixelDecoder<Mapping>::startNewTF(InputRecord& inputs, const std::vector<InputSpec>& filter )
140140{
141141 mTimerTFStart .Start (false );
142142 for (auto & link : mGBTLinks ) {
@@ -149,7 +149,7 @@ void RawPixelDecoder<Mapping>::startNewTF(InputRecord& inputs)
149149 ru.linkHBFToDump .clear ();
150150 ru.nLinksDone = 0 ;
151151 }
152- setupLinks (inputs);
152+ setupLinks (inputs, filter );
153153 mNLinksDone = 0 ;
154154 mExtTriggers .clear ();
155155 mTimerTFStart .Stop ();
@@ -186,6 +186,9 @@ bool RawPixelDecoder<Mapping>::doIRMajorityPoll()
186186 if (link.statusInTF == GBTLink::DataSeen) {
187187 if (link.status == GBTLink::DataSeen || link.status == GBTLink::CachedDataExist) {
188188 mIRPoll [link.ir ]++;
189+ if (mVerbosity >= GBTLink::Verbosity::VerboseHeaders) {
190+ LOGP (info, " doIRMajorityPoll: {} contributes to poll {}" , link.describe (), link.ir .asString ());
191+ }
189192 } else if (link.status == GBTLink::StoppedOnEndOfData || link.status == GBTLink::AbortedOnError) {
190193 link.statusInTF = GBTLink::StoppedOnEndOfData;
191194 if (mVerbosity >= GBTLink::Verbosity::VerboseHeaders) {
@@ -195,31 +198,35 @@ bool RawPixelDecoder<Mapping>::doIRMajorityPoll()
195198 }
196199 }
197200 }
201+ if (mNLinksDone == mNLinksInTF ) {
202+ if (mVerbosity >= GBTLink::Verbosity::VerboseHeaders) {
203+ LOGP (info, " doIRMajorityPoll: All {} links registered in TF are done" , mNLinksInTF );
204+ }
205+ return false ;
206+ }
198207 int majIR = -1 ;
199208 for (const auto & entIR : mIRPoll ) {
200209 if (entIR.second > majIR) {
201210 majIR = entIR.second ;
202211 mInteractionRecord = entIR.first ;
203212 }
204213 }
205- mInteractionRecordHB = mInteractionRecord ;
206214 if (mInteractionRecord .isDummy ()) {
207215 if (mVerbosity >= GBTLink::Verbosity::VerboseHeaders) {
208216 LOG (info) << " doIRMajorityPoll: did not find any valid IR" ;
209217 }
210218 return false ;
211219 }
212- mInteractionRecordHB .bc = 0 ;
213220 if (mVerbosity >= GBTLink::Verbosity::VerboseHeaders) {
214- LOG (info) << " doIRMajorityPoll: " << mInteractionRecordHB .asString () << " majority = " << majIR << " for " << mNLinksInTF << " links seen, LinksDone = " << mNLinksDone ;
221+ LOG (info) << " doIRMajorityPoll: " << mInteractionRecord .asString () << " majority = " << majIR << " for " << mNLinksInTF << " links seen, LinksDone = " << mNLinksDone ;
215222 }
216223 return true ;
217224}
218225
219226// /______________________________________________________________
220227// / Setup links checking the very RDH of every input
221228template <class Mapping >
222- void RawPixelDecoder<Mapping>::setupLinks(InputRecord& inputs)
229+ void RawPixelDecoder<Mapping>::setupLinks(InputRecord& inputs, const std::vector<InputSpec>& filter )
223230{
224231 constexpr uint32_t ROF_RAMP_FLAG = 0x1 << 4 ;
225232 constexpr uint32_t LINK_RECOVERY_FLAG = 0x1 << 5 ;
@@ -228,7 +235,6 @@ void RawPixelDecoder<Mapping>::setupLinks(InputRecord& inputs)
228235 auto nLinks = mGBTLinks .size ();
229236 auto origin = (mUserDataOrigin == o2::header::gDataOriginInvalid ) ? mMAP .getOrigin () : mUserDataOrigin ;
230237 auto datadesc = (mUserDataDescription == o2::header::gDataDescriptionInvalid ) ? o2::header::gDataDescriptionRawData : mUserDataDescription ;
231- std::vector<InputSpec> filter{InputSpec{" filter" , ConcreteDataTypeMatcher{origin, datadesc}}};
232238
233239 // if we see requested data type input with 0xDEADBEEF subspec and 0 payload this means that the "delayed message"
234240 // mechanism created it in absence of real data from upstream. Processor should send empty output to not block the workflow
@@ -258,21 +264,24 @@ void RawPixelDecoder<Mapping>::setupLinks(InputRecord& inputs)
258264
259265 uint32_t currSSpec = 0xffffffff ; // dummy starting subspec
260266 int linksAdded = 0 ;
267+ uint16_t lr, dummy; // extraxted info from FEEId
261268 for (auto it = parser.begin (); it != parser.end (); ++it) {
262269 auto const * dh = it.o2DataHeader ();
263270 auto & lnkref = mSubsSpec2LinkID [dh->subSpecification ];
264271 const auto & rdh = *reinterpret_cast <const header::RDHAny*>(it.raw ()); // RSTODO this is a hack in absence of generic header getter
272+ const auto feeID = RDHUtils::getFEEID (rdh);
273+ mMAP .expandFEEId (feeID, lr, dummy, dummy);
265274
266275 if (lnkref.entry == -1 ) { // new link needs to be added
267276 lnkref.entry = int (mGBTLinks .size ());
268- auto & lnk = mGBTLinks .emplace_back (RDHUtils::getCRUID (rdh), RDHUtils::getFEEID (rdh) , RDHUtils::getEndPointID (rdh), RDHUtils::getLinkID (rdh), lnkref.entry );
277+ auto & lnk = mGBTLinks .emplace_back (RDHUtils::getCRUID (rdh), feeID , RDHUtils::getEndPointID (rdh), RDHUtils::getLinkID (rdh), lnkref.entry );
269278 lnk.subSpec = dh->subSpecification ;
270279 lnk.wordLength = (lnk.expectPadding = (RDHUtils::getDataFormat (rdh) == 0 )) ? o2::itsmft::GBTPaddedWordLength : o2::itsmft::GBTWordLength;
271- getCreateRUDecode (mMAP .FEEId2RUSW (RDHUtils::getFEEID (rdh) )); // make sure there is a RU for this link
280+ getCreateRUDecode (mMAP .FEEId2RUSW (feeID )); // make sure there is a RU for this link
272281 lnk.verbosity = GBTLink::Verbosity (mVerbosity );
273282 lnk.alwaysParseTrigger = mAlwaysParseTrigger ;
274283 if (mVerbosity >= GBTLink::Verbosity::VerboseHeaders) {
275- LOG (info) << mSelfName << " registered new link " << lnk.describe () << " RUSW=" << int (mMAP .FEEId2RUSW (lnk.feeID ));
284+ LOG (info) << mSelfName << " registered new " << lnk.describe () << " RUSW=" << int (mMAP .FEEId2RUSW (lnk.feeID ));
276285 }
277286 linksAdded++;
278287 }
@@ -330,7 +339,7 @@ void RawPixelDecoder<Mapping>::setupLinks(InputRecord& inputs)
330339 mMAP .expandFEEId (link.feeID , lr, ruOnLr, linkInRU);
331340 if (newLinkAdded) {
332341 if (mVerbosity >= GBTLink::Verbosity::VerboseHeaders) {
333- LOG (info) << mSelfName << " Attaching " << link. describe () << " to RU# " << int (mMAP .FEEId2RUSW (link.feeID )) << " (stave " << ruOnLr << " of layer " << lr << ' ) ' ;
342+ LOGP (info, " {} Attaching {} to RU#{:02} (stave {:02} of layer {}) " , mSelfName , link. describe (), int (mMAP .FEEId2RUSW (link.feeID )), ruOnLr, lr) ;
334343 }
335344 }
336345 link.idInRU = linkInRU;
0 commit comments