Project
Loading...
Searching...
No Matches
TrackerSpec.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 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
21
22namespace o2
23{
24using namespace framework;
25namespace its
26{
27TrackerDPL::TrackerDPL(std::shared_ptr<o2::base::GRPGeomRequest> gr,
28 bool isMC,
29 int trgType,
30 const TrackingMode::Type trMode,
31 const bool overrBeamEst,
32 o2::gpu::gpudatatypes::DeviceType dType) : mGGCCDBRequest(gr),
33 mRecChain{o2::gpu::GPUReconstruction::CreateInstance(dType, true)},
34 mITSTrackingInterface{isMC, trgType, overrBeamEst}
35{
36 mITSTrackingInterface.setTrackingMode(trMode);
37}
38
40{
41 mTimer.Stop();
42 mTimer.Reset();
44 mChainITS.reset(mRecChain->AddChain<o2::gpu::GPUChainITS>());
45 mITSTrackingInterface.setTraitsFromProvider(mChainITS->GetITSVertexerTraits(),
46 mChainITS->GetITSTrackerTraits(),
47 mChainITS->GetITSTimeframe());
48}
49
51{
52 end();
53}
54
56{
57 auto cput = mTimer.CpuTime();
58 auto realt = mTimer.RealTime();
59 mTimer.Start(false);
60 mITSTrackingInterface.updateTimeDependentParams(pc);
61 mITSTrackingInterface.run(pc);
62 mTimer.Stop();
63 LOGP(info, "CPU Reconstruction time for this TF {:.2f} s (cpu), {:.2f} s (wall)", mTimer.CpuTime() - cput, mTimer.RealTime() - realt);
64 static bool first = true;
65 if (first) {
66 first = false;
70 }
71 }
72}
73
75{
76 mITSTrackingInterface.finaliseCCDB(matcher, obj);
77}
78
83
84void TrackerDPL::end()
85{
86 mITSTrackingInterface.printSummary();
87 LOGF(info, "ITS CA-Tracker total timing: Cpu: %.3e Real: %.3e s in %d slots", mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
88}
89
90DataProcessorSpec getTrackerSpec(bool useMC, bool useGeom, int trgType, TrackingMode::Type trMode, const bool overrBeamEst, o2::gpu::gpudatatypes::DeviceType dType)
91{
92 std::vector<InputSpec> inputs;
93
94 inputs.emplace_back("compClusters", "ITS", "COMPCLUSTERS", 0, Lifetime::Timeframe);
95 inputs.emplace_back("patterns", "ITS", "PATTERNS", 0, Lifetime::Timeframe);
96 inputs.emplace_back("ROframes", "ITS", "CLUSTERSROF", 0, Lifetime::Timeframe);
97 if (trgType == 1) {
98 inputs.emplace_back("phystrig", "ITS", "PHYSTRIG", 0, Lifetime::Timeframe);
99 } else if (trgType == 2) {
100 inputs.emplace_back("phystrig", "TRD", "TRKTRGRD", 0, Lifetime::Timeframe);
101 }
102 inputs.emplace_back("itscldict", "ITS", "CLUSDICT", 0, Lifetime::Condition, ccdbParamSpec("ITS/Calib/ClusterDictionary"));
103 inputs.emplace_back("itsalppar", "ITS", "ALPIDEPARAM", 0, Lifetime::Condition, ccdbParamSpec("ITS/Config/AlpideParam"));
104 auto ggRequest = std::make_shared<o2::base::GRPGeomRequest>(false, // orbitResetTime
105 true, // GRPECS=true
106 false, // GRPLHCIF
107 true, // GRPMagField
108 true, // askMatLUT
110 inputs,
111 true);
112 if (!useGeom) {
113 ggRequest->addInput({"itsTGeo", "ITS", "GEOMTGEO", 0, Lifetime::Condition, framework::ccdbParamSpec("ITS/Config/Geometry")}, inputs);
114 }
115 if (overrBeamEst) {
116 inputs.emplace_back("meanvtx", "GLO", "MEANVERTEX", 0, Lifetime::Condition, ccdbParamSpec("GLO/Calib/MeanVertex", {}, 1));
117 }
118
119 std::vector<OutputSpec> outputs;
120 outputs.emplace_back("ITS", "TRACKS", 0, Lifetime::Timeframe);
121 outputs.emplace_back("ITS", "TRACKCLSID", 0, Lifetime::Timeframe);
122 outputs.emplace_back("ITS", "ITSTrackROF", 0, Lifetime::Timeframe);
123 outputs.emplace_back("ITS", "VERTICES", 0, Lifetime::Timeframe);
124 outputs.emplace_back("ITS", "VERTICESROF", 0, Lifetime::Timeframe);
125 outputs.emplace_back("ITS", "IRFRAMES", 0, Lifetime::Timeframe);
126
127 if (useMC) {
128 inputs.emplace_back("itsmclabels", "ITS", "CLUSTERSMCTR", 0, Lifetime::Timeframe);
129 inputs.emplace_back("ITSMC2ROframes", "ITS", "CLUSTERSMC2ROF", 0, Lifetime::Timeframe);
130 outputs.emplace_back("ITS", "VERTICESMCTR", 0, Lifetime::Timeframe);
131 outputs.emplace_back("ITS", "VERTICESMCPUR", 0, Lifetime::Timeframe);
132 outputs.emplace_back("ITS", "TRACKSMCTR", 0, Lifetime::Timeframe);
133 outputs.emplace_back("ITS", "ITSTrackMC2ROF", 0, Lifetime::Timeframe);
135 outputs.emplace_back("ITS", "VERTICESMCTRCONT", 0, Lifetime::Timeframe);
136 }
137 }
138
139 return DataProcessorSpec{
140 "its-tracker",
141 inputs,
142 outputs,
143 AlgorithmSpec{adaptFromTask<TrackerDPL>(ggRequest,
144 useMC,
145 trgType,
146 trMode,
147 overrBeamEst,
148 dType)},
149 Options{}};
150}
151
152} // namespace its
153} // 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:115
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, 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 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