Project
Loading...
Searching...
No Matches
MatchCosmics.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
15
16#ifndef ALICEO2_MATCH_COSMICS
17#define ALICEO2_MATCH_COSMICS
18
19#include <Rtypes.h>
30
31#define _ALLOW_DEBUG_TREES_COSM // to allow debug and control tree output
32
33namespace o2
34{
35namespace tpc
36{
37class VDriftCorrFact;
38}
39namespace gpu
40{
41class TPCFastTransformPOD;
42}
43namespace globaltracking
44{
45
46namespace o2d = o2::dataformats;
47
50class RecoContainer;
51
53{
54 public:
55 static constexpr int Zero = 0;
56 static constexpr int MinusOne = -1;
57 static constexpr int MinusTen = -10;
58 static constexpr int Validated = -2;
59 static constexpr int Reject = MinusTen;
72
73 using InfoAccessor = o2d::AbstractRefAccessor<int, GTrackID::NSources>; // there is no unique <Info> structure, so the default return type is dummy (int)
74
76 struct MatchRecord {
77 int id0 = MinusOne;
78 int id1 = MinusOne;
79 float chi2 = -1.f;
80 int next = MinusOne;
81 };
82
92 void setITSROFrameLengthMUS(float fums) { mITSROFrameLengthMUS = fums; }
93 void setITSDict(const o2::itsmft::TopologyDictionary* dict) { mITSDict = dict; }
95 void setUseMC(bool mc) { mUseMC = mc; }
96 void setUsePVInfo(bool v) { mUsePVInfo = v; }
97 void init();
98 void end();
99
100 auto getCosmicTracks() const { return mCosmicTracks; }
101 auto getCosmicTracksLbl() const { return mCosmicTracksLbl; }
102
103#ifdef _ALLOW_DEBUG_TREES_COSM
104 enum DebugFlagTypes : UInt_t {
106 MatchTreeAccOnly = 0x1 << 1
107 };
109 bool isDebugFlag(UInt_t flags) const { return mDBGFlags & flags; }
110
112 UInt_t getDebugFlags() const { return mDBGFlags; }
113
115 void setDebugFlag(UInt_t flag, bool on = true);
116
118 void setDebugTreeFileName(std::string name)
119 {
120 if (!name.empty()) {
121 mDebugTreeFileName = name;
122 }
123 }
124
126 const std::string& getDebugTreeFileName() const { return mDebugTreeFileName; }
127#endif
128
129 private:
130 void updateTimeDependentParams();
131 RejFlag checkPair(int i, int j);
132 void registerMatch(int i, int j, float chi2);
133 void suppressMatch(int partner0, int partner1);
134 void createSeeds(const o2::globaltracking::RecoContainer& data);
135 bool validateMatch(int partner0);
136 void selectWinners();
137 void refitWinners(const o2::globaltracking::RecoContainer& data);
139
140 std::vector<TrackSeed> mSeeds;
141 std::vector<MatchRecord> mRecords;
142 std::vector<int> mWinners;
143 const o2::itsmft::TopologyDictionary* mITSDict = nullptr; // cluster patterns dictionary
144 const o2::gpu::TPCFastTransformPOD* mTPCCorrMaps = nullptr;
145 int mTFCount = 0;
146 float mTPCVDriftRef = -1.;
147 float mTPCVDriftCorrFact = 1.;
148 float mTPCVDrift = -1.;
149 float mTPCDriftTimeOffset = 0.;
150 float mTPCTBinMUS = 0.;
151 float mBz = 0;
152 bool mFieldON = true;
153 bool mUsePVInfo = false;
154 bool mUseMC = true;
155 float mITSROFrameLengthMUS = 0.;
156 float mQ2PtCutoff = 1e9;
157 const MatchCosmicsParams* mMatchParams = nullptr;
158
159 std::vector<o2d::TrackCosmics> mCosmicTracks;
160 std::vector<o2::MCCompLabel> mCosmicTracksLbl;
161
162#ifdef _ALLOW_DEBUG_TREES_COSM
163 std::unique_ptr<o2::utils::TreeStreamRedirector> mDBGOut;
164 UInt_t mDBGFlags = 0;
165 std::string mDebugTreeFileName = "dbg_cosmics_match.root";
166#endif
167
168 ClassDefNV(MatchCosmics, 1);
169};
170
171} // namespace globaltracking
172} // namespace o2
173
174#endif
Container of the ITS/MFT clusters addressed by the composed (layer,index) ID.
Definition of the ClusterTopology class.
int32_t i
Accessor for TrackParCov derived objects from multiple containers.
Global index for barrel track: provides provenance (detectors combination), index in respective array...
float chi2
Configurable params for cosmics matching.
Declarations of 2D primitives.
uint32_t j
Definition RawData.h:0
Result of top-bottom cosmic tracks leg matching.
void setITSROFrameLengthMUS(float fums)
@ MatchTreeAll
produce matching candidates tree for all candidates
@ MatchTreeAccOnly
fill the matching candidates tree only once the cut is passed
static constexpr int Validated
bool isDebugFlag(UInt_t flags) const
get debug trees flags
void setITSDict(const o2::itsmft::TopologyDictionary *dict)
void setDebugFlag(UInt_t flag, bool on=true)
set the name of output debug file
void setTPCVDrift(const o2::tpc::VDriftCorrFact &v)
static constexpr int Reject
void setDebugTreeFileName(std::string name)
get the name of output debug file
void setTPCCorrMaps(const o2::gpu::TPCFastTransformPOD *maph)
void process(const o2::globaltracking::RecoContainer &data)
static constexpr int MinusOne
static constexpr int MinusTen
UInt_t getDebugFlags() const
set or unset debug stream flag
const std::string & getDebugTreeFileName() const
const GLdouble * v
Definition glcorearb.h:832
GLuint const GLchar * name
Definition glcorearb.h:781
GLboolean * data
Definition glcorearb.h:298
GLbitfield flags
Definition glcorearb.h:1570
Definition of a container to keep/associate and arbitrary number of labels associated to an index wit...
detail::Bracket< float > Bracketf_t
Definition Primitive2D.h:40
TrackParCovF TrackParCov
Definition Track.h:33
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
< record about matchig of 2 tracks
int next
index of eventual next record
short vtIDMax
id of the last compatible vertex
short vtIDMin
id of the 1st compatible vertex
int matchID
entry (none if MinusOne) of its match in the vector of matches
TBracket tBracket
bracketing time-bins