From 4da263470a1472e1cba91e6fa3098d22a6406cce Mon Sep 17 00:00:00 2001 From: shahoian Date: Fri, 8 Jul 2022 15:24:27 +0200 Subject: [PATCH] Use TimingInfo instead of DataHeader and DataProcessingHeader In order to extract current TF timing information use pc.services().get() instead of accessing DataHeader and DataProcessingHeader of particular input (e.g. via pc.inputs().getFirstValid(true)) --- .../GlobalTracking/src/RecoContainer.cxx | 4 ++-- .../include/Headers/DataHeaderHelpers.h | 2 +- Detectors/AOD/src/AODProducerWorkflowSpec.cxx | 6 +++--- Detectors/AOD/src/aod-producer-workflow.cxx | 2 +- .../src/barrel-alignment-workflow.cxx | 2 +- Detectors/Base/src/TFIDInfoHelper.cxx | 19 +++++++++---------- .../workflow/src/RawToDigitConverterSpec.cxx | 2 +- .../CPV/workflow/src/cpv-reco-workflow.cxx | 2 +- Detectors/CTF/workflow/src/CTFReaderSpec.cxx | 2 +- Detectors/CTF/workflow/src/CTFWriterSpec.cxx | 8 ++++---- .../Calibration/workflow/CCDBPopulatorSpec.h | 2 +- .../emc-channel-calib-workflow.cxx | 2 +- .../workflow/src/RawToCellConverterSpec.cxx | 2 +- .../src/StandaloneAODProducerSpec.cxx | 6 +++--- .../workflow/src/cell-reader-workflow.cxx | 2 +- .../workflow/src/digit-reader-workflow.cxx | 2 +- .../EMCAL/workflow/src/emc-reco-workflow.cxx | 2 +- .../workflow/src/digits-reader-workflow.cxx | 2 +- .../FDD/workflow/src/fdd-reco-workflow.cxx | 2 +- .../testWorkflow/FT0DCSDataProcessorSpec.h | 2 +- .../testWorkflow/FT0TFProcessor-Workflow.cxx | 3 +-- .../GlobalOffsetsCollectWorkflow.cxx | 3 +-- .../FT0/workflow/src/ReconstructionSpec.cxx | 4 +--- .../workflow/src/digits-reader-workflow.cxx | 2 +- .../FT0/workflow/src/ft0-reco-workflow.cxx | 2 +- .../workflow/FV0TFProcessor-Workflow.cxx | 3 +-- .../workflow/src/digits-reader-workflow.cxx | 2 +- .../FV0/workflow/src/fv0-reco-workflow.cxx | 2 +- Detectors/Filtering/src/FilteringSpec.cxx | 11 ++++------- .../Filtering/src/filtering-workflow.cxx | 2 +- Detectors/GRP/workflows/src/GRPDCSDPsSpec.cxx | 2 +- .../helpers/src/GlobalTrackClusterReader.cxx | 2 +- .../readers/src/irframe-reader-workflow.cxx | 2 +- .../src/GlobalFwdMatchingSpec.cxx | 2 -- .../src/TOFMatcherSpec.cxx | 2 +- .../src/cosmics-match-workflow.cxx | 2 +- .../src/globalfwd-matcher-workflow.cxx | 2 +- .../src/primary-vertex-reader-workflow.cxx | 2 +- .../src/primary-vertexing-workflow.cxx | 2 +- .../src/secondary-vertex-reader-workflow.cxx | 2 +- .../src/secondary-vertexing-workflow.cxx | 2 +- .../src/tof-matcher-workflow.cxx | 2 +- .../src/tpcits-match-workflow.cxx | 2 +- .../tofworkflow/src/tof-reco-workflow.cxx | 2 +- .../src/tpc-interpolation-workflow.cxx | 2 +- .../src/clusters-to-root-workflow.cxx | 2 +- .../workflow/src/digits-to-raw-workflow.cxx | 2 +- .../workflow/src/digits-to-root-workflow.cxx | 2 +- .../workflow/src/ThresholdAggregatorSpec.cxx | 4 ++-- .../src/its-cluster-reader-workflow.cxx | 2 +- .../ITS/workflow/src/its-reco-workflow.cxx | 2 +- .../src/mft-cluster-reader-workflow.cxx | 2 +- .../MFT/workflow/src/mft-reco-workflow.cxx | 2 +- .../ITSMFTReconstruction/RawPixelDecoder.h | 3 ++- .../reconstruction/src/RawPixelDecoder.cxx | 9 +++++---- .../common/workflow/src/STFDecoderSpec.cxx | 4 ++-- .../MUON/MCH/Workflow/src/DataDecoderSpec.cxx | 14 ++++++-------- .../Workflow/src/cru-page-reader-workflow.cxx | 4 ++-- .../Workflow/src/digits-reader-workflow.cxx | 2 +- .../Workflow/src/raw-to-digits-workflow.cxx | 2 +- .../MUON/MCH/Workflow/src/reco-workflow.cxx | 2 +- .../Workflow/src/digits-reader-workflow.cxx | 2 +- .../Workflow/src/tracks-matcher-workflow.cxx | 2 +- .../PHOS/calib/src/PHOSBadMapCalibDevice.cxx | 3 +-- .../PHOS/calib/src/PHOSEnergyCalibDevice.cxx | 6 +++--- .../calib/src/PHOSHGLGRatioCalibDevice.cxx | 3 +-- .../calib/src/PHOSPedestalCalibDevice.cxx | 3 +-- .../calib/src/PHOSRunbyrunCalibDevice.cxx | 3 +-- .../workflow/src/RawToCellConverterSpec.cxx | 2 +- .../src/StandaloneAODProducerSpec.cxx | 7 +++---- .../PHOS/workflow/src/phos-reco-workflow.cxx | 2 +- Detectors/Raw/TFReaderDD/src/TFReaderSpec.cxx | 2 +- Detectors/Raw/src/DistSTFSenderSpec.cxx | 5 ++--- Detectors/Raw/src/RawFileReaderWorkflow.cxx | 2 +- Detectors/Raw/src/diststf-sender-workflow.cxx | 2 +- .../testWorkflow/LHCClockCalibratorSpec.h | 2 +- .../testWorkflow/TOFChannelCalibratorSpec.h | 2 +- .../testWorkflow/TOFDCSConfigProcessorSpec.h | 1 - .../testWorkflow/TOFDCSDataProcessorSpec.h | 2 +- .../workflow/src/CompressedDecodingTask.cxx | 7 +++---- .../TOF/workflow/src/EntropyDecoderSpec.cxx | 2 +- .../TOF/workflow/src/TOFClusterizerSpec.cxx | 9 +++------ .../workflowIO/src/CalibInfoReaderSpec.cxx | 2 +- Detectors/TPC/dcs/src/DCSSpec.cxx | 2 +- .../TPCWorkflow/TPCFourierTransformEPNSpec.h | 2 +- .../workflow/src/ChunkedDigitPublisher.cxx | 2 +- Detectors/TPC/workflow/src/FileWriterSpec.cxx | 17 ++++++++--------- .../TPC/workflow/src/MonitorWorkflowSpec.cxx | 2 +- .../TPC/workflow/src/ProcessingHelpers.cxx | 13 +++++++------ .../TPC/workflow/src/SACProcessorSpec.cxx | 12 +++++------- Detectors/TPC/workflow/src/ZSSpec.cxx | 3 +-- .../TPC/workflow/src/tpc-reco-workflow.cxx | 2 +- .../workflow/test/test_ft_EPN_Aggregator.cxx | 7 ++++--- .../workflow/TRDDCSDataProcessorSpec.h | 2 +- .../TRD/workflow/src/EntropyDecoderSpec.cxx | 2 +- .../TRD/workflow/src/TRDDigitizerSpec.cxx | 3 +-- .../src/TRDTrackletTransformerWorkflow.cxx | 2 +- .../TRD/workflow/src/TRDTrapSimulatorSpec.cxx | 3 +-- .../workflow/src/trd-tracking-workflow.cxx | 2 +- .../IT3/workflow/src/its3-reco-workflow.cxx | 2 +- .../ZDC/calib/src/BaselineCalibEPNSpec.cxx | 3 +-- Detectors/ZDC/calib/src/InterCalibEPNSpec.cxx | 3 +-- .../ZDC/calib/src/WaveformCalibEPNSpec.cxx | 3 +-- .../calib/src/zdc-intercalib-epn-workflow.cxx | 2 +- .../src/zdc-waveformcalib-epn-workflow.cxx | 2 +- .../ZDC/workflow/src/reco-reader-workflow.cxx | 2 +- .../ZDC/workflow/src/zdc-reco-workflow.cxx | 2 +- .../EventVisualisationView/Screenshot.h | 2 +- EventVisualisation/View/src/Screenshot.cxx | 4 ++-- .../Workflow/src/O2DPLDisplay.cxx | 16 +++++++--------- .../include/Framework/DataDescriptorMatcher.h | 2 +- .../Core/include/Framework/DataRelayer.h | 2 +- Framework/Core/include/Framework/TimingInfo.h | 2 +- Framework/Core/src/CCDBHelpers.cxx | 10 +++++----- Framework/Core/src/CallbacksPolicy.cxx | 12 ++++++------ Framework/Core/src/DataAllocator.cxx | 2 +- Framework/Core/src/DataProcessingDevice.cxx | 2 +- .../Core/src/ExternalFairMQDeviceProxy.cxx | 4 ++-- Framework/Core/src/LifetimeHelpers.cxx | 2 +- .../src/FrameworkGUIDataRelayerUsage.cxx | 2 +- GPU/Workflow/src/GPUWorkflowSpec.cxx | 6 +++--- GPU/Workflow/src/O2GPUDPLDisplay.cxx | 3 +-- GPU/Workflow/src/gpu-reco-workflow.cxx | 2 +- .../src/SimpleDigitizerWorkflow.cxx | 2 +- .../src/TOFDigitizerSpec.cxx | 2 -- 125 files changed, 202 insertions(+), 236 deletions(-) diff --git a/DataFormats/Detectors/GlobalTracking/src/RecoContainer.cxx b/DataFormats/Detectors/GlobalTracking/src/RecoContainer.cxx index 0820352bcb598..a505c6792cf0f 100644 --- a/DataFormats/Detectors/GlobalTracking/src/RecoContainer.cxx +++ b/DataFormats/Detectors/GlobalTracking/src/RecoContainer.cxx @@ -15,6 +15,7 @@ #include #include +#include "Framework/TimingInfo.h" #include "DataFormatsGlobalTracking/RecoContainerCreateTracksVariadic.h" #include "CommonDataFormat/TimeStamp.h" #include "CommonDataFormat/IRFrame.h" @@ -548,8 +549,7 @@ void RecoContainer::collectData(ProcessingContext& pc, const DataRequest& reques { auto& reqMap = requests.requestMap; - const auto* dh = DataRefUtils::getHeader(pc.inputs().getFirstValid(true)); - startIR = {0, dh->firstTForbit}; + startIR = {0, pc.services().get().firstTForbit}; auto req = reqMap.find("trackITS"); if (req != reqMap.end()) { diff --git a/DataFormats/Headers/include/Headers/DataHeaderHelpers.h b/DataFormats/Headers/include/Headers/DataHeaderHelpers.h index b786d26c6003e..41d59090e0274 100644 --- a/DataFormats/Headers/include/Headers/DataHeaderHelpers.h +++ b/DataFormats/Headers/include/Headers/DataHeaderHelpers.h @@ -76,7 +76,7 @@ struct fmt::formatter { fmt::format(" sub spec. : {}\n", (long long unsigned int)h.subSpecification) + fmt::format(" header size : {}\n", h.headerSize) + fmt::format(" payloadSize : {}\n", (long long unsigned int)h.payloadSize) + - fmt::format(" firstTFOrbit : {}\n", h.firstTForbit) + + fmt::format(" firstTForbit : {}\n", h.firstTForbit) + fmt::format(" tfCounter : {}\n", h.tfCounter) + fmt::format(" runNumber : {}\n", h.runNumber); return format_to(ctx.out(), "{}", res); diff --git a/Detectors/AOD/src/AODProducerWorkflowSpec.cxx b/Detectors/AOD/src/AODProducerWorkflowSpec.cxx index 04c431d0c2918..daa2e78ae0546 100644 --- a/Detectors/AOD/src/AODProducerWorkflowSpec.cxx +++ b/Detectors/AOD/src/AODProducerWorkflowSpec.cxx @@ -1273,7 +1273,7 @@ void AODProducerWorkflowDPL::run(ProcessingContext& pc) auto caloCellsTRGTableCursor = caloCellsTRGTableBuilder.cursor(); auto originCursor = originTableBuilder.cursor(); - const auto* dh = o2::header::get(pc.inputs().getFirstValid(true).header); + const auto& tinfo = pc.services().get(); std::unique_ptr mcReader; if (mUseMC) { @@ -1286,10 +1286,10 @@ void AODProducerWorkflowDPL::run(ProcessingContext& pc) } uint64_t tfNumber; - const int runNumber = (mRunNumber == -1) ? int(dh->runNumber) : mRunNumber; + const int runNumber = (mRunNumber == -1) ? int(tinfo.runNumber) : mRunNumber; if (mTFNumber == -1L) { // TODO has to use absolute time of TF - tfNumber = uint64_t(dh->firstTForbit) + (uint64_t(dh->runNumber) << 32); // getTFNumber(mStartIR, runNumber); + tfNumber = uint64_t(tinfo.firstTForbit) + (uint64_t(tinfo.runNumber) << 32); // getTFNumber(mStartIR, runNumber); } else { tfNumber = mTFNumber; } diff --git a/Detectors/AOD/src/aod-producer-workflow.cxx b/Detectors/AOD/src/aod-producer-workflow.cxx index 46b627e26feb4..f7dff9fa02770 100644 --- a/Detectors/AOD/src/aod-producer-workflow.cxx +++ b/Detectors/AOD/src/aod-producer-workflow.cxx @@ -79,7 +79,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext) } } - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs); return std::move(specs); diff --git a/Detectors/Align/Workflow/src/barrel-alignment-workflow.cxx b/Detectors/Align/Workflow/src/barrel-alignment-workflow.cxx index 98991c8f34f6f..dbf57519825b3 100644 --- a/Detectors/Align/Workflow/src/barrel-alignment-workflow.cxx +++ b/Detectors/Align/Workflow/src/barrel-alignment-workflow.cxx @@ -103,7 +103,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext) if (!disableRootOut) { } - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs); return std::move(specs); diff --git a/Detectors/Base/src/TFIDInfoHelper.cxx b/Detectors/Base/src/TFIDInfoHelper.cxx index 5939cf22cb2f9..d5bdad3ed37a6 100644 --- a/Detectors/Base/src/TFIDInfoHelper.cxx +++ b/Detectors/Base/src/TFIDInfoHelper.cxx @@ -12,6 +12,7 @@ #include "Framework/ProcessingContext.h" #include "Framework/InputRecord.h" #include "Framework/DataRefUtils.h" +#include "Framework/TimingInfo.h" #include "Framework/DataProcessingHeader.h" #include "Headers/DataHeader.h" #include "DetectorsBase/TFIDInfoHelper.h" @@ -20,19 +21,17 @@ using namespace o2::framework; void o2::base::TFIDInfoHelper::fillTFIDInfo(ProcessingContext& pc, o2::dataformats::TFIDInfo& ti) { - const auto ref = pc.inputs().getFirstValid(true); - const auto* dh = DataRefUtils::getHeader(ref); - const auto* dph = DataRefUtils::getHeader(ref); + const auto& tinfo = pc.services().get(); static int errCount = 0; - if (dh->firstTForbit == -1U || dph->creation == -1) { + if (tinfo.firstTForbit == -1U || tinfo.creation == -1) { if (errCount++ < 5) { - LOGP(warn, "Ignoring gummy input with orbit {} and creation time {} in fillTFIDInfo", dh->firstTForbit, dph->creation); + LOGP(warn, "Ignoring gummy input with orbit {} and creation time {} in fillTFIDInfo", tinfo.firstTForbit, tinfo.creation); } return; } - ti.firstTForbit = dh->firstTForbit; - ti.tfCounter = dh->tfCounter; - ti.runNumber = dh->runNumber; - ti.startTime = dph->startTime; - ti.creation = dph->creation; + ti.firstTForbit = tinfo.firstTForbit; + ti.tfCounter = tinfo.tfCounter; + ti.runNumber = tinfo.runNumber; + ti.startTime = tinfo.timeslice; + ti.creation = tinfo.creation; } diff --git a/Detectors/CPV/workflow/src/RawToDigitConverterSpec.cxx b/Detectors/CPV/workflow/src/RawToDigitConverterSpec.cxx index 6d46e26cbb472..3225d62d7d8b2 100644 --- a/Detectors/CPV/workflow/src/RawToDigitConverterSpec.cxx +++ b/Detectors/CPV/workflow/src/RawToDigitConverterSpec.cxx @@ -284,7 +284,7 @@ void RawToDigitConverterSpec::run(framework::ProcessingContext& ctx) // Loop over BCs, sort digits with increasing digit ID and write to output containers mOutputDigits.clear(); mOutputTriggerRecords.clear(); - const auto tfOrbitFirst = o2::framework::DataRefUtils::getHeader(ctx.inputs().getFirstValid(true))->firstTForbit; + const auto tfOrbitFirst = ctx.services().get().firstTForbit; const auto& ctpOffsets = o2::ctp::TriggerOffsetsParam::Instance(); for (auto [bc, digits] : digitBuffer) { if (bc.differenceInBC({0, tfOrbitFirst}) < ctpOffsets.LM_L0) { diff --git a/Detectors/CPV/workflow/src/cpv-reco-workflow.cxx b/Detectors/CPV/workflow/src/cpv-reco-workflow.cxx index 817af62ed9c8b..2f6111a96abe7 100644 --- a/Detectors/CPV/workflow/src/cpv-reco-workflow.cxx +++ b/Detectors/CPV/workflow/src/cpv-reco-workflow.cxx @@ -89,7 +89,7 @@ o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext co cfgc.options().get("input-type"), cfgc.options().get("output-type")); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(cfgc, wf); return wf; diff --git a/Detectors/CTF/workflow/src/CTFReaderSpec.cxx b/Detectors/CTF/workflow/src/CTFReaderSpec.cxx index a63fe218c7f58..4a79d55130d39 100644 --- a/Detectors/CTF/workflow/src/CTFReaderSpec.cxx +++ b/Detectors/CTF/workflow/src/CTFReaderSpec.cxx @@ -249,7 +249,7 @@ void CTFReaderSpec::processTF(ProcessingContext& pc) LOG(info) << ctfHeader; auto& timingInfo = pc.services().get(); - timingInfo.firstTFOrbit = ctfHeader.firstTForbit; + timingInfo.firstTForbit = ctfHeader.firstTForbit; timingInfo.creation = ctfHeader.creationTime; timingInfo.tfCounter = ctfHeader.tfCounter; timingInfo.runNumber = ctfHeader.run; diff --git a/Detectors/CTF/workflow/src/CTFWriterSpec.cxx b/Detectors/CTF/workflow/src/CTFWriterSpec.cxx index d109466f56fdc..62fee45ecff51 100644 --- a/Detectors/CTF/workflow/src/CTFWriterSpec.cxx +++ b/Detectors/CTF/workflow/src/CTFWriterSpec.cxx @@ -390,7 +390,7 @@ void CTFWriterSpec::run(ProcessingContext& pc) prepareTFTreeAndFile(); } // create header - CTFHeader header{mTimingInfo.runNumber, mTimingInfo.creation, mTimingInfo.firstTFOrbit, mTimingInfo.tfCounter}; + CTFHeader header{mTimingInfo.runNumber, mTimingInfo.creation, mTimingInfo.firstTForbit, mTimingInfo.tfCounter}; size_t szCTF = 0; mSizeReport = ""; szCTF += processDet(pc, DetID::ITS, header, mCTFTreeOut.get()); @@ -419,7 +419,7 @@ void CTFWriterSpec::run(ProcessingContext& pc) szCTF += appendToTree(*mCTFTreeOut.get(), "CTFHeader", header); mAccCTFSize += szCTF; mCTFTreeOut->SetEntries(++mNAccCTF); - mTFOrbits.push_back(mTimingInfo.firstTFOrbit); + mTFOrbits.push_back(mTimingInfo.firstTForbit); LOG(info) << "TF#" << mNCTF << ": wrote CTF{" << header << "} of size " << szCTF << " to " << mCurrentCTFFileNameFull << " in " << mTimer.CpuTime() - cput << " s"; if (mNAccCTF > 1) { LOG(info) << "Current CTF tree has " << mNAccCTF << " entries with total size of " << mAccCTFSize << " bytes"; @@ -500,7 +500,7 @@ void CTFWriterSpec::prepareTFTreeAndFile() LOGP(info, "Created {} directory for CTFs output", ctfDir); } } - mCurrentCTFFileName = o2::base::NameConf::getCTFFileName(mTimingInfo.runNumber, mTimingInfo.firstTFOrbit, mTimingInfo.tfCounter, mHostName); + mCurrentCTFFileName = o2::base::NameConf::getCTFFileName(mTimingInfo.runNumber, mTimingInfo.firstTForbit, mTimingInfo.tfCounter, mHostName); mCurrentCTFFileNameFull = fmt::format("{}{}", ctfDir, mCurrentCTFFileName); mCTFFileOut.reset(TFile::Open(fmt::format("{}{}", mCurrentCTFFileNameFull, TMPFileEnding).c_str(), "recreate")); // to prevent premature external usage, use temporary name mCTFTreeOut = std::make_unique(std::string(o2::base::NameConf::CTFTREENAME).c_str(), "O2 CTF tree"); @@ -608,7 +608,7 @@ void CTFWriterSpec::createLockFile(int level) { // create lock file for the CTF to be written to the storage of given level while (1) { - mLockFileName = fmt::format("{}/ctfs{}-{}_{}_{}_{}.lock", LOCKFileDir, level, o2::utils::Str::getRandomString(8), mTimingInfo.runNumber, mTimingInfo.firstTFOrbit, mTimingInfo.tfCounter); + mLockFileName = fmt::format("{}/ctfs{}-{}_{}_{}_{}.lock", LOCKFileDir, level, o2::utils::Str::getRandomString(8), mTimingInfo.runNumber, mTimingInfo.firstTForbit, mTimingInfo.tfCounter); if (!std::filesystem::exists(mLockFileName)) { break; } diff --git a/Detectors/Calibration/workflow/CCDBPopulatorSpec.h b/Detectors/Calibration/workflow/CCDBPopulatorSpec.h index 17eaf849662ca..4c849844119fb 100644 --- a/Detectors/Calibration/workflow/CCDBPopulatorSpec.h +++ b/Detectors/Calibration/workflow/CCDBPopulatorSpec.h @@ -54,7 +54,7 @@ class CCDBPopulator : public o2::framework::Task { int nSlots = pc.inputs().getNofParts(0); assert(pc.inputs().getNofParts(1) == nSlots); - auto runNoFromDH = o2::framework::DataRefUtils::getHeader(pc.inputs().getFirstValid(true))->runNumber; + auto runNoFromDH = pc.services().get().runNumber; std::string runNoStr; if (runNoFromDH > 0) { runNoStr = std::to_string(runNoFromDH); diff --git a/Detectors/EMCAL/calibration/testWorkflow/emc-channel-calib-workflow.cxx b/Detectors/EMCAL/calibration/testWorkflow/emc-channel-calib-workflow.cxx index 172a33f77a3c9..7e11ea715a11f 100644 --- a/Detectors/EMCAL/calibration/testWorkflow/emc-channel-calib-workflow.cxx +++ b/Detectors/EMCAL/calibration/testWorkflow/emc-channel-calib-workflow.cxx @@ -50,7 +50,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) o2::conf::ConfigurableParam::updateFromString(cfgc.options().get("configKeyValues")); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit // o2::raw::HBFUtilsInitializer hbfIni(cfgc, specs); return specs; } diff --git a/Detectors/EMCAL/workflow/src/RawToCellConverterSpec.cxx b/Detectors/EMCAL/workflow/src/RawToCellConverterSpec.cxx index c62baa0e21ba2..8eb71ade3490f 100644 --- a/Detectors/EMCAL/workflow/src/RawToCellConverterSpec.cxx +++ b/Detectors/EMCAL/workflow/src/RawToCellConverterSpec.cxx @@ -124,7 +124,7 @@ void RawToCellConverterSpec::run(framework::ProcessingContext& ctx) // Get the first orbit of the timeframe later used to check whether the corrected // BC is within the timeframe - const auto tfOrbitFirst = o2::framework::DataRefUtils::getHeader(ctx.inputs().getFirstValid(true))->firstTForbit; + const auto tfOrbitFirst = ctx.services().get().firstTForbit; auto lml0delay = o2::ctp::TriggerOffsetsParam::Instance().LM_L0; // Cache cells from for bunch crossings as the component reads timeframes from many links consecutively diff --git a/Detectors/EMCAL/workflow/src/StandaloneAODProducerSpec.cxx b/Detectors/EMCAL/workflow/src/StandaloneAODProducerSpec.cxx index f19231a746179..cd2b206257984 100644 --- a/Detectors/EMCAL/workflow/src/StandaloneAODProducerSpec.cxx +++ b/Detectors/EMCAL/workflow/src/StandaloneAODProducerSpec.cxx @@ -48,15 +48,15 @@ void StandaloneAODProducerSpec::run(ProcessingContext& pc) auto cput = mTimer.CpuTime(); mTimer.Start(false); - const auto* dh = o2::header::get(pc.inputs().getFirstValid(true).header); + const auto& tinfo = pc.services().get(); uint64_t tfNumber; if (mTFNumber == -1L) { // TODO has to be made globally unique (by using absolute time of TF). For now is unique within the run - tfNumber = uint64_t(dh->firstTForbit) + (uint64_t(dh->runNumber) << 32); // getTFNumber(mStartIR, runNumber); + tfNumber = uint64_t(tinfo.firstTForbit) + (uint64_t(tinfo.runNumber) << 32); // getTFNumber(mStartIR, runNumber); } else { tfNumber = mTFNumber; } - const int runNumber = (mRunNumber == -1) ? int(dh->runNumber) : mRunNumber; + const int runNumber = (mRunNumber == -1) ? int(tinfo.runNumber) : mRunNumber; auto cellsIn = pc.inputs().get>(getCellBinding()); auto triggersIn = pc.inputs().get>(getCellTriggerRecordBinding()); diff --git a/Detectors/EMCAL/workflow/src/cell-reader-workflow.cxx b/Detectors/EMCAL/workflow/src/cell-reader-workflow.cxx index 3b3e5163ed9d7..a290f76c2d873 100644 --- a/Detectors/EMCAL/workflow/src/cell-reader-workflow.cxx +++ b/Detectors/EMCAL/workflow/src/cell-reader-workflow.cxx @@ -56,7 +56,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) o2::framework::OutputSpec{"EMC", "CELLSMCTR"}}, !disableMC)); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(cfgc, specs); return specs; } diff --git a/Detectors/EMCAL/workflow/src/digit-reader-workflow.cxx b/Detectors/EMCAL/workflow/src/digit-reader-workflow.cxx index 201939be37e81..e6d7586828196 100644 --- a/Detectors/EMCAL/workflow/src/digit-reader-workflow.cxx +++ b/Detectors/EMCAL/workflow/src/digit-reader-workflow.cxx @@ -58,7 +58,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) o2::framework::OutputSpec{"EMC", "DIGITSMCTR"}}, !disableMC)); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(cfgc, specs); return specs; diff --git a/Detectors/EMCAL/workflow/src/emc-reco-workflow.cxx b/Detectors/EMCAL/workflow/src/emc-reco-workflow.cxx index 2cdffa85e1b12..d9a3cf5a4fdd1 100644 --- a/Detectors/EMCAL/workflow/src/emc-reco-workflow.cxx +++ b/Detectors/EMCAL/workflow/src/emc-reco-workflow.cxx @@ -86,7 +86,7 @@ o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext co cfgc.options().get("disable-root-output"), cfgc.options().get("disable-decoding-errors")); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(cfgc, wf); return std::move(wf); diff --git a/Detectors/FIT/FDD/workflow/src/digits-reader-workflow.cxx b/Detectors/FIT/FDD/workflow/src/digits-reader-workflow.cxx index f7cb5133e6d29..2b5a405e9ed2b 100644 --- a/Detectors/FIT/FDD/workflow/src/digits-reader-workflow.cxx +++ b/Detectors/FIT/FDD/workflow/src/digits-reader-workflow.cxx @@ -51,7 +51,7 @@ WorkflowSpec defineDataProcessing(const ConfigContext& ctx) DataProcessorSpec producer = o2::fdd::getFDDDigitReaderSpec(ctx.options().get("disable-mc")); specs.push_back(producer); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(ctx, specs); return specs; diff --git a/Detectors/FIT/FDD/workflow/src/fdd-reco-workflow.cxx b/Detectors/FIT/FDD/workflow/src/fdd-reco-workflow.cxx index 9fc62e905723e..652ddb8bd2a29 100644 --- a/Detectors/FIT/FDD/workflow/src/fdd-reco-workflow.cxx +++ b/Detectors/FIT/FDD/workflow/src/fdd-reco-workflow.cxx @@ -60,7 +60,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext) auto wf = o2::fdd::getRecoWorkflow(useMC, disableRootInp, disableRootOut); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, wf); return std::move(wf); diff --git a/Detectors/FIT/FT0/calibration/testWorkflow/FT0DCSDataProcessorSpec.h b/Detectors/FIT/FT0/calibration/testWorkflow/FT0DCSDataProcessorSpec.h index fe6fc7c720c33..cd0ac4aa67238 100644 --- a/Detectors/FIT/FT0/calibration/testWorkflow/FT0DCSDataProcessorSpec.h +++ b/Detectors/FIT/FT0/calibration/testWorkflow/FT0DCSDataProcessorSpec.h @@ -122,7 +122,7 @@ class FT0DCSDataProcessor : public o2::framework::Task void run(o2::framework::ProcessingContext& pc) final { auto timeNow = HighResClock::now(); - long dataTime = (long)(DataRefUtils::getHeader(pc.inputs().getFirstValid(true))->creation); + long dataTime = (long)(pc.services().get().creation); if (dataTime == 0xffffffffffffffff) { // it means it is not set dataTime = std::chrono::duration_cast(timeNow.time_since_epoch()).count(); // in ms } diff --git a/Detectors/FIT/FT0/calibration/testWorkflow/FT0TFProcessor-Workflow.cxx b/Detectors/FIT/FT0/calibration/testWorkflow/FT0TFProcessor-Workflow.cxx index a2b4421421e70..a5428c1bea375 100644 --- a/Detectors/FIT/FT0/calibration/testWorkflow/FT0TFProcessor-Workflow.cxx +++ b/Detectors/FIT/FT0/calibration/testWorkflow/FT0TFProcessor-Workflow.cxx @@ -29,8 +29,7 @@ class FT0TFProcessor final : public o2::framework::Task public: void run(o2::framework::ProcessingContext& pc) final { - const auto ref = pc.inputs().getFirstValid(true); - auto creationTime = DataRefUtils::getHeader(ref)->creation; // approximate time in ms + auto creationTime = pc.services().get().creation; // approximate time in ms // LOG(info)<<" FT0TFProcessor run "<>("digits"); auto channels = pc.inputs().get>("channels"); diff --git a/Detectors/FIT/FT0/calibration/testWorkflow/GlobalOffsetsCollectWorkflow.cxx b/Detectors/FIT/FT0/calibration/testWorkflow/GlobalOffsetsCollectWorkflow.cxx index e55a10b95c192..3a90816f7d5c2 100644 --- a/Detectors/FIT/FT0/calibration/testWorkflow/GlobalOffsetsCollectWorkflow.cxx +++ b/Detectors/FIT/FT0/calibration/testWorkflow/GlobalOffsetsCollectWorkflow.cxx @@ -28,8 +28,7 @@ class GlobalOffsetsCollectWorkflow final : public o2::framework::Task public: void run(o2::framework::ProcessingContext& pc) final { - const auto ref = pc.inputs().getFirstValid(true); - auto creationTime = DataRefUtils::getHeader(ref)->creation; // approximate time in ms + auto creationTime = pc.services().get().creation; // approximate time in ms auto recpoints = pc.inputs().get>("recpoints"); auto& calib_data = pc.outputs().make>(o2::framework::OutputRef{"calib", 0}); for (const auto& recpoint : recpoints) { diff --git a/Detectors/FIT/FT0/workflow/src/ReconstructionSpec.cxx b/Detectors/FIT/FT0/workflow/src/ReconstructionSpec.cxx index aab54c99e169a..015250426eef8 100644 --- a/Detectors/FIT/FT0/workflow/src/ReconstructionSpec.cxx +++ b/Detectors/FIT/FT0/workflow/src/ReconstructionSpec.cxx @@ -40,9 +40,7 @@ void ReconstructionDPL::init(InitContext& ic) void ReconstructionDPL::run(ProcessingContext& pc) { /* - const auto ref = pc.inputs().getFirstValid(true); - auto creationTime = - o2::framework::DataRefUtils::getHeader(ref)->creation; + auto creationTime = pc.services().get().creation; auto& mCCDBManager = o2::ccdb::BasicCCDBManager::instance(); mCCDBManager.setURL(mCCDBpath); mCCDBManager.setTimestamp(creationTime); diff --git a/Detectors/FIT/FT0/workflow/src/digits-reader-workflow.cxx b/Detectors/FIT/FT0/workflow/src/digits-reader-workflow.cxx index a6f6b52568849..a15d863f81caa 100644 --- a/Detectors/FIT/FT0/workflow/src/digits-reader-workflow.cxx +++ b/Detectors/FIT/FT0/workflow/src/digits-reader-workflow.cxx @@ -52,7 +52,7 @@ WorkflowSpec defineDataProcessing(const ConfigContext& ctx) DataProcessorSpec producer = o2::ft0::getDigitReaderSpec(ctx.options().get("disable-mc"), ctx.options().get("disable-trigger-input")); specs.push_back(producer); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(ctx, specs); return specs; diff --git a/Detectors/FIT/FT0/workflow/src/ft0-reco-workflow.cxx b/Detectors/FIT/FT0/workflow/src/ft0-reco-workflow.cxx index 395f8711e4a9a..ee84c8b35a5f6 100644 --- a/Detectors/FIT/FT0/workflow/src/ft0-reco-workflow.cxx +++ b/Detectors/FIT/FT0/workflow/src/ft0-reco-workflow.cxx @@ -64,7 +64,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext) LOG(info) << "WorkflowSpec getRecoWorkflow useMC " << useMC << " CCDB " << ccdbpath; auto wf = o2::ft0::getRecoWorkflow(useMC, ccdbpath, disableRootInp, disableRootOut); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, wf); return std::move(wf); diff --git a/Detectors/FIT/FV0/calibration/workflow/FV0TFProcessor-Workflow.cxx b/Detectors/FIT/FV0/calibration/workflow/FV0TFProcessor-Workflow.cxx index fb27c6fc9f4a9..8a1b55865e9d2 100644 --- a/Detectors/FIT/FV0/calibration/workflow/FV0TFProcessor-Workflow.cxx +++ b/Detectors/FIT/FV0/calibration/workflow/FV0TFProcessor-Workflow.cxx @@ -28,8 +28,7 @@ class FV0TFProcessor final : public o2::framework::Task public: void run(o2::framework::ProcessingContext& pc) final { - const auto ref = pc.inputs().getFirstValid(true); - auto creationTime = DataRefUtils::getHeader(ref)->creation; // approximate time in ms + auto creationTime = pc.services().get().creation; // approximate time in ms auto channels = pc.inputs().get>("channels"); auto digits = pc.inputs().get>("digits"); auto& calib_data = pc.outputs().make>(o2::framework::OutputRef{"calib", 0}); diff --git a/Detectors/FIT/FV0/workflow/src/digits-reader-workflow.cxx b/Detectors/FIT/FV0/workflow/src/digits-reader-workflow.cxx index 1e5f1aedb8694..d3cb4f3229fb8 100644 --- a/Detectors/FIT/FV0/workflow/src/digits-reader-workflow.cxx +++ b/Detectors/FIT/FV0/workflow/src/digits-reader-workflow.cxx @@ -52,7 +52,7 @@ WorkflowSpec defineDataProcessing(const ConfigContext& ctx) DataProcessorSpec producer = o2::fv0::getDigitReaderSpec(ctx.options().get("disable-mc"), ctx.options().get("disable-trigger-input")); specs.push_back(producer); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(ctx, specs); return specs; diff --git a/Detectors/FIT/FV0/workflow/src/fv0-reco-workflow.cxx b/Detectors/FIT/FV0/workflow/src/fv0-reco-workflow.cxx index 8d61d1b9e00e5..16d1383c7e8c4 100644 --- a/Detectors/FIT/FV0/workflow/src/fv0-reco-workflow.cxx +++ b/Detectors/FIT/FV0/workflow/src/fv0-reco-workflow.cxx @@ -63,7 +63,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext) LOG(info) << "WorkflowSpec getRecoWorkflow useMC " << useMC; auto wf = o2::fv0::getRecoWorkflow(useMC, disableRootInp, disableRootOut); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, wf); return std::move(wf); diff --git a/Detectors/Filtering/src/FilteringSpec.cxx b/Detectors/Filtering/src/FilteringSpec.cxx index 7da29fcb9bb94..93a58b20890ab 100644 --- a/Detectors/Filtering/src/FilteringSpec.cxx +++ b/Detectors/Filtering/src/FilteringSpec.cxx @@ -123,13 +123,10 @@ void FilteringSpec::run(ProcessingContext& pc) if (mNeedToSave) { fillData(recoData); - auto dref = pc.inputs().getFirstValid(true); - const auto* dh = DataRefUtils::getHeader(dref); - const auto* dph = DataRefUtils::getHeader(dref); - - mFTF.header.run = dh->runNumber; - mFTF.header.firstTForbit = dh->firstTForbit; - mFTF.header.creationTime = dph->creation; + const auto& tinfo = pc.services().get(); + mFTF.header.run = tinfo.runNumber; + mFTF.header.firstTForbit = tinfo.firstTForbit; + mFTF.header.creationTime = tinfo.creation; pc.outputs().snapshot(Output{"GLO", "FILTERED_RECO_TF", 0}, mFTF); clear(); // clear caches, safe after the snapshot diff --git a/Detectors/Filtering/src/filtering-workflow.cxx b/Detectors/Filtering/src/filtering-workflow.cxx index c1275cc3401f2..8e36cfc36b197 100644 --- a/Detectors/Filtering/src/filtering-workflow.cxx +++ b/Detectors/Filtering/src/filtering-workflow.cxx @@ -59,7 +59,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext) o2::globaltracking::InputHelper::addInputSpecsSVertex(configcontext, specs); } - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs); return std::move(specs); diff --git a/Detectors/GRP/workflows/src/GRPDCSDPsSpec.cxx b/Detectors/GRP/workflows/src/GRPDCSDPsSpec.cxx index a4698cca1ca2a..24ac29aed05ad 100644 --- a/Detectors/GRP/workflows/src/GRPDCSDPsSpec.cxx +++ b/Detectors/GRP/workflows/src/GRPDCSDPsSpec.cxx @@ -124,7 +124,7 @@ void GRPDCSDPsDataProcessor::run(o2::framework::ProcessingContext& pc) { mLHCIFupdated = false; TStopwatch sw; - auto startValidity = (long)(DataRefUtils::getHeader(pc.inputs().getFirstValid(true))->creation); + auto startValidity = (long)(pc.services().get().creation); auto dps = pc.inputs().get>("input"); auto timeNow = HighResClock::now(); if (startValidity == 0xffffffffffffffff) { // it means it is not set diff --git a/Detectors/GlobalTrackingWorkflow/helpers/src/GlobalTrackClusterReader.cxx b/Detectors/GlobalTrackingWorkflow/helpers/src/GlobalTrackClusterReader.cxx index d07b7e628bac5..3fc8df70fdd84 100644 --- a/Detectors/GlobalTrackingWorkflow/helpers/src/GlobalTrackClusterReader.cxx +++ b/Detectors/GlobalTrackingWorkflow/helpers/src/GlobalTrackClusterReader.cxx @@ -74,7 +74,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) InputHelper::addInputSpecsIRFramesITS(cfgc, specs); } - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(cfgc, specs); return std::move(specs); diff --git a/Detectors/GlobalTrackingWorkflow/readers/src/irframe-reader-workflow.cxx b/Detectors/GlobalTrackingWorkflow/readers/src/irframe-reader-workflow.cxx index dd9bbc690a41d..5b93b40b902fd 100644 --- a/Detectors/GlobalTrackingWorkflow/readers/src/irframe-reader-workflow.cxx +++ b/Detectors/GlobalTrackingWorkflow/readers/src/irframe-reader-workflow.cxx @@ -44,7 +44,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cc) specs.emplace_back(o2::globaltracking::getIRFrameReaderSpec(origin, (uint32_t)cc.options().get("subspec"), cc.options().get("device-name"), cc.options().get("file-name"))); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(cc, specs); return specs; diff --git a/Detectors/GlobalTrackingWorkflow/src/GlobalFwdMatchingSpec.cxx b/Detectors/GlobalTrackingWorkflow/src/GlobalFwdMatchingSpec.cxx index 6b3e2dd3996cf..8dbe5b8704d3e 100644 --- a/Detectors/GlobalTrackingWorkflow/src/GlobalFwdMatchingSpec.cxx +++ b/Detectors/GlobalTrackingWorkflow/src/GlobalFwdMatchingSpec.cxx @@ -81,8 +81,6 @@ void GlobalFwdMatchingDPL::init(InitContext& ic) void GlobalFwdMatchingDPL::run(ProcessingContext& pc) { - const auto* dh = o2::header::get(pc.inputs().getFirstValid(true).header); - LOG(info) << " startOrbit: " << dh->firstTForbit; mTimer.Start(false); RecoContainer recoData; recoData.collectData(pc, *mDataRequest.get()); diff --git a/Detectors/GlobalTrackingWorkflow/src/TOFMatcherSpec.cxx b/Detectors/GlobalTrackingWorkflow/src/TOFMatcherSpec.cxx index 724c36a884578..cb511e92a4da6 100644 --- a/Detectors/GlobalTrackingWorkflow/src/TOFMatcherSpec.cxx +++ b/Detectors/GlobalTrackingWorkflow/src/TOFMatcherSpec.cxx @@ -116,7 +116,7 @@ void TOFMatcherSpec::run(ProcessingContext& pc) RecoContainer recoData; recoData.collectData(pc, *mDataRequest.get()); updateTimeDependentParams(pc); - auto creationTime = DataRefUtils::getHeader(pc.inputs().getFirstValid(true))->creation; + auto creationTime = pc.services().get().creation; LOG(debug) << "isTrackSourceLoaded: TPC -> " << recoData.isTrackSourceLoaded(o2::dataformats::GlobalTrackID::Source::TPC); LOG(debug) << "isTrackSourceLoaded: ITSTPC -> " << recoData.isTrackSourceLoaded(o2::dataformats::GlobalTrackID::Source::ITSTPC); diff --git a/Detectors/GlobalTrackingWorkflow/src/cosmics-match-workflow.cxx b/Detectors/GlobalTrackingWorkflow/src/cosmics-match-workflow.cxx index 7ada745d7fff0..d3f7aafe202e5 100644 --- a/Detectors/GlobalTrackingWorkflow/src/cosmics-match-workflow.cxx +++ b/Detectors/GlobalTrackingWorkflow/src/cosmics-match-workflow.cxx @@ -94,7 +94,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext) specs.emplace_back(o2::globaltracking::getTrackCosmicsWriterSpec(useMC)); } - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs); return std::move(specs); diff --git a/Detectors/GlobalTrackingWorkflow/src/globalfwd-matcher-workflow.cxx b/Detectors/GlobalTrackingWorkflow/src/globalfwd-matcher-workflow.cxx index 9376faabec223..13a842130e5d1 100644 --- a/Detectors/GlobalTrackingWorkflow/src/globalfwd-matcher-workflow.cxx +++ b/Detectors/GlobalTrackingWorkflow/src/globalfwd-matcher-workflow.cxx @@ -92,7 +92,7 @@ WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& configcont o2::globaltracking::InputHelper::addInputSpecs(configcontext, specs, srcClusters, matchMask, srcTracks, useMC, srcClusters, srcTracks); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs); return std::move(specs); diff --git a/Detectors/GlobalTrackingWorkflow/src/primary-vertex-reader-workflow.cxx b/Detectors/GlobalTrackingWorkflow/src/primary-vertex-reader-workflow.cxx index 0d0fb6db91425..60fe5c90c3c01 100644 --- a/Detectors/GlobalTrackingWorkflow/src/primary-vertex-reader-workflow.cxx +++ b/Detectors/GlobalTrackingWorkflow/src/primary-vertex-reader-workflow.cxx @@ -49,7 +49,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext) WorkflowSpec specs; specs.emplace_back(o2::vertexing::getPrimaryVertexReaderSpec(useMC)); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs); return std::move(specs); diff --git a/Detectors/GlobalTrackingWorkflow/src/primary-vertexing-workflow.cxx b/Detectors/GlobalTrackingWorkflow/src/primary-vertexing-workflow.cxx index 6e47201d57223..bc478abef0433 100644 --- a/Detectors/GlobalTrackingWorkflow/src/primary-vertexing-workflow.cxx +++ b/Detectors/GlobalTrackingWorkflow/src/primary-vertexing-workflow.cxx @@ -122,7 +122,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext) specs.emplace_back(o2::vertexing::getPrimaryVertexWriterSpec(srcVT.none(), useMC)); } - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit if (srcPV.any() && !configcontext.options().get("disable-root-output")) { o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs); } diff --git a/Detectors/GlobalTrackingWorkflow/src/secondary-vertex-reader-workflow.cxx b/Detectors/GlobalTrackingWorkflow/src/secondary-vertex-reader-workflow.cxx index 7be303f9c4dec..5f1e5c1af75c3 100644 --- a/Detectors/GlobalTrackingWorkflow/src/secondary-vertex-reader-workflow.cxx +++ b/Detectors/GlobalTrackingWorkflow/src/secondary-vertex-reader-workflow.cxx @@ -46,7 +46,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext) WorkflowSpec specs; specs.emplace_back(o2::vertexing::getSecondaryVertexReaderSpec()); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs); return std::move(specs); diff --git a/Detectors/GlobalTrackingWorkflow/src/secondary-vertexing-workflow.cxx b/Detectors/GlobalTrackingWorkflow/src/secondary-vertexing-workflow.cxx index f837c1b5c9d08..4ac76d28663aa 100644 --- a/Detectors/GlobalTrackingWorkflow/src/secondary-vertexing-workflow.cxx +++ b/Detectors/GlobalTrackingWorkflow/src/secondary-vertexing-workflow.cxx @@ -106,7 +106,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext) specs.emplace_back(o2::vertexing::getSecondaryVertexWriterSpec()); } - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs); return std::move(specs); diff --git a/Detectors/GlobalTrackingWorkflow/src/tof-matcher-workflow.cxx b/Detectors/GlobalTrackingWorkflow/src/tof-matcher-workflow.cxx index 780e162660b30..a04a903e1e0b0 100644 --- a/Detectors/GlobalTrackingWorkflow/src/tof-matcher-workflow.cxx +++ b/Detectors/GlobalTrackingWorkflow/src/tof-matcher-workflow.cxx @@ -183,7 +183,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext) } } - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs); return std::move(specs); diff --git a/Detectors/GlobalTrackingWorkflow/src/tpcits-match-workflow.cxx b/Detectors/GlobalTrackingWorkflow/src/tpcits-match-workflow.cxx index ecdf557e64631..09a3c3e865ed0 100644 --- a/Detectors/GlobalTrackingWorkflow/src/tpcits-match-workflow.cxx +++ b/Detectors/GlobalTrackingWorkflow/src/tpcits-match-workflow.cxx @@ -91,7 +91,7 @@ WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& configcont // the only clusters MC which is need with useMC is ITS (for afterburner), for the rest we use tracks MC labels o2::globaltracking::InputHelper::addInputSpecs(configcontext, specs, srcL, srcL, srcL, useMC, GID::getSourceMask(GID::ITS), GID::getSourcesMask(GID::ALL), needStrictTRDTOF); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs); return std::move(specs); diff --git a/Detectors/GlobalTrackingWorkflow/tofworkflow/src/tof-reco-workflow.cxx b/Detectors/GlobalTrackingWorkflow/tofworkflow/src/tof-reco-workflow.cxx index ac55fc1458b09..89d2ede35687f 100644 --- a/Detectors/GlobalTrackingWorkflow/tofworkflow/src/tof-reco-workflow.cxx +++ b/Detectors/GlobalTrackingWorkflow/tofworkflow/src/tof-reco-workflow.cxx @@ -207,7 +207,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) LOG(debug) << "Number of active devices = " << specs.size(); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(cfgc, specs); return std::move(specs); diff --git a/Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/tpc-interpolation-workflow.cxx b/Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/tpc-interpolation-workflow.cxx index 2359e50a63526..e30319da9630f 100644 --- a/Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/tpc-interpolation-workflow.cxx +++ b/Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/tpc-interpolation-workflow.cxx @@ -84,7 +84,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext) specs.emplace_back(o2::tpc::getTPCResidualWriterSpec(useMC)); } - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs); o2::globaltracking::InputHelper::addInputSpecs(configcontext, specs, src, src, src, useMC); diff --git a/Detectors/HMPID/workflow/src/clusters-to-root-workflow.cxx b/Detectors/HMPID/workflow/src/clusters-to-root-workflow.cxx index d150e0a3b1778..8da14f051dffd 100644 --- a/Detectors/HMPID/workflow/src/clusters-to-root-workflow.cxx +++ b/Detectors/HMPID/workflow/src/clusters-to-root-workflow.cxx @@ -64,7 +64,7 @@ WorkflowSpec defineDataProcessing(const ConfigContext& configcontext) DataProcessorSpec consumer = o2::hmpid::getClustersToRootSpec(); specs.push_back(consumer); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs); return specs; diff --git a/Detectors/HMPID/workflow/src/digits-to-raw-workflow.cxx b/Detectors/HMPID/workflow/src/digits-to-raw-workflow.cxx index 072d2797bc800..e943cb7b502ba 100644 --- a/Detectors/HMPID/workflow/src/digits-to-raw-workflow.cxx +++ b/Detectors/HMPID/workflow/src/digits-to-raw-workflow.cxx @@ -64,7 +64,7 @@ WorkflowSpec defineDataProcessing(const ConfigContext& configcontext) DataProcessorSpec consumer = o2::hmpid::getDigitsToRawSpec(); specs.push_back(consumer); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs); return specs; diff --git a/Detectors/HMPID/workflow/src/digits-to-root-workflow.cxx b/Detectors/HMPID/workflow/src/digits-to-root-workflow.cxx index ce2987e67efb5..a6c44649e11d8 100644 --- a/Detectors/HMPID/workflow/src/digits-to-root-workflow.cxx +++ b/Detectors/HMPID/workflow/src/digits-to-root-workflow.cxx @@ -64,7 +64,7 @@ WorkflowSpec defineDataProcessing(const ConfigContext& configcontext) DataProcessorSpec consumer = o2::hmpid::getDigitsToRootSpec(); specs.push_back(consumer); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs); return specs; diff --git a/Detectors/ITSMFT/ITS/workflow/src/ThresholdAggregatorSpec.cxx b/Detectors/ITSMFT/ITS/workflow/src/ThresholdAggregatorSpec.cxx index 3b3d87dd7d699..dd2f78b5a7690 100644 --- a/Detectors/ITSMFT/ITS/workflow/src/ThresholdAggregatorSpec.cxx +++ b/Detectors/ITSMFT/ITS/workflow/src/ThresholdAggregatorSpec.cxx @@ -46,8 +46,8 @@ void ITSThresholdAggregator::init(InitContext& ic) void ITSThresholdAggregator::run(ProcessingContext& pc) { // Skip everything in case of garbage (potentially at EoS) - if (pc.services().get().firstTFOrbit == -1U) { - LOG(info) << "Skipping the processing of inputs for timeslice " << pc.services().get().timeslice << " (firstTFOrbit is " << pc.services().get().firstTFOrbit << ")"; + if (pc.services().get().firstTForbit == -1U) { + LOG(info) << "Skipping the processing of inputs for timeslice " << pc.services().get().timeslice << " (firstTForbit is " << pc.services().get().firstTForbit << ")"; return; } // take run type, scan type, fit type, db version only at the beginning (important for EoS operations!) diff --git a/Detectors/ITSMFT/ITS/workflow/src/its-cluster-reader-workflow.cxx b/Detectors/ITSMFT/ITS/workflow/src/its-cluster-reader-workflow.cxx index 2abcc8ea4999c..5d52a9c8ee736 100644 --- a/Detectors/ITSMFT/ITS/workflow/src/its-cluster-reader-workflow.cxx +++ b/Detectors/ITSMFT/ITS/workflow/src/its-cluster-reader-workflow.cxx @@ -56,7 +56,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cc) specs.emplace_back(o2::itsmft::getITSClusterReaderSpec(withMC, withPatterns)); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(cc, specs); return specs; diff --git a/Detectors/ITSMFT/ITS/workflow/src/its-reco-workflow.cxx b/Detectors/ITSMFT/ITS/workflow/src/its-reco-workflow.cxx index 1c61bd2615ad8..40ed7d94d74a1 100644 --- a/Detectors/ITSMFT/ITS/workflow/src/its-reco-workflow.cxx +++ b/Detectors/ITSMFT/ITS/workflow/src/its-reco-workflow.cxx @@ -81,7 +81,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext) auto wf = o2::its::reco_workflow::getWorkflow(useMC, useCAtracker, trmode, gpuDevice, extDigits, extClusters, disableRootOutput, eencode); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, wf); // write the configuration used for the reco workflow diff --git a/Detectors/ITSMFT/MFT/workflow/src/mft-cluster-reader-workflow.cxx b/Detectors/ITSMFT/MFT/workflow/src/mft-cluster-reader-workflow.cxx index efbeab94f25a4..76e2a57f0f10b 100644 --- a/Detectors/ITSMFT/MFT/workflow/src/mft-cluster-reader-workflow.cxx +++ b/Detectors/ITSMFT/MFT/workflow/src/mft-cluster-reader-workflow.cxx @@ -49,7 +49,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cc) specs.emplace_back(o2::itsmft::getMFTClusterReaderSpec(withMC, withPatterns)); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(cc, specs); return specs; diff --git a/Detectors/ITSMFT/MFT/workflow/src/mft-reco-workflow.cxx b/Detectors/ITSMFT/MFT/workflow/src/mft-reco-workflow.cxx index 44f98a0986923..4dd4421497458 100644 --- a/Detectors/ITSMFT/MFT/workflow/src/mft-reco-workflow.cxx +++ b/Detectors/ITSMFT/MFT/workflow/src/mft-reco-workflow.cxx @@ -64,7 +64,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext) auto wf = o2::mft::reco_workflow::getWorkflow(useMC, extDigits, extClusters, disableRootOutput, runAssessment, processGen, runTracking); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, wf); return std::move(wf); diff --git a/Detectors/ITSMFT/common/reconstruction/include/ITSMFTReconstruction/RawPixelDecoder.h b/Detectors/ITSMFT/common/reconstruction/include/ITSMFTReconstruction/RawPixelDecoder.h index 8bff16d51a34d..1fe46e566e129 100644 --- a/Detectors/ITSMFT/common/reconstruction/include/ITSMFTReconstruction/RawPixelDecoder.h +++ b/Detectors/ITSMFT/common/reconstruction/include/ITSMFTReconstruction/RawPixelDecoder.h @@ -35,6 +35,7 @@ namespace o2 namespace framework { class InputRecord; +class TimingInfo; } namespace itsmft @@ -88,7 +89,7 @@ class RawPixelDecoder final : public PixelReader int getVerbosity() const { return mVerbosity; } void printReport(bool decstat = true, bool skipNoErr = true) const; - void produceRawDataDumps(int dump, const o2::header::DataHeader* dh); + void produceRawDataDumps(int dump, const o2::framework::TimingInfo& tinfo); void clearStat(); diff --git a/Detectors/ITSMFT/common/reconstruction/src/RawPixelDecoder.cxx b/Detectors/ITSMFT/common/reconstruction/src/RawPixelDecoder.cxx index 9e1475ea79711..6b4b37fbe3f78 100644 --- a/Detectors/ITSMFT/common/reconstruction/src/RawPixelDecoder.cxx +++ b/Detectors/ITSMFT/common/reconstruction/src/RawPixelDecoder.cxx @@ -16,6 +16,7 @@ #include "ITSMFTReconstruction/RawPixelDecoder.h" #include "DPLUtils/DPLRawParser.h" #include "Framework/InputRecordWalker.h" +#include "Framework/TimingInfo.h" #include "Framework/DataRefUtils.h" #include "CommonUtils/StringUtils.h" #include "CommonUtils/VerbosityConfig.h" @@ -422,7 +423,7 @@ void RawPixelDecoder::clearStat() ///______________________________________________________________________ template -void RawPixelDecoder::produceRawDataDumps(int dump, const o2::header::DataHeader* dh) +void RawPixelDecoder::produceRawDataDumps(int dump, const o2::framework::TimingInfo& tinfo) { bool dumpFullTF = false; for (auto& ru : mRUDecodeVec) { @@ -441,10 +442,10 @@ void RawPixelDecoder::produceRawDataDumps(int dump, const o2::header::D allHBFs = true; entry = 0; fnm = fmt::format("{}{}rawdump_{}_run{}_tf_orb{}_full_feeID{:#06x}.raw", mRawDumpDirectory, mRawDumpDirectory.empty() ? "" : "/", - Mapping::getName(), dh->runNumber, dh->firstTForbit, lnk.feeID); + Mapping::getName(), tinfo.runNumber, tinfo.firstTForbit, lnk.feeID); } else { fnm = fmt::format("{}{}rawdump_{}_run{}_tf_orb{}_hbf_orb{}_feeID{:#06x}.raw", mRawDumpDirectory, mRawDumpDirectory.empty() ? "" : "/", - Mapping::getName(), dh->runNumber, dh->firstTForbit, it.second, lnk.feeID); + Mapping::getName(), tinfo.runNumber, tinfo.firstTForbit, it.second, lnk.feeID); } std::ofstream ostrm(fnm, std::ios::binary); if (!ostrm.good()) { @@ -466,7 +467,7 @@ void RawPixelDecoder::produceRawDataDumps(int dump, const o2::header::D } while (dumpFullTF) { std::string fnm = fmt::format("rawdump_{}_run{}_tf_orb{}_full.raw", - Mapping::getName(), dh->runNumber, dh->firstTForbit); + Mapping::getName(), tinfo.runNumber, tinfo.firstTForbit); std::ofstream ostrm(fnm, std::ios::binary); if (!ostrm.good()) { LOG(error) << "failed to open " << fnm; diff --git a/Detectors/ITSMFT/common/workflow/src/STFDecoderSpec.cxx b/Detectors/ITSMFT/common/workflow/src/STFDecoderSpec.cxx index a1b8c2bfa609f..274ec4351d377 100644 --- a/Detectors/ITSMFT/common/workflow/src/STFDecoderSpec.cxx +++ b/Detectors/ITSMFT/common/workflow/src/STFDecoderSpec.cxx @@ -182,7 +182,7 @@ void STFDecoder::run(ProcessingContext& pc) pc.outputs().snapshot(Output{orig, "PHYSTRIG", 0, Lifetime::Timeframe}, mDecoder->getExternalTriggers()); if (mDumpOnError != int(GBTLink::RawDataDumps::DUMP_NONE)) { - mDecoder->produceRawDataDumps(mDumpOnError, DataRefUtils::getHeader(pc.inputs().getFirstValid(true))); + mDecoder->produceRawDataDumps(mDumpOnError, pc.services().get()); } if (mDoClusters) { @@ -192,7 +192,7 @@ void STFDecoder::run(ProcessingContext& pc) LOG(debug) << mSelfName << " Decoded " << digVec.size() << " Digits in " << digROFVec.size() << " ROFs"; } mTimer.Stop(); - auto tfID = DataRefUtils::getHeader(pc.inputs().getFirstValid(true))->tfCounter; + auto tfID = pc.services().get().tfCounter; LOG(debug) << mSelfName << " Total time for TF " << tfID << '(' << mTFCounter << ") : CPU: " << mTimer.CpuTime() - timeCPU0 << " Real: " << mTimer.RealTime() - timeReal0; mTFCounter++; } diff --git a/Detectors/MUON/MCH/Workflow/src/DataDecoderSpec.cxx b/Detectors/MUON/MCH/Workflow/src/DataDecoderSpec.cxx index 6b20a60b7a597..e5a2e775b61d1 100644 --- a/Detectors/MUON/MCH/Workflow/src/DataDecoderSpec.cxx +++ b/Detectors/MUON/MCH/Workflow/src/DataDecoderSpec.cxx @@ -109,8 +109,8 @@ class DataDecoderTask // the decodeTF() function processes the messages generated by the (sub)TimeFrame builder void decodeTF(framework::ProcessingContext& pc) { - const auto* dh = DataRefUtils::getHeader(pc.inputs().getFirstValid(true)); - mFirstTForbit = dh->firstTForbit; + const auto& tinfo = pc.services().get(); + mFirstTForbit = tinfo.firstTForbit; mDecoder->setFirstOrbitInTF(mFirstTForbit); @@ -185,19 +185,17 @@ class DataDecoderTask /// "delayed message" mechanism created it in absence of real data /// from upstream, i.e. the TF was dropped. constexpr auto origin = header::gDataOriginMCH; + const auto& tinfo = pc.services().get(); static size_t contDeadBeef = 0; // number of times 0xDEADBEEF was seen continuously - o2::framework::InputSpec dummy{"dummy", - framework::ConcreteDataMatcher{origin, - header::gDataDescriptionRawData, - 0xDEADBEEF}}; + o2::framework::InputSpec dummy{"dummy", framework::ConcreteDataMatcher{origin, header::gDataDescriptionRawData, 0xDEADBEEF}}; for (const auto& ref : o2::framework::InputRecordWalker(pc.inputs(), {dummy})) { - const auto dh = o2::framework::DataRefUtils::getHeader(ref); auto payloadSize = DataRefUtils::getPayloadSize(ref); if (payloadSize == 0) { + const auto* dh = DataRefUtils::getHeader(pc.inputs().getFirstValid(true)); auto maxWarn = o2::conf::VerbosityConfig::Instance().maxWarnDeadBeef; if (++contDeadBeef <= maxWarn) { LOGP(alarm, "Found input [{}/{}/{:#x}] TF#{} 1st_orbit:{} Payload {} : assuming no payload for all links in this TF{}", - dh->dataOrigin.str, dh->dataDescription.str, dh->subSpecification, dh->tfCounter, dh->firstTForbit, payloadSize, + dh->dataOrigin.str, dh->dataDescription.str, dh->subSpecification, tinfo.tfCounter, tinfo.firstTForbit, payloadSize, contDeadBeef == maxWarn ? fmt::format(". {} such inputs in row received, stopping reporting", contDeadBeef) : ""); } return true; diff --git a/Detectors/MUON/MCH/Workflow/src/cru-page-reader-workflow.cxx b/Detectors/MUON/MCH/Workflow/src/cru-page-reader-workflow.cxx index ae1c5be4d3181..a3ae4284d88bc 100644 --- a/Detectors/MUON/MCH/Workflow/src/cru-page-reader-workflow.cxx +++ b/Detectors/MUON/MCH/Workflow/src/cru-page-reader-workflow.cxx @@ -593,7 +593,7 @@ class FileReaderTask { auto& timingInfo = pc.services().get(); if (tfid.firstTForbit != -1U) { - timingInfo.firstTFOrbit = tfid.firstTForbit; + timingInfo.firstTForbit = tfid.firstTForbit; } if (tfid.tfCounter != -1U) { timingInfo.tfCounter = tfid.tfCounter; @@ -604,7 +604,7 @@ class FileReaderTask if (tfid.creation != -1U) { timingInfo.creation = tfid.creation; } - // LOGP(info, "TimingInfo set to : firstTFOrbit {}, tfCounter {}, runNumber {}, creatio {}", timingInfo.firstTFOrbit, timingInfo.tfCounter, timingInfo.runNumber, timingInfo.creation); + // LOGP(info, "TimingInfo set to : firstTForbit {}, tfCounter {}, runNumber {}, creatio {}", timingInfo.firstTForbit, timingInfo.tfCounter, timingInfo.runNumber, timingInfo.creation); } private: diff --git a/Detectors/MUON/MCH/Workflow/src/digits-reader-workflow.cxx b/Detectors/MUON/MCH/Workflow/src/digits-reader-workflow.cxx index 0d39b5cb99bb7..c36574c08132d 100644 --- a/Detectors/MUON/MCH/Workflow/src/digits-reader-workflow.cxx +++ b/Detectors/MUON/MCH/Workflow/src/digits-reader-workflow.cxx @@ -45,7 +45,7 @@ WorkflowSpec defineDataProcessing(const ConfigContext& configcontext) WorkflowSpec wf{o2::mch::getDigitSamplerSpec()}; - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, wf); return std::move(wf); diff --git a/Detectors/MUON/MCH/Workflow/src/raw-to-digits-workflow.cxx b/Detectors/MUON/MCH/Workflow/src/raw-to-digits-workflow.cxx index 3e11432bf22a0..3d5928210f3fc 100644 --- a/Detectors/MUON/MCH/Workflow/src/raw-to-digits-workflow.cxx +++ b/Detectors/MUON/MCH/Workflow/src/raw-to-digits-workflow.cxx @@ -64,7 +64,7 @@ WorkflowSpec defineDataProcessing(const ConfigContext& configcontext) WorkflowSpec wf{o2::mch::raw::getDecodingSpec("mch-data-decoder", inputSpec, askSTFDist)}; - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, wf); return std::move(wf); diff --git a/Detectors/MUON/MCH/Workflow/src/reco-workflow.cxx b/Detectors/MUON/MCH/Workflow/src/reco-workflow.cxx index d4bac94f85047..cd104cba8f82c 100644 --- a/Detectors/MUON/MCH/Workflow/src/reco-workflow.cxx +++ b/Detectors/MUON/MCH/Workflow/src/reco-workflow.cxx @@ -109,7 +109,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext) specs.emplace_back(o2::mch::getClusterWriterSpec(false, "mch-global-cluster-writer", true, digits)); // RS cannot find who produces MCH/CLUSTERLABELS/0 } - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs); // write the configuration used for the reco workflow diff --git a/Detectors/MUON/MID/Workflow/src/digits-reader-workflow.cxx b/Detectors/MUON/MID/Workflow/src/digits-reader-workflow.cxx index d34f692a8bf52..13a66b444e53e 100644 --- a/Detectors/MUON/MID/Workflow/src/digits-reader-workflow.cxx +++ b/Detectors/MUON/MID/Workflow/src/digits-reader-workflow.cxx @@ -66,7 +66,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) specs.emplace_back(o2::mid::getZeroSuppressionSpec(useMC, outDesc)); } - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(cfgc, specs); return specs; diff --git a/Detectors/MUON/Workflow/src/tracks-matcher-workflow.cxx b/Detectors/MUON/Workflow/src/tracks-matcher-workflow.cxx index 633934a3c5a9c..3e06a11609cab 100644 --- a/Detectors/MUON/Workflow/src/tracks-matcher-workflow.cxx +++ b/Detectors/MUON/Workflow/src/tracks-matcher-workflow.cxx @@ -80,7 +80,7 @@ WorkflowSpec defineDataProcessing(const ConfigContext& configcontext) specs.emplace_back(o2::muon::getTrackWriterSpec(useMC, "muon-track-writer", "muontracks.root")); } - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs); // write the configuration used for the workflow diff --git a/Detectors/PHOS/calib/src/PHOSBadMapCalibDevice.cxx b/Detectors/PHOS/calib/src/PHOSBadMapCalibDevice.cxx index ad729943bd44d..ecec817dd4fc7 100644 --- a/Detectors/PHOS/calib/src/PHOSBadMapCalibDevice.cxx +++ b/Detectors/PHOS/calib/src/PHOSBadMapCalibDevice.cxx @@ -57,8 +57,7 @@ void PHOSBadMapCalibDevice::init(o2::framework::InitContext& ic) void PHOSBadMapCalibDevice::run(o2::framework::ProcessingContext& ctx) { if (mRunStartTime == 0) { - const auto ref = ctx.inputs().getFirstValid(true); - mRunStartTime = DataRefUtils::getHeader(ref)->creation; // approximate time in ms + mRunStartTime = ctx.services().get().creation; mValidityTime = mRunStartTime + 31622400000; // one year validity range } diff --git a/Detectors/PHOS/calib/src/PHOSEnergyCalibDevice.cxx b/Detectors/PHOS/calib/src/PHOSEnergyCalibDevice.cxx index f629b5f736f6e..363eba4191a09 100644 --- a/Detectors/PHOS/calib/src/PHOSEnergyCalibDevice.cxx +++ b/Detectors/PHOS/calib/src/PHOSEnergyCalibDevice.cxx @@ -105,9 +105,9 @@ void PHOSEnergyCalibDevice::run(o2::framework::ProcessingContext& pc) LOG(debug) << "[PHOSEnergyCalibDevice - run] Received " << cluTR.size() << " TRs and " << clusters.size() << " clusters, running calibration"; if (mRunStartTime == 0) { - const auto ref = pc.inputs().getFirstValid(true); - mRunStartTime = DataRefUtils::getHeader(ref)->creation; // approximate time in ms - mRunNumber = DataRefUtils::getHeader(ref)->runNumber; + const auto& tinfo = pc.services().get(); + mRunStartTime = tinfo.creation; // approximate time in ms + mRunNumber = tinfo.runNumber; auto LHCPeriodStr = pc.services().get().device()->fConfig->GetProperty("LHCPeriod", ""); if (!(LHCPeriodStr.empty())) { diff --git a/Detectors/PHOS/calib/src/PHOSHGLGRatioCalibDevice.cxx b/Detectors/PHOS/calib/src/PHOSHGLGRatioCalibDevice.cxx index f314b01f6f121..2731974bccef4 100644 --- a/Detectors/PHOS/calib/src/PHOSHGLGRatioCalibDevice.cxx +++ b/Detectors/PHOS/calib/src/PHOSHGLGRatioCalibDevice.cxx @@ -46,8 +46,7 @@ void PHOSHGLGRatioCalibDevice::run(o2::framework::ProcessingContext& ctx) // scan Cells stream, collect HG/LG pairs if (mRunStartTime == 0) { - const auto ref = ctx.inputs().getFirstValid(true); - mRunStartTime = DataRefUtils::getHeader(ref)->creation; // approximate time in ms + mRunStartTime = ctx.services().get().creation; // approximate time in ms } if (mStatistics <= 0) { // skip the rest of the run diff --git a/Detectors/PHOS/calib/src/PHOSPedestalCalibDevice.cxx b/Detectors/PHOS/calib/src/PHOSPedestalCalibDevice.cxx index 3fe1f06157246..626f732b09b02 100644 --- a/Detectors/PHOS/calib/src/PHOSPedestalCalibDevice.cxx +++ b/Detectors/PHOS/calib/src/PHOSPedestalCalibDevice.cxx @@ -49,8 +49,7 @@ void PHOSPedestalCalibDevice::run(o2::framework::ProcessingContext& ctx) // scan Cells stream, collect mean and RMS then calculate average and post if (mRunStartTime == 0) { - const auto ref = ctx.inputs().getFirstValid(true); - mRunStartTime = DataRefUtils::getHeader(ref)->creation; // approximate time in ms + mRunStartTime = ctx.services().get().creation; // approximate time in ms } if (!mOldPed) { // Default map and calibration was not set, use CCDB LOG(info) << "Getting calib from CCDB"; diff --git a/Detectors/PHOS/calib/src/PHOSRunbyrunCalibDevice.cxx b/Detectors/PHOS/calib/src/PHOSRunbyrunCalibDevice.cxx index 1bda107bdbb12..9c024bb29dc5d 100644 --- a/Detectors/PHOS/calib/src/PHOSRunbyrunCalibDevice.cxx +++ b/Detectors/PHOS/calib/src/PHOSRunbyrunCalibDevice.cxx @@ -35,8 +35,7 @@ void PHOSRunbyrunCalibDevice::run(o2::framework::ProcessingContext& pc) { o2::base::GRPGeomHelper::instance().checkUpdates(pc); if (mRunStartTime == 0) { - const auto ref = pc.inputs().getFirstValid(true); - mRunStartTime = DataRefUtils::getHeader(ref)->creation; // approximate time in ms + mRunStartTime = pc.services().get().creation; // approximate time in ms } auto tfcounter = o2::header::get(pc.inputs().get("clusters").header)->tfCounter; auto clusters = pc.inputs().get>("clusters"); diff --git a/Detectors/PHOS/workflow/src/RawToCellConverterSpec.cxx b/Detectors/PHOS/workflow/src/RawToCellConverterSpec.cxx index 80ca7aa139d39..4c04a0602cef3 100644 --- a/Detectors/PHOS/workflow/src/RawToCellConverterSpec.cxx +++ b/Detectors/PHOS/workflow/src/RawToCellConverterSpec.cxx @@ -161,7 +161,7 @@ void RawToCellConverterSpec::run(framework::ProcessingContext& ctx) o2::InteractionRecord currentIR(triggerBC, triggerOrbit); // Correct for L0-LM trigger lattency - const auto tfOrbitFirst = o2::framework::DataRefUtils::getHeader(ctx.inputs().getFirstValid(true))->firstTForbit; + const auto tfOrbitFirst = ctx.services().get().firstTForbit; const auto& ctpOffsets = o2::ctp::TriggerOffsetsParam::Instance(); if (currentIR.differenceInBC({0, tfOrbitFirst}) >= ctpOffsets.LM_L0) { currentIR -= ctpOffsets.LM_L0; // guaranteed to stay in the TF containing the collision diff --git a/Detectors/PHOS/workflow/src/StandaloneAODProducerSpec.cxx b/Detectors/PHOS/workflow/src/StandaloneAODProducerSpec.cxx index 194be62803fa0..79aa0ecef8cc5 100644 --- a/Detectors/PHOS/workflow/src/StandaloneAODProducerSpec.cxx +++ b/Detectors/PHOS/workflow/src/StandaloneAODProducerSpec.cxx @@ -47,16 +47,15 @@ void StandaloneAODProducerSpec::run(ProcessingContext& pc) { // auto cput = mTimer.CpuTime(); // mTimer.Start(false); - - const auto* dh = o2::header::get(pc.inputs().getFirstValid(true).header); + const auto& tinfo = pc.services().get(); uint64_t tfNumber; if (mTFNumber == -1L) { // TODO has to be made globally unique (by using absolute time of TF). For now is unique within the run - tfNumber = uint64_t(dh->firstTForbit) + (uint64_t(dh->runNumber) << 32); // getTFNumber(mStartIR, runNumber); + tfNumber = uint64_t(tinfo.firstTForbit) + (uint64_t(tinfo.runNumber) << 32); // getTFNumber(mStartIR, runNumber); } else { tfNumber = mTFNumber; } - const int runNumber = (mRunNumber == -1) ? int(dh->runNumber) : mRunNumber; + const int runNumber = (mRunNumber == -1) ? int(tinfo.runNumber) : mRunNumber; auto cells = pc.inputs().get>("cells"); auto ctr = pc.inputs().get>("cellTriggerRecords"); diff --git a/Detectors/PHOS/workflow/src/phos-reco-workflow.cxx b/Detectors/PHOS/workflow/src/phos-reco-workflow.cxx index 384029a4b5e68..e9196b742bc5a 100644 --- a/Detectors/PHOS/workflow/src/phos-reco-workflow.cxx +++ b/Detectors/PHOS/workflow/src/phos-reco-workflow.cxx @@ -85,7 +85,7 @@ o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext co cfgc.options().get("fullclu-output"), cfgc.options().get("flpId"), cfgc.options().get("defbadmap")); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(cfgc, wf); return wf; diff --git a/Detectors/Raw/TFReaderDD/src/TFReaderSpec.cxx b/Detectors/Raw/TFReaderDD/src/TFReaderSpec.cxx index 2d13ae4a2dd39..05eac2b459feb 100644 --- a/Detectors/Raw/TFReaderDD/src/TFReaderSpec.cxx +++ b/Detectors/Raw/TFReaderDD/src/TFReaderSpec.cxx @@ -166,7 +166,7 @@ void TFReaderSpec::run(o2f::ProcessingContext& ctx) const auto* dataptr = (*msgMap.begin()->second.get())[0].GetData(); const auto* hd0 = o2h::get(dataptr); const auto* dph = o2h::get(dataptr); - timingInfo.firstTFOrbit = hd0->firstTForbit; + timingInfo.firstTForbit = hd0->firstTForbit; timingInfo.creation = dph->creation; timingInfo.tfCounter = hd0->tfCounter; timingInfo.runNumber = hd0->runNumber; diff --git a/Detectors/Raw/src/DistSTFSenderSpec.cxx b/Detectors/Raw/src/DistSTFSenderSpec.cxx index 483a34519c78f..38635a871a3b8 100644 --- a/Detectors/Raw/src/DistSTFSenderSpec.cxx +++ b/Detectors/Raw/src/DistSTFSenderSpec.cxx @@ -40,9 +40,8 @@ class DistSTFSender : public Task //___________________________________________________________ void DistSTFSender::run(ProcessingContext& pc) { - const auto* dh = DataRefUtils::getHeader(pc.inputs().getFirstValid(true)); - auto creationTime = DataRefUtils::getHeader(pc.inputs().getFirstValid(true))->creation; - STFHeader stfHeader{dh->tfCounter, dh->firstTForbit, dh->runNumber}; + const auto& tinfo = pc.services().get(); + STFHeader stfHeader{tinfo.tfCounter, tinfo.firstTForbit, tinfo.runNumber}; pc.outputs().snapshot(o2::framework::Output{gDataOriginFLP, gDataDescriptionDISTSTF, mSubSpec}, stfHeader); if (++mTFCount >= mMaxTF) { pc.services().get().endOfStream(); diff --git a/Detectors/Raw/src/RawFileReaderWorkflow.cxx b/Detectors/Raw/src/RawFileReaderWorkflow.cxx index ec2d419c88554..0eb4ade08662a 100644 --- a/Detectors/Raw/src/RawFileReaderWorkflow.cxx +++ b/Detectors/Raw/src/RawFileReaderWorkflow.cxx @@ -315,7 +315,7 @@ void RawReaderSpecs::run(o2f::ProcessingContext& ctx) } auto& timingInfo = ctx.services().get(); - timingInfo.firstTFOrbit = firstOrbit; + timingInfo.firstTForbit = firstOrbit; timingInfo.creation = creationTime; timingInfo.tfCounter = mTFCounter; timingInfo.runNumber = mRunNumber; diff --git a/Detectors/Raw/src/diststf-sender-workflow.cxx b/Detectors/Raw/src/diststf-sender-workflow.cxx index 02df4af7a28f4..af8b7a949feb4 100644 --- a/Detectors/Raw/src/diststf-sender-workflow.cxx +++ b/Detectors/Raw/src/diststf-sender-workflow.cxx @@ -46,7 +46,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext) int maxTF = configcontext.options().get("max-tf"); unsigned subSpec = static_cast(configcontext.options().get("dist-tf-subspec")); specs.push_back(o2::raw::getDistSTFSenderSpec(maxTF > 0 ? maxTF : 1, subSpec)); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs); return specs; } diff --git a/Detectors/TOF/calibration/testWorkflow/LHCClockCalibratorSpec.h b/Detectors/TOF/calibration/testWorkflow/LHCClockCalibratorSpec.h index 35edce18bd261..c5cd93aa88084 100644 --- a/Detectors/TOF/calibration/testWorkflow/LHCClockCalibratorSpec.h +++ b/Detectors/TOF/calibration/testWorkflow/LHCClockCalibratorSpec.h @@ -115,7 +115,7 @@ class LHCClockCalibDevice : public o2::framework::Task } if (mUseCCDB) { // setting the timestamp to get the LHCPhase correction; if we don't use CCDB, then it can stay to 0 as set when creating the calibTOFapi above - const auto tfOrbitFirst = DataRefUtils::getHeader(pc.inputs().getFirstValid(true))->firstTForbit; + const auto tfOrbitFirst = pc.services().get().firstTForbit; mcalibTOFapi->setTimeStamp(0.001 * (o2::base::GRPGeomHelper::instance().getOrbitResetTimeMS() + tfOrbitFirst * o2::constants::lhc::LHCOrbitMUS * 0.001)); // in seconds } diff --git a/Detectors/TOF/calibration/testWorkflow/TOFChannelCalibratorSpec.h b/Detectors/TOF/calibration/testWorkflow/TOFChannelCalibratorSpec.h index 2b2773f653df2..e5ace3072904f 100644 --- a/Detectors/TOF/calibration/testWorkflow/TOFChannelCalibratorSpec.h +++ b/Detectors/TOF/calibration/testWorkflow/TOFChannelCalibratorSpec.h @@ -161,7 +161,7 @@ class TOFChannelCalibDevice : public o2::framework::Task LOG(info) << "Processing TF " << tfcounter << " with " << data.size() << " tracks"; if (mUseCCDB) { // setting the timestamp to get the LHCPhase correction; if we don't use CCDB, then it can stay to 0 as set when creating the calibTOFapi above - const auto tfOrbitFirst = DataRefUtils::getHeader(pc.inputs().getFirstValid(true))->firstTForbit; + const auto tfOrbitFirst = pc.services().get().firstTForbit; mcalibTOFapi->setTimeStamp(0.001 * (o2::base::GRPGeomHelper::instance().getOrbitResetTimeMS() + tfOrbitFirst * o2::constants::lhc::LHCOrbitMUS * 0.001)); // in seconds } diff --git a/Detectors/TOF/calibration/testWorkflow/TOFDCSConfigProcessorSpec.h b/Detectors/TOF/calibration/testWorkflow/TOFDCSConfigProcessorSpec.h index 5d6efdf1ff8cd..7f95bb92b9bb3 100644 --- a/Detectors/TOF/calibration/testWorkflow/TOFDCSConfigProcessorSpec.h +++ b/Detectors/TOF/calibration/testWorkflow/TOFDCSConfigProcessorSpec.h @@ -54,7 +54,6 @@ class TOFDCSConfigProcessor : public o2::framework::Task LOG(info) << "got input file " << configFileName << " of size " << configBuff.size(); mTOFFEElightReader.loadFEElightConfig(configBuff); mTOFFEElightReader.parseFEElightConfig(mVerbose); - //auto tfcounter = o2::header::get(pc.inputs().getFirstValid(true).header)->startTime; sendOutput(pc.outputs(), configFileName); } diff --git a/Detectors/TOF/calibration/testWorkflow/TOFDCSDataProcessorSpec.h b/Detectors/TOF/calibration/testWorkflow/TOFDCSDataProcessorSpec.h index 69b05679ecb2a..9678473d5e1c2 100644 --- a/Detectors/TOF/calibration/testWorkflow/TOFDCSDataProcessorSpec.h +++ b/Detectors/TOF/calibration/testWorkflow/TOFDCSDataProcessorSpec.h @@ -114,7 +114,7 @@ class TOFDCSDataProcessor : public o2::framework::Task TStopwatch sw; auto timeNow = HighResClock::now(); - long dataTime = (long)(DataRefUtils::getHeader(pc.inputs().getFirstValid(true))->creation); + long dataTime = (long)(pc.services().get().creation); if (dataTime == 0xffffffffffffffff) { // it means it is not set dataTime = std::chrono::duration_cast(timeNow.time_since_epoch()).count(); // in ms } diff --git a/Detectors/TOF/workflow/src/CompressedDecodingTask.cxx b/Detectors/TOF/workflow/src/CompressedDecodingTask.cxx index 5e58956c0479e..1159f9084d615 100644 --- a/Detectors/TOF/workflow/src/CompressedDecodingTask.cxx +++ b/Detectors/TOF/workflow/src/CompressedDecodingTask.cxx @@ -135,8 +135,7 @@ void CompressedDecodingTask::run(ProcessingContext& pc) mCreationTime = std::chrono::high_resolution_clock::now().time_since_epoch().count() / 1000000; //RS set the 1st orbit of the TF from the O2 header, relying on rdhHandler is not good (in fact, the RDH might be eliminated in the derived data) - const auto* dh = DataRefUtils::getHeader(pc.inputs().getFirstValid(true)); - mInitOrbit = dh->firstTForbit; + mInitOrbit = pc.services().get().firstTForbit; if (!mConetMode) { mDecoder.setFirstIR({0, mInitOrbit}); } @@ -164,7 +163,7 @@ void CompressedDecodingTask::endOfStream(EndOfStreamContext& ec) void CompressedDecodingTask::decodeTF(ProcessingContext& pc) { auto& inputs = pc.inputs(); - + const auto& tinfo = pc.services().get(); // if we see requested data type input with 0xDEADBEEF subspec and 0 payload this means that the "delayed message" // mechanism created it in absence of real data from upstream. Processor should send empty output to not block the workflow { @@ -177,7 +176,7 @@ void CompressedDecodingTask::decodeTF(ProcessingContext& pc) auto maxWarn = o2::conf::VerbosityConfig::Instance().maxWarnDeadBeef; if (++contDeadBeef <= maxWarn) { LOGP(alarm, "Found input [{}/{}/{:#x}] TF#{} 1st_orbit:{} Payload {} : assuming no payload for all links in this TF{}", - dh->dataOrigin.str, dh->dataDescription.str, dh->subSpecification, dh->tfCounter, dh->firstTForbit, payloadSize, + dh->dataOrigin.str, dh->dataDescription.str, dh->subSpecification, tinfo.tfCounter, tinfo.firstTForbit, payloadSize, contDeadBeef == maxWarn ? fmt::format(". {} such inputs in row received, stopping reporting", contDeadBeef) : ""); } return; diff --git a/Detectors/TOF/workflow/src/EntropyDecoderSpec.cxx b/Detectors/TOF/workflow/src/EntropyDecoderSpec.cxx index 782e38fafada0..a028b10d542fe 100644 --- a/Detectors/TOF/workflow/src/EntropyDecoderSpec.cxx +++ b/Detectors/TOF/workflow/src/EntropyDecoderSpec.cxx @@ -73,7 +73,7 @@ void EntropyDecoderSpec::run(ProcessingContext& pc) mFiller.setReadoutWindowData(row, patterns); mFiller.fillDiagnosticFrequency(); auto diagnostic = mFiller.getDiagnosticFrequency(); - auto creationTime = DataRefUtils::getHeader(pc.inputs().getFirstValid(true))->creation; + auto creationTime = pc.services().get().creation; diagnostic.setTimeStamp(creationTime / 1000); pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "DIAFREQ", 0, Lifetime::Timeframe}, diagnostic); pc.outputs().snapshot({"ctfrep", 0}, iosize); diff --git a/Detectors/TOF/workflow/src/TOFClusterizerSpec.cxx b/Detectors/TOF/workflow/src/TOFClusterizerSpec.cxx index 18affb0d15f62..c9a45785b538b 100644 --- a/Detectors/TOF/workflow/src/TOFClusterizerSpec.cxx +++ b/Detectors/TOF/workflow/src/TOFClusterizerSpec.cxx @@ -110,10 +110,9 @@ class TOFDPLClustererTask auto row = pc.inputs().get>("readoutwin"); auto dia = pc.inputs().get("diafreq"); auto patterns = pc.inputs().get>("patterns"); - const auto* dh = DataRefUtils::getHeader(pc.inputs().getFirstValid(true)); updateTimeDependentParams(pc); - - mClusterer.setFirstOrbit(dh->firstTForbit); + const auto& tinfo = pc.services().get(); + mClusterer.setFirstOrbit(tinfo.firstTForbit); auto labelvector = std::make_shared>>(); if (mUseMC) { @@ -139,9 +138,7 @@ class TOFDPLClustererTask mCalibApi = new o2::tof::CalibTOFapi(long(0), lhcPhaseDummy, channelCalibDummy); } - const auto ref = pc.inputs().getFirstValid(true); - auto creationTime = DataRefUtils::getHeader(ref)->creation; - mCalibApi->setTimeStamp(creationTime / 1000); + mCalibApi->setTimeStamp(tinfo.creation / 1000); mClusterer.setCalibApi(mCalibApi); diff --git a/Detectors/TOF/workflowIO/src/CalibInfoReaderSpec.cxx b/Detectors/TOF/workflowIO/src/CalibInfoReaderSpec.cxx index a02c16ac696bd..371ac9f370264 100644 --- a/Detectors/TOF/workflowIO/src/CalibInfoReaderSpec.cxx +++ b/Detectors/TOF/workflowIO/src/CalibInfoReaderSpec.cxx @@ -58,7 +58,7 @@ void CalibInfoReader::run(ProcessingContext& pc) static uint64_t timestamp = 1; const auto& hbfu = o2::raw::HBFUtils::Instance(); auto& timingInfo = pc.services().get(); - timingInfo.firstTFOrbit = hbfu.orbitFirst; + timingInfo.firstTForbit = hbfu.orbitFirst; timingInfo.creation = timestamp; // set after reading tree timingInfo.tfCounter = tf; timingInfo.runNumber = hbfu.runNumber; diff --git a/Detectors/TPC/dcs/src/DCSSpec.cxx b/Detectors/TPC/dcs/src/DCSSpec.cxx index d753328b0b257..90cf9460caa3c 100644 --- a/Detectors/TPC/dcs/src/DCSSpec.cxx +++ b/Detectors/TPC/dcs/src/DCSSpec.cxx @@ -133,7 +133,7 @@ void DCSDevice::init(o2::framework::InitContext& ic) void DCSDevice::run(o2::framework::ProcessingContext& pc) { TStopwatch sw; - mLastCreationTime = DataRefUtils::getHeader(pc.inputs().getFirstValid(true))->creation; + mLastCreationTime = pc.services().get().creation; if (mUpdateIntervalStart == 0) { mUpdateIntervalStart = mLastCreationTime; } diff --git a/Detectors/TPC/workflow/include/TPCWorkflow/TPCFourierTransformEPNSpec.h b/Detectors/TPC/workflow/include/TPCWorkflow/TPCFourierTransformEPNSpec.h index ed3a4feff2dea..b0db8444738c1 100644 --- a/Detectors/TPC/workflow/include/TPCWorkflow/TPCFourierTransformEPNSpec.h +++ b/Detectors/TPC/workflow/include/TPCWorkflow/TPCFourierTransformEPNSpec.h @@ -85,7 +85,7 @@ class TPCFourierTransformEPNSpec : public o2::framework::Task if (mDebug) { LOGP(info, "dumping FT to file"); - mIDCFourierTransform.dumpToFile(fmt::format("FourierEPN_{:02}.root", o2::framework::DataRefUtils::getHeader(pc.inputs().getFirstValid(true))->tfCounter).data()); + mIDCFourierTransform.dumpToFile(fmt::format("FourierEPN_{:02}.root", pc.services().get().tfCounter).data()); } sendOutput(pc.outputs()); diff --git a/Detectors/TPC/workflow/src/ChunkedDigitPublisher.cxx b/Detectors/TPC/workflow/src/ChunkedDigitPublisher.cxx index 7c80c59a12bcf..cf11e3c7b39ce 100644 --- a/Detectors/TPC/workflow/src/ChunkedDigitPublisher.cxx +++ b/Detectors/TPC/workflow/src/ChunkedDigitPublisher.cxx @@ -294,7 +294,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext) std::iota(lanes.begin(), lanes.end(), 0); specs.emplace_back(o2::tpc::getSpec(lanes, tpcsectors, mctruth)); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs); return specs; } diff --git a/Detectors/TPC/workflow/src/FileWriterSpec.cxx b/Detectors/TPC/workflow/src/FileWriterSpec.cxx index 7f7223bdaa41c..7aac176eec21d 100644 --- a/Detectors/TPC/workflow/src/FileWriterSpec.cxx +++ b/Detectors/TPC/workflow/src/FileWriterSpec.cxx @@ -126,17 +126,16 @@ class FileWriterDevice : public Task } const std::string NAStr = "NA"; - - const auto dh = DataRefUtils::getHeader(pc.inputs().getFirstValid(true)); + const auto& tinfo = pc.services().get(); auto oldRun = mRun; auto oldTF = mPresentTF; mRun = processing_helpers::getRunNumber(pc); - mPresentTF = dh->tfCounter; - mFirstTForbit = dh->firstTForbit; + mPresentTF = tinfo.tfCounter; + mFirstTForbit = tinfo.firstTForbit; if (mWrite) { if (!mCollectedData.size() || mCollectedData.find(mPresentTF) == mCollectedData.end()) { - prepareTreeAndFile(dh); + prepareTreeAndFile(tinfo); } fillData(); @@ -206,12 +205,12 @@ class FileWriterDevice : public Task o2::framework::DataTakingContext mDataTakingContext{}; static constexpr std::string_view TMPFileEnding{".part"}; - void prepareTreeAndFile(const o2::header::DataHeader* dh); + void prepareTreeAndFile(const o2::framework::TimingInfo& tinfo); void closeTreeAndFile(); }; //___________________________________________________________________ template -void FileWriterDevice::prepareTreeAndFile(const o2::header::DataHeader* dh) +void FileWriterDevice::prepareTreeAndFile(const o2::framework::TimingInfo& tinfo) { if (!mWrite) { return; @@ -227,7 +226,7 @@ void FileWriterDevice::prepareTreeAndFile(const o2::header::DataHeader* dh) if (needToOpen) { LOGP(info, "opening new file"); closeTreeAndFile(); - // auto fname = o2::base::NameConf::getCTFFileName(mRun, dh->firstTForbit, dh->tfCounter, "tpc_krypton"); + // auto fname = o2::base::NameConf::getCTFFileName(mRun, tinfo.firstTForbit, tinfo.tfCounter, "tpc_krypton"); auto ctfDir = mOutDir.empty() ? o2::utils::Str::rectifyDirectory("./") : mOutDir; // if (mChkSize > 0 && (mDirFallBack != "/dev/null")) { // createLockFile(dh, 0); @@ -248,7 +247,7 @@ void FileWriterDevice::prepareTreeAndFile(const o2::header::DataHeader* dh) } } } - mCurrentFileName = o2::base::NameConf::getCTFFileName(mRun, dh->firstTForbit, dh->tfCounter, "tpc_krypton"); + mCurrentFileName = o2::base::NameConf::getCTFFileName(mRun, tinfo.firstTForbit, tinfo.tfCounter, "tpc_krypton"); mCurrentFileNameFull = fmt::format("{}{}", ctfDir, mCurrentFileName); mFileOut.reset(TFile::Open(fmt::format("{}{}", mCurrentFileNameFull, TMPFileEnding).c_str(), "recreate")); // to prevent premature external usage, use temporary name mTreeOut = std::make_unique(TreeName.at(mBranchType).data(), "O2 tree"); diff --git a/Detectors/TPC/workflow/src/MonitorWorkflowSpec.cxx b/Detectors/TPC/workflow/src/MonitorWorkflowSpec.cxx index 55faa8ae55c88..ed3aaa4caf6a4 100644 --- a/Detectors/TPC/workflow/src/MonitorWorkflowSpec.cxx +++ b/Detectors/TPC/workflow/src/MonitorWorkflowSpec.cxx @@ -113,7 +113,7 @@ class TPCMonitorDevice : public o2::framework::Task } mEventDisplayGUI.resetNextEventReqested(); - const auto tf = o2::framework::DataRefUtils::getHeader(pc.inputs().getFirstValid(true))->tfCounter; + const auto tf = pc.services().get().tfCounter; mEventDisplayGUI.getEventDisplay().setPresentEventNumber(size_t(tf)); LOGP(info, "processing tF {}", tf); diff --git a/Detectors/TPC/workflow/src/ProcessingHelpers.cxx b/Detectors/TPC/workflow/src/ProcessingHelpers.cxx index 1df72de788297..50f9743fa2c26 100644 --- a/Detectors/TPC/workflow/src/ProcessingHelpers.cxx +++ b/Detectors/TPC/workflow/src/ProcessingHelpers.cxx @@ -15,6 +15,7 @@ #include "Headers/DataHeader.h" #include "Framework/Logger.h" #include "Framework/ProcessingContext.h" +#include "Framework/TimingInfo.h" #include "Framework/RawDeviceService.h" #include "Framework/DataRefUtils.h" #include "Framework/InputRecord.h" @@ -32,9 +33,9 @@ uint64_t processing_helpers::getRunNumber(ProcessingContext& pc) const std::string NAStr = "NA"; uint64_t run = 0; - const auto dh = DataRefUtils::getHeader(pc.inputs().getFirstValid(true)); - if (dh->runNumber != 0) { - run = dh->runNumber; + const auto& tinfo = pc.services().get(); + if (tinfo.runNumber != 0) { + run = tinfo.runNumber; } // check runNumber with FMQ property, if set, override DH number { @@ -60,17 +61,17 @@ uint64_t processing_helpers::getRunNumber(ProcessingContext& pc) uint32_t processing_helpers::getCurrentTF(o2::framework::ProcessingContext& pc) { - return o2::framework::DataRefUtils::getHeader(pc.inputs().getFirstValid(true))->tfCounter; + return pc.services().get().tfCounter; } uint64_t processing_helpers::getCreationTime(o2::framework::ProcessingContext& pc) { - return DataRefUtils::getHeader(pc.inputs().getFirstValid(true))->creation; + return pc.services().get().creation; } uint64_t processing_helpers::getTimeStamp(o2::framework::ProcessingContext& pc) { - const auto tfOrbitFirst = DataRefUtils::getHeader(pc.inputs().getFirstValid(true))->firstTForbit; + const auto tfOrbitFirst = pc.services().get().firstTForbit; const long tPrec = getOrbitReset(pc) + tfOrbitFirst * o2::constants::lhc::LHCOrbitMUS; // microsecond-precise time stamp return tPrec; } diff --git a/Detectors/TPC/workflow/src/SACProcessorSpec.cxx b/Detectors/TPC/workflow/src/SACProcessorSpec.cxx index 16481ba122f08..76f82cb20179b 100644 --- a/Detectors/TPC/workflow/src/SACProcessorSpec.cxx +++ b/Detectors/TPC/workflow/src/SACProcessorSpec.cxx @@ -58,10 +58,8 @@ class SACProcessorDevice : public Task void run(ProcessingContext& pc) final { o2::base::GRPGeomHelper::instance().checkUpdates(pc); + const auto& tinfo = pc.services().get(); const auto startTime = HighResClock::now(); - const auto firstTForbit = DataRefUtils::getHeader(pc.inputs().getFirstValid(true))->firstTForbit; - const auto tfCounter = DataRefUtils::getHeader(pc.inputs().getFirstValid(true))->tfCounter; - const auto runNumber = DataRefUtils::getHeader(pc.inputs().getFirstValid(true))->runNumber; std::vector filter = {{"check", ConcreteDataTypeMatcher{o2::header::gDataOriginTPC, "RAWDATA"}, Lifetime::Timeframe}}; // TODO: Change to SAC when changed in DD for (auto const& ref : InputRecordWalker(pc.inputs(), filter)) { @@ -78,7 +76,7 @@ class SACProcessorDevice : public Task continue; } if (mDebugLevel & (uint32_t)DebugFlags::HBFInfo) { - LOGP(info, "SAC Processing firstTForbit {:9}, tfCounter {:5}, run {:6}, feeId {:6} ({:3}/{}/{:2})", firstTForbit, tfCounter, runNumber, feeId, cruID, endPoint, link); + LOGP(info, "SAC Processing firstTForbit {:9}, tfCounter {:5}, run {:6}, feeId {:6} ({:3}/{}/{:2})", tinfo.firstTForbit, tinfo.tfCounter, tinfo.runNumber, feeId, cruID, endPoint, link); } // ---| data loop |--- @@ -93,8 +91,8 @@ class SACProcessorDevice : public Task } // TODO: should only be done once for the first packet if ((mDecoder.getReferenceTime() < 0) && (rdhPtr->packetCounter == 0)) { - const double referenceTime = o2::base::GRPGeomHelper::instance().getOrbitResetTimeMS() + firstTForbit * o2::constants::lhc::LHCOrbitMUS * 0.001; - LOGP(info, "setting time stamp reset reference to: {}, at tfCounter: {}, firstTForbit: {}", referenceTime, tfCounter, firstTForbit); + const double referenceTime = o2::base::GRPGeomHelper::instance().getOrbitResetTimeMS() + tinfo.firstTForbit * o2::constants::lhc::LHCOrbitMUS * 0.001; + LOGP(info, "setting time stamp reset reference to: {}, at tfCounter: {}, firstTForbit: {}", referenceTime, tinfo.tfCounter, tinfo.firstTForbit); mDecoder.setReferenceTime(referenceTime); // TODO set proper time } continue; @@ -110,7 +108,7 @@ class SACProcessorDevice : public Task if (mDebugLevel & (uint32_t)sac::Decoder::DebugFlags::TimingInfo) { auto endTime = HighResClock::now(); auto elapsed_seconds = std::chrono::duration_cast>(endTime - startTime); - LOGP(info, "Time spent for TF {}, firstTForbit {}: {} s", tfCounter, firstTForbit, elapsed_seconds.count()); + LOGP(info, "Time spent for TF {}, firstTForbit {}: {} s", tinfo.tfCounter, tinfo.firstTForbit, elapsed_seconds.count()); } } diff --git a/Detectors/TPC/workflow/src/ZSSpec.cxx b/Detectors/TPC/workflow/src/ZSSpec.cxx index e00f03f82675b..bbc621e29b666 100644 --- a/Detectors/TPC/workflow/src/ZSSpec.cxx +++ b/Detectors/TPC/workflow/src/ZSSpec.cxx @@ -100,8 +100,7 @@ DataProcessorSpec getZSEncoderSpec(std::vector const& tpcSectors, bool outR const auto& inputs = getWorkflowTPCInput(pc, 0, false, false, tpcSectorMask, true); sizes.resize(NSectors * NEndpoints); - const auto* dh = DataRefUtils::getHeader(pc.inputs().getFirstValid(true)); - o2::InteractionRecord ir{0, dh->firstTForbit}; + o2::InteractionRecord ir{0, pc.services().get().firstTForbit}; o2::gpu::GPUReconstructionConvert::RunZSEncoder(inputs->inputDigits, &zsoutput, sizes.data(), nullptr, &ir, _GPUParam, 2, verify, config.configReconstruction.tpc.zsThreshold); ZeroSuppressedContainer8kb* page = reinterpret_cast(zsoutput.get()); unsigned int offset = 0; diff --git a/Detectors/TPC/workflow/src/tpc-reco-workflow.cxx b/Detectors/TPC/workflow/src/tpc-reco-workflow.cxx index 1f5aa4439d920..72d3f2e7e7e9d 100644 --- a/Detectors/TPC/workflow/src/tpc-reco-workflow.cxx +++ b/Detectors/TPC/workflow/src/tpc-reco-workflow.cxx @@ -169,7 +169,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) !cfgc.options().get("ignore-dist-stf") // ); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(cfgc, wf); return std::move(wf); diff --git a/Detectors/TPC/workflow/test/test_ft_EPN_Aggregator.cxx b/Detectors/TPC/workflow/test/test_ft_EPN_Aggregator.cxx index c0a41d3c80eeb..0bf7b9da64e6b 100644 --- a/Detectors/TPC/workflow/test/test_ft_EPN_Aggregator.cxx +++ b/Detectors/TPC/workflow/test/test_ft_EPN_Aggregator.cxx @@ -137,7 +137,7 @@ DataProcessorSpec generateIDCsCRU(int lane, const unsigned int maxTFs, const std outputSpecs, AlgorithmSpec{ [maxTFs, fastgen, nIDCs, cruStart = crus.front(), cruEnde = crus.back()](ProcessingContext& ctx) { - const auto tf = o2::framework::DataRefUtils::getHeader(ctx.inputs().getFirstValid(true))->tfCounter; + const auto tf = ctx.services().get().tfCounter; for (uint32_t icru = cruStart; icru <= cruEnde; ++icru) { const o2::tpc::CRU cruTmp(icru); @@ -185,15 +185,16 @@ class TPCReceiveEPNSpec : public o2::framework::Task void run(o2::framework::ProcessingContext& ctx) final { + const auto& tinfo = ctx.services().get(); for (int i = 0; i < o2::tpc::SIDES; ++i) { const DataRef ref = ctx.inputs().getByPos(i); auto const* tpcFourierCoeffHeader = o2::framework::DataRefUtils::getHeader(ref); const int side = tpcFourierCoeffHeader->subSpecification; - const auto tf = o2::framework::DataRefUtils::getHeader(ref)->tfCounter; + const auto tf = tinfo.tfCounter; mFourierCoeffEPN[tf].mFourierCoefficients[side] = ctx.inputs().get>(ref); } - const auto tf = o2::framework::DataRefUtils::getHeader(ctx.inputs().getFirstValid(true))->tfCounter; + const auto tf = tinfo.tfCounter; if (tf == mMaxTF) { ctx.outputs().snapshot(Output{gDataOriginTPC, getDataDescriptionCoeffEPN()}, mFourierCoeffEPN); } diff --git a/Detectors/TRD/calibration/workflow/TRDDCSDataProcessorSpec.h b/Detectors/TRD/calibration/workflow/TRDDCSDataProcessorSpec.h index 08d100a5904ec..456d1af4328e2 100644 --- a/Detectors/TRD/calibration/workflow/TRDDCSDataProcessorSpec.h +++ b/Detectors/TRD/calibration/workflow/TRDDCSDataProcessorSpec.h @@ -133,7 +133,7 @@ class TRDDCSDataProcessor : public o2::framework::Task void run(o2::framework::ProcessingContext& pc) final { TStopwatch sw; - auto currentTimeStamp = DataRefUtils::getHeader(pc.inputs().getFirstValid(true))->creation; + auto currentTimeStamp = pc.services().get().creation; auto dps = pc.inputs().get>("input"); auto timeNow = std::chrono::high_resolution_clock::now(); if (currentTimeStamp < 1577833200000UL || currentTimeStamp > 2208985200000UL) { diff --git a/Detectors/TRD/workflow/src/EntropyDecoderSpec.cxx b/Detectors/TRD/workflow/src/EntropyDecoderSpec.cxx index 2e72eaeb07cd2..9dc659a47a9e4 100644 --- a/Detectors/TRD/workflow/src/EntropyDecoderSpec.cxx +++ b/Detectors/TRD/workflow/src/EntropyDecoderSpec.cxx @@ -83,7 +83,7 @@ void EntropyDecoderSpec::run(ProcessingContext& pc) // since the buff is const, we cannot use EncodedBlocks::relocate directly, instead we wrap its data to another flat object if (buff.size()) { const auto ctfImage = o2::trd::CTF::getImage(buff.data()); - mCTFCoder.setFirstTFOrbit(pc.services().get().firstTFOrbit); + mCTFCoder.setFirstTFOrbit(pc.services().get().firstTForbit); iosize = mCTFCoder.decode(ctfImage, triggers, tracklets, digits); } pc.outputs().snapshot({"ctfrep", 0}, iosize); diff --git a/Detectors/TRD/workflow/src/TRDDigitizerSpec.cxx b/Detectors/TRD/workflow/src/TRDDigitizerSpec.cxx index e4af5998435c8..5a415834d3cb1 100644 --- a/Detectors/TRD/workflow/src/TRDDigitizerSpec.cxx +++ b/Detectors/TRD/workflow/src/TRDDigitizerSpec.cxx @@ -64,8 +64,7 @@ class TRDDPLDigitizerTask : public o2::base::BaseDPLDigitizer Calibrations simcal; // the timestamp can be extracted from the DPL header (it is set in SimReader) - const auto ref = pc.inputs().getFirstValid(true); - auto creationTime = DataRefUtils::getHeader(ref)->creation; + auto creationTime = pc.services().get().creation; simcal.getCCDBObjects(creationTime); mDigitizer.setCalibrations(&simcal); diff --git a/Detectors/TRD/workflow/src/TRDTrackletTransformerWorkflow.cxx b/Detectors/TRD/workflow/src/TRDTrackletTransformerWorkflow.cxx index caf0194705605..373cc3b4de12a 100644 --- a/Detectors/TRD/workflow/src/TRDTrackletTransformerWorkflow.cxx +++ b/Detectors/TRD/workflow/src/TRDTrackletTransformerWorkflow.cxx @@ -73,7 +73,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext) if (!configcontext.options().get("disable-root-output")) { spec.emplace_back(o2::trd::getTRDCalibratedTrackletWriterSpec(useMC)); } - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, spec); return spec; diff --git a/Detectors/TRD/workflow/src/TRDTrapSimulatorSpec.cxx b/Detectors/TRD/workflow/src/TRDTrapSimulatorSpec.cxx index 206148b1596f6..7c809b9d5a228 100644 --- a/Detectors/TRD/workflow/src/TRDTrapSimulatorSpec.cxx +++ b/Detectors/TRD/workflow/src/TRDTrapSimulatorSpec.cxx @@ -162,8 +162,7 @@ void TRDDPLTrapSimulatorTask::run(o2::framework::ProcessingContext& pc) LOG(info) << "TRD Trap Simulator Device running over incoming message"; if (!mInitCcdbObjectsDone) { - const auto ref = pc.inputs().getFirstValid(true); - auto creationTime = DataRefUtils::getHeader(ref)->creation; + auto creationTime = pc.services().get().creation; auto timeStamp = (mRunNumber < 0) ? creationTime : mRunNumber; mCalib = std::make_unique(); mCalib->getCCDBObjects(timeStamp); diff --git a/Detectors/TRD/workflow/src/trd-tracking-workflow.cxx b/Detectors/TRD/workflow/src/trd-tracking-workflow.cxx index 2a9ac5af138a6..f84c1d3cdd8da 100644 --- a/Detectors/TRD/workflow/src/trd-tracking-workflow.cxx +++ b/Detectors/TRD/workflow/src/trd-tracking-workflow.cxx @@ -108,7 +108,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext) auto maskMatches = GTrackID::getSourcesMask(GTrackID::NONE); o2::globaltracking::InputHelper::addInputSpecs(configcontext, specs, maskClusters, maskMatches, maskTracks, useMC); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs); return specs; diff --git a/Detectors/Upgrades/IT3/workflow/src/its3-reco-workflow.cxx b/Detectors/Upgrades/IT3/workflow/src/its3-reco-workflow.cxx index 1001a889506ff..b202cf67b81f1 100644 --- a/Detectors/Upgrades/IT3/workflow/src/its3-reco-workflow.cxx +++ b/Detectors/Upgrades/IT3/workflow/src/its3-reco-workflow.cxx @@ -72,7 +72,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext) auto wf = o2::its3::reco_workflow::getWorkflow(useMC, trmode, gpuDevice, extDigits, extClusters, disableRootOutput, eencode); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, wf); // write the configuration used for the reco workflow diff --git a/Detectors/ZDC/calib/src/BaselineCalibEPNSpec.cxx b/Detectors/ZDC/calib/src/BaselineCalibEPNSpec.cxx index c36f71258c638..74b1b102e732b 100644 --- a/Detectors/ZDC/calib/src/BaselineCalibEPNSpec.cxx +++ b/Detectors/ZDC/calib/src/BaselineCalibEPNSpec.cxx @@ -89,8 +89,7 @@ void BaselineCalibEPNSpec::run(ProcessingContext& pc) mTimer.Start(false); } - const auto ref = pc.inputs().getFirstValid(true); - auto creationTime = DataRefUtils::getHeader(ref)->creation; // approximate time in ms + auto creationTime = pc.services().get().creation; // approximate time in ms BaselineCalibData& data = mWorker.getData(); data.setCreationTime(creationTime); diff --git a/Detectors/ZDC/calib/src/InterCalibEPNSpec.cxx b/Detectors/ZDC/calib/src/InterCalibEPNSpec.cxx index a3eb5722813cf..7cc34dc1931a4 100644 --- a/Detectors/ZDC/calib/src/InterCalibEPNSpec.cxx +++ b/Detectors/ZDC/calib/src/InterCalibEPNSpec.cxx @@ -90,8 +90,7 @@ void InterCalibEPNSpec::run(ProcessingContext& pc) mTimer.Start(false); } - const auto ref = pc.inputs().getFirstValid(true); - auto creationTime = DataRefUtils::getHeader(ref)->creation; // approximate time in ms + auto creationTime = pc.services().get().creation; // approximate time in ms mWorker.getData().setCreationTime(creationTime); auto bcrec = pc.inputs().get>("bcrec"); diff --git a/Detectors/ZDC/calib/src/WaveformCalibEPNSpec.cxx b/Detectors/ZDC/calib/src/WaveformCalibEPNSpec.cxx index 8b8187a2f22c5..d90f26d341515 100644 --- a/Detectors/ZDC/calib/src/WaveformCalibEPNSpec.cxx +++ b/Detectors/ZDC/calib/src/WaveformCalibEPNSpec.cxx @@ -90,8 +90,7 @@ void WaveformCalibEPNSpec::run(ProcessingContext& pc) mTimer.Start(false); } - const auto ref = pc.inputs().getFirstValid(true); - auto creationTime = DataRefUtils::getHeader(ref)->creation; // approximate time in ms + auto creationTime = pc.services().get().creation; // approximate time in ms WaveformCalibData& data = mWorker.getData(); data.setCreationTime(creationTime); diff --git a/Detectors/ZDC/calib/src/zdc-intercalib-epn-workflow.cxx b/Detectors/ZDC/calib/src/zdc-intercalib-epn-workflow.cxx index 9fab9a7b0ca18..d200e7db4938f 100644 --- a/Detectors/ZDC/calib/src/zdc-intercalib-epn-workflow.cxx +++ b/Detectors/ZDC/calib/src/zdc-intercalib-epn-workflow.cxx @@ -41,7 +41,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext) o2::conf::ConfigurableParam::updateFromString(configcontext.options().get("configKeyValues")); WorkflowSpec specs; specs.emplace_back(o2::zdc::getInterCalibEPNSpec()); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs); return specs; } diff --git a/Detectors/ZDC/calib/src/zdc-waveformcalib-epn-workflow.cxx b/Detectors/ZDC/calib/src/zdc-waveformcalib-epn-workflow.cxx index 1811d0fb9b36c..93f1f17ed5856 100644 --- a/Detectors/ZDC/calib/src/zdc-waveformcalib-epn-workflow.cxx +++ b/Detectors/ZDC/calib/src/zdc-waveformcalib-epn-workflow.cxx @@ -41,7 +41,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext) o2::conf::ConfigurableParam::updateFromString(configcontext.options().get("configKeyValues")); WorkflowSpec specs; specs.emplace_back(o2::zdc::getWaveformCalibEPNSpec()); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs); // Needed only if you read from root files return specs; } diff --git a/Detectors/ZDC/workflow/src/reco-reader-workflow.cxx b/Detectors/ZDC/workflow/src/reco-reader-workflow.cxx index 94ee7f0e8df87..ccd83f6b8486e 100644 --- a/Detectors/ZDC/workflow/src/reco-reader-workflow.cxx +++ b/Detectors/ZDC/workflow/src/reco-reader-workflow.cxx @@ -48,7 +48,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext) DataProcessorSpec producer = o2::zdc::getRecoReaderSpec(); specs.push_back(producer); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs); return specs; diff --git a/Detectors/ZDC/workflow/src/zdc-reco-workflow.cxx b/Detectors/ZDC/workflow/src/zdc-reco-workflow.cxx index 02e9cff3c549f..ed0ee3b9495a3 100644 --- a/Detectors/ZDC/workflow/src/zdc-reco-workflow.cxx +++ b/Detectors/ZDC/workflow/src/zdc-reco-workflow.cxx @@ -72,7 +72,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext) LOG(info) << "WorkflowSpec getRecoWorkflow useMC " << useMC; auto wf = o2::zdc::getRecoWorkflow(useMC, disableRootInp, disableRootOut, verbosity, enableDebugOut, enableZDCTDCCorr, enableZDCEnergyParam, enableZDCTowerParam, enableBaselineParam); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(configcontext, wf); return std::move(wf); diff --git a/EventVisualisation/View/include/EventVisualisationView/Screenshot.h b/EventVisualisation/View/include/EventVisualisationView/Screenshot.h index 2f9ccae70bae8..8d0650b3dbbd5 100644 --- a/EventVisualisation/View/include/EventVisualisationView/Screenshot.h +++ b/EventVisualisation/View/include/EventVisualisationView/Screenshot.h @@ -33,7 +33,7 @@ class Screenshot static TASImage* ScaleImage(TASImage* image, UInt_t desiredWidth, UInt_t desiredHeight, const std::string& backgroundColor); public: - static void perform(o2::detectors::DetID::mask_t detectorsMask, int runNumber, int firstTFOrbit, std::string collisionTime); + static void perform(o2::detectors::DetID::mask_t detectorsMask, int runNumber, int firstTForbit, std::string collisionTime); }; } // namespace event_visualisation diff --git a/EventVisualisation/View/src/Screenshot.cxx b/EventVisualisation/View/src/Screenshot.cxx index b20dd4b0c3936..62a84437aaeea 100644 --- a/EventVisualisation/View/src/Screenshot.cxx +++ b/EventVisualisation/View/src/Screenshot.cxx @@ -117,7 +117,7 @@ TASImage* Screenshot::ScaleImage(TASImage* image, UInt_t desiredWidth, UInt_t de return scaledImage; } -void Screenshot::perform(o2::detectors::DetID::mask_t detectorsMask, int runNumber, int firstTFOrbit, std::string collisionTime) +void Screenshot::perform(o2::detectors::DetID::mask_t detectorsMask, int runNumber, int firstTForbit, std::string collisionTime) { TEnv settings; ConfigurationManager::getInstance().getConfig(settings); @@ -214,7 +214,7 @@ void Screenshot::perform(o2::detectors::DetID::mask_t detectorsMask, int runNumb std::vector lines; if (!collisionTime.empty()) { lines.push_back((std::string)settings.GetValue("screenshot.message.line.0", TString::Format("Run number: %d", runNumber))); - lines.push_back((std::string)settings.GetValue("screenshot.message.line.1", TString::Format("First TF orbit: %d", firstTFOrbit))); + lines.push_back((std::string)settings.GetValue("screenshot.message.line.1", TString::Format("First TF orbit: %d", firstTForbit))); lines.push_back((std::string)settings.GetValue("screenshot.message.line.2", TString::Format("Date: %s", collisionTime.c_str()))); lines.push_back((std::string)settings.GetValue("screenshot.message.line.3", TString::Format("Detectors: %s", detectorsString.c_str()))); } diff --git a/EventVisualisation/Workflow/src/O2DPLDisplay.cxx b/EventVisualisation/Workflow/src/O2DPLDisplay.cxx index e765cb0803f4a..0d3edcb215286 100644 --- a/EventVisualisation/Workflow/src/O2DPLDisplay.cxx +++ b/EventVisualisation/Workflow/src/O2DPLDisplay.cxx @@ -118,9 +118,7 @@ void O2DPLDisplaySpec::run(ProcessingContext& pc) helper.prepareITSClusters(mData.mITSDict); helper.prepareMFTClusters(mData.mMFTDict); - const auto& ref = pc.inputs().getFirstValid(true); - const auto* dh = DataRefUtils::getHeader(ref); - const auto* dph = DataRefUtils::getHeader(ref); + const auto& tinfo = pc.services().get(); std::unordered_map savedTracks; @@ -146,10 +144,10 @@ void O2DPLDisplaySpec::run(ProcessingContext& pc) if (save) { helper.mEvent.setClMask(this->mClMask.to_ulong()); helper.mEvent.setTrkMask(this->mTrkMask.to_ulong()); - helper.mEvent.setRunNumber(dh->runNumber); - helper.mEvent.setTfCounter(dh->tfCounter); - helper.mEvent.setFirstTForbit(dh->firstTForbit); - helper.save(this->mJsonPath, this->mNumberOfFiles, this->mTrkMask, this->mClMask, dh->runNumber, dph->creation); + helper.mEvent.setRunNumber(tinfo.runNumber); + helper.mEvent.setTfCounter(tinfo.tfCounter); + helper.mEvent.setFirstTForbit(tinfo.firstTForbit); + helper.save(this->mJsonPath, this->mNumberOfFiles, this->mTrkMask, this->mClMask, tinfo.runNumber, tinfo.creation); anythingSaved = true; } @@ -161,7 +159,7 @@ void O2DPLDisplaySpec::run(ProcessingContext& pc) } auto endTime = std::chrono::high_resolution_clock::now(); - LOGP(info, "Visualization of TF:{} at orbit {} took {} s.", dh->tfCounter, dh->firstTForbit, std::chrono::duration_cast(endTime - currentTime).count() * 1e-6); + LOGP(info, "Visualization of TF:{} at orbit {} took {} s.", tinfo.tfCounter, tinfo.firstTForbit, std::chrono::duration_cast(endTime - currentTime).count() * 1e-6); if (mPrimaryVertexMode) { LOGP(info, "Primary vertices: {}", helper.mTotalPrimaryVertices); @@ -310,7 +308,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) {}, AlgorithmSpec{adaptFromTask(useMC, srcTrk, srcCl, dataRequest, jsonFolder, timeInterval, numberOfFiles, numberOfTracks, eveHostNameMatch, minITSTracks, minTracks, filterITSROF, filterTime, timeBracket, removeTPCEta, etaBracket, tracksSorting, onlyNthEvent, primaryVertexMode)}}); - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(cfgc, specs); return std::move(specs); diff --git a/Framework/Core/include/Framework/DataDescriptorMatcher.h b/Framework/Core/include/Framework/DataDescriptorMatcher.h index c5478915b4fee..d5932b91bc1ed 100644 --- a/Framework/Core/include/Framework/DataDescriptorMatcher.h +++ b/Framework/Core/include/Framework/DataDescriptorMatcher.h @@ -51,7 +51,7 @@ struct ContextRef { enum ContextPos { STARTTIME_POS = 0, /// The DataProcessingHeader::startTime associated to the timeslice TFCOUNTER_POS = 14, /// The DataHeader::tfCounter associated to the timeslice - FIRSTTFORBIT_POS = 15, /// The DataHeader::firstTFOrbit associated to the timeslice + FIRSTTFORBIT_POS = 15, /// The DataHeader::firstTForbit associated to the timeslice RUNNUMBER_POS = 13, /// The DataHeader::runNumber associated to the timeslice CREATIONTIME_POS = 12 /// The DataProcessingHeader::creation associated to the timeslice }; diff --git a/Framework/Core/include/Framework/DataRelayer.h b/Framework/Core/include/Framework/DataRelayer.h index 961ddd124c599..add1eeb777116 100644 --- a/Framework/Core/include/Framework/DataRelayer.h +++ b/Framework/Core/include/Framework/DataRelayer.h @@ -140,7 +140,7 @@ class DataRelayer /// Mark a given slot as done so that the GUI /// can reflect that. void updateCacheStatus(TimesliceSlot slot, CacheEntryStatus oldStatus, CacheEntryStatus newStatus); - /// Get the firstTFOrbit associate to a given slot. + /// Get the firstTForbit associate to a given slot. uint32_t getFirstTFOrbitForSlot(TimesliceSlot slot); /// Get the firstTFCounter associate to a given slot. uint32_t getFirstTFCounterForSlot(TimesliceSlot slot); diff --git a/Framework/Core/include/Framework/TimingInfo.h b/Framework/Core/include/Framework/TimingInfo.h index 6726de15e86b6..32dd347162023 100644 --- a/Framework/Core/include/Framework/TimingInfo.h +++ b/Framework/Core/include/Framework/TimingInfo.h @@ -22,7 +22,7 @@ namespace o2::framework struct TimingInfo { size_t timeslice; /// the timeslice associated to current processing - uint32_t firstTFOrbit = -1; /// the orbit the TF begins + uint32_t firstTForbit = -1; /// the orbit the TF begins uint32_t tfCounter = -1; // the counter associated to a TF uint32_t runNumber = -1; uint64_t creation = -1UL; diff --git a/Framework/Core/src/CCDBHelpers.cxx b/Framework/Core/src/CCDBHelpers.cxx index acdbeda451772..0343905631d86 100644 --- a/Framework/Core/src/CCDBHelpers.cxx +++ b/Framework/Core/src/CCDBHelpers.cxx @@ -304,7 +304,7 @@ AlgorithmSpec CCDBHelpers::fetchFromCCDB() LOGP(info, " {}: {}/{} ({}-{} bytes)", entry.first, entry.second.cacheMiss, entry.second.cacheHit, entry.second.minSize, entry.second.maxSize); } }); - + return adaptStateless([helper](DataTakingContext& dtc, DataAllocator& allocator, TimingInfo& timingInfo) { static Long64_t orbitResetTime = -1; static size_t lastTimeUsed = -1; @@ -380,18 +380,18 @@ AlgorithmSpec CCDBHelpers::fetchFromCCDB() } } - int64_t timestamp = ceil((timingInfo.firstTFOrbit * o2::constants::lhc::LHCOrbitNS / 1000 + orbitResetTime) / 1000); // RS ceilf precision is not enough + int64_t timestamp = ceil((timingInfo.firstTForbit * o2::constants::lhc::LHCOrbitNS / 1000 + orbitResetTime) / 1000); // RS ceilf precision is not enough if (timestamp + 5000 < timingInfo.creation) { // 5 sec. tolerance static bool notWarnedYet = true; if (notWarnedYet) { - LOGP(warn, "timestamp {} for orbit {} and orbit reset time {} is well behind TF creation time {}, use the latter", timestamp, timingInfo.firstTFOrbit, orbitResetTime / 1000, timingInfo.creation); + LOGP(warn, "timestamp {} for orbit {} and orbit reset time {} is well behind TF creation time {}, use the latter", timestamp, timingInfo.firstTForbit, orbitResetTime / 1000, timingInfo.creation); notWarnedYet = false; } timestamp = timingInfo.creation; } // Fetch the rest of the objects. - LOGP(debug, "Fetching objects. Run: {}. OrbitResetTime: {}, Creation: {}, Timestamp: {}, firstTFOrbit: {}", - dtc.runNumber, orbitResetTime, timingInfo.creation, timestamp, timingInfo.firstTFOrbit); + LOGP(debug, "Fetching objects. Run: {}. OrbitResetTime: {}, Creation: {}, Timestamp: {}, firstTForbit: {}", + dtc.runNumber, orbitResetTime, timingInfo.creation, timestamp, timingInfo.firstTForbit); populateCacheWith(helper, timestamp, timingInfo, dtc, allocator); }); }); diff --git a/Framework/Core/src/CallbacksPolicy.cxx b/Framework/Core/src/CallbacksPolicy.cxx index cdfea4de93db3..7db7ae3907e0f 100644 --- a/Framework/Core/src/CallbacksPolicy.cxx +++ b/Framework/Core/src/CallbacksPolicy.cxx @@ -33,18 +33,18 @@ CallbacksPolicy epnProcessReporting() .policy = [](CallbackService& callbacks, InitContext& context) -> void { callbacks.set(CallbackService::Id::PreProcessing, [](ServiceRegistry& registry, int op) { auto& info = registry.get(); - if ((int)info.firstTFOrbit != -1) { + if ((int)info.firstTForbit != -1) { char const* what = (info.timeslice > 1652945069870351) ? "timer" : "timeslice"; - LOGP(info, "Processing {}:{}, tfCounter:{}, firstTFOrbit:{}, runNumber:{}, creation:{}, action:{}", - what, info.timeslice, info.tfCounter, info.firstTFOrbit, info.runNumber, info.creation, op); + LOGP(info, "Processing {}:{}, tfCounter:{}, firstTForbit:{}, runNumber:{}, creation:{}, action:{}", + what, info.timeslice, info.tfCounter, info.firstTForbit, info.runNumber, info.creation, op); } }); callbacks.set(CallbackService::Id::PostProcessing, [](ServiceRegistry& registry, int op) { auto& info = registry.get(); - if ((int)info.firstTFOrbit != -1) { + if ((int)info.firstTForbit != -1) { char const* what = (info.timeslice > 1652945069870351) ? "timer" : "timeslice"; - LOGP(info, "Done processing {}:{}, tfCounter:{}, firstTFOrbit:{}, runNumber:{}, creation:{}, action:{}", - what, info.timeslice, info.tfCounter, info.firstTFOrbit, info.runNumber, info.creation, op); + LOGP(info, "Done processing {}:{}, tfCounter:{}, firstTForbit:{}, runNumber:{}, creation:{}, action:{}", + what, info.timeslice, info.tfCounter, info.firstTForbit, info.runNumber, info.creation, op); } }); }}; diff --git a/Framework/Core/src/DataAllocator.cxx b/Framework/Core/src/DataAllocator.cxx index ea4bf550e0871..5b3f88372b059 100644 --- a/Framework/Core/src/DataAllocator.cxx +++ b/Framework/Core/src/DataAllocator.cxx @@ -102,7 +102,7 @@ fair::mq::MessagePtr DataAllocator::headerMessageFromOutput(Output const& spec, dh.payloadSize = payloadSize; dh.payloadSerializationMethod = method; dh.tfCounter = timingInfo.tfCounter; - dh.firstTForbit = timingInfo.firstTFOrbit; + dh.firstTForbit = timingInfo.firstTForbit; dh.runNumber = timingInfo.runNumber; DataProcessingHeader dph{timingInfo.timeslice, 1, timingInfo.creation}; diff --git a/Framework/Core/src/DataProcessingDevice.cxx b/Framework/Core/src/DataProcessingDevice.cxx index 295cdf5f6de7f..b441a6763a1fd 100644 --- a/Framework/Core/src/DataProcessingDevice.cxx +++ b/Framework/Core/src/DataProcessingDevice.cxx @@ -1579,7 +1579,7 @@ bool DataProcessingDevice::tryDispatchComputation(DataProcessorContext& context, auto timeslice = relayer->getTimesliceForSlot(i); timingInfo->timeslice = timeslice.value; timingInfo->tfCounter = relayer->getFirstTFCounterForSlot(i); - timingInfo->firstTFOrbit = relayer->getFirstTFOrbitForSlot(i); + timingInfo->firstTForbit = relayer->getFirstTFOrbitForSlot(i); timingInfo->runNumber = relayer->getRunNumberForSlot(i); timingInfo->creation = relayer->getCreationTimeForSlot(i); }; diff --git a/Framework/Core/src/ExternalFairMQDeviceProxy.cxx b/Framework/Core/src/ExternalFairMQDeviceProxy.cxx index 1a527d4e48697..554de58b20bb7 100644 --- a/Framework/Core/src/ExternalFairMQDeviceProxy.cxx +++ b/Framework/Core/src/ExternalFairMQDeviceProxy.cxx @@ -244,7 +244,7 @@ InjectorFunction dplModelAdaptor(std::vector const& filterSpecs, DPL const_cast(dph)->startTime = dplCounter; timingInfo.timeslice = dph->startTime; timingInfo.creation = dph->creation; - timingInfo.firstTFOrbit = dh->firstTForbit; + timingInfo.firstTForbit = dh->firstTForbit; timingInfo.runNumber = dh->runNumber; timingInfo.tfCounter = dh->tfCounter; LOG(debug) << msgidx << ": " << DataSpecUtils::describe(OutputSpec{dh->dataOrigin, dh->dataDescription, dh->subSpecification}) << " part " << dh->splitPayloadIndex << " of " << dh->splitPayloadParts << " payload " << parts.At(msgidx + 1)->GetSize(); @@ -469,7 +469,7 @@ DataProcessorSpec specifyExternalFairMQDeviceProxy(char const* name, auto& timingInfo = ctx.services().get(); if (dh != nullptr) { timingInfo.runNumber = dh->runNumber; - timingInfo.firstTFOrbit = dh->firstTForbit; + timingInfo.firstTForbit = dh->firstTForbit; timingInfo.tfCounter = dh->tfCounter; } auto const dph = o2::header::get(parts.At(0)->GetData()); diff --git a/Framework/Core/src/LifetimeHelpers.cxx b/Framework/Core/src/LifetimeHelpers.cxx index ca327a73a7aa0..1f7dc15ff7c4c 100644 --- a/Framework/Core/src/LifetimeHelpers.cxx +++ b/Framework/Core/src/LifetimeHelpers.cxx @@ -369,7 +369,7 @@ ExpirationHandler::Handler // * By default we use the time when the data was created. // * If an override is specified, we use it. // * If the orbit reset time comes from CTP, we use it for precise - // timestamp evaluation via the firstTFOrbit + // timestamp evaluation via the firstTForbit uint64_t timestamp = -1; if (overrideTimestampMilliseconds) { timestamp = overrideTimestampMilliseconds; diff --git a/Framework/GUISupport/src/FrameworkGUIDataRelayerUsage.cxx b/Framework/GUISupport/src/FrameworkGUIDataRelayerUsage.cxx index bc9a3a095d46a..0cd79b3b7c3de 100644 --- a/Framework/GUISupport/src/FrameworkGUIDataRelayerUsage.cxx +++ b/Framework/GUISupport/src/FrameworkGUIDataRelayerUsage.cxx @@ -164,7 +164,7 @@ void displayDataRelayer(DeviceMetricsInfo const& metrics, ImGui::Text("$%zu (tfCounter): %s", vi, value); break; case o2::framework::data_matcher::FIRSTTFORBIT_POS: - ImGui::Text("$%zu (firstTFOrbit): %s", vi, value); + ImGui::Text("$%zu (firstTForbit): %s", vi, value); break; default: ImGui::Text("$%zu: %s", vi, value); diff --git a/GPU/Workflow/src/GPUWorkflowSpec.cxx b/GPU/Workflow/src/GPUWorkflowSpec.cxx index 541e41773d03d..13ad1ae1677b3 100644 --- a/GPU/Workflow/src/GPUWorkflowSpec.cxx +++ b/GPU/Workflow/src/GPUWorkflowSpec.cxx @@ -590,15 +590,15 @@ void GPURecoWorkflowSpec::run(ProcessingContext& pc) outputRegions.clusterLabels.allocator = [&clustersMCBuffer](size_t size) -> void* { return &clustersMCBuffer; }; } - const auto* dh = o2::header::get(pc.inputs().getFirstValid(true).header); - mTFSettings->tfStartOrbit = dh->firstTForbit; + const auto& tinfo = pc.services().get(); + mTFSettings->tfStartOrbit = tinfo.firstTForbit; mTFSettings->hasTfStartOrbit = 1; mTFSettings->hasNHBFPerTF = 1; mTFSettings->nHBFPerTF = GRPGeomHelper::instance().getGRPECS()->getNHBFPerTF(); mTFSettings->hasRunStartOrbit = 0; // mTFSettings->runStartOrbit = grp->getFirstOrbit(); if (mVerbosity) { - LOG(info) << "TF firstTFOrbit " << mTFSettings->tfStartOrbit << " nHBF " << mTFSettings->nHBFPerTF << " runStartOrbit " << mTFSettings->runStartOrbit << " simStartOrbit " << mTFSettings->simStartOrbit; + LOG(info) << "TF firstTForbit " << mTFSettings->tfStartOrbit << " nHBF " << mTFSettings->nHBFPerTF << " runStartOrbit " << mTFSettings->runStartOrbit << " simStartOrbit " << mTFSettings->simStartOrbit; } ptrs.settingsTF = mTFSettings.get(); diff --git a/GPU/Workflow/src/O2GPUDPLDisplay.cxx b/GPU/Workflow/src/O2GPUDPLDisplay.cxx index ce80510da72c2..7f5abe875477c 100644 --- a/GPU/Workflow/src/O2GPUDPLDisplay.cxx +++ b/GPU/Workflow/src/O2GPUDPLDisplay.cxx @@ -94,8 +94,7 @@ void O2GPUDPLDisplaySpec::run(ProcessingContext& pc) return; } - const auto* dh = o2::header::get(pc.inputs().getFirstValid(true).header); - mTFSettings->tfStartOrbit = dh->firstTForbit; + mTFSettings->tfStartOrbit = pc.services().get().firstTForbit; mTFSettings->hasTfStartOrbit = 1; mTFSettings->hasNHBFPerTF = 1; mTFSettings->nHBFPerTF = GRPGeomHelper::instance().getGRPECS()->getNHBFPerTF(); diff --git a/GPU/Workflow/src/gpu-reco-workflow.cxx b/GPU/Workflow/src/gpu-reco-workflow.cxx index b15c64fddf83b..ba97402e70786 100644 --- a/GPU/Workflow/src/gpu-reco-workflow.cxx +++ b/GPU/Workflow/src/gpu-reco-workflow.cxx @@ -167,7 +167,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) o2::globaltracking::InputHelper::addInputSpecs(cfgc, specs, srcCl, srcTrk, srcTrk, doMC); } - // configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit + // configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit o2::raw::HBFUtilsInitializer hbfIni(cfgc, specs); return specs; diff --git a/Steer/DigitizerWorkflow/src/SimpleDigitizerWorkflow.cxx b/Steer/DigitizerWorkflow/src/SimpleDigitizerWorkflow.cxx index 147ddbf416d3b..2a0d241879286 100644 --- a/Steer/DigitizerWorkflow/src/SimpleDigitizerWorkflow.cxx +++ b/Steer/DigitizerWorkflow/src/SimpleDigitizerWorkflow.cxx @@ -226,7 +226,7 @@ void customize(std::vector& policies) const auto startTime = hbfu.startTime; const auto orbitFirst = hbfu.orbitFirst; dh.firstTForbit = offset + increment * dh.tfCounter; - LOG(info) << "Setting firstTFOrbit to " << dh.firstTForbit; + LOG(info) << "Setting firstTForbit to " << dh.firstTForbit; dh.runNumber = hbfu.runNumber; LOG(info) << "Setting runNumber to " << dh.runNumber; dph.creation = startTime + (dh.firstTForbit - orbitFirst) * o2::constants::lhc::LHCOrbitMUS * 1.e-3; diff --git a/Steer/DigitizerWorkflow/src/TOFDigitizerSpec.cxx b/Steer/DigitizerWorkflow/src/TOFDigitizerSpec.cxx index eaeef2b727ada..765b24b1d051a 100644 --- a/Steer/DigitizerWorkflow/src/TOFDigitizerSpec.cxx +++ b/Steer/DigitizerWorkflow/src/TOFDigitizerSpec.cxx @@ -175,8 +175,6 @@ class TOFDPLDigitizerTask : public o2::base::BaseDPLDigitizer mDigitizer->setCalibApi(mCalibApi); - // const auto ref = pc.inputs().getFirstValid(true); - // auto creationTime = DataRefUtils::getHeader(ref)->creation; mCalibApi->setTimeStamp(o2::raw::HBFUtils::Instance().startTime / 1000); static std::vector hits;