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
32#include "ITS3Base/SpecsV2.h"
33
34namespace o2
35{
36using namespace framework;
37
38namespace its3
39{
41
42TrackerDPL::TrackerDPL(std::shared_ptr<o2::base::GRPGeomRequest> gr,
43 bool isMC,
44 int trgType,
46 const bool overrBeamEst,
47 o2::gpu::GPUDataTypes::DeviceType dType) : mGGCCDBRequest(gr),
48 mRecChain{o2::gpu::GPUReconstruction::CreateInstance(dType, true)},
49 mITS3TrackingInterface{isMC, trgType, overrBeamEst}
50{
51 mITS3TrackingInterface.setTrackingMode(trMode);
52}
53
55{
56 mTimer.Stop();
57 mTimer.Reset();
59 mChainITS.reset(mRecChain->AddChain<o2::gpu::GPUChainITS>());
60 mITS3TrackingInterface.setTraitsFromProvider(mChainITS->GetITSVertexerTraits(),
61 mChainITS->GetITSTrackerTraits(),
62 mChainITS->GetITSTimeframe());
63}
64
66{
67 LOGF(info, "CPU Reconstruction total timing: Cpu: %.3e Real: %.3e s in %d slots", mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
68}
69
71{
72 auto cput = mTimer.CpuTime();
73 auto realt = mTimer.RealTime();
74 mTimer.Start(false);
75 mITS3TrackingInterface.updateTimeDependentParams(pc);
76 mITS3TrackingInterface.run(pc);
77 mTimer.Stop();
78 LOGP(info, "CPU Reconstruction time for this TF {} s (cpu), {} s (wall)", mTimer.CpuTime() - cput, mTimer.RealTime() - realt);
79}
80
82{
83 mITS3TrackingInterface.finaliseCCDB(matcher, obj);
84}
85
87{
88 LOGF(info, "ITS3 CA-Tracker total timing: Cpu: %.3e Real: %.3e s in %d slots", mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
89}
90
91DataProcessorSpec getTrackerSpec(bool useMC, bool useGeom, int trgType, its::TrackingMode::Type trMode, const bool overrBeamEst, o2::gpu::GPUDataTypes::DeviceType dType)
92{
93 std::vector<InputSpec> inputs;
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("cldict", "IT3", "CLUSDICT", 0, Lifetime::Condition, ccdbParamSpec("IT3/Calib/ClusterDictionary"));
103 inputs.emplace_back("alppar", "ITS", "ALPIDEPARAM", 0, Lifetime::Condition, ccdbParamSpec("ITS/Config/AlpideParam"));
104 auto ggRequest = std::make_shared<o2::base::GRPGeomRequest>(false, // orbitResetTime
105 true, // GRPECS
106 false, // GRPLHCIF
107 true, // GRPMagField
108 true, // askMatLUT
110 inputs,
111 true);
112
113 if (!useGeom) { // load light-weight geometry
114 inputs.emplace_back("itsTGeo", "ITS", "GEOMTGEO", 0, Lifetime::Condition, ccdbParamSpec("ITS/Config/Geometry"));
115 }
116 if (overrBeamEst) {
117 inputs.emplace_back("meanvtx", "GLO", "MEANVERTEX", 0, Lifetime::Condition, ccdbParamSpec("GLO/Calib/MeanVertex", {}, 1));
118 }
119
120 std::vector<OutputSpec> outputs;
121 outputs.emplace_back("ITS", "TRACKS", 0, Lifetime::Timeframe);
122 outputs.emplace_back("ITS", "TRACKCLSID", 0, Lifetime::Timeframe);
123 outputs.emplace_back("ITS", "ITSTrackROF", 0, Lifetime::Timeframe);
124 outputs.emplace_back("ITS", "VERTICES", 0, Lifetime::Timeframe);
125 outputs.emplace_back("ITS", "VERTICESROF", 0, Lifetime::Timeframe);
126 outputs.emplace_back("ITS", "IRFRAMES", 0, Lifetime::Timeframe);
127
128 if (useMC) {
129 inputs.emplace_back("itsmclabels", "ITS", "CLUSTERSMCTR", 0, Lifetime::Timeframe);
130 inputs.emplace_back("ITSMC2ROframes", "ITS", "CLUSTERSMC2ROF", 0, Lifetime::Timeframe);
131 outputs.emplace_back("ITS", "VERTICESMCTR", 0, Lifetime::Timeframe);
132 outputs.emplace_back("ITS", "VERTICESMCPUR", 0, Lifetime::Timeframe);
133 outputs.emplace_back("ITS", "TRACKSMCTR", 0, Lifetime::Timeframe);
134 outputs.emplace_back("ITS", "ITSTrackMC2ROF", 0, Lifetime::Timeframe);
135 }
136
137 return DataProcessorSpec{
138 "its3-tracker",
139 inputs,
140 outputs,
141 AlgorithmSpec{adaptFromTask<TrackerDPL>(ggRequest, useMC, trgType, trMode, overrBeamEst, dType)},
142 Options{}};
143}
144
145} // namespace its3
146} // namespace o2
Definition of the ITSMFT compact cluster.
Class to delimit start and end IR of certain time period.
Definition of the GeometryTGeo class.
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
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
TrackerDPL(std::shared_ptr< o2::base::GRPGeomRequest > gr, bool isMC, int trgType, its::TrackingMode::Type trmode=its::TrackingMode::Unset, const bool overrBeamEst=false, gpu::GPUDataTypes::DeviceType dType=gpu::GPUDataTypes::DeviceType::CPU)
void run(framework::ProcessingContext &pc)
void setTrackingMode(TrackingMode::Type mode=TrackingMode::Unset)
void setTraitsFromProvider(VertexerTraitsN *, TrackerTraitsN *, TimeFrameN *)
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, its::TrackingMode::Type 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 ...