40 mClusterer = std::make_unique<o2::its3::Clusterer>();
41 mUseClusterDictionary = !ic.
options().
get<
bool>(
"ignore-cluster-dictionary");
42 mNThreads = std::max(1, ic.
options().
get<
int>(
"nthreads"));
51 updateTimeDependentParams(pc);
53 auto rofs = pc.
inputs().
get<gsl::span<o2::itsmft::ROFRecord>>(
"ROframes");
55 gsl::span<const o2::itsmft::MC2ROFRecord> mc2rofs;
56 gsl::span<const char> labelbuffer;
58 labelbuffer = pc.
inputs().
get<gsl::span<char>>(
"labels");
59 mc2rofs = pc.
inputs().
get<gsl::span<o2::itsmft::MC2ROFRecord>>(
"MC2ROframes");
63 LOGP(info,
"ITS3Clusterer pulled {} digits in {} ROFs",
digits.size(), rofs.size());
64 LOGP(info,
"ITS3Clusterer pulled {} labels", labels.
getNElements());
78 std::vector<o2::itsmft::CompClusterExt> clusCompVec;
79 std::vector<o2::itsmft::ROFRecord> clusROFVec;
80 std::vector<unsigned char> clusPattVec;
82 std::unique_ptr<o2::dataformats::MCTruthContainer<o2::MCCompLabel>> clusterLabels;
84 clusterLabels = std::make_unique<o2::dataformats::MCTruthContainer<o2::MCCompLabel>>();
86 mClusterer->process(mNThreads, reader, &clusCompVec, &clusPattVec, &clusROFVec, clusterLabels.get());
93 std::vector<o2::itsmft::MC2ROFRecord> clusterMC2ROframes(mc2rofs.size());
94 for (
int i = mc2rofs.size();
i--;) {
95 clusterMC2ROframes[
i] = mc2rofs[
i];
102 LOG(info) <<
"ITS3Clusterer pushed " << clusCompVec.size() <<
" clusters, in " << clusROFVec.size() <<
" RO frames";
108 static bool initOnceDone =
false;
118 if (clParams.maxBCDiffToMaskBias > 0 && clParams.maxBCDiffToSquashBias > 0) {
119 LOGP(fatal,
"maxBCDiffToMaskBias = {} and maxBCDiffToMaskBias = {} cannot be set at the same time. Either set masking or squashing with a BCDiff > 0", clParams.maxBCDiffToMaskBias, clParams.maxBCDiffToSquashBias);
121 auto nbc = clParams.maxBCDiffToMaskBias;
123 mClusterer->setMaxBCSeparationToMask(nbc);
124 mClusterer->setMaxRowColDiffToMask(clParams.maxRowColDiffToMask);
127 mClusterer->setMaxBCSeparationToSquash(rofBC + clParams.maxBCDiffToSquashBias);
128 int nROFsToSquash = 0;
129 if (clParams.maxSOTMUS > 0 && rofBC > 0) {
132 mClusterer->setMaxROFDepthToSquash(clParams.maxBCDiffToSquashBias > 0 ? nROFsToSquash : 0);
145 LOG(info) <<
"cluster dictionary updated" << (!mUseClusterDictionary ?
" but its using is disabled" :
"");
146 if (mUseClusterDictionary) {
153 LOG(info) <<
"Alpide param updated";
155 par.printKeyValues();
159 LOG(info) <<
"Cluster param updated";
161 par.printKeyValues();
173 std::vector<InputSpec> inputs;
174 inputs.emplace_back(
"digits",
"IT3",
"DIGITS", 0, Lifetime::Timeframe);
175 inputs.emplace_back(
"ROframes",
"IT3",
"DIGITSROF", 0, Lifetime::Timeframe);
176 inputs.emplace_back(
"cldict",
"IT3",
"CLUSDICT", 0, Lifetime::Condition,
ccdbParamSpec(
"IT3/Calib/ClusterDictionary"));
177 inputs.emplace_back(
"cluspar",
"ITS",
"CLUSPARAM", 0, Lifetime::Condition,
ccdbParamSpec(
"ITS/Config/ClustererParam"));
178 inputs.emplace_back(
"alppar",
"ITS",
"ALPIDEPARAM", 0, Lifetime::Condition,
ccdbParamSpec(
"ITS/Config/AlpideParam"));
179 auto ggRequest = std::make_shared<o2::base::GRPGeomRequest>(
false,
187 std::vector<OutputSpec> outputs;
188 outputs.emplace_back(
"ITS",
"COMPCLUSTERS", 0, Lifetime::Timeframe);
189 outputs.emplace_back(
"ITS",
"PATTERNS", 0, Lifetime::Timeframe);
190 outputs.emplace_back(
"ITS",
"CLUSTERSROF", 0, Lifetime::Timeframe);
193 inputs.emplace_back(
"labels",
"IT3",
"DIGITSMCTR", 0, Lifetime::Timeframe);
194 inputs.emplace_back(
"MC2ROframes",
"IT3",
"DIGITSMC2ROF", 0, Lifetime::Timeframe);
195 outputs.emplace_back(
"ITS",
"CLUSTERSMCTR", 0, Lifetime::Timeframe);
196 outputs.emplace_back(
"ITS",
"CLUSTERSMC2ROF", 0, Lifetime::Timeframe);
203 AlgorithmSpec{adaptFromTask<ClustererDPL>(ggRequest, useMC)},
205 {
"ignore-cluster-dictionary", VariantType::Bool,
false, {
"do not use cluster dictionary, always store explicit patterns"}},
206 {
"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 BuildTopologyDictionary class for ITS3.
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 finaliseCCDB(ConcreteDataMatcher &matcher, void *obj) final
void run(ProcessingContext &pc) final
void endOfStream(o2::framework::EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
void init(InitContext &ic) 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
constexpr unsigned int nChips
framework::DataProcessorSpec getClustererSpec(bool useMC)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
std::vector< Digit > digits