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
44#include "TPCFastTransform.h"
48
49#include "HMPIDBase/Geo.h"
52
53namespace o2
54{
55
56namespace globaltracking
57{
58class RecoContainer;
59}
60
61namespace dataformats
62{
63template <typename TruthElement>
65}
66
67namespace globaltracking
68{
69
71{
72
73 using Geo = o2::hmpid::Geo;
79 using matchTrack = std::pair<o2::track::TrackParCov, timeEst>;
80
81 public:
84
86 void print() const;
87 void printCandidatesHMP() const;
88
90 void setExtraTimeToleranceTRD(float val) { mExtraTimeToleranceTRD = val; }
92 float getExtraTimeToleranceTRD() const { return mExtraTimeToleranceTRD; }
93
95 void setExtraTimeToleranceTOF(float val) { mExtraTimeToleranceTOF = val; }
97 float getExtraTimeToleranceTOF() const { return mExtraTimeToleranceTOF; }
98
99 /* enum DebugFlagTypes : UInt_t {
100 MatchTreeAll = 0x1 << 1, // ///< produce matching candidates tree for all candidates
101 };
102 */
111
112 std::vector<o2::dataformats::MatchInfoHMP>& getMatchedTrackVector(o2::globaltracking::MatchHMP::trackType index) { return mMatchedTracks[index]; }
113
114 std::vector<o2::MCCompLabel>& getMatchedHMPLabelsVector(o2::globaltracking::MatchHMP::trackType index) { return mOutHMPLabels[index]; }
115
116 void setTS(unsigned long creationTime)
117 {
118 mTimestamp = creationTime;
119 }
120 unsigned long getTS() const { return mTimestamp; }
121
122 private:
123 // bool prepareFITData();
124 int prepareInteractionTimes();
125 bool prepareTracks();
126 bool prepareHMPClusters();
127 void doFastMatching();
128 void doMatching();
129
130 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
131 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
132
133 bool intersect(Double_t pnt[3], Double_t norm[3]) const;
134
135 void addTPCSeed(const o2::tpc::TrackTPC& _tr, o2::dataformats::GlobalTrackID srcGID, float time0, float terr);
136 void addITSTPCSeed(const o2::dataformats::TrackTPCITS& _tr, o2::dataformats::GlobalTrackID srcGID, float time0, float terr);
137 void addTRDSeed(const o2::trd::TrackTRD& _tr, o2::dataformats::GlobalTrackID srcGID, float time0, float terr);
138 void addTPCTOFSeed(const o2::dataformats::TrackTPCTOF& _tr, o2::dataformats::GlobalTrackID srcGID, float time0, float terr);
139 void addConstrainedSeed(o2::track::TrackParCov& trc, o2::dataformats::GlobalTrackID srcGID, timeEst timeMUS);
140
141 // Data members
142 const o2::globaltracking::RecoContainer* mRecoCont = nullptr;
143
144 o2::InteractionRecord mStartIR{0, 0};
145
146 // for derived class
147 int mCurrTracksTreeEntry = 0;
148
149 bool mMCTruthON = false;
150
152 float mBz = 0;
153 float mMaxInvPt = 999.;
154
155 // to be done later
156 float mTPCTBinMUS = 0.;
157 float mTPCTBinMUSInv = 0.;
158 float mTPCBin2Z = 0.;
159 // float mTimeTolerance = 1e3; ///< tolerance in ns for track-TOF time bracket matching
160 float mExtraTimeToleranceTRD = 0.;
161 float mExtraTimeToleranceTOF = 0.;
162 float mSigmaTimeCut = 3.;
163
164 static constexpr Double_t BC_TIME = o2::constants::lhc::LHCBunchSpacingNS; // bunch crossing in ns
165 static constexpr Double_t BC_TIME_INV = 1. / BC_TIME; // inv bunch crossing in ns
166 static constexpr Double_t BC_TIME_INPS = BC_TIME * 1000; // bunch crossing in ps
167 static constexpr Double_t BC_TIME_INPS_INV = 1. / BC_TIME_INPS; // inv bunch crossing in ps
168
169 bool mIsFIT = false;
170 bool mIsTPCused = false;
171 bool mIsITSTPCused = false;
172 bool mIsTPCTOFused = false;
173 bool mIsTPCTRDused = false;
174 bool mIsITSTPCTOFused = false;
175 bool mIsTPCTRDTOFused = false;
176 bool mIsITSTPCTRDused = false;
177 bool mIsITSTPCTRDTOFused = false;
178 bool mSetHighPurity = false;
179
180 float mTPCVDrift = -1.;
181
182 unsigned long mTimestamp = 0;
183
185 // since this info is provided by external device
186 gsl::span<const Cluster> mHMPClustersArray;
187 gsl::span<const Trigger> mHMPTriggersArray;
188
190
192 std::vector<matchTrack> mTracksWork[o2::globaltracking::MatchHMP::trackType::SIZE];
193 std::vector<Trigger> mHMPTriggersWork;
194 std::vector<o2::MCCompLabel> mTracksLblWork[o2::globaltracking::MatchHMP::trackType::SIZE];
195
196 std::vector<int> mTracksIndexCache[o2::globaltracking::MatchHMP::trackType::SIZE];
197 std::vector<int> mHMPTriggersIndexCache;
198
200 std::vector<o2::dataformats::MatchInfoHMP> mMatchedTracks[o2::globaltracking::MatchHMP::trackType::SIZE]; // this is the output of the matching -> UNCONS, CONSTR
201 std::vector<o2::MCCompLabel> mOutHMPLabels[o2::globaltracking::MatchHMP::trackType::SIZE];
202
203 std::vector<o2::dataformats::GlobalTrackID> mTrackGid[o2::globaltracking::MatchHMP::trackType::SIZE];
204 std::vector<int> mMatchedTracksIndex[o2::globaltracking::MatchHMP::trackType::SIZE]; // vector of indexes of the tracks to be matched
205
206 int mNumOfTriggers; // number of HMP triggers
207
209 static constexpr float MAXSNP = 0.85; // max snp of ITS or TPC track at xRef to be matched
210
211 TStopwatch mTimerTot;
212 TStopwatch mTimerMatchITSTPC;
213 TStopwatch mTimerMatchTPC;
214 TStopwatch mTimerDBG;
215
216 ClassDef(MatchHMP, 1);
217};
218} // namespace globaltracking
219} // namespace o2
220
221#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.
Definition of TPCFastTransform class.
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:90
std::vector< o2::dataformats::MatchInfoHMP > & getMatchedTrackVector(o2::globaltracking::MatchHMP::trackType index)
Definition MatchHMP.h:112
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:114
void run(const o2::globaltracking::RecoContainer &inp)
< perform matching for provided input
Definition MatchHMP.cxx:64
unsigned long getTS() const
Definition MatchHMP.h:120
float getExtraTimeToleranceTOF() const
Definition MatchHMP.h:97
void setExtraTimeToleranceTOF(float val)
get extra tolerance
Definition MatchHMP.h:95
void setTS(unsigned long creationTime)
Definition MatchHMP.h:116
float getExtraTimeToleranceTRD() const
set extra time tolerance
Definition MatchHMP.h:92
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 ...