11#include <fairlogger/Logger.h>
30 LOG(
debug) <<
"[PHOSClusterizer - init] Initialize clusterizer ...";
36 LOG(info) <<
"No reading BadMap/Calibration from ccdb requested, set default";
38 mCalibParams = std::make_unique<CalibParams>(1);
39 mBadMap = std::make_unique<BadChannelsMap>();
60 if (!mSkipL1phase && !mPropagateMC) {
61 auto vec = ctx.
inputs().
get<std::vector<int>*>(
"l1phase");
69 mInitSimParams =
false;
73 LOG(
debug) <<
"PHOSClusterizer - run on digits called";
78 auto digitsTR = ctx.
inputs().
get<std::vector<o2::phos::TriggerRecord>>(
"digitTriggerRecords");
79 if (!digitsTR.size()) {
80 mOutputClusters.clear();
83 mOutputCluElements.clear();
86 mOutputClusterTrigRecs.clear();
89 mOutputTruthCont.
clear();
95 LOG(
debug) <<
"[PHOSClusterizer - run] Received " << digitsTR.size() <<
" TR, running clusterizer ...";
99 mClusterizer.
process(
digits, digitsTR, truthcont.get(), mOutputClusters, mOutputCluElements, mOutputClusterTrigRecs, mOutputTruthCont);
101 mClusterizer.
process(
digits, digitsTR,
nullptr, mOutputClusters, mOutputCluElements, mOutputClusterTrigRecs, mOutputTruthCont);
104 auto cells = ctx.
inputs().
get<std::vector<o2::phos::Cell>>(
"cells");
106 LOG(
debug) <<
"[PHOSClusterizer - run] Received " <<
cells.size() <<
" cells, running clusterizer ...";
108 auto cellsTR = ctx.
inputs().
get<std::vector<o2::phos::TriggerRecord>>(
"cellTriggerRecords");
112 mClusterizer.
processCells(
cells, cellsTR, truthcont.get(), mOutputClusters, mOutputCluElements, mOutputClusterTrigRecs, mOutputTruthCont);
114 mClusterizer.
processCells(
cells, cellsTR,
nullptr, mOutputClusters, mOutputCluElements, mOutputClusterTrigRecs, mOutputTruthCont);
119 LOG(
debug) <<
"[PHOSClusterizer - run] Writing " << mOutputClusters.size() <<
" clusters, " << mOutputClusterTrigRecs.size() <<
"TR and " << mOutputTruthCont.
getIndexedSize() <<
" Labels";
121 LOG(
debug) <<
"[PHOSClusterizer - run] Writing " << mOutputClusters.size() <<
" clusters and " << mOutputClusterTrigRecs.size() <<
" TR";
124 if (mFullCluOutput) {
135 std::vector<o2::framework::InputSpec> inputs;
136 std::vector<o2::framework::OutputSpec> outputs;
138 inputs.emplace_back(
"digitTriggerRecords",
o2::header::gDataOriginPHS,
"DIGITTRIGREC", 0, o2::framework::Lifetime::Timeframe);
145 inputs.emplace_back(
"digitsmctr",
"PHS",
"DIGITSMCTR", 0, o2::framework::Lifetime::Timeframe);
147 outputs.emplace_back(
"PHS",
"CLUSTERS", 0, o2::framework::Lifetime::Timeframe);
149 outputs.emplace_back(
"PHS",
"CLUELEMENTS", 0, o2::framework::Lifetime::Timeframe);
151 outputs.emplace_back(
"PHS",
"CLUSTERTRIGREC", 0, o2::framework::Lifetime::Timeframe);
153 outputs.emplace_back(
"PHS",
"CLUSTERTRUEMC", 0, o2::framework::Lifetime::Timeframe);
159 o2::framework::adaptFromTask<o2::phos::reco_workflow::ClusterizerSpec>(propagateMC,
true, fullClu, defBadMap,
true),
166 std::vector<o2::framework::InputSpec> inputs;
167 std::vector<o2::framework::OutputSpec> outputs;
173 if (!skipL1phase && !propagateMC) {
179 inputs.emplace_back(
"cellsmctr",
"PHS",
"CELLSMCTR", 0, o2::framework::Lifetime::Timeframe);
181 outputs.emplace_back(
"PHS",
"CLUSTERS", 0, o2::framework::Lifetime::Timeframe);
183 outputs.emplace_back(
"PHS",
"CLUELEMENTS", 0, o2::framework::Lifetime::Timeframe);
185 outputs.emplace_back(
"PHS",
"CLUSTERTRIGREC", 0, o2::framework::Lifetime::Timeframe);
187 outputs.emplace_back(
"PHS",
"CLUSTERTRUEMC", 0, o2::framework::Lifetime::Timeframe);
193 o2::framework::adaptFromTask<o2::phos::reco_workflow::ClusterizerSpec>(propagateMC,
false, fullClu, defBadMap, skipL1phase),
Definition of the Names Generator class.
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.
CCDB container for bad (masked) channels in PHOS.
void processCells(gsl::span< const Cell > digits, gsl::span< const TriggerRecord > dtr, const o2::dataformats::MCTruthContainer< MCLabel > *dmc, std::vector< Cluster > &clusters, std::vector< CluElement > &cluel, std::vector< TriggerRecord > &rigRec, o2::dataformats::MCTruthContainer< MCLabel > &cluMC)
void setBadMap(const o2::phos::BadChannelsMap *m)
void setCalibration(const o2::phos::CalibParams *c)
void process(gsl::span< const Digit > digits, gsl::span< const TriggerRecord > dtr, const o2::dataformats::MCTruthContainer< MCLabel > *dmc, std::vector< Cluster > &clusters, std::vector< CluElement > &cluel, std::vector< TriggerRecord > &rigRec, o2::dataformats::MCTruthContainer< MCLabel > &cluMC)
void setL1phase(int phase)
void run(framework::ProcessingContext &ctx) final
Clusterizes digits into clusters.
void init(framework::InitContext &ctx) final
Initializing the ClusterizerSpec.
constexpr o2::header::DataOrigin gDataOriginPHS
std::vector< ConfigParamSpec > ccdbParamSpec(std::string const &path, int runDependent, std::vector< CCDBMetadata > metadata={}, int qrate=0)
std::vector< ConfigParamSpec > Options
framework::DataProcessorSpec getClusterizerSpec(bool propagateMC, bool fillFullClu, bool defBadMap=false)
Creating DataProcessorSpec for the PHOS Clusterizer Spec.
framework::DataProcessorSpec getCellClusterizerSpec(bool propagateMC, bool fillFullClu, bool defBadMap=false, bool skipL1phase=true)
std::vector< o2::ctf::BufferType > vec
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
std::vector< Cell > cells
std::vector< Digit > digits