2323#include " Framework/Task.h"
2424#include " Framework/DataProcessorSpec.h"
2525#include " TPCCalibration/VDriftHelper.h"
26- #include " TPCCalibration/CorrectionMapsHelper .h"
26+ #include " TPCCalibration/CorrectionMapsLoader .h"
2727
2828// from Tracks
2929#include " ReconstructionDataFormats/GlobalTrackID.h"
@@ -70,7 +70,7 @@ class TOFMatcherSpec : public Task
7070 std::shared_ptr<DataRequest> mDataRequest ;
7171 std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest ;
7272 o2::tpc::VDriftHelper mTPCVDriftHelper {};
73- o2::tpc::CorrectionMapsHelper mTPCCorrMapsHelper {};
73+ o2::tpc::CorrectionMapsLoader mTPCCorrMapsLoader {};
7474 bool mUseMC = true ;
7575 bool mUseFIT = false ;
7676 bool mDoTPCRefit = false ;
@@ -95,7 +95,7 @@ void TOFMatcherSpec::updateTimeDependentParams(ProcessingContext& pc)
9595{
9696 o2::base::GRPGeomHelper::instance ().checkUpdates (pc);
9797 o2::tpc::VDriftHelper::extractCCDBInputs (pc);
98- o2::tpc::CorrectionMapsHelper ::extractCCDBInputs (pc);
98+ o2::tpc::CorrectionMapsLoader ::extractCCDBInputs (pc);
9999 static bool initOnceDone = false ;
100100 if (!initOnceDone) { // this params need to be queried only once
101101 const auto bcs = o2::base::GRPGeomHelper::instance ().getGRPLHCIF ()->getBunchFilling ().getFilledBCs ();
@@ -106,15 +106,21 @@ void TOFMatcherSpec::updateTimeDependentParams(ProcessingContext& pc)
106106 // put here init-once stuff
107107 }
108108 // we may have other params which need to be queried regularly
109- if (mTPCCorrMapsHelper .isUpdated ()) {
110- mMatcher .setTPCCorrMaps (&mTPCCorrMapsHelper );
111- mTPCCorrMapsHelper .acknowledgeUpdate ();
109+ bool updateMaps = false ;
110+ if (mTPCCorrMapsLoader .isUpdated ()) {
111+ mMatcher .setTPCCorrMaps (&mTPCCorrMapsLoader );
112+ mTPCCorrMapsLoader .acknowledgeUpdate ();
113+ updateMaps = true ;
112114 }
113115 if (mTPCVDriftHelper .isUpdated ()) {
114116 LOGP (info, " Updating TPC fast transform map with new VDrift factor of {} wrt reference {} from source {}" ,
115117 mTPCVDriftHelper .getVDriftObject ().corrFact , mTPCVDriftHelper .getVDriftObject ().refVDrift , mTPCVDriftHelper .getSourceName ());
116118 mMatcher .setTPCVDrift (mTPCVDriftHelper .getVDriftObject ());
117119 mTPCVDriftHelper .acknowledgeUpdate ();
120+ updateMaps = true ;
121+ if (updateMaps) {
122+ mTPCCorrMapsLoader .updateVDrift (mTPCVDriftHelper .getVDriftObject ().corrFact , mTPCVDriftHelper .getVDriftObject ().refVDrift );
123+ }
118124 }
119125}
120126
@@ -126,7 +132,7 @@ void TOFMatcherSpec::finaliseCCDB(ConcreteDataMatcher& matcher, void* obj)
126132 if (mTPCVDriftHelper .accountCCDBInputs (matcher, obj)) {
127133 return ;
128134 }
129- if (mTPCCorrMapsHelper .accountCCDBInputs (matcher, obj)) {
135+ if (mTPCCorrMapsLoader .accountCCDBInputs (matcher, obj)) {
130136 return ;
131137 }
132138}
@@ -227,7 +233,7 @@ DataProcessorSpec getTOFMatcherSpec(GID::mask_t src, bool useMC, bool useFIT, bo
227233 dataRequest->inputs ,
228234 true );
229235 o2::tpc::VDriftHelper::requestCCDBInputs (dataRequest->inputs );
230- o2::tpc::CorrectionMapsHelper ::requestCCDBInputs (dataRequest->inputs );
236+ o2::tpc::CorrectionMapsLoader ::requestCCDBInputs (dataRequest->inputs );
231237 std::vector<OutputSpec> outputs;
232238 if (GID::includesSource (GID::TPC, src)) {
233239 outputs.emplace_back (o2::header::gDataOriginTOF , " MTC_TPC" , ss, Lifetime::Timeframe);
0 commit comments