30#include "MFTBase/GeometryTGeo.h" 
   46  mClusterer = std::make_unique<o2::itsmft::Clusterer>();
 
   48  mUseClusterDictionary = !ic.
options().
get<
bool>(
"ignore-cluster-dictionary");
 
   50  mNThreads = std::max(1, ic.
options().
get<
int>(
"nthreads"));
 
 
   56  updateTimeDependentParams(pc);
 
   58  auto rofs = pc.
inputs().
get<gsl::span<o2::itsmft::ROFRecord>>(
"ROframes");
 
   60  gsl::span<const o2::itsmft::MC2ROFRecord> mc2rofs;
 
   61  gsl::span<const char> labelbuffer;
 
   63    labelbuffer = pc.
inputs().
get<gsl::span<char>>(
"labels");
 
   64    mc2rofs = pc.
inputs().
get<gsl::span<o2::itsmft::MC2ROFRecord>>(
"MC2ROframes");
 
   68  LOG(
debug) << 
"MFTClusterer pulled " << 
digits.size() << 
" digits, in " 
   69             << rofs.size() << 
" RO frames";
 
   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(
debug) << 
"MFTClusterer pushed " << clusCompVec.size() << 
" compressed clusters, in " << clusROFVec.size() << 
" RO frames";
 
 
  114  static bool initOnceDone = 
false;
 
  124    if (clParams.maxBCDiffToMaskBias > 0 && clParams.maxBCDiffToSquashBias > 0) {
 
  125      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);
 
  127    mClusterer->setDropHugeClusters(clParams.dropHugeClusters);
 
  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(nROFsToSquash);
 
  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", 
"MFT", 
"DIGITS", 0, Lifetime::Timeframe);
 
  177  inputs.emplace_back(
"ROframes", 
"MFT", 
"DIGITSROF", 0, Lifetime::Timeframe);
 
  178  inputs.emplace_back(
"cldict", 
"MFT", 
"CLUSDICT", 0, Lifetime::Condition, 
ccdbParamSpec(
"MFT/Calib/ClusterDictionary"));
 
  179  inputs.emplace_back(
"cluspar", 
"MFT", 
"CLUSPARAM", 0, Lifetime::Condition, 
ccdbParamSpec(
"MFT/Config/ClustererParam"));
 
  180  inputs.emplace_back(
"alppar", 
"MFT", 
"ALPIDEPARAM", 0, Lifetime::Condition, 
ccdbParamSpec(
"MFT/Config/AlpideParam"));
 
  181  auto ggRequest = std::make_shared<o2::base::GRPGeomRequest>(
false,                          
 
  189  std::vector<OutputSpec> outputs;
 
  190  outputs.emplace_back(
"MFT", 
"COMPCLUSTERS", 0, Lifetime::Timeframe);
 
  191  outputs.emplace_back(
"MFT", 
"PATTERNS", 0, Lifetime::Timeframe);
 
  192  outputs.emplace_back(
"MFT", 
"CLUSTERSROF", 0, Lifetime::Timeframe);
 
  195    inputs.emplace_back(
"labels", 
"MFT", 
"DIGITSMCTR", 0, Lifetime::Timeframe);
 
  196    inputs.emplace_back(
"MC2ROframes", 
"MFT", 
"DIGITSMC2ROF", 0, Lifetime::Timeframe);
 
  197    outputs.emplace_back(
"MFT", 
"CLUSTERSMCTR", 0, Lifetime::Timeframe);
 
  198    outputs.emplace_back(
"MFT", 
"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 GeometryManager 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.
static constexpr Int_t getNChips()
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)
void init(InitContext &ic) final
void run(ProcessingContext &pc) final
void finaliseCCDB(ConcreteDataMatcher &matcher, void *obj) final
constexpr o2::header::DataOrigin gDataOriginMFT
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