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>
29
30#define _ALLOW_DEBUG_TREES_COSM // to allow debug and control tree output
31
32namespace o2
33{
34namespace tpc
35{
36class VDriftCorrFact;
37}
38namespace gpu
39{
40class TPCFastTransformPOD;
41}
42namespace globaltracking
43{
44
45namespace o2d = o2::dataformats;
46
49class RecoContainer;
50
52{
53 public:
54 static constexpr int Zero = 0;
55 static constexpr int MinusOne = -1;
56 static constexpr int MinusTen = -10;
57 static constexpr int Validated = -2;
58 static constexpr int Reject = MinusTen;
71
72 using InfoAccessor = o2d::AbstractRefAccessor<int, GTrackID::NSources>; // there is no unique <Info> structure, so the default return type is dummy (int)
73
75 struct MatchRecord {
76 int id0 = MinusOne;
77 int id1 = MinusOne;
78 float chi2 = -1.f;
79 int next = MinusOne;
80 };
81
91 void setITSROFrameLengthMUS(float fums) { mITSROFrameLengthMUS = fums; }
92 void setITSDict(const o2::itsmft::TopologyDictionary* dict) { mITSDict = dict; }
94 void setUseMC(bool mc) { mUseMC = mc; }
95 void setUsePVInfo(bool v) { mUsePVInfo = v; }
96 void init();
97 void end();
98
99 auto getCosmicTracks() const { return mCosmicTracks; }
100 auto getCosmicTracksLbl() const { return mCosmicTracksLbl; }
101
102#ifdef _ALLOW_DEBUG_TREES_COSM
103 enum DebugFlagTypes : UInt_t {
105 MatchTreeAccOnly = 0x1 << 1
106 };
108 bool isDebugFlag(UInt_t flags) const { return mDBGFlags & flags; }
109
111 UInt_t getDebugFlags() const { return mDBGFlags; }
112
114 void setDebugFlag(UInt_t flag, bool on = true);
115
117 void setDebugTreeFileName(std::string name)
118 {
119 if (!name.empty()) {
120 mDebugTreeFileName = name;
121 }
122 }
123
125 const std::string& getDebugTreeFileName() const { return mDebugTreeFileName; }
126#endif
127
128 private:
129 void updateTimeDependentParams();
130 RejFlag checkPair(int i, int j);
131 void registerMatch(int i, int j, float chi2);
132 void suppressMatch(int partner0, int partner1);
133 void createSeeds(const o2::globaltracking::RecoContainer& data);
134 bool validateMatch(int partner0);
135 void selectWinners();
136 void refitWinners(const o2::globaltracking::RecoContainer& data);
137 std::vector<o2::BaseCluster<float>> prepareITSClusters(const o2::globaltracking::RecoContainer& data) const;
138
139 std::vector<TrackSeed> mSeeds;
140 std::vector<MatchRecord> mRecords;
141 std::vector<int> mWinners;
142 const o2::itsmft::TopologyDictionary* mITSDict = nullptr; // cluster patterns dictionary
143 const o2::gpu::TPCFastTransformPOD* mTPCCorrMaps = nullptr;
144 int mTFCount = 0;
145 float mTPCVDriftRef = -1.;
146 float mTPCVDriftCorrFact = 1.;
147 float mTPCVDrift = -1.;
148 float mTPCDriftTimeOffset = 0.;
149 float mTPCTBinMUS = 0.;
150 float mBz = 0;
151 bool mFieldON = true;
152 bool mUsePVInfo = false;
153 bool mUseMC = true;
154 float mITSROFrameLengthMUS = 0.;
155 float mQ2PtCutoff = 1e9;
156 const MatchCosmicsParams* mMatchParams = nullptr;
157
158 std::vector<o2d::TrackCosmics> mCosmicTracks;
159 std::vector<o2::MCCompLabel> mCosmicTracksLbl;
160
161#ifdef _ALLOW_DEBUG_TREES_COSM
162 std::unique_ptr<o2::utils::TreeStreamRedirector> mDBGOut;
163 UInt_t mDBGFlags = 0;
164 std::string mDebugTreeFileName = "dbg_cosmics_match.root";
165#endif
166
167 ClassDefNV(MatchCosmics, 1);
168};
169
170} // namespace globaltracking
171} // namespace o2
172
173#endif
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...
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