Project
Loading...
Searching...
No Matches
TRDGlobalTrackingSpec.h
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
14#ifndef O2_TRD_GLOBALTRACKING
15#define O2_TRD_GLOBALTRACKING
16
18#include "Framework/Task.h"
19#include "TStopwatch.h"
21#include "GPUO2Interface.h"
22#include "GPUTRDTracker.h"
27#include "DataFormatsTRD/PID.h"
28#include "TRDPID/PIDBase.h"
31#include <memory>
35#include "GPUO2InterfaceRefit.h"
36#include "TPCFastTransform.h"
37#include "TRDBase/RecoParam.h"
42
43#ifdef ENABLE_UPGRADES
45#endif
46
47namespace o2
48{
49namespace trd
50{
51
53{
54 public:
55 TRDGlobalTracking(bool useMC, bool withPID, PIDPolicy policy, std::shared_ptr<o2::globaltracking::DataRequest> dataRequest, std::shared_ptr<o2::base::GRPGeomRequest> gr, const o2::tpc::CorrectionMapsLoaderGloOpts& sclOpts,
56 o2::dataformats::GlobalTrackID::mask_t src, bool trigRecFilterActive, bool strict) : mUseMC(useMC), mWithPID(withPID), mDataRequest(dataRequest), mGGCCDBRequest(gr), mTrkMask(src), mTrigRecFilter(trigRecFilterActive), mStrict(strict), mPolicy(policy)
57 {
58 mTPCCorrMapsLoader.setLumiScaleType(sclOpts.lumiType);
59 mTPCCorrMapsLoader.setLumiScaleMode(sclOpts.lumiMode);
60 }
61 ~TRDGlobalTracking() override = default;
62 void init(o2::framework::InitContext& ic) final;
63 void fillMCTruthInfo(const TrackTRD& trk, o2::MCCompLabel lblSeed, std::vector<o2::MCCompLabel>& lblContainerTrd, std::vector<o2::MCCompLabel>& lblContainerMatch, const o2::dataformats::MCTruthContainer<o2::MCCompLabel>* trkltLabels) const;
64 void fillTrackTriggerRecord(const std::vector<TrackTRD>& tracks, std::vector<TrackTriggerRecord>& trigRec, const gsl::span<const o2::trd::TriggerRecord>& trackletTrigRec) const;
66 void finaliseCCDB(o2::framework::ConcreteDataMatcher& matcher, void* obj) final;
67 bool refitITSTPCTRDTrack(TrackTRD& trk, float timeTRD, o2::globaltracking::RecoContainer* recoCont);
68 bool refitTPCTRDTrack(TrackTRD& trk, float timeTRD, o2::globaltracking::RecoContainer* recoCont);
69 bool refitTRDTrack(TrackTRD& trk, float& chi2, bool inwards, bool tpcSA);
71
72 private:
73 void updateTimeDependentParams(o2::framework::ProcessingContext& pc);
74
75 o2::gpu::GPUTRDTracker* mTracker{nullptr};
76 o2::gpu::GPUReconstruction* mRec{nullptr};
77 o2::gpu::GPUChainTracking* mChainTracking{nullptr};
78 std::unique_ptr<GeometryFlat> mFlatGeo{nullptr};
79 bool mUseMC{false};
80 bool mWithPID{false};
81 float mTPCTBinMUS{.2f};
82 float mTPCTBinMUSInv{1.f / mTPCTBinMUS};
83 float mTPCVdrift{2.58f};
84 float mTPCTDriftOffset{0.f};
85 std::shared_ptr<o2::globaltracking::DataRequest> mDataRequest;
86 std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
87 o2::tpc::VDriftHelper mTPCVDriftHelper{};
88 o2::tpc::CorrectionMapsLoader mTPCCorrMapsLoader{};
90 bool mTrigRecFilter{false};
91 bool mStrict{false};
92 TStopwatch mTimer;
93 // temporary members -> should go into processor (GPUTRDTracker or additional refit processor?)
94 std::unique_ptr<o2::gpu::GPUO2InterfaceRefit> mTPCRefitter;
95 const o2::tpc::ClusterNativeAccess* mTPCClusterIdxStruct = nullptr;
96 RecoParam mRecoParam;
97 gsl::span<const Tracklet64> mTrackletsRaw;
98 gsl::span<const CalibratedTracklet> mTrackletsCalib;
99 gsl::span<const o2::tpc::TrackTPC> mTPCTracksArray;
100 gsl::span<const o2::its::TrackITS> mITSTracksArray;
101 gsl::span<const o2::itsmft::TrkClusRef> mITSABRefsArray;
102 gsl::span<const int> mITSTrackClusIdx;
103 gsl::span<const int> mITSABTrackClusIdx;
104 std::vector<o2::BaseCluster<float>> mITSClustersArray;
105 const o2::itsmft::TopologyDictionary* mITSDict = nullptr;
106#ifdef ENABLE_UPGRADES
107 const o2::its3::TopologyDictionary* mIT3Dict = nullptr;
108#endif
109 std::array<float, 5> mCovDiagInner{};
110 std::array<float, 5> mCovDiagOuter{};
111 // PID
113 std::unique_ptr<PIDBase> mBase;
114};
115
117framework::DataProcessorSpec getTRDGlobalTrackingSpec(bool useMC, o2::dataformats::GlobalTrackID::mask_t src, bool trigRecFilterActive, bool strict /* = false*/, bool withPID /* = false*/, PIDPolicy policy /* = PIDPolicy::DEFAULT*/, const o2::tpc::CorrectionMapsLoaderGloOpts& sclOpts);
118
119} // namespace trd
120} // namespace o2
121
122#endif /* O2_TRD_TRACKLETREADER */
A const (ready only) version of MCTruthContainer.
Helper class to access load maps from CCDB.
Wrapper container for different reconstructed object types.
Definition of the ClusterTopology class.
Definition of the BuildTopologyDictionary class for ITS3.
Online TRD tracker based on extrapolated TPC tracks.
Helper for geometry and GRP related CCDB requests.
Global index for barrel track: provides provenance (detectors combination), index in respective array...
This file provides the base interface for pid policies.
Definition of TPCFastTransform class.
Error parameterizations and helper functions for TRD reconstruction.
Definition of the ITS track.
Reference on ITS/MFT clusters set.
Helper class to extract VDrift from different sources.
A container to hold and manage MC truth information/labels.
void fillMCTruthInfo(const TrackTRD &trk, o2::MCCompLabel lblSeed, std::vector< o2::MCCompLabel > &lblContainerTrd, std::vector< o2::MCCompLabel > &lblContainerMatch, const o2::dataformats::MCTruthContainer< o2::MCCompLabel > *trkltLabels) const
void finaliseCCDB(o2::framework::ConcreteDataMatcher &matcher, void *obj) final
void endOfStream(o2::framework::EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
void run(o2::framework::ProcessingContext &pc) final
bool refitTRDTrack(TrackTRD &trk, float &chi2, bool inwards, bool tpcSA)
~TRDGlobalTracking() override=default
void init(o2::framework::InitContext &ic) final
TRDGlobalTracking(bool useMC, bool withPID, PIDPolicy policy, std::shared_ptr< o2::globaltracking::DataRequest > dataRequest, std::shared_ptr< o2::base::GRPGeomRequest > gr, const o2::tpc::CorrectionMapsLoaderGloOpts &sclOpts, o2::dataformats::GlobalTrackID::mask_t src, bool trigRecFilterActive, bool strict)
bool refitITSTPCTRDTrack(TrackTRD &trk, float timeTRD, o2::globaltracking::RecoContainer *recoCont)
void fillTrackTriggerRecord(const std::vector< TrackTRD > &tracks, std::vector< TrackTriggerRecord > &trigRec, const gsl::span< const o2::trd::TriggerRecord > &trackletTrigRec) const
bool refitTPCTRDTrack(TrackTRD &trk, float timeTRD, o2::globaltracking::RecoContainer *recoCont)
GLenum src
Definition glcorearb.h:1767
PIDPolicy
Option for available PID policies.
Definition PID.h:29
@ DEFAULT
The default option.
framework::DataProcessorSpec getTRDGlobalTrackingSpec(bool useMC, o2::dataformats::GlobalTrackID::mask_t src, bool trigRecFilterActive, bool strict, bool withPID, PIDPolicy policy, const o2::tpc::CorrectionMapsLoaderGloOpts &sclOpts)
create a processor spec
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
int lumiType
what estimator to used for corrections scaling: 0: no scaling, 1: CTP, 2: IDC
int lumiMode
what corrections method to use: 0: classical scaling, 1: Using of the derivative map,...