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 bool doStag,
45 int trgType,
47 const bool overrBeamEst,
48 o2::gpu::gpudatatypes::DeviceType dType) : mGGCCDBRequest(gr),
49 mRecChain{o2::gpu::GPUReconstruction::CreateInstance(dType, true)},
50 mITS3TrackingInterface{isMC, doStag, trgType, overrBeamEst}
51{
52 mITS3TrackingInterface.setTrackingMode(trMode);
53}
54
56{
57 mTimer.Stop();
58 mTimer.Reset();
60 mChainITS.reset(mRecChain->AddChain<o2::gpu::GPUChainITS>());
61 mITS3TrackingInterface.setTraitsFromProvider(mChainITS->GetITSVertexerTraits(),
62 mChainITS->GetITSTrackerTraits(),
63 mChainITS->GetITSTimeframe());
64}
65
67{
68 LOGF(info, "CPU Reconstruction total timing: Cpu: %.3e Real: %.3e s in %d slots", mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
69}
70
72{
73 auto cput = mTimer.CpuTime();
74 auto realt = mTimer.RealTime();
75 mTimer.Start(false);
76 mITS3TrackingInterface.updateTimeDependentParams(pc);
77 mITS3TrackingInterface.run(pc);
78 mTimer.Stop();
79 LOGP(info, "CPU Reconstruction time for this TF {} s (cpu), {} s (wall)", mTimer.CpuTime() - cput, mTimer.RealTime() - realt);
80}
81
83{
84 mITS3TrackingInterface.finaliseCCDB(matcher, obj);
85}
86
88{
89 LOGF(info, "ITS3 CA-Tracker total timing: Cpu: %.3e Real: %.3e s in %d slots", mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
90}
91
92DataProcessorSpec getTrackerSpec(bool useMC, bool doStag, bool useGeom, int trgType, its::TrackingMode::Type trMode, const bool overrBeamEst, o2::gpu::gpudatatypes::DeviceType dType)
93{
94 std::vector<InputSpec> inputs;
95 std::vector<OutputSpec> outputs;
96 for (uint32_t iLayer{0}; iLayer < (doStag ? 7 : 1); ++iLayer) {
97 inputs.emplace_back("compClusters", "ITS", "COMPCLUSTERS", iLayer, Lifetime::Timeframe);
98 inputs.emplace_back("patterns", "ITS", "PATTERNS", iLayer, Lifetime::Timeframe);
99 inputs.emplace_back("ROframes", "ITS", "CLUSTERSROF", iLayer, Lifetime::Timeframe);
100 if (useMC) {
101 inputs.emplace_back("itsmclabels", "ITS", "CLUSTERSMCTR", iLayer, Lifetime::Timeframe);
102 }
103 }
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("itscldict", "IT3", "CLUSDICT", 0, Lifetime::Condition, ccdbParamSpec("IT3/Calib/ClusterDictionary"));
110 inputs.emplace_back("itsalppar", "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 outputs.emplace_back("ITS", "TRACKS", 0, Lifetime::Timeframe);
128 outputs.emplace_back("ITS", "TRACKCLSID", 0, Lifetime::Timeframe);
129 outputs.emplace_back("ITS", "ITSTrackROF", 0, Lifetime::Timeframe);
130 outputs.emplace_back("ITS", "VERTICES", 0, Lifetime::Timeframe);
131 outputs.emplace_back("ITS", "VERTICESROF", 0, Lifetime::Timeframe);
132 outputs.emplace_back("ITS", "IRFRAMES", 0, Lifetime::Timeframe);
133
134 if (useMC) {
135 outputs.emplace_back("ITS", "VERTICESMCTR", 0, Lifetime::Timeframe);
136 outputs.emplace_back("ITS", "VERTICESMCPUR", 0, Lifetime::Timeframe);
137 outputs.emplace_back("ITS", "TRACKSMCTR", 0, Lifetime::Timeframe);
138 }
139
140 return DataProcessorSpec{
141 .name = "its3-tracker",
142 .inputs = inputs,
143 .outputs = outputs,
144 .algorithm = AlgorithmSpec{adaptFromTask<TrackerDPL>(ggRequest, useMC, doStag, trgType, trMode, overrBeamEst, dType)},
145 .options = Options{}};
146}
147
148} // namespace its3
149} // namespace o2
Definition of the ITSMFT compact cluster.
unsigned int uint32_t
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 run(framework::ProcessingContext &pc) final
void init(framework::InitContext &ic) final
TrackerDPL(std::shared_ptr< o2::base::GRPGeomRequest > gr, bool isMC, bool doStag, int trgType, its::TrackingMode::Type 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 run(framework::ProcessingContext &pc)
void setTrackingMode(TrackingMode::Type mode=TrackingMode::Unset)
virtual void updateTimeDependentParams(framework::ProcessingContext &pc)
void setTraitsFromProvider(VertexerTraitsN *, TrackerTraitsN *, TimeFrameN *)
std::vector< ConfigParamSpec > ccdbParamSpec(std::string const &path, int runDependent, std::vector< CCDBMetadata > metadata={}, int qrate=0)
framework::DataProcessorSpec getTrackerSpec(bool useMC, bool doStag, 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 ...