L1CAIteration.h 7.01 KB
Newer Older
Sergei Zharko's avatar
Sergei Zharko committed
1
2
3
4
/* Copyright (C) 2016-2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
   SPDX-License-Identifier: GPL-3.0-only
   Authors: Sergey Gorbunov, Sergei Zharko [committer] */

Sergei Zharko's avatar
Sergei Zharko committed
5
/***************************************************************************************************
6
7
8
9
10
 * @file   L1CAIteration.h
 * @brief  Declaration of the L1CAIteration class 
 * @since  05.02.2022
 * @author S.Zharko <s.zharko@gsi.de>
 ***************************************************************************************************/
Sergei Zharko's avatar
Sergei Zharko committed
11
12
13
14

#ifndef L1CAIteration_h
#define L1CAIteration_h 1

15
#include <bitset>
16
17
#include <string>

18
19
// TODO: discuss the border conditions for the parameters. Implement them (S.Zharko)
//       Implementation: use tuples for boundary conditions of the parameters
Sergei Zharko's avatar
Sergei Zharko committed
20
21
/// Class L1CAIteration describes L1 Track finder iteration.
/// Each iteration utilizes special physics cuts and run condition to find tracks of a particular
22
23
/// class (e.g., fast primary tracks or secondary electron tracks). Hits associated with tracks
/// reconstructed during current iteration are removed from the further iterations.
Sergei Zharko's avatar
Sergei Zharko committed
24
25
///
class L1CAIteration {
26
27
28
  /// Enumeration ControlFlag is used to keep flags, which controls behaviour of the track finder
  /// iterations loop
  ///
Sergei Zharko's avatar
Sergei Zharko committed
29
30
  enum class ControlFlag
  {
31
    kePrimary,  ///> true - track is primary, false - track is secondary (not primary)
32
33
34
35
    keEnd
  };
  using ControlFlags_t = std::bitset<static_cast<int>(ControlFlag::keEnd)>;

Sergei Zharko's avatar
Sergei Zharko committed
36
public:
37
38
39
40
41
42
  /// Default constructor
  L1CAIteration() noexcept;
  /// Copy constructor
  L1CAIteration(const L1CAIteration& other) noexcept;
  /// Move constructor
  L1CAIteration(L1CAIteration&& other) noexcept;
43
44
45
46
  /// Constructor from L1CAIteration type
  L1CAIteration(const std::string& name) noexcept;
  /// Destructor
  ~L1CAIteration() noexcept;
47
  /// Copy assignment operator
48
  L1CAIteration& operator=(const L1CAIteration& other) noexcept;
49
  /// Move assignment operator
50
  L1CAIteration& operator=(L1CAIteration&& other) noexcept;
Sergei Zharko's avatar
Sergei Zharko committed
51

52
53
  /// Gets doublet chi2 upper cut
  float GetDoubletChi2Cut() const { return fDoubletChi2Cut; }
54
  /// Gets correction for accounting overlaping and iff z
55
56
57
  float GetMaxDZ() const { return fMaxDZ; }
  /// Gets max considered q/p for tracks
  float GetMaxInvMom() const { return fMaxInvMom; }
58
  /// Gets max slope (tx\ty) in 3D hit position of a triplet
59
  float GetMaxSlope() const { return fMaxSlope; }
60
  /// Gets max slope (tx\ty) in primary vertex
61
  float GetMaxSlopePV() const { return fMaxSlopePV; }
62
63
  /// Gets min level of the triplet start
  int GetMinLevelTripletStart() const { return fMinLevelTripletStart; }
64
65
  /// Gets the name of the iteration
  const std::string& GetName() const { return fName; }
66
  /// Gets size of region [TODO: units??] to attach new hits to the created track
67
  float GetPickGather() const { return fPickGather; }
68
  /// Gets min value of dp/dp_error, for which two tiplets are neighbours
69
  float GetPickNeighbour() const { return fPickNeighbour; }
70
71
72
73
  /// Gets sigma target position in X direction [cm]
  float GetTargetPosSigmaX() const { return fTargetPosSigmaX; }
  /// Gets sigma target position in Y direction [cm]
  float GetTargetPosSigmaY() const { return fTargetPosSigmaY; }
74
75
76
77
  /// Gets track chi2 upper cut
  float GetTrackChi2Cut() const { return fTrackChi2Cut; }
  /// Gets triplet chi2 upper cut
  float GetTripletChi2Cut() const { return fTripletChi2Cut; }
Sergei Zharko's avatar
Sergei Zharko committed
78

79
80
  /// flag check: primary tracks - true, secondary tracks - false
  bool IsPrimary() const { return fControlFlags[static_cast<int>(ControlFlag::kePrimary)]; }
Sergei Zharko's avatar
Sergei Zharko committed
81
82

