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