Skip to content

Commit 6b4f98a

Browse files
authored
Use calculated 1st orbit only if requested, add verbosity option (AliceO2Group#7808)
Co-authored-by: shahoian <ruben.shahoyan@cern.ch>
1 parent 18d8712 commit 6b4f98a

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

Detectors/Raw/include/DetectorsRaw/RawFileReader.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ struct ReaderInp {
4646
uint32_t errMap = 0xffffffff;
4747
uint32_t minTF = 0;
4848
uint32_t maxTF = 0xffffffff;
49+
int verbosity = 0;
4950
bool partPerSP = true;
5051
bool cache = false;
5152
bool autodetectTF0 = false;

Detectors/Raw/src/RawFileReaderWorkflow.cxx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ class RawReaderSpecs : public o2f::Task
6868
uint32_t mDelayUSec = 0; // Delay in microseconds between TFs
6969
uint32_t mMinTFID = 0; // 1st TF to extract
7070
uint32_t mMaxTFID = 0xffffffff; // last TF to extrct
71+
int mVerbosity = 0;
72+
bool mPreferCalcTF = false;
7173
size_t mLoopsDone = 0;
7274
size_t mSentSize = 0;
7375
size_t mSentMessages = 0;
@@ -85,7 +87,7 @@ class RawReaderSpecs : public o2f::Task
8587

8688
//___________________________________________________________
8789
RawReaderSpecs::RawReaderSpecs(const ReaderInp& rinp)
88-
: mLoop(rinp.loop < 0 ? INT_MAX : (rinp.loop < 1 ? 1 : rinp.loop)), mDelayUSec(rinp.delay_us), mMinTFID(rinp.minTF), mMaxTFID(rinp.maxTF), mPartPerSP(rinp.partPerSP), mReader(std::make_unique<o2::raw::RawFileReader>(rinp.inifile, 0, rinp.bufferSize)), mRawChannelName(rinp.rawChannelConfig)
90+
: mLoop(rinp.loop < 0 ? INT_MAX : (rinp.loop < 1 ? 1 : rinp.loop)), mDelayUSec(rinp.delay_us), mMinTFID(rinp.minTF), mMaxTFID(rinp.maxTF), mPartPerSP(rinp.partPerSP), mReader(std::make_unique<o2::raw::RawFileReader>(rinp.inifile, rinp.verbosity, rinp.bufferSize)), mRawChannelName(rinp.rawChannelConfig), mVerbosity(rinp.verbosity), mPreferCalcTF(rinp.preferCalcTF)
8991
{
9092
mReader->setCheckErrors(rinp.errMap);
9193
mReader->setMaxTFToRead(rinp.maxTF);
@@ -234,7 +236,7 @@ void RawReaderSpecs::run(o2f::ProcessingContext& ctx)
234236
if (!mDropTFMap.empty()) { // some TFs should be dropped
235237
auto res = mDropTFMap.find(link.origin.str);
236238
if (res != mDropTFMap.end() && (mTFCounter % res->second.first) == res->second.second) {
237-
LOG(info) << "Droppint " << mTFCounter << " for " << link.origin.str << "/" << link.description.str << "/" << link.subspec;
239+
LOG(info) << "Dropping " << mTFCounter << " for " << link.origin.str << "/" << link.description.str << "/" << link.subspec;
238240
continue; // drop the data
239241
}
240242
}
@@ -247,7 +249,9 @@ void RawReaderSpecs::run(o2f::ProcessingContext& ctx)
247249
hdrTmpl.payloadSerializationMethod = o2h::gSerializationMethodNone;
248250
hdrTmpl.splitPayloadParts = nParts;
249251
hdrTmpl.tfCounter = mTFCounter;
250-
252+
if (mVerbosity > 1) {
253+
LOG(info) << link.describe() << " will read " << nParts << " HBFs starting from block " << link.nextBlock2Read;
254+
}
251255
const auto fmqChannel = findOutputChannel(hdrTmpl);
252256
if (fmqChannel.empty()) { // no output channel
253257
continue;
@@ -269,7 +273,7 @@ void RawReaderSpecs::run(o2f::ProcessingContext& ctx)
269273
if (hdrTmpl.splitPayloadIndex == 0) {
270274
auto ir = o2::raw::RDHUtils::getHeartBeatIR(plMessage->GetData());
271275
auto tfid = hbfU.getTF(ir);
272-
firstOrbit = hdrTmpl.firstTForbit = hbfU.getIRTF(tfid).orbit; // will be picked for the following parts
276+
firstOrbit = hdrTmpl.firstTForbit = (mPreferCalcTF || !link.cruDetector) ? hbfU.getIRTF(tfid).orbit : ir.orbit; // will be picked for the following parts
273277
creationTime = hbfU.getTFTimeStamp({0, firstOrbit});
274278
}
275279
o2::header::Stack headerStack{hdrTmpl, o2::framework::DataProcessingHeader{mTFCounter, 1, creationTime}};

Detectors/Raw/src/rawfile-reader-workflow.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
3838
options.push_back(ConfigParamSpec{"detect-tf0", VariantType::Bool, false, {"autodetect HBFUtils start Orbit/BC from 1st TF seen"}});
3939
options.push_back(ConfigParamSpec{"calculate-tf-start", VariantType::Bool, false, {"calculate TF start instead of using TType"}});
4040
options.push_back(ConfigParamSpec{"drop-tf", VariantType::String, "none", {"Drop each TFid%(1)==(2) of detector, e.g. ITS,2,4;TPC,4[,0];..."}});
41+
options.push_back(ConfigParamSpec{"verbosity-level", VariantType::Int, 0, {"verbosity level"}});
4142
options.push_back(ConfigParamSpec{"configKeyValues", VariantType::String, "", {"semicolon separated key=value strings"}});
4243
options.push_back(ConfigParamSpec{"hbfutils-config", VariantType::String, std::string(o2::base::NameConf::DIGITIZATIONCONFIGFILE), {"configKeyValues ini file for HBFUtils (used if exists)"}});
4344
// options for error-check suppression
@@ -69,6 +70,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
6970
rinp.rawChannelConfig = configcontext.options().get<std::string>("raw-channel-config");
7071
rinp.delay_us = uint32_t(1e6 * configcontext.options().get<float>("delay")); // delay in microseconds
7172
rinp.dropTF = configcontext.options().get<std::string>("drop-tf");
73+
rinp.verbosity = configcontext.options().get<int>("verbosity-level");
7274
rinp.errMap = 0;
7375
for (int i = RawFileReader::NErrorsDefined; i--;) {
7476
auto ei = RawFileReader::ErrTypes(i);

0 commit comments

Comments
 (0)