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
13
24
27
33#include "ITS3Base/SpecsV2.h"
34
35namespace o2
36{
37using namespace framework;
38using its::FastMultEstConfig;
39using its::TimeFrame;
40using its::Tracker;
41using its::TrackingParameters;
42using its::TrackITSExt;
43using its::Vertexer;
44
45namespace its3
46{
48
49TrackerDPL::TrackerDPL(std::shared_ptr<o2::base::GRPGeomRequest> gr,
50 bool isMC,
51 int trgType,
52 const its::TrackingMode& trMode,
53 const bool overrBeamEst,
54 o2::gpu::GPUDataTypes::DeviceType dType) : mGGCCDBRequest(gr),
55 mRecChain{o2::gpu::GPUReconstruction::CreateInstance(dType, true)},
56 mITS3TrackingInterface{isMC, trgType, overrBeamEst}
57{
58 mITS3TrackingInterface.setTrackingMode(trMode);
59}
60
61void TrackerDPL::init(InitContext& ic)
62{
63 mTimer.Stop();
64 mTimer.Reset();
66 mChainITS.reset(mRecChain->AddChain<o2::gpu::GPUChainITS>());
67 mITS3TrackingInterface.setTraitsFromProvider(mChainITS->GetITSVertexerTraits(),
68 mChainITS->GetITSTrackerTraits(),
69 mChainITS->GetITSTimeframe());
70 mITS3TrackingInterface.initialise();
71}
72
73void TrackerDPL::stop()
74{
75 LOGF(info, "CPU Reconstruction total timing: Cpu: %.3e Real: %.3e s in %d slots", mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
76}
77
78void TrackerDPL::run(ProcessingContext& pc)
79{
80 auto cput = mTimer.CpuTime();
81 auto realt = mTimer.RealTime();
82 mTimer.Start(false);
83 mITS3TrackingInterface.updateTimeDependentParams(pc);
84 mITS3TrackingInterface.run(pc);
85 mTimer.Stop();
86 LOGP(info, "CPU Reconstruction time for this TF {} s (cpu), {} s (wall)", mTimer.CpuTime() - cput, mTimer.RealTime() - realt);
87}
88
89void TrackerDPL::finaliseCCDB(ConcreteDataMatcher& matcher, void* obj)
90{
91 mITS3TrackingInterface.finaliseCCDB(matcher, obj);
92}
93
94void TrackerDPL::endOfStream(EndOfStreamContext& ec)
95{
96 LOGF(info, "ITS3 CA-Tracker total timing: Cpu: %.3e Real: %.3e s in %d slots", mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
97}
98
99DataProcessorSpec getTrackerSpec(bool useMC, bool useGeom, int trgType, const std::string& trModeS, const bool overrBeamEst, o2::gpu::GPUDataTypes::DeviceType dType)
100{
101 std::vector<InputSpec> inputs;
102 inputs.emplace_back("compClusters", "ITS", "COMPCLUSTERS", 0, Lifetime::Timeframe);
103 inputs.emplace_back("patterns", "ITS", "PATTERNS", 0, Lifetime::Timeframe);
104 inputs.emplace_back("ROframes", "ITS", "CLUSTERSROF", 0, Lifetime::Timeframe);
105 if (trgType == 1) {
106 inputs.emplace_back("phystrig", "ITS", "PHYSTRIG", 0, Lifetime::Timeframe);
107 } else if (trgType == 2) {
108 inputs.emplace_back("phystrig", "TRD", "TRKTRGRD", 0, Lifetime::Timeframe);
109 }
110 inputs.emplace_back("cldict", "IT3", "CLUSDICT", 0, Lifetime::Condition, ccdbParamSpec("IT3/Calib/ClusterDictionary"));
111 inputs.emplace_back("alppar", "ITS", "ALPIDEPARAM", 0, Lifetime::Condition, ccdbParamSpec("ITS/Config/AlpideParam"));
112 auto ggRequest = std::make_shared<o2::base::GRPGeomRequest>(false, // orbitResetTime
113 true, // GRPECS
114 false, // GRPLHCIF
115 true, // GRPMagField
116 true, // askMatLUT
118 inputs,
119 true);
120
121 if (!useGeom) { // load light-weight geometry
122 inputs.emplace_back("itsTGeo", "ITS", "GEOMTGEO", 0, Lifetime::Condition, ccdbParamSpec("ITS/Config/Geometry"));
123 }
124 if (overrBeamEst) {
125 inputs.emplace_back("meanvtx", "GLO", "MEANVERTEX", 0, Lifetime::Condition, ccdbParamSpec("GLO/Calib/MeanVertex", {}, 1));
126 }
127
128 std::vector<OutputSpec> outputs;
129 outputs.emplace_back("ITS", "TRACKS", 0, Lifetime::Timeframe);
130 outputs.emplace_back("ITS", "TRACKCLSID", 0, Lifetime::Timeframe);
131 outputs.emplace_back("ITS", "ITSTrackROF", 0, Lifetime::Timeframe);
132 outputs.emplace_back("ITS", "VERTICES", 0, Lifetime::Timeframe);
133 outputs.emplace_back("ITS", "VERTICESROF", 0, Lifetime::Timeframe);
134 outputs.emplace_back("ITS", "IRFRAMES", 0, Lifetime::Timeframe);
135
136 if (useMC) {
137 inputs.emplace_back("itsmclabels", "ITS", "CLUSTERSMCTR", 0, Lifetime::Timeframe);
138 inputs.emplace_back("ITSMC2ROframes", "ITS", "CLUSTERSMC2ROF", 0, Lifetime::Timeframe);
139 outputs.emplace_back("ITS", "VERTICESMCTR", 0, Lifetime::Timeframe);
140 outputs.emplace_back("ITS", "VERTICESMCPUR", 0, Lifetime::Timeframe);
141 outputs.emplace_back("ITS", "TRACKSMCTR", 0, Lifetime::Timeframe);
142 outputs.emplace_back("ITS", "ITSTrackMC2ROF", 0, Lifetime::Timeframe);
143 }
144
145 return DataProcessorSpec{
146 "its3-tracker",
147 inputs,
148 outputs,
149 AlgorithmSpec{adaptFromTask<TrackerDPL>(ggRequest, useMC, trgType,
150 trModeS == "sync" ? o2::its::TrackingMode::Sync : trModeS == "async" ? o2::its::TrackingMode::Async
152 overrBeamEst, dType)},
153 Options{}};
154}
155
156} // namespace its3
157} // namespace o2
Definition of the ITSMFT compact cluster.
Class to delimit start and end IR of certain time period.
Definition of the GeometryTGeo class.
Configuration parameters for ITS fast multiplicity estimator.
Definition of the ITSMFT ROFrame (trigger) record.
Definition of a container to keep Monte Carlo truth external to simulation objects.
Definition Physics trigger record extracted from the ITS/MFT stream.
Definition of the ITS track.
static GRPGeomHelper & instance()
void setRequest(std::shared_ptr< GRPGeomRequest > req)
TrackerDPL(std::shared_ptr< o2::base::GRPGeomRequest > gr, bool isMC, int trgType, const its::TrackingMode &trMode=its::TrackingMode::Unset, const bool overrBeamEst=false, gpu::GPUDataTypes::DeviceType dType=gpu::GPUDataTypes::DeviceType::CPU)
std::vector< ConfigParamSpec > ccdbParamSpec(std::string const &path, int runDependent, std::vector< CCDBMetadata > metadata={}, int qrate=0)
std::vector< ConfigParamSpec > Options
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...