@@ -43,12 +43,14 @@ void DataReaderTask::init(InitContext& ic)
4343 ic.services ().get <CallbackService>().set (CallbackService::Id::Stop, finishFunction);
4444}
4545
46- void DataReaderTask::sendData (ProcessingContext& pc)
46+ void DataReaderTask::sendData (ProcessingContext& pc, bool blankframe )
4747{
4848 // mReader.getParsedObjects(mTracklets,mDigits,mTriggers);
49- mReader .getParsedObjects (mTracklets , mDigits , mTriggers );
49+ if (!blankframe) {
50+ mReader .getParsedObjects (mTracklets , mDigits , mTriggers );
51+ }
5052
51- LOG (info) << " Sending data onwards with " << mDigits .size () << " Digits and " << mTracklets .size () << " Tracklets and " << mTriggers .size () << " Triggers" ;
53+ LOG (info) << " Sending data onwards with " << mDigits .size () << " Digits and " << mTracklets .size () << " Tracklets and " << mTriggers .size () << " Triggers and blankframe: " << blankframe ;
5254 pc.outputs ().snapshot (Output{o2::header::gDataOriginTRD , " DIGITS" , 0 , Lifetime::Timeframe}, mDigits );
5355 pc.outputs ().snapshot (Output{o2::header::gDataOriginTRD , " TRACKLETS" , 0 , Lifetime::Timeframe}, mTracklets );
5456 pc.outputs ().snapshot (Output{o2::header::gDataOriginTRD , " TRKTRGRD" , 0 , Lifetime::Timeframe}, mTriggers );
@@ -65,34 +67,31 @@ void DataReaderTask::run(ProcessingContext& pc)
6567 auto device = pc.services ().get <o2::framework::RawDeviceService>().device ();
6668 auto outputRoutes = pc.services ().get <o2::framework::RawDeviceService>().spec ().outputs ;
6769 auto fairMQChannel = outputRoutes.at (0 ).channel ;
68- int inputcount = 0 ;
69- std::vector<InputSpec> dummy{InputSpec{" filter" , ConcreteDataTypeMatcher{" FLP" , " DISTSUBTIMEFRAME" }, Lifetime::Timeframe}};
70+ mDataSpec = o2::header::gDataDescriptionRawData ;
71+
72+ std::vector<InputSpec> dummy{InputSpec{" dummy" , ConcreteDataMatcher{" TRD" , mDataSpec , 0xDEADBEEF }}};
7073 // if we see requested data type input with 0xDEADBEEF subspec and 0 payload this means that the "delayed message"
7174 // // mechanism created it in absence of real data from upstream. Processor should send empty output to not block the workflow
7275
7376 for (const auto & ref : InputRecordWalker (pc.inputs (), dummy)) {
7477 const auto dh = o2::framework::DataRefUtils::getHeader<o2::header::DataHeader*>(ref);
75- if (dh->payloadSize == 16 ) {
78+ if (dh->payloadSize == 16 || dh-> payloadSize == 0 ) {
7679 LOGP (WARNING , " Found input [{}/{}/{:#x}] TF#{} 1st_orbit:{} Payload {} : assuming no payload for all links in this TF" ,
7780 dh->dataOrigin .str , dh->dataDescription .str , dh->subSpecification , dh->tfCounter , dh->firstTForbit , dh->payloadSize );
78- sendData (pc); // send the empty tf data.
81+ sendData (pc, true ); // send the empty tf data.
7982 return ;
8083 }
8184 LOG (info) << " matched DEADBEEF" ;
8285 }
8386 // TODO combine the previous and subsequent loops.
84- int inputcounts = 0 ;
8587 /* loop over inputs routes */
8688 for (auto iit = pc.inputs ().begin (), iend = pc.inputs ().end (); iit != iend; ++iit) {
87- LOG (info) << " looping over inputs " << inputcounts;
88- inputcounts++;
8989 if (!iit.isValid ()) {
9090 continue ;
9191 }
9292 /* loop over input parts */
9393 int inputpartscount = 0 ;
9494 for (auto const & ref : iit) {
95- LOG (info) << " looping over parts " << inputpartscount;
9695 if (mVerbose ) {
9796 const auto dh = DataRefUtils::getHeader<o2::header::DataHeader*>(ref);
9897 LOGP (info, " Found input [{}/{}/{:#x}] TF#{} 1st_orbit:{} Payload {} : assuming no payload for all links in this TF" ,
@@ -135,10 +134,9 @@ void DataReaderTask::run(ProcessingContext& pc)
135134 mTriggers = mCompressedReader .getIR ();
136135 // get the payload of trigger and digits out.
137136 }
138- /* output */
139- // sendData(pc); //TODO do we ever have to not post the data. i.e. can we get here mid event? I dont think so.
140137 }
141- sendData (pc); // TODO do we ever have to not post the data. i.e. can we get here mid event? I dont think so.
138+ /* output */
139+ sendData (pc, false ); // TODO do we ever have to not post the data. i.e. can we get here mid event? I dont think so.
142140 }
143141
144142 auto dataReadTime = std::chrono::high_resolution_clock::now () - dataReadStart;
0 commit comments