11#include <fairlogger/Logger.h>
25 LOG(
debug) <<
"[CPVClusterizer - init] Initialize clusterizer ...";
34 LOG(info) <<
"Starting ClusterizerSpec::run() ";
35 LOG(
debug) <<
"CPVClusterizer - run on digits called";
38 static bool isConfigFetched =
false;
39 if (!isConfigFetched) {
40 LOG(info) <<
"ClusterizerSpec::run() : fetching o2::cpv::CPVSimParams from CCDB";
42 LOG(info) <<
"ClusterizerSpec::run() : o2::cpv::CPVSimParams::Instance() now is following:";
44 isConfigFetched =
true;
50 LOG(info) <<
"ClusterizerSpec::run() : no digits; moving on";
51 mOutputClusters.clear();
53 mOutputClusterTrigRecs.clear();
58 mOutputTruthCont.
clear();
63 auto digitsTR = ctx.
inputs().
get<std::vector<o2::cpv::TriggerRecord>>(
"digitTriggerRecords");
69 mClusterizer.
process(
digits, digitsTR, truthcont.get(), &mOutputClusters, &mOutputClusterTrigRecs, &mOutputTruthCont, &mCalibDigits);
71 mClusterizer.
process(
digits, digitsTR,
nullptr, &mOutputClusters, &mOutputClusterTrigRecs, &mOutputTruthCont, &mCalibDigits);
74 LOG(
debug) <<
"CPVClusterizer::run() : Received " << digitsTR.size() <<
" TR, calling clusterizer ...";
82 LOG(info) <<
"Finished, wrote " << mOutputClusters.size() <<
" clusters, " << mOutputClusterTrigRecs.size() <<
"TR and " << mOutputTruthCont.
getIndexedSize() <<
" Labels";
86 std::vector<o2::framework::InputSpec> inputs;
87 std::vector<o2::framework::OutputSpec> outputs;
88 inputs.emplace_back(
"simparams",
"CPV",
"CPV_SimPars", 0, o2::framework::Lifetime::Condition,
o2::framework::ccdbParamSpec(
"CPV/Config/CPVSimParams"));
92 inputs.emplace_back(
"digitsmctr",
"CPV",
"DIGITSMCTR", 0, o2::framework::Lifetime::Timeframe);
94 outputs.emplace_back(
"CPV",
"CLUSTERS", 0, o2::framework::Lifetime::Timeframe);
95 outputs.emplace_back(
"CPV",
"CLUSTERTRIGRECS", 0, o2::framework::Lifetime::Timeframe);
97 outputs.emplace_back(
"CPV",
"CLUSTERTRUEMC", 0, o2::framework::Lifetime::Timeframe);
99 outputs.emplace_back(
"CPV",
"CALIBDIGITS", 0, o2::framework::Lifetime::Timeframe);
104 o2::framework::adaptFromTask<o2::cpv::reco_workflow::ClusterizerSpec>(propagateMC)};
void printKeyValues(bool showProv=true, bool useLogger=false) const final
static const CPVSimParams & Instance()
void process(gsl::span< const Digit > digits, gsl::span< const TriggerRecord > dtr, const o2::dataformats::MCTruthContainer< o2::MCCompLabel > *dmc, std::vector< Cluster > *clusters, std::vector< TriggerRecord > *trigRec, o2::dataformats::MCTruthContainer< o2::MCCompLabel > *cluMC, std::vector< Digit > *calibDigits)
void propagateMC(bool toRun=true)
void run(framework::ProcessingContext &ctx) final
Clusterizes digits into clusters.
void init(framework::InitContext &ctx) final
Initializing the ClusterizerSpec.
void snapshot(const Output &spec, T const &object)
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
InputRecord & inputs()
The inputs associated with this processing context.
constexpr o2::header::DataOrigin gDataOriginCPV
framework::DataProcessorSpec getClusterizerSpec(bool propagateMC)
Creating DataProcessorSpec for the CPV Clusterizer Spec.
std::vector< ConfigParamSpec > ccdbParamSpec(std::string const &path, int runDependent, std::vector< CCDBMetadata > metadata={}, int qrate=0)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
std::vector< Digit > digits