1- // Copyright 2019-2020 CERN and copyright holders of ALICE O2.
1+ // Copyright 2019-2026 CERN and copyright holders of ALICE O2.
22// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
33// All rights not expressly granted are reserved.
44//
@@ -40,7 +40,8 @@ RawPixelDecoder<Mapping>::RawPixelDecoder()
4040 mTimerDecode .Stop ();
4141 mTimerFetchData .Stop ();
4242 mSelfName = o2::utils::Str::concat_string (Mapping::getName (), " Decoder" );
43- DPLRawParser<>::setCheckIncompleteHBF (false ); // Disable incomplete HBF checking, see ErrPacketCounterJump check in GBTLink.cxx
43+ DPLRawParser<>::setCheckIncompleteHBF (false ); // Disable incomplete HBF checking, see ErrPacketCounterJump check in GBTLink.cxx
44+ mInputFilter = {InputSpec{" filter" , ConcreteDataTypeMatcher{Mapping::getOrigin (), o2::header::gDataDescriptionRawData }}}; // by default take all raw data
4445}
4546
4647// /______________________________________________________________
@@ -102,8 +103,7 @@ int RawPixelDecoder<Mapping>::decodeNextTrigger()
102103 }
103104
104105#ifdef WITH_OPENMP
105- #pragma omp parallel for schedule(dynamic) num_threads(mNThreads) reduction(+ \
106- : mNChipsFiredROF , mNPixelsFiredROF )
106+ #pragma omp parallel for schedule(dynamic) num_threads(mNThreads) reduction(+ : mNChipsFiredROF, mNPixelsFiredROF)
107107#endif
108108 for (int iru = 0 ; iru < nru; iru++) {
109109 auto & ru = mRUDecodeVec [iru];
@@ -136,7 +136,7 @@ int RawPixelDecoder<Mapping>::decodeNextTrigger()
136136// /______________________________________________________________
137137// / prepare for new TF
138138template <class Mapping >
139- void RawPixelDecoder<Mapping>::startNewTF(InputRecord& inputs, const std::vector<InputSpec>& filter )
139+ void RawPixelDecoder<Mapping>::startNewTF(InputRecord& inputs)
140140{
141141 mTimerTFStart .Start (false );
142142 for (auto & link : mGBTLinks ) {
@@ -149,7 +149,7 @@ void RawPixelDecoder<Mapping>::startNewTF(InputRecord& inputs, const std::vector
149149 ru.linkHBFToDump .clear ();
150150 ru.nLinksDone = 0 ;
151151 }
152- setupLinks (inputs, filter );
152+ setupLinks (inputs);
153153 mNLinksDone = 0 ;
154154 mExtTriggers .clear ();
155155 mTimerTFStart .Stop ();
@@ -226,7 +226,7 @@ bool RawPixelDecoder<Mapping>::doIRMajorityPoll()
226226// /______________________________________________________________
227227// / Setup links checking the very RDH of every input
228228template <class Mapping >
229- void RawPixelDecoder<Mapping>::setupLinks(InputRecord& inputs, const std::vector<InputSpec>& filter )
229+ void RawPixelDecoder<Mapping>::setupLinks(InputRecord& inputs)
230230{
231231 constexpr uint32_t ROF_RAMP_FLAG = 0x1 << 4 ;
232232 constexpr uint32_t LINK_RECOVERY_FLAG = 0x1 << 5 ;
@@ -235,6 +235,14 @@ void RawPixelDecoder<Mapping>::setupLinks(InputRecord& inputs, const std::vector
235235 auto nLinks = mGBTLinks .size ();
236236 auto origin = (mUserDataOrigin == o2::header::gDataOriginInvalid ) ? mMAP .getOrigin () : mUserDataOrigin ;
237237 auto datadesc = (mUserDataDescription == o2::header::gDataDescriptionInvalid ) ? o2::header::gDataDescriptionRawData : mUserDataDescription ;
238+ if (mUserDataDescription != o2::header::gDataDescriptionInvalid ) { // overwrite data filter origin&descriptions with user defined ones if possible
239+ for (auto & filt : mInputFilter ) {
240+ if (std::holds_alternative<o2::framework::ConcreteDataMatcher>(filt.matcher )) {
241+ std::get<o2::framework::ConcreteDataMatcher>(filt.matcher ).origin = origin;
242+ std::get<o2::framework::ConcreteDataMatcher>(filt.matcher ).description = datadesc;
243+ }
244+ }
245+ }
238246
239247 // if we see requested data type input with 0xDEADBEEF subspec and 0 payload this means that the "delayed message"
240248 // mechanism created it in absence of real data from upstream. Processor should send empty output to not block the workflow
@@ -257,7 +265,7 @@ void RawPixelDecoder<Mapping>::setupLinks(InputRecord& inputs, const std::vector
257265 contDeadBeef = 0 ; // if good data, reset the counter
258266 }
259267 mROFRampUpStage = false ;
260- DPLRawParser parser (inputs, filter , o2::conf::VerbosityConfig::Instance ().rawParserSeverity );
268+ DPLRawParser parser (inputs, mInputFilter , o2::conf::VerbosityConfig::Instance ().rawParserSeverity );
261269 parser.setMaxFailureMessages (o2::conf::VerbosityConfig::Instance ().maxWarnRawParser );
262270 static size_t cntParserFailures = 0 ;
263271 parser.setExtFailureCounter (&cntParserFailures);
0 commit comments