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
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}
71
73{
74 LOGF(info, "CPU Reconstruction total timing: Cpu: %.3e Real: %.3e s in %d slots", mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
75}
76
78{
79 auto cput = mTimer.CpuTime();
80 auto realt = mTimer.RealTime();
81 mTimer.Start(false);
82 mITS3TrackingInterface.updateTimeDependentParams(pc);
83 mITS3TrackingInterface.run(pc);
84 mTimer.Stop();
85 LOGP(info, "CPU Reconstruction time for this TF {} s (cpu), {} s (wall)", mTimer.CpuTime() - cput, mTimer.RealTime() - realt);
86}
87
89{
90 mITS3TrackingInterface.finaliseCCDB(matcher, obj);
91}
92
94{
95 LOGF(info, "ITS3 CA-Tracker total timing: Cpu: %.3e Real: %.3e s in %d slots", mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
96}
97
98DataProcessorSpec getTrackerSpec(bool useMC, bool useGeom, int trgType, const std::string& trModeS, const bool overrBeamEst, o2::gpu::GPUDataTypes::DeviceType dType)
99{
100 std::vector<InputSpec> inputs;
101 inputs.emplace_back("compClusters", "ITS", "COMPCLUSTERS", 0, Lifetime::Timeframe);
102 inputs.emplace_back("patterns", "ITS", "PATTERNS", 0, Lifetime::Timeframe);
103 inputs.emplace_back("ROframes", "ITS", "CLUSTERSROF", 0, Lifetime::Timeframe);
104 if (trgType == 1) {
105 inputs.emplace_back("phystrig", "ITS", "PHYSTRIG", 0, Lifetime::Timeframe);
106 } else if (trgType == 2) {
107 inputs.emplace_back("phystrig", "TRD", "TRKTRGRD", 0, Lifetime::Timeframe);
108 }
109 inputs.emplace_back("cldict", "IT3", "CLUSDICT", 0, Lifetime::Condition, ccdbParamSpec("IT3/Calib/ClusterDictionary"));
110 inputs.emplace_back("alppar", "ITS", "ALPIDEPARAM", 0, Lifetime::Condition, ccdbParamSpec("ITS/Config/AlpideParam"));
111 auto ggRequest = std::make_shared<o2::base::GRPGeomRequest>(false, // orbitResetTime
112 true, // GRPECS
113 false, // GRPLHCIF
114 true, // GRPMagField
115 true, // askMatLUT
117 inputs,
118 true);
119
120 if (!useGeom) { // load light-weight geometry
121 inputs.emplace_back("itsTGeo", "ITS", "GEOMTGEO", 0, Lifetime::Condition, ccdbParamSpec("ITS/Config/Geometry"));
122 }
123 if (overrBeamEst) {
124 inputs.emplace_back("meanvtx", "GLO", "MEANVERTEX", 0, Lifetime::Condition, ccdbParamSpec("GLO/Calib/MeanVertex", {}, 1));
125 }
126
127 std::vector<OutputSpec> outputs;
128 outputs.emplace_back("ITS", "TRACKS", 0, Lifetime::Timeframe);
129 outputs.emplace_back("ITS", "TRACKCLSID", 0, Lifetime::Timeframe);
130 outputs.emplace_back("ITS", "ITSTrackROF", 0, Lifetime::Timeframe);
131 outputs.emplace_back("ITS", "VERTICES", 0, Lifetime::Timeframe);
132 outputs.emplace_back("ITS", "VERTICESROF", 0, Lifetime::Timeframe);
133 outputs.emplace_back("ITS", "IRFRAMES", 0, Lifetime::Timeframe);
134
135 if (useMC) {
136 inputs.emplace_back("itsmclabels", "ITS", "CLUSTERSMCTR", 0, Lifetime::Timeframe);
137 inputs.emplace_back("ITSMC2ROframes", "ITS", "CLUSTERSMC2ROF", 0, Lifetime::Timeframe);
138 outputs.emplace_back("ITS", "VERTICESMCTR", 0, Lifetime::Timeframe);
139 outputs.emplace_back("ITS", "VERTICESMCPUR", 0, Lifetime::Timeframe);
140 outputs.emplace_back("ITS", "TRACKSMCTR", 0, Lifetime::Timeframe);
141 outputs.emplace_back("ITS", "ITSTrackMC2ROF", 0, Lifetime::Timeframe);
142 }
143
144 return DataProcessorSpec{
145 "its3-tracker",
146 inputs,
147 outputs,
148 AlgorithmSpec{adaptFromTask<TrackerDPL>(ggRequest, useMC, trgType,
149 trModeS == "sync" ? o2::its::TrackingMode::Sync : trModeS == "async" ? o2::its::TrackingMode::Async
151 overrBeamEst, dType)},
152 Options{}};
153}
154
155} // namespace its3
156} // 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)
void finaliseCCDB(framework::ConcreteDataMatcher &matcher, void *obj) final
void updateTimeDependentParams(framework::ProcessingContext &pc) final
void run(framework::ProcessingContext &pc) final
void init(framework::InitContext &ic) final
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)
void endOfStream(framework::EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
void stop() final
This is invoked on stop.
void finaliseCCDB(framework::ConcreteDataMatcher &matcher, void *obj) final
void setTraitsFromProvider(VertexerTraits *, TrackerTraits *, TimeFrame *)
void run(framework::ProcessingContext &pc)
void setTrackingMode(TrackingMode mode=TrackingMode::Unset)
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, const std::string &trMode, const bool overrBeamEst=false, gpu::GPUDataTypes::DeviceType dType=gpu::GPUDataTypes::DeviceType::CPU)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...