@@ -46,7 +46,7 @@ class RawReaderSpecs : public o2f::Task
4646{
4747 public:
4848 explicit RawReaderSpecs (const std::string& config, int loop = 1 , uint32_t delay_us = 0 ,
49- uint32_t errmap = 0xffffffff , uint32_t minTF = 0 , uint32_t maxTF = 0xffffffff , bool partPerSP = true , bool cache = false ,
49+ uint32_t errmap = 0xffffffff , uint32_t minTF = 0 , uint32_t maxTF = 0xffffffff , bool partPerSP = true , bool cache = false , bool autodetectTF0 = false ,
5050 size_t spSize = 1024L * 1024L , size_t buffSize = 5 * 1024UL ,
5151 const std::string& rawChannelName = " " )
5252 : mLoop(loop < 0 ? INT_MAX : (loop < 1 ? 1 : loop)), mDelayUSec(delay_us), mMinTFID(minTF), mMaxTFID(maxTF), mPartPerSP(partPerSP), mReader(std::make_unique<o2::raw::RawFileReader>(config, 0 , buffSize)), mRawChannelName(rawChannelName)
@@ -55,6 +55,7 @@ class RawReaderSpecs : public o2f::Task
5555 mReader ->setMaxTFToRead (maxTF);
5656 mReader ->setNominalSPageSize (spSize);
5757 mReader ->setCacheData (cache);
58+ mReader ->setTFAutodetect (autodetectTF0 ? RawFileReader::FirstTFDetection::Pending : RawFileReader::FirstTFDetection::Disabled);
5859 LOG (INFO) << " Will preprocess files with buffer size of " << buffSize << " bytes" ;
5960 LOG (INFO) << " Number of loops over whole data requested: " << mLoop ;
6061 for (int i = NTimers; i--;) {
@@ -246,7 +247,7 @@ class RawReaderSpecs : public o2f::Task
246247};
247248
248249o2f::DataProcessorSpec getReaderSpec (std::string config, int loop, uint32_t delay_us, uint32_t errmap,
249- uint32_t minTF, uint32_t maxTF, bool partPerSP, bool cache, size_t spSize, size_t buffSize, const std::string& rawChannelConfig)
250+ uint32_t minTF, uint32_t maxTF, bool partPerSP, bool cache, bool autodetectTF0, size_t spSize, size_t buffSize, const std::string& rawChannelConfig)
250251{
251252 // check which inputs are present in files to read
252253 o2f::DataProcessorSpec spec;
@@ -277,15 +278,15 @@ o2f::DataProcessorSpec getReaderSpec(std::string config, int loop, uint32_t dela
277278 LOG (INFO) << " Will send output to non-DPL channel " << rawChannelConfig;
278279 }
279280
280- spec.algorithm = o2f::adaptFromTask<RawReaderSpecs>(config, loop, delay_us, errmap, minTF, maxTF, partPerSP, cache, spSize, buffSize, rawChannelName);
281+ spec.algorithm = o2f::adaptFromTask<RawReaderSpecs>(config, loop, delay_us, errmap, minTF, maxTF, partPerSP, cache, autodetectTF0, spSize, buffSize, rawChannelName);
281282
282283 return spec;
283284}
284285
285286o2f::WorkflowSpec o2::raw::getRawFileReaderWorkflow (std::string inifile, int loop, uint32_t delay_us, uint32_t errmap, uint32_t minTF, uint32_t maxTF,
286- bool partPerSP, bool cache, size_t spSize, size_t buffSize, const std::string& rawChannelConfig)
287+ bool partPerSP, bool cache, bool autodetectTF0, size_t spSize, size_t buffSize, const std::string& rawChannelConfig)
287288{
288289 o2f::WorkflowSpec specs;
289- specs.emplace_back (getReaderSpec (inifile, loop, delay_us, errmap, minTF, maxTF, partPerSP, cache, spSize, buffSize, rawChannelConfig));
290+ specs.emplace_back (getReaderSpec (inifile, loop, delay_us, errmap, minTF, maxTF, partPerSP, cache, autodetectTF0, spSize, buffSize, rawChannelConfig));
290291 return specs;
291292}
0 commit comments