26#include "TStopwatch.h"
66namespace globaltracking
73 bool useFT0,
bool calib,
bool skipTPCOnly,
bool useMC)
74 : mDataRequest(dr), mGGCCDBRequest(gr), mUseFT0(useFT0), mCalibMode(calib), mSkipTPCOnly(skipTPCOnly), mUseMC(useMC)
88 std::shared_ptr<DataRequest> mDataRequest;
89 std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
94 bool mCalibMode =
false;
95 bool mSkipTPCOnly =
false;
106 mMatching.
setDebugTreeFileName(maxLanes == 1 ?
"dbg_TPCITSmatch.root" : fmt::format(
"dbg_TPCITSmatch_{}.root", lane));
111 mTPCCorrMapsLoader.
init(ic);
119 updateTimeDependentParams(pc);
124 auto& matchedTracks = pc.
outputs().
make<std::vector<o2::dataformats::TrackTPCITS>>(
Output{
"GLO",
"TPCITS", 0});
125 auto& ABTrackletRefs = pc.
outputs().
make<std::vector<o2::itsmft::TrkClusRef>>(
Output{
"GLO",
"TPCITSAB_REFS", 0});
126 auto& ABTrackletClusterIDs = pc.
outputs().
make<std::vector<int>>(
Output{
"GLO",
"TPCITSAB_CLID", 0});
127 auto& matchLabels = mUseMC ? pc.
outputs().
make<std::vector<o2::MCCompLabel>>(
Output{
"GLO",
"TPCITS_MC", 0}) : dummyMCLab;
128 auto& ABTrackletLabels = mUseMC ? pc.
outputs().
make<std::vector<o2::MCCompLabel>>(
Output{
"GLO",
"TPCITSAB_MC", 0}) : dummyMCLabAB;
129 auto& calib = mCalibMode ? pc.
outputs().
make<std::vector<o2::dataformats::Triplet<float, float, float>>>(
Output{
"GLO",
"TPCITS_VDTGL", 0}) : dummyCalib;
131 mMatching.
run(recoData, matchedTracks, ABTrackletRefs, ABTrackletClusterIDs, matchLabels, ABTrackletLabels, calib);
133 static bool first =
true;
147 LOGF(info,
"TPC-ITS matching total timing: Cpu: %.3e Real: %.3e s in %d slots",
148 mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
164 LOG(info) <<
"ITS-TPC Matching params updated from ccdb";
168 LOG(info) <<
"its cluster dictionary updated";
173 LOG(info) <<
"ITS Alpide param updated";
175 par.printKeyValues();
179 LOG(info) <<
"ITS GeometryTGeo loaded from ccdb";
183#ifdef ENABLE_UPGRADES
185 LOG(info) <<
"it3 cluster dictionary updated";
197 static bool initOnceDone =
false;
227 LOGP(fatal,
"USEMatCorrTGeo cannot work w/o full geometry request in the GRPGeomHelper");
231 bool updateMaps =
false;
239 LOGP(info,
"Updating TPC fast transform map with new VDrift factor of {} wrt reference {} and DriftTimeOffset correction {} wrt {} from source {}",
254 std::vector<OutputSpec> outputs;
255 auto dataRequest = std::make_shared<DataRequest>();
257 dataRequest->setMatchingInputStrict();
259 dataRequest->inputs.emplace_back(
"MatchParam",
"GLO",
"ITSTPCPARAM", 0, Lifetime::Condition,
ccdbParamSpec(
"GLO/Config/ITSTPCParam"));
261 dataRequest->requestTracks(
src, useMC);
262 dataRequest->requestTPCClusters(
false);
264#ifdef ENABLE_UPGRADES
266 dataRequest->requestIT3Clusters(useMC);
268 dataRequest->requestITSClusters(useMC);
271 dataRequest->requestITSClusters(useMC);
274 dataRequest->requestFT0RecPoints(
false);
276 outputs.emplace_back(
"GLO",
"TPCITS", 0, Lifetime::Timeframe);
277 outputs.emplace_back(
"GLO",
"TPCITSAB_REFS", 0, Lifetime::Timeframe);
278 outputs.emplace_back(
"GLO",
"TPCITSAB_CLID", 0, Lifetime::Timeframe);
281 outputs.emplace_back(
"GLO",
"TPCITS_VDTGL", 0, Lifetime::Timeframe);
285 outputs.emplace_back(
"GLO",
"TPCITS_MC", 0, Lifetime::Timeframe);
286 outputs.emplace_back(
"GLO",
"TPCITSAB_MC", 0, Lifetime::Timeframe);
290 auto ggRequest = std::make_shared<o2::base::GRPGeomRequest>(
true,
299 ggRequest->addInput({
"itsTGeo",
"ITS",
"GEOMTGEO", 0, Lifetime::Condition,
ccdbParamSpec(
"ITS/Config/Geometry")}, dataRequest->inputs);
303 {
"nthreads", VariantType::Int, 1, {
"Number of afterburner threads"}},
304 {
"ignore-bc-check", VariantType::Bool,
false, {
"Do not check match candidate against BC filling"}},
305 {
"debug-tree-flags", VariantType::Int, 0, {
"DebugFlagTypes bit-pattern for debug tree"}}};
311 "itstpc-track-matcher",
314 AlgorithmSpec{adaptFromTask<TPCITSMatchingDPL>(dataRequest, ggRequest, sclOpts, useFT0, calib, skipTPCOnly, useMC)},
Class of a TPC cluster in TPC-native coordinates (row, time)
Definition of the ITS/MFT clusterer settings.
Definition of the ITSMFT compact cluster.
Helper class to access load maps from CCDB.
gsl::span< const o2::MCCompLabel > MCLabelsTr
Definition of the Names Generator class.
Definition of the GeometryManager class.
Definition of the BuildTopologyDictionary class for ITS3.
Header of the AggregatedRunInfo struct.
Helper for geometry and GRP related CCDB requests.
Definition of the GeometryTGeo class.
Definition of a container to keep Monte Carlo truth external to simulation objects.
Configurable params for TPC ITS matching.
Class to perform TPC ITS matching.
Definition of the ITS track.
Result of refitting TPC-ITS matched track.
Helper class to extract VDrift from different sources.
Helper class to obtain TPC clusters / digits / labels from DPL.
void checkUpdates(o2::framework::ProcessingContext &pc)
static GRPGeomHelper & instance()
void setRequest(std::shared_ptr< GRPGeomRequest > req)
static bool isGeometryLoaded()
static std::string getConfigOutputFileName(const std::string &procName, const std::string &confName="", bool json=true)
static const MatchTPCITSParams & Instance()
static void write(std::string const &filename, std::string const &keyOnly="")
T get(const char *key) const
decltype(auto) make(const Output &spec, Args... args)
ServiceRegistryRef services()
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.
ServiceRegistryRef services()
The services registry associated with this processing context.
bool isITSTriggered() const
void setDebugTreeFileName(std::string name)
get the name of output debug file
void setUseBCFilling(bool v)
void reportTiming()
clear results of previous event reco
void setITSROFrameLengthMUS(float fums)
set ITS ROFrame duration in BC (continuous mode only)
void setTPCVDrift(const o2::tpc::VDriftCorrFact &v)
void setNHBPerTF(int n)
ITS readout mode.
void setITSTriggered(bool v)
void setTPCCorrMaps(o2::gpu::CorrectionMapsHelper *maph)
print settings
void setSkipTPCOnly(bool v)
void setMCTruthOn(bool v)
request VDrift calibration
void run(const o2::globaltracking::RecoContainer &inp, pmr::vector< o2::dataformats::TrackTPCITS > &matchedTracks, pmr::vector< o2::itsmft::TrkClusRef > &ABTrackletRefs, pmr::vector< int > &ABTrackletClusterIDs, pmr::vector< o2::MCCompLabel > &matchLabels, pmr::vector< o2::MCCompLabel > &ABTrackletLabels, pmr::vector< o2::dataformats::Triplet< float, float, float > > &calib)
void setVDriftCalib(bool v)
void setBunchFilling(const o2::BunchFilling &bf)
void setDebugFlag(UInt_t flag, bool on=true)
set the name of output debug file
void setITSROFrameLengthInBC(int nbc)
void setITSTimeBiasInBC(int n)
void setITSDictionary(const o2::itsmft::TopologyDictionary *d)
set flag to use MC truth
auto getUseMatCorrFlag() const
void setNThreads(int n)
perform all initializations
void endOfStream(framework::EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
void finaliseCCDB(framework::ConcreteDataMatcher &matcher, void *obj) final
~TPCITSMatchingDPL() override=default
TPCITSMatchingDPL(std::shared_ptr< DataRequest > dr, std::shared_ptr< o2::base::GRPGeomRequest > gr, const o2::tpc::CorrectionMapsLoaderGloOpts &sclOpts, bool useFT0, bool calib, bool skipTPCOnly, bool useMC)
void init(InitContext &ic) final
void run(ProcessingContext &pc) final
void setLumiScaleType(int32_t v)
void setLumiScaleMode(int32_t v)
void setCheckCTPIDCConsistency(bool v)
static void adopt(GeometryTGeo *raw, bool canDelete=false)
void extractCCDBInputs(o2::framework::ProcessingContext &pc)
void updateVDrift(float vdriftCorr, float vdrifRef, float driftTimeOffset=0)
bool accountCCDBInputs(const o2::framework::ConcreteDataMatcher &matcher, void *obj)
static void requestCCDBInputs(std::vector< o2::framework::InputSpec > &inputs, std::vector< o2::framework::ConfigParamSpec > &options, const CorrectionMapsLoaderGloOpts &gloOpts)
void init(o2::framework::InitContext &ic)
static void requestCCDBInputs(std::vector< o2::framework::InputSpec > &inputs, bool laser=true, bool itstpcTgl=true)
void extractCCDBInputs(o2::framework::ProcessingContext &pc, bool laser=true, bool itstpcTgl=true)
const VDriftCorrFact & getVDriftObject() const
bool accountCCDBInputs(const o2::framework::ConcreteDataMatcher &matcher, void *obj)
static std::string_view getSourceName(Source s)
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 getTPCITSMatchingSpec(o2::dataformats::GlobalTrackID::mask_t src, bool useFT0, bool calib, bool skipTPCOnly, bool useGeom, bool useMC, const o2::tpc::CorrectionMapsLoaderGloOpts &sclOpts)
create a processor spec
std::vector< T, fair::mq::pmr::polymorphic_allocator< T > > vector
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::string name
The name of the associated DataProcessorSpec.
size_t inputTimesliceId
The time pipelining id of this particular device.
void collectData(o2::framework::ProcessingContext &pc, const DataRequest &request)
int lumiType
what estimator to used for corrections scaling: 0: no scaling, 1: CTP, 2: IDC
bool checkCTPIDCconsistency
int lumiMode
what corrections method to use: 0: classical scaling, 1: Using of the derivative map,...
float refTimeOffset
additive time offset reference (\mus)
float refVDrift
reference vdrift for which factor was extracted
float getTimeOffset() const
float timeOffsetCorr
additive time offset correction (\mus)
float corrFact
drift velocity correction factor (multiplicative)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"