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
89 void setITSROFrameLengthMUS(float fums) { mITSROFrameLengthMUS = fums; }
90 void setITSDict(const o2::itsmft::TopologyDictionary* dict) { mITSDict = dict; }
92 void setUseMC(bool mc) { mUseMC = mc; }
93 void init();
94 void end();
95
96 auto getCosmicTracks() const { return mCosmicTracks; }
97 auto getCosmicTracksLbl() const { return mCosmicTracksLbl; }
98
99#ifdef _ALLOW_DEBUG_TREES_COSM
100 enum DebugFlagTypes : UInt_t {
102 MatchTreeAccOnly = 0x1 << 1
103 };
105 bool isDebugFlag(UInt_t flags) const { return mDBGFlags & flags; }
106
108 UInt_t getDebugFlags() const { return mDBGFlags; }
109
111 void setDebugFlag(UInt_t flag, bool on = true);
112
114 void setDebugTreeFileName(std::string name)
115 {
116 if (!name.empty()) {
117 mDebugTreeFileName = name;
118 }
119 }
120
122 const std::string& getDebugTreeFileName() const { return mDebugTreeFileName; }
123#endif
124
125 private:
126 void updateTimeDependentParams();
127 RejFlag checkPair(int i, int j);
128 void registerMatch(int i, int j, float chi2);
129 void suppressMatch(int partner0, int partner1);
130 void createSeeds(const o2::globaltracking::RecoContainer& data);
131 bool validateMatch(int partner0);
132 void selectWinners();
133 void refitWinners(const o2::globaltracking::RecoContainer& data);
134 std::vector<o2::BaseCluster<float>> prepareITSClusters(const o2::globaltracking::RecoContainer& data) const;
135
136 std::vector<TrackSeed> mSeeds;
137 std::vector<MatchRecord> mRecords;
138 std::vector<int> mWinners;
139 const o2::itsmft::TopologyDictionary* mITSDict = nullptr; // cluster patterns dictionary
140 const o2::gpu::TPCFastTransformPOD* mTPCCorrMaps = nullptr;
141 int mTFCount = 0;
142 float mTPCVDriftRef = -1.;
143 float mTPCVDriftCorrFact = 1.;
144 float mTPCVDrift = -1.;
145 float mTPCDriftTimeOffset = 0.;
146 float mTPCTBinMUS = 0.;
147 float mBz = 0;
148 bool mFieldON = true;
149 bool mUseMC = true;
150 float mITSROFrameLengthMUS = 0.;
151 float mQ2PtCutoff = 1e9;
152 const MatchCosmicsParams* mMatchParams = nullptr;
153
154 std::vector<o2d::TrackCosmics> mCosmicTracks;
155 std::vector<o2::MCCompLabel> mCosmicTracksLbl;
156
157#ifdef _ALLOW_DEBUG_TREES_COSM
158 std::unique_ptr<o2::utils::TreeStreamRedirector> mDBGOut;
159 UInt_t mDBGFlags = 0;
160 std::string mDebugTreeFileName = "dbg_cosmics_match.root";
161#endif
162
163 ClassDefNV(MatchCosmics, 1);
164};
165
166} // namespace globaltracking
167} // namespace o2
168
169#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
int matchID
entry (none if MinusOne) of its match in the vector of matches
TBracket tBracket
bracketing time-bins