Project
Loading...
Searching...
No Matches
TrackerSpec.cxx
Go to the documentation of this file.
1// Copyright 2019-2026 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#include <vector>
13
22
23namespace o2
24{
25using namespace framework;
26namespace its
27{
28TrackerDPL::TrackerDPL(std::shared_ptr<o2::base::GRPGeomRequest> gr,
29 bool isMC,
30 bool doStag,
31 int trgType,
32 const TrackingMode::Type trMode,
33 const bool overrBeamEst,
34 o2::gpu::gpudatatypes::DeviceType dType) : mGGCCDBRequest(gr),
35 mRecChain{o2::gpu::GPUReconstruction::CreateInstance(dType, true)},
36 mITSTrackingInterface{isMC, doStag, trgType, overrBeamEst}
37{
38 mITSTrackingInterface.setTrackingMode(trMode);
39}
40
42{
43 mTimer.Stop();
44 mTimer.Reset();
46 mChainITS.reset(mRecChain->AddChain<o2::gpu::GPUChainITS>());
47 mITSTrackingInterface.setTraitsFromProvider(mChainITS->GetITSVertexerTraits(),
48 mChainITS->GetITSTrackerTraits(),
49 mChainITS->GetITSTimeframe());
50}
51
53{
54 end();
55}
56
58{
59 auto cput = mTimer.CpuTime();
60 auto realt = mTimer.RealTime();
61 mTimer.Start(false);
62 mITSTrackingInterface.updateTimeDependentParams(pc);
63 mITSTrackingInterface.run(pc);
64 mTimer.Stop();
65 LOGP(info, "CPU Reconstruction time for this TF {:.2f} s (cpu), {:.2f} s (wall)", mTimer.CpuTime() - cput, mTimer.RealTime() - realt);
66 static bool first = true;
67 if (first) {
68 first = false;
72 }
73 }
74}
75
77{
78 mITSTrackingInterface.finaliseCCDB(matcher, obj);
79}
80
85
86void TrackerDPL::end()
87{
88 if (static bool printOnce{false}; !printOnce) {
89 printOnce = true;
90 mITSTrackingInterface.printSummary();
91 LOGF(info, "ITS CA-Tracker total timing: Cpu: %.3e Real: %.3e s in %d slots", mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
92 }
93}
94
95DataProcessorSpec getTrackerSpec(bool useMC, bool doStag, bool useGeom, int trgType, TrackingMode::Type trMode, const bool overrBeamEst, o2::gpu::gpudatatypes::DeviceType dType)
96{
98 std::vector<InputSpec> inputs;
99 for (int iLayer = 0; iLayer < mLayers; ++iLayer) {
100 inputs.emplace_back("compClusters", "ITS", "COMPCLUSTERS", iLayer, Lifetime::Timeframe);
101 inputs.emplace_back("patterns", "ITS", "PATTERNS", iLayer, Lifetime::Timeframe);
102 inputs.emplace_back("ROframes", "ITS", "CLUSTERSROF", iLayer, Lifetime::Timeframe);
103 if (useMC) {
104 inputs.emplace_back("itsmclabels", "ITS", "CLUSTERSMCTR", iLayer, Lifetime::Timeframe);
105 }
106 }
107 if (trgType == 1) {
108 inputs.emplace_back("phystrig", "ITS", "PHYSTRIG", 0, Lifetime::Timeframe);
109 } else if (trgType == 2) {
110 inputs.emplace_back("phystrig", "TRD", "TRKTRGRD", 0, Lifetime::Timeframe);
111 }
112 inputs.emplace_back("itscldict", "ITS", "CLUSDICT", 0, Lifetime::Condition, ccdbParamSpec("ITS/Calib/ClusterDictionary"));
113 inputs.emplace_back("itsalppar", "ITS", "ALPIDEPARAM", 0, Lifetime::Condition, ccdbParamSpec("ITS/Config/AlpideParam"));
114 auto ggRequest = std::make_shared<o2::base::GRPGeomRequest>(false, // orbitResetTime
115 true, // GRPECS=true
116 false, // GRPLHCIF
117 true, // GRPMagField
118 true, // askMatLUT
120 inputs,
121 true);
122 if (!useGeom) {
123 ggRequest->addInput({"itsTGeo", "ITS", "GEOMTGEO", 0, Lifetime::Condition, framework::ccdbParamSpec("ITS/Config/Geometry")}, inputs);
124 }
125 if (overrBeamEst) {
126 inputs.emplace_back("meanvtx", "GLO", "MEANVERTEX", 0, Lifetime::Condition, ccdbParamSpec("GLO/Calib/MeanVertex", {}, 1));
127 }
128
129 std::vector<OutputSpec> outputs;
130 outputs.emplace_back("ITS", "TRACKS", 0, Lifetime::Timeframe);
131 outputs.emplace_back("ITS", "TRACKCLSID", 0, Lifetime::Timeframe);
132 outputs.emplace_back("ITS", "ITSTrackROF", 0, Lifetime::Timeframe);
133 outputs.emplace_back("ITS", "VERTICES", 0, Lifetime::Timeframe);
134 outputs.emplace_back("ITS", "VERTICESROF", 0, Lifetime::Timeframe);
135 outputs.emplace_back("ITS", "IRFRAMES", 0, Lifetime::Timeframe);
136 if (useMC) {
137 outputs.emplace_back("ITS", "VERTICESMCTR", 0, Lifetime::Timeframe);
138 outputs.emplace_back("ITS", "VERTICESMCPUR", 0, Lifetime::Timeframe);
139 outputs.emplace_back("ITS", "TRACKSMCTR", 0, Lifetime::Timeframe);
140 }
141
142 return DataProcessorSpec{
143 .name = "its-tracker",
144 .inputs = inputs,
145 .outputs = outputs,
146 .algorithm = AlgorithmSpec{adaptFromTask<TrackerDPL>(ggRequest,
147 useMC,
148 doStag,
149 trgType,
150 trMode,
151 overrBeamEst,
152 dType)},
153 .options = Options{}};
154}
155
156} // namespace its
157} // namespace o2
static GRPGeomHelper & instance()
void setRequest(std::shared_ptr< GRPGeomRequest > req)
static std::string getConfigOutputFileName(const std::string &procName, const std::string &confName="", bool json=true)
Definition NameConf.cxx:120
static void write(std::string const &filename, std::string const &keyOnly="")
ServiceRegistryRef services()
The services registry associated with this processing context.
void run(framework::ProcessingContext &pc)
void setTrackingMode(TrackingMode::Type mode=TrackingMode::Unset)
virtual void updateTimeDependentParams(framework::ProcessingContext &pc)
virtual void finaliseCCDB(framework::ConcreteDataMatcher &matcher, void *obj)
void setTraitsFromProvider(VertexerTraitsN *, TrackerTraitsN *, TimeFrameN *)
void stop() final
This is invoked on stop.
TrackerDPL(std::shared_ptr< o2::base::GRPGeomRequest > gr, bool isMC, bool doStag, int trgType, const TrackingMode::Type trMode=TrackingMode::Unset, const bool overrBeamEst=false, o2::gpu::gpudatatypes::DeviceType dType=o2::gpu::gpudatatypes::DeviceType::CPU)
void init(framework::InitContext &ic) final
void finaliseCCDB(framework::ConcreteDataMatcher &matcher, void *obj) final
void endOfStream(framework::EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
void run(framework::ProcessingContext &pc) final
GLuint GLuint end
Definition glcorearb.h:469
std::vector< ConfigParamSpec > ccdbParamSpec(std::string const &path, int runDependent, std::vector< CCDBMetadata > metadata={}, int qrate=0)
std::vector< ConfigParamSpec > Options
framework::DataProcessorSpec getTrackerSpec(bool useMC, bool doStag, bool useGeom, int useTrig, TrackingMode::Type trMode, const bool overrBeamEst=false, o2::gpu::gpudatatypes::DeviceType dType=o2::gpu::gpudatatypes::DeviceType::CPU)
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.
Definition DeviceSpec.h:50
size_t inputTimesliceId
The time pipelining id of this particular device.
Definition DeviceSpec.h:68
static constexpr int getNLayers()