From ca9197ac4d879f58104813b635ea6250fe02c95d Mon Sep 17 00:00:00 2001 From: shahoian Date: Fri, 21 Jul 2023 17:35:35 +0200 Subject: [PATCH] Restore setting VDrift as a reference for the CalibLaserTracks and remove unnecessary Consume completion policies --- .../include/TPCCalibration/CalibLaserTracks.h | 2 ++ .../include/TPCWorkflow/CalibLaserTracksSpec.h | 18 +++++++++++++++++- .../workflow/src/tpc-calib-laser-tracks.cxx | 7 ------- .../workflow/src/tpc-laser-track-filter.cxx | 7 ------- .../src/tpc-laser-tracks-calibrator.cxx | 7 ------- 5 files changed, 19 insertions(+), 22 deletions(-) diff --git a/Detectors/TPC/calibration/include/TPCCalibration/CalibLaserTracks.h b/Detectors/TPC/calibration/include/TPCCalibration/CalibLaserTracks.h index 5896766e7cbab..eed7989882c0c 100644 --- a/Detectors/TPC/calibration/include/TPCCalibration/CalibLaserTracks.h +++ b/Detectors/TPC/calibration/include/TPCCalibration/CalibLaserTracks.h @@ -154,6 +154,8 @@ class CalibLaserTracks /// name of the debug output tree void setDebugOutputName(std::string_view name) { mDebugOutputName = name; } + void setVDriftRef(float v) { mDriftV = v; } + private: int mTriggerPos{0}; ///< trigger position, if < 0 it treats it as the CE position float mBz{0.5}; ///< Bz field in Tesla diff --git a/Detectors/TPC/workflow/include/TPCWorkflow/CalibLaserTracksSpec.h b/Detectors/TPC/workflow/include/TPCWorkflow/CalibLaserTracksSpec.h index d08ad15e0de5b..bbc6f77d4fedf 100644 --- a/Detectors/TPC/workflow/include/TPCWorkflow/CalibLaserTracksSpec.h +++ b/Detectors/TPC/workflow/include/TPCWorkflow/CalibLaserTracksSpec.h @@ -25,6 +25,7 @@ #include "CCDB/CcdbApi.h" #include "CCDB/CcdbObjectInfo.h" #include "CommonUtils/NameConf.h" +#include "TPCCalibration/VDriftHelper.h" #include "TPCWorkflow/ProcessingHelpers.h" @@ -60,6 +61,7 @@ class CalibLaserTracksDevice : public o2::framework::Task LOGP(warning, "CalibLaserTracksDevice::run: No DataProcessingHeader found for \"input\". Only conditions? Skipping event."); return; } + mTPCVDriftHelper.extractCCDBInputs(pc); const auto startTime = dph->startTime; const auto endTime = dph->startTime + dph->duration; mRunNumber = processing_helpers::getRunNumber(pc); @@ -85,8 +87,20 @@ class CalibLaserTracksDevice : public o2::framework::Task sendOutput(ec.outputs()); } + void finaliseCCDB(ConcreteDataMatcher& matcher, void* obj) final + { + if (mTPCVDriftHelper.accountCCDBInputs(matcher, obj)) { + if (mTPCVDriftHelper.isUpdated()) { + mTPCVDriftHelper.acknowledgeUpdate(); + mCalib.setVDriftRef(mTPCVDriftHelper.getVDriftObject().getVDrift()); + } + return; + } + } + private: CalibLaserTracks mCalib; ///< laser track calibration component + o2::tpc::VDriftHelper mTPCVDriftHelper{}; uint64_t mRunNumber{0}; ///< processed run number int mMinNumberTFs{100}; ///< minimum number of TFs required for good calibration bool mPublished{false}; ///< if calibration was already published @@ -145,10 +159,12 @@ DataProcessorSpec getCalibLaserTracks(const std::string inputSpec) outputs.emplace_back(ConcreteDataTypeMatcher{"TPC", "LtrCalibData"}, Lifetime::Sporadic); outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBPayload, "TPC_CalibLtr"}, Lifetime::Sporadic); outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBWrapper, "TPC_CalibLtr"}, Lifetime::Sporadic); + std::vector inputs = select(inputSpec.data()); + o2::tpc::VDriftHelper::requestCCDBInputs(inputs); return DataProcessorSpec{ "tpc-calib-laser-tracks", - select(inputSpec.data()), + inputs, outputs, AlgorithmSpec{adaptFromTask()}, Options{ diff --git a/Detectors/TPC/workflow/src/tpc-calib-laser-tracks.cxx b/Detectors/TPC/workflow/src/tpc-calib-laser-tracks.cxx index e287b712439d9..b69308e2bd109 100644 --- a/Detectors/TPC/workflow/src/tpc-calib-laser-tracks.cxx +++ b/Detectors/TPC/workflow/src/tpc-calib-laser-tracks.cxx @@ -16,13 +16,6 @@ using namespace o2::framework; -// customize the completion policy -void customize(std::vector& policies) -{ - using o2::framework::CompletionPolicy; - policies.push_back(CompletionPolicyHelpers::defineByName("tpc-calib-laser-tracks", CompletionPolicy::CompletionOp::Consume)); -} - // we need to add workflow options before including Framework/runDataProcessing void customize(std::vector& workflowOptions) { diff --git a/Detectors/TPC/workflow/src/tpc-laser-track-filter.cxx b/Detectors/TPC/workflow/src/tpc-laser-track-filter.cxx index 158eeb394f6b5..a1f1ef75ff3ba 100644 --- a/Detectors/TPC/workflow/src/tpc-laser-track-filter.cxx +++ b/Detectors/TPC/workflow/src/tpc-laser-track-filter.cxx @@ -23,13 +23,6 @@ using namespace o2::tpc; template using BranchDefinition = MakeRootTreeWriterSpec::BranchDefinition; -// customize the completion policy -void customize(std::vector& policies) -{ - using o2::framework::CompletionPolicy; - policies.push_back(CompletionPolicyHelpers::defineByName("tpc-laser-track-filter", CompletionPolicy::CompletionOp::Consume)); -} - // we need to add workflow options before including Framework/runDataProcessing void customize(std::vector& workflowOptions) { diff --git a/Detectors/TPC/workflow/src/tpc-laser-tracks-calibrator.cxx b/Detectors/TPC/workflow/src/tpc-laser-tracks-calibrator.cxx index 422c4a841d785..384061ddffe7f 100644 --- a/Detectors/TPC/workflow/src/tpc-laser-tracks-calibrator.cxx +++ b/Detectors/TPC/workflow/src/tpc-laser-tracks-calibrator.cxx @@ -17,13 +17,6 @@ using namespace o2::framework; -// customize the completion policy -void customize(std::vector& policies) -{ - using o2::framework::CompletionPolicy; - policies.push_back(CompletionPolicyHelpers::defineByName("tpc-laser-tracks-calibrator", CompletionPolicy::CompletionOp::Consume)); -} - // we need to add workflow options before including Framework/runDataProcessing void customize(std::vector& workflowOptions) {