Project
Loading...
Searching...
No Matches
MatchHMP.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
12#ifndef ALICEO2_GLOBTRACKING_MATCHHMP_
13#define ALICEO2_GLOBTRACKING_MATCHHMP_
14
15#include <Rtypes.h>
16#include <array>
17#include <vector>
18#include <string>
19#include <gsl/span>
20#include <TStopwatch.h>
29
32#include "MathUtils/Cartesian.h"
33#include "MathUtils/Utils.h"
38
47
48#include "HMPIDBase/Geo.h"
51
52namespace o2
53{
54
55namespace globaltracking
56{
57class RecoContainer;
58}
59
60namespace dataformats
61{
62template <typename TruthElement>
64}
65
66namespace globaltracking
67{
68
70{
71
72 using Geo = o2::hmpid::Geo;
78 using matchTrack = std::pair<o2::track::TrackParCov, timeEst>;
79
80 public:
83
85 void print() const;
86 void printCandidatesHMP() const;
87
89 void setExtraTimeToleranceTRD(float val) { mExtraTimeToleranceTRD = val; }
91 float getExtraTimeToleranceTRD() const { return mExtraTimeToleranceTRD; }
92
94 void setExtraTimeToleranceTOF(float val) { mExtraTimeToleranceTOF = val; }
96 float getExtraTimeToleranceTOF() const { return mExtraTimeToleranceTOF; }
97
98 /* enum DebugFlagTypes : UInt_t {
99 MatchTreeAll = 0x1 << 1, // ///< produce matching candidates tree for all candidates
100 };
101 */
110
111 std::vector<o2::dataformats::MatchInfoHMP>& getMatchedTrackVector(o2::globaltracking::MatchHMP::trackType index) { return mMatchedTracks[index]; }
112
113 std::vector<o2::MCCompLabel>& getMatchedHMPLabelsVector(o2::globaltracking::MatchHMP::trackType index) { return mOutHMPLabels[index]; }
114
115 void setTS(unsigned long creationTime)
116 {
117 mTimestamp = creationTime;
118 }
119 unsigned long getTS() const { return mTimestamp; }
120
121 private:
122 // bool prepareFITData();
123 int prepareInteractionTimes();
124 bool prepareTracks();
125 bool prepareHMPClusters();
126 void doFastMatching();
127 void doMatching();
128
129 static int intTrkCha(o2::track::TrackParCov* pTrk, double& xPc, double& yPc, double& xRa, double& yRa, double& theta, double& phi, double bz); // find track-PC intersection, retuns chamber ID
130 static int intTrkCha(int ch, o2::dataformats::TrackHMP* pHmpTrk, double& xPc, double& yPc, double& xRa, double& yRa, double& theta, double& phi, double bz); // find track-PC intersection, retuns chamber ID
131
132 bool intersect(Double_t pnt[3], Double_t norm[3]) const;
133
134 void addTPCSeed(const o2::tpc::TrackTPC& _tr, o2::dataformats::GlobalTrackID srcGID, float time0, float terr);
135 void addITSTPCSeed(const o2::dataformats::TrackTPCITS& _tr, o2::dataformats::GlobalTrackID srcGID, float time0, float terr);
136 void addTRDSeed(const o2::trd::TrackTRD& _tr, o2::dataformats::GlobalTrackID srcGID, float time0, float terr);
137 void addTPCTOFSeed(const o2::dataformats::TrackTPCTOF& _tr, o2::dataformats::GlobalTrackID srcGID, float time0, float terr);
138 void addConstrainedSeed(o2::track::TrackParCov& trc, o2::dataformats::GlobalTrackID srcGID, timeEst timeMUS);
139
140 // Data members
141 const o2::globaltracking::RecoContainer* mRecoCont = nullptr;
142
143 o2::InteractionRecord mStartIR{0, 0};
144
145 // for derived class
146 int mCurrTracksTreeEntry = 0;
147
148 bool mMCTruthON = false;
149
151 float mBz = 0;
152 float mMaxInvPt = 999.;
153
154 // to be done later
155 float mTPCTBinMUS = 0.;
156 float mTPCTBinMUSInv = 0.;
157 float mTPCBin2Z = 0.;
158 // float mTimeTolerance = 1e3; ///< tolerance in ns for track-TOF time bracket matching
159 float mExtraTimeToleranceTRD = 0.;
160 float mExtraTimeToleranceTOF = 0.;
161 float mSigmaTimeCut = 3.;
162
163 static constexpr Double_t BC_TIME = o2::constants::lhc::LHCBunchSpacingNS; // bunch crossing in ns
164 static constexpr Double_t BC_TIME_INV = 1. / BC_TIME; // inv bunch crossing in ns
165 static constexpr Double_t BC_TIME_INPS = BC_TIME * 1000; // bunch crossing in ps
166 static constexpr Double_t BC_TIME_INPS_INV = 1. / BC_TIME_INPS; // inv bunch crossing in ps
167
168 bool mIsFIT = false;
169 bool mIsTPCused = false;
170 bool mIsITSTPCused = false;
171 bool mIsTPCTOFused = false;
172 bool mIsTPCTRDused = false;
173 bool mIsITSTPCTOFused = false;
174 bool mIsTPCTRDTOFused = false;
175 bool mIsITSTPCTRDused = false;
176 bool mIsITSTPCTRDTOFused = false;
177 bool mSetHighPurity = false;
178
179 float mTPCVDrift = -1.;
180
181 unsigned long mTimestamp = 0;
182
184 // since this info is provided by external device
185 gsl::span<const Cluster> mHMPClustersArray;
186 gsl::span<const Trigger> mHMPTriggersArray;
187
189
191 std::vector<matchTrack> mTracksWork[o2::globaltracking::MatchHMP::trackType::SIZE];
192 std::vector<Trigger> mHMPTriggersWork;
193 std::vector<o2::MCCompLabel> mTracksLblWork[o2::globaltracking::MatchHMP::trackType::SIZE];
194
195 std::vector<int> mTracksIndexCache[o2::globaltracking::MatchHMP::trackType::SIZE];
196 std::vector<int> mHMPTriggersIndexCache;
197
199 std::vector<o2::dataformats::MatchInfoHMP> mMatchedTracks[o2::globaltracking::MatchHMP::trackType::SIZE]; // this is the output of the matching -> UNCONS, CONSTR
200 std::vector<o2::MCCompLabel> mOutHMPLabels[o2::globaltracking::MatchHMP::trackType::SIZE];
201
202 std::vector<o2::dataformats::GlobalTrackID> mTrackGid[o2::globaltracking::MatchHMP::trackType::SIZE];
203 std::vector<int> mMatchedTracksIndex[o2::globaltracking::MatchHMP::trackType::SIZE]; // vector of indexes of the tracks to be matched
204
205 int mNumOfTriggers; // number of HMP triggers
206
208 static constexpr float MAXSNP = 0.85; // max snp of ITS or TPC track at xRef to be matched
209
210 TStopwatch mTimerTot;
211 TStopwatch mTimerMatchITSTPC;
212 TStopwatch mTimerMatchTPC;
213 TStopwatch mTimerDBG;
214
215 ClassDef(MatchHMP, 1);
216};
217} // namespace globaltracking
218} // namespace o2
219
220#endif
General auxilliary methods.
particle ids, masses, names class definition
Base track model for the Barrel, params only, w/o covariance.
Definition of the GeometryManager class.
Class to store event ID and index in the event for objects like track, cluster...
Some ALICE geometry constants of common interest.
Global index for barrel track: provides provenance (detectors combination), index in respective array...
Definition of a container to keep Monte Carlo truth external to simulation objects.
Class to store the output of the matching to HMPID.
Class to temporary store the output of the matching to TOF in reconstruction.
Class to perform TPC ITS matching.
useful math constants
Header to collect physics constants.
Result of refitting TPC-ITS matched track.
Result of refitting TPC with TOF match constraint.
void setExtraTimeToleranceTRD(float val)
get extra tolerance
Definition MatchHMP.h:89
std::vector< o2::dataformats::MatchInfoHMP > & getMatchedTrackVector(o2::globaltracking::MatchHMP::trackType index)
Definition MatchHMP.h:111
void printCandidatesHMP() const
set extra time tolerance
std::vector< o2::MCCompLabel > & getMatchedHMPLabelsVector(o2::globaltracking::MatchHMP::trackType index)
get vector of HMP label of matched tracks
Definition MatchHMP.h:113
void run(const o2::globaltracking::RecoContainer &inp)
< perform matching for provided input
Definition MatchHMP.cxx:64
unsigned long getTS() const
Definition MatchHMP.h:119
float getExtraTimeToleranceTOF() const
Definition MatchHMP.h:96
void setExtraTimeToleranceTOF(float val)
get extra tolerance
Definition MatchHMP.h:94
void setTS(unsigned long creationTime)
Definition MatchHMP.h:115
float getExtraTimeToleranceTRD() const
set extra time tolerance
Definition MatchHMP.h:91
HMPID cluster implementation.
Definition Cluster.h:27
HMPID detector geometry (only statics)
Definition Geo.h:76
HMPID Trigger declaration.
Definition Trigger.h:32
GLuint index
Definition glcorearb.h:781
GLuint GLfloat * val
Definition glcorearb.h:1582
constexpr double LHCBunchSpacingNS
TrackParCovF TrackParCov
Definition Track.h:33
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...