44 mClusterer = std::make_unique<o2::itsmft::Clusterer>();
46 mUseClusterDictionary = !ic.
options().
get<
bool>(
"ignore-cluster-dictionary");
48 mNThreads = std::max(1, ic.
options().
get<
int>(
"nthreads"));
49 LOGP(info,
"Initialising ITSClusterer with {} threads", mNThreads);
55 updateTimeDependentParams(pc);
57 auto rofs = pc.
inputs().
get<gsl::span<o2::itsmft::ROFRecord>>(
"ROframes");
59 gsl::span<const o2::itsmft::MC2ROFRecord> mc2rofs;
60 gsl::span<const char> labelbuffer;
62 labelbuffer = pc.
inputs().
get<gsl::span<char>>(
"labels");
63 mc2rofs = pc.
inputs().
get<gsl::span<o2::itsmft::MC2ROFRecord>>(
"MC2ROframes");
67 LOG(info) <<
"ITSClusterer pulled " <<
digits.size() <<
" digits, in "
68 << rofs.size() <<
" RO frames";
69 LOG(info) <<
"ITSClusterer pulled " << labels.
getNElements() <<
" labels ";
83 std::vector<o2::itsmft::CompClusterExt> clusCompVec;
84 std::vector<o2::itsmft::ROFRecord> clusROFVec;
85 std::vector<unsigned char> clusPattVec;
87 std::unique_ptr<o2::dataformats::MCTruthContainer<o2::MCCompLabel>> clusterLabels;
89 clusterLabels = std::make_unique<o2::dataformats::MCTruthContainer<o2::MCCompLabel>>();
91 mClusterer->process(mNThreads, reader, &clusCompVec, &clusPattVec, &clusROFVec, clusterLabels.get());
98 std::vector<o2::itsmft::MC2ROFRecord> clusterMC2ROframes(mc2rofs.size());
99 for (
int i = mc2rofs.size();
i--;) {
100 clusterMC2ROframes[
i] = mc2rofs[
i];
107 LOG(info) <<
"ITSClusterer pushed " << clusCompVec.size() <<
" clusters, in " << clusROFVec.size() <<
" RO frames";
113 static bool initOnceDone =
false;
124 mClusterer->setDropHugeClusters(clParams.dropHugeClusters);
125 if (clParams.maxBCDiffToMaskBias > 0 && clParams.maxBCDiffToSquashBias > 0) {
126 LOGP(fatal,
"maxBCDiffToMaskBias = {} and maxBCDiffToSquashBias = {} cannot be set at the same time. Either set masking or squashing with a BCDiff > 0", clParams.maxBCDiffToMaskBias, clParams.maxBCDiffToSquashBias);
128 auto nbc = clParams.maxBCDiffToMaskBias;
130 mClusterer->setMaxBCSeparationToMask(nbc);
131 mClusterer->setMaxRowColDiffToMask(clParams.maxRowColDiffToMask);
134 mClusterer->setMaxBCSeparationToSquash(rofBC + clParams.maxBCDiffToSquashBias);
135 int nROFsToSquash = 0;
136 if (clParams.maxSOTMUS > 0 && rofBC > 0) {
139 mClusterer->setMaxROFDepthToSquash(clParams.maxBCDiffToSquashBias > 0 ? nROFsToSquash : 0);
152 LOG(info) <<
"cluster dictionary updated" << (!mUseClusterDictionary ?
" but its using is disabled" :
"");
153 if (mUseClusterDictionary) {
160 LOG(info) <<
"Alpide param updated";
162 par.printKeyValues();
166 LOG(info) <<
"Cluster param updated";
168 par.printKeyValues();
175 std::vector<InputSpec> inputs;
176 inputs.emplace_back(
"digits",
"ITS",
"DIGITS", 0, Lifetime::Timeframe);
177 inputs.emplace_back(
"ROframes",
"ITS",
"DIGITSROF", 0, Lifetime::Timeframe);
178 inputs.emplace_back(
"cldict",
"ITS",
"CLUSDICT", 0, Lifetime::Condition,
ccdbParamSpec(
"ITS/Calib/ClusterDictionary"));
179 inputs.emplace_back(
"cluspar",
"ITS",
"CLUSPARAM", 0, Lifetime::Condition,
ccdbParamSpec(
"ITS/Config/ClustererParam"));
180 inputs.emplace_back(
"alppar",
"ITS",
"ALPIDEPARAM", 0, Lifetime::Condition,
ccdbParamSpec(
"ITS/Config/AlpideParam"));
181 auto ggRequest = std::make_shared<o2::base::GRPGeomRequest>(
false,
189 std::vector<OutputSpec> outputs;
190 outputs.emplace_back(
"ITS",
"COMPCLUSTERS", 0, Lifetime::Timeframe);
191 outputs.emplace_back(
"ITS",
"PATTERNS", 0, Lifetime::Timeframe);
192 outputs.emplace_back(
"ITS",
"CLUSTERSROF", 0, Lifetime::Timeframe);
195 inputs.emplace_back(
"labels",
"ITS",
"DIGITSMCTR", 0, Lifetime::Timeframe);
196 inputs.emplace_back(
"MC2ROframes",
"ITS",
"DIGITSMC2ROF", 0, Lifetime::Timeframe);
197 outputs.emplace_back(
"ITS",
"CLUSTERSMCTR", 0, Lifetime::Timeframe);
198 outputs.emplace_back(
"ITS",
"CLUSTERSMC2ROF", 0, Lifetime::Timeframe);
205 AlgorithmSpec{adaptFromTask<ClustererDPL>(ggRequest, useMC)},
207 {
"ignore-cluster-dictionary", VariantType::Bool,
false, {
"do not use cluster dictionary, always store explicit patterns"}},
208 {
"nthreads", VariantType::Int, 1, {
"Number of clustering threads"}}}};
Definition of the ITS/MFT clusterer settings.
Definition of the ITSMFT compact cluster.
A const (ready only) version of MCTruthContainer.
Definition of the Names Generator class.
Definition of the Alpide pixel reader for MC digits processing.
Header of the General Run Parameters object.
Header to collect LHC related constants.
void checkUpdates(o2::framework::ProcessingContext &pc)
static GRPGeomHelper & instance()
void setRequest(std::shared_ptr< GRPGeomRequest > req)
static const DPLAlpideParam< N > & Instance()
T get(const char *key) const
void snapshot(const Output &spec, T const &object)
ConfigParamRegistry const & options()
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
InputRecord & inputs()
The inputs associated with this processing context.
void init(InitContext &ic) final
void finaliseCCDB(ConcreteDataMatcher &matcher, void *obj) final
void run(ProcessingContext &pc) final
void endOfStream(o2::framework::EndOfStreamContext &ec) final
static constexpr int getNChips()
number of chips per barrel
void setDigitsMCTruth(const o2::dataformats::ConstMCTruthContainerView< o2::MCCompLabel > *m)
void setDigits(const gsl::span< const o2::itsmft::Digit > a)
void setSquashingDist(const int16_t v)
void setMaxBCSeparationToSquash(int n)
void setMC2ROFRecords(const gsl::span< const o2::itsmft::MC2ROFRecord > a)
void setROFRecords(const gsl::span< const o2::itsmft::ROFRecord > a)
void setSquashingDepth(const int16_t v)
constexpr o2::header::DataOrigin gDataOriginITS
constexpr double LHCBunchSpacingMUS
constexpr double LHCBunchSpacingNS
Defining PrimaryVertex explicitly as messageable.
std::vector< ConfigParamSpec > ccdbParamSpec(std::string const &path, int runDependent, std::vector< CCDBMetadata > metadata={}, int qrate=0)
std::vector< ConfigParamSpec > Options
framework::DataProcessorSpec getClustererSpec(bool useMC)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
std::vector< Digit > digits