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