CbmRoot
Loading...
Searching...
No Matches
CaIteration.h
Go to the documentation of this file.
1/* Copyright (C) 2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergey Gorbunov, Sergei Zharko [committer] */
4
5/***************************************************************************************************
6 * @file L1CAIteration.h
7 * @brief Declaration of the L1CAIteration class
8 * @since 05.02.2022
9 * @author S.Zharko <s.zharko@gsi.de>
10 ***************************************************************************************************/
11
12#pragma once // include this header only once per compilation unit
13
14#include "CaVector.h"
15
16#include <boost/serialization/access.hpp>
17#include <boost/serialization/string.hpp>
18
19#include <bitset>
20#include <iomanip>
21#include <string>
22
23namespace cbm::algo::ca
24{
31 class Iteration {
32 public:
34 Iteration() = default;
35
37 Iteration(const Iteration& other) = default;
38
40 Iteration(const Iteration& other, const std::string& name) : Iteration(other) { SetName(name); }
41
43 Iteration(Iteration&& other) noexcept = default;
44
46 Iteration(const std::string& name);
47
49 ~Iteration() noexcept = default;
50
52 Iteration& operator=(const Iteration& other) = default;
53
55 Iteration& operator=(Iteration&& other) = default;
56
58 bool Check() const;
59
61 float GetDoubletChi2Cut() const { return fDoubletChi2Cut; }
62
64 bool GetElectronFlag() const { return fIsElectron; }
65
67 bool GetExtendTracksFlag() const { return fIsExtendTracks; }
68
71
73 int GetMaxStationGap() const { return fMaxStationGap; }
74
76 float GetMaxDZ() const { return fMaxDZ; }
77
79 float GetMaxQp() const { return fMaxQp; }
80
82 float GetMaxSlope() const { return fMaxSlope; }
83
85 float GetMaxSlopePV() const { return fMaxSlopePV; }
86
88 int GetMinNhits() const { return fMinNhits; }
89
91 int GetMinNhitsStation0() const { return fMinNhitsStation0; }
92
94 const std::string& GetName() const { return fName; }
95
97 float GetPickGather() const { return fPickGather; }
98
100 bool GetPrimaryFlag() const { return fIsPrimary; }
101
103 float GetTargetPosSigmaX() const { return fTargetPosSigmaX; }
104
106 float GetTargetPosSigmaY() const { return fTargetPosSigmaY; }
107
109 float GetTrackChi2Cut() const { return fTrackChi2Cut; }
110
122
124 float GetTripletChi2Cut() const { return fTripletChi2Cut; }
125
128
130 float GetTripletLinkChi2() const { return fTripletLinkChi2; }
131
133 void SetDoubletChi2Cut(float input) { fDoubletChi2Cut = input; }
134
136 void SetElectronFlag(bool flag) { fIsElectron = flag; }
137
139 void SetExtendTracksFlag(bool flag) { fIsExtendTracks = flag; }
140
142 void SetFirstStationIndex(int index) { fFirstStationIndex = index; }
143
145 void SetMaxStationGap(int nSkipped) { fMaxStationGap = nSkipped; }
146
148 void SetMaxDZ(float input) { fMaxDZ = input; }
149
151 void SetMaxQp(float input) { fMaxQp = input; }
152
154 void SetMaxSlope(float input) { fMaxSlope = input; }
155
157 void SetMaxSlopePV(float input) { fMaxSlopePV = input; }
158
160 void SetMinNhits(int val) { fMinNhits = val; }
161
163 void SetMinNhitsStation0(int val) { fMinNhitsStation0 = val; }
164
166 void SetName(const std::string& name) { fName = name; }
167
169 void SetPickGather(float input) { fPickGather = input; }
170
172 void SetPrimaryFlag(bool flag) { fIsPrimary = flag; }
173
177 void SetTargetPosSigmaXY(float sigmaX, float sigmaY);
178
180 void SetTrackChi2Cut(float input) { fTrackChi2Cut = input; }
181
193
195 void SetTripletChi2Cut(float input) { fTripletChi2Cut = input; }
196
198 void SetTripletFinalChi2Cut(float input) { fTripletFinalChi2Cut = input; }
199
201 void SetTripletLinkChi2(float input) { fTripletLinkChi2 = input; }
202
205 std::string ToString(int indentLevel = 0) const;
206
210 static std::string ToTableFromVector(const Vector<Iteration>& vIterations);
211
212 private:
214 std::string fName{""};
215
217 // TODO: Iteratively change the literals to floats (S.Zharko)
218 // NOTE: For each new cut one should not forget to create a setter and a getter, insert the value
219 // initialization in the copy constructor and the Swap operator as well as a string repre-
220 // sentation to the ToString method (S.Zharko)
221 float fTrackChi2Cut = 10.f;
222 float fTripletChi2Cut = 21.1075f;
223 float fTripletFinalChi2Cut = 21.1075f;
224 float fDoubletChi2Cut = 11.3449 * 2.f / 3.f;
225 float fPickGather = 3.0;
226 float fTripletLinkChi2 = 25.0;
227 float fMaxQp = 1.0 / 0.5;
228 float fMaxSlopePV = 1.1;
229 float fMaxSlope = 2.748;
230 float fMaxDZ = 0.f;
234 int fMinNhits = 3;
236 bool fIsPrimary = false;
237 bool fIsElectron = false;
238 bool fIsExtendTracks = false;
240
241
252
255 template<class Archive>
256 void serialize(Archive& ar, const unsigned int /*version*/)
257 {
258 ar& fName;
259 ar& fTrackChi2Cut;
260 ar& fTripletChi2Cut;
262 ar& fDoubletChi2Cut;
263 ar& fPickGather;
265 ar& fMaxQp;
266 ar& fMaxSlopePV;
267 ar& fMaxSlope;
268 ar& fMaxDZ;
272 ar& fMinNhits;
274 ar& fIsPrimary;
275 ar& fIsElectron;
276 ar& fIsExtendTracks;
277 ar& fMaxStationGap;
279 }
280 };
281} // namespace cbm::algo::ca
A set of parameters for the CA Track finder iteration.
float fTripletLinkChi2
Min value of dp^2/dp_error^2, for which two tiplets are neighbours.
float fDoubletChi2Cut
Doublet chi2 upper cut.
void SetPickGather(float input)
Sets size of region [TODO: units??] to attach new hits to the created track.
int fMaxStationGap
Flag: true - find triplets with fMaxStationGap missing stations.
int GetMinNhits() const
Gets min n hits.
Definition CaIteration.h:88
void SetTrackFromTripletsFlag(bool flag)
Sets flag: true: all the triplets found on this iteration will be converted to tracks,...
void SetTrackChi2Cut(float input)
Sets track chi2 upper cut.
float GetTripletChi2Cut() const
Gets triplet chi2 upper cut.
bool fIsPrimary
Flag: true - only primary tracks are searched for.
int fFirstStationIndex
First station, used for tracking.
bool fIsTrackFromTriplets
Flag to select triplets on the iteration as tracks In ordinary cases, the shortest track consists fro...
int fMinNhitsStation0
min n hits for tracks that start on station 0
float fMaxDZ
Correction for accounting overlaping and iff z [cm].
bool Check() const
Checks parameters consistency.
float fTargetPosSigmaY
Constraint on target position in Y direction [cm].
float fMaxSlope
Max slope (tx\ty) in 3D hit position of a triplet.
float GetMaxSlope() const
Gets max slope (tx\ty) in 3D hit position of a triplet.
Definition CaIteration.h:82
void SetMaxSlope(float input)
Sets max slope (tx\ty) in 3D hit position of a triplet.
void SetName(const std::string &name)
Sets name of the iteration.
Iteration(Iteration &&other) noexcept=default
Move constructor.
float GetPickGather() const
Gets size of region [TODO: units??] to attach new hits to the created track.
Definition CaIteration.h:97
~Iteration() noexcept=default
Destructor.
void SetElectronFlag(bool flag)
Sets flag: electron tracks - true, heavy ion tracks - false.
float GetTrackChi2Cut() const
Gets track chi2 upper cut.
bool GetElectronFlag() const
flag check: electrons/positrons - true, heavy charged - false
Definition CaIteration.h:64
float GetDoubletChi2Cut() const
Gets doublet chi2 upper cut.
Definition CaIteration.h:61
float fTargetPosSigmaX
Constraint on target position in X direction [cm].
float GetTripletFinalChi2Cut() const
Gets triplet chi2 upper cut.
int GetMaxStationGap() const
Gets flag: true - triplets are also built with skipping <= GetMaxStationGap stations.
Definition CaIteration.h:73
std::string fName
Iteration name.
void SetMaxQp(float input)
Sets max considered q/p for tracks.
void SetTargetPosSigmaXY(float sigmaX, float sigmaY)
Sets sigma of target positions in XY plane.
void SetMinNhits(int val)
Sets flag: true - skip track candidates with level = 0.
std::string ToString(int indentLevel=0) const
String representation of the class contents.
void SetFirstStationIndex(int index)
Sets index of first station used in tracking.
static std::string ToTableFromVector(const Vector< Iteration > &vIterations)
Forms a string, representing a table of iterations from the vector of iterations.
void SetPrimaryFlag(bool flag)
Sets flag: primary tracks - true, secondary tracks - false.
int GetMinNhitsStation0() const
Gets min n hits for tracks that start on station 0.
Definition CaIteration.h:91
float fMaxQp
Max considered q/p for tracks.
Iteration(const Iteration &other, const std::string &name)
Copy constructor.
Definition CaIteration.h:40
float fMaxSlopePV
Max slope (tx\ty) in primary vertex.
float GetTargetPosSigmaX() const
Gets sigma target position in X direction [cm].
void serialize(Archive &ar, const unsigned int)
bool GetTrackFromTripletsFlag() const
float fPickGather
Size of region to attach new hits to the created track.
void SetMaxDZ(float input)
TODO: select a more proper name.
void SetTripletChi2Cut(float input)
Sets triplet chi2 upper cut.
bool fIsExtendTracks
Flag: true - extends track candidates with unused hits.
void SetTripletFinalChi2Cut(float input)
Sets triplet chi2 upper cut.
void SetMaxStationGap(int nSkipped)
Sets flag: true - triplets are built also skipping <= GetMaxStationGap stations.
float GetTripletLinkChi2() const
Gets min value of dp/dp_error, for which two tiplets are neighbours.
float GetMaxQp() const
Gets max considered q/p for tracks.
Definition CaIteration.h:79
float GetMaxDZ() const
Gets correction for accounting overlaping and iff z.
Definition CaIteration.h:76
void SetTripletLinkChi2(float input)
Sets min value of dp/dp_error, for which two tiplets are neighbours.
float fTripletChi2Cut
Triplet chi2 upper cut.
bool GetPrimaryFlag() const
Checks flag: true - only primary tracks are searched, false - [all or only secondary?...
float fTrackChi2Cut
Track chi2 upper cut.
float fTripletFinalChi2Cut
Triplet chi2 upper cut.
const std::string & GetName() const
Gets the name of the iteration.
Definition CaIteration.h:94
bool fIsElectron
Flag: true - only electrons are searched for.
friend class boost::serialization::access
Serialization method, used to save ca::Hit objects into binary or text file in a defined order.
float GetTargetPosSigmaY() const
Gets sigma target position in Y direction [cm].
Iteration()=default
Default constructor.
int GetFirstStationIndex() const
Gets station index of the first station used in tracking.
Definition CaIteration.h:70
bool GetExtendTracksFlag() const
Sets flag: true - extends track candidates with unused hits.
Definition CaIteration.h:67
int fMinNhits
min n hits on the tracks
void SetDoubletChi2Cut(float input)
Sets doublet chi2 upper cut.
float GetMaxSlopePV() const
Gets max slope (tx\ty) in primary vertex.
Definition CaIteration.h:85
Iteration(const Iteration &other)=default
Copy constructor.
void SetMaxSlopePV(float input)
Sets max slope (tx\ty) in primary vertex.
void SetExtendTracksFlag(bool flag)
Sets flag: true - extends track candidates with unused hits.
void SetMinNhitsStation0(int val)
Sets min n hits for tracks that start on station 0.
TODO: SZh 8.11.2022: add selection of parameterisation.
Definition CaBranch.h:14