Skip to content

Commit

Permalink
Restore setting VDrift as a reference for the CalibLaserTracks
Browse files Browse the repository at this point in the history
and remove unnecessary Consume completion policies
  • Loading branch information
shahor02 committed Jul 22, 2023
1 parent f091224 commit ca9197a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "CCDB/CcdbApi.h"
#include "CCDB/CcdbObjectInfo.h"
#include "CommonUtils/NameConf.h"
#include "TPCCalibration/VDriftHelper.h"

#include "TPCWorkflow/ProcessingHelpers.h"

Expand Down Expand Up @@ -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);
Expand All @@ -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
Expand Down Expand Up @@ -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<InputSpec> inputs = select(inputSpec.data());
o2::tpc::VDriftHelper::requestCCDBInputs(inputs);

return DataProcessorSpec{
"tpc-calib-laser-tracks",
select(inputSpec.data()),
inputs,
outputs,
AlgorithmSpec{adaptFromTask<device>()},
Options{
Expand Down
7 changes: 0 additions & 7 deletions Detectors/TPC/workflow/src/tpc-calib-laser-tracks.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@

using namespace o2::framework;

// customize the completion policy
void customize(std::vector<o2::framework::CompletionPolicy>& 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<ConfigParamSpec>& workflowOptions)
{
Expand Down
7 changes: 0 additions & 7 deletions Detectors/TPC/workflow/src/tpc-laser-track-filter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ using namespace o2::tpc;
template <typename T>
using BranchDefinition = MakeRootTreeWriterSpec::BranchDefinition<T>;

// customize the completion policy
void customize(std::vector<o2::framework::CompletionPolicy>& 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<ConfigParamSpec>& workflowOptions)
{
Expand Down
7 changes: 0 additions & 7 deletions Detectors/TPC/workflow/src/tpc-laser-tracks-calibrator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@

using namespace o2::framework;

// customize the completion policy
void customize(std::vector<o2::framework::CompletionPolicy>& 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<o2::framework::ConfigParamSpec>& workflowOptions)
{
Expand Down

0 comments on commit ca9197a

Please sign in to comment.