  /// Prints iteration options
83
  void Print(int verbosityLevel = 0) const;
Sergei Zharko's avatar
Sergei Zharko committed
84
85
86

  /// Sets doublet chi2 upper cut
  void SetDoubletChi2Cut(float input) { fDoubletChi2Cut = input; }
87
  /// Sets correction for accounting overlaping and iff z
88
89
  void SetMaxDZ(float input) { fMaxDZ = input; }
  /// Sets max considered q/p for tracks
90
  void SetMaxInvMom(float input) { fMaxInvMom = input; }
91
  /// Sets max slope (tx\ty) in 3D hit position of a triplet
92
  void SetMaxSlope(float input) { fMaxSlope = input; }
93
  /// Sets max slope (tx\ty) in primary vertex
94
  void SetMaxSlopePV(float input) { fMaxSlopePV = input; }
95
96
  /// Sets min level of the triplet start
  void SetMinLevelTripletStart(int input) { fMinLevelTripletStart = input; }
97
98
  /// Sets name of the iteration
  void SetName(const std::string& name) { fName = name; }
99
  /// Sets size of region [TODO: units??] to attach new hits to the created track
100
  void SetPickGather(float input) { fPickGather = input; }
101
  /// Sets min value of dp/dp_error, for which two tiplets are neighbours
102
  void SetPickNeighbour(float input) { fPickNeighbour = input; }
103
104
  /// Sets flag: primary tracks - true, secondary tracks - false
  void SetPrimary(bool flag) { fControlFlags[static_cast<int>(ControlFlag::kePrimary)] = flag; }
105
106
107
  /// Sets sigma of target positions in XY plane
  /// \param  sigmaX  Sigma value in X direction [cm]
  /// \param  sigmaX  Sigma value in Y direction [cm]
108
  void SetTargetPosSigmaXY(float sigmaX, float sigmaY);
109
110
111
112
113
114
115
116
  /// Sets track chi2 upper cut
  void SetTrackChi2Cut(float input) { fTrackChi2Cut = input; }
  /// Sets triplet chi2 upper cut
  void SetTripletChi2Cut(float input) { fTripletChi2Cut = input; }

  /// Swap method
  void Swap(L1CAIteration& other) noexcept;
  /// String representation of the class contents
117
  /// \param indentLevel  Level of indentation for the text (in terms of \t symbols)
118
  std::string ToString(int indentLevel = 0) const;
Sergei Zharko's avatar
Sergei Zharko committed
119
120

private:
121
  /** Basic fields **/
122
123
  std::string fName {""};           ///< Iteration name
  ControlFlags_t fControlFlags {};  ///< bitset flags to control iteration behaviour
Sergei Zharko's avatar
Sergei Zharko committed
124

125
  /** Track finder dependent cuts **/
126
  // TODO: Iteratively change the literals to floats (S.Zharko)
127
128
129
  // NOTE: For each new cut one should not forget to create a setter and a getter, insert the value
  //       initialization in the copy constructor and the Swap operator as well as a string repre-
  //       sentation to the ToString method (S.Zharko)
130
131
132
  float fTrackChi2Cut {10.f};                   ///> Track chi2 upper cut
  float fTripletChi2Cut {21.1075f};             ///> Triplet chi2 upper cut
  float fDoubletChi2Cut {11.3449 * 2.f / 3.f};  ///> Doublet chi2 upper cut
Sergei Zharko's avatar
Sergei Zharko committed
133
134
135
136
137
138
  float fPickGather {3.0};       ///> Size of region to attach new hits to the created track [TODO: units??]
  float fPickNeighbour {5.0};    ///> Min value of dp/dp_error, for which two tiplets are neighbours
  float fMaxInvMom {1.0 / 0.5};  ///> Max considered q/p for tracks
  float fMaxSlopePV {1.1};       ///> Max slope (tx\ty) in primary vertex
  float fMaxSlope {2.748};       ///> Max slope (tx\ty) in 3D hit position of a triplet
  float fMaxDZ {0.f};            ///> Correction for accounting overlaping and iff z [TODO: units??]
139
140
  float fTargetPosSigmaX {0};                   ///> Constraint on target position in X direction [cm]
  float fTargetPosSigmaY {0};                   ///> Constraint on target position in Y direction [cm]
Sergei Zharko's avatar
Sergei Zharko committed
141
  int fMinLevelTripletStart {0};  ///> Min level for starting a triplet. Track length = fMinLevelTripletStart + 3
142
  // ^ TODO: invent more proper name
Sergei Zharko's avatar
Sergei Zharko committed
143
144
};

145
#endif  // L1CAIteration_h