CbmRoot
Loading...
Searching...
No Matches
CaStationInitializer.h
Go to the documentation of this file.
1/* Copyright (C) 2021-2023 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergey Gorbunov, Sergei Zharko [committer] */
4
9
10#pragma once // include this header only once per compilation unit
11
13#include "CaSimd.h"
14#include "CaStation.h"
15
16#include <bitset>
17#include <functional>
18#include <string>
19
20namespace cbm::algo::ca
21{
22 enum class EDetectorID;
23
27 enum class EManagementFlag
28 {
30 kEnd
31 };
32 using ManagementFlags_t = std::bitset<static_cast<int>(EManagementFlag::kEnd)>;
33
34 public:
37 enum class EInitKey
38 {
39 // Basic fields initialization
43 kXmax,
44 kYmax,
45 // ca::Station initialization
46 kType,
47 kTimeInfo,
49 kZref,
50 kZmin,
51 kZmax,
54 // The last item is equal to the number of bits in fInitFlags
55 kEnd
56 };
58
60 StationInitializer() = default;
61
63 StationInitializer(EDetectorID detetorID, int stationID) noexcept;
64
66 ~StationInitializer() noexcept = default;
67
69 StationInitializer(const StationInitializer& other) = default;
70
72 bool operator<(const StationInitializer& right) const { return (GetZref() < right.GetZref()); }
73
76
78 int GetFieldStatus() const { return fStation.fieldStatus; }
79
82
84 const Station<fvec>& GetStation() const;
85
87 int GetStationID() const { return fStationID; }
88
90 int GetStationType() const { return fStation.type; }
91
93 bool GetTrackingStatus() const { return fTrackingStatus; }
94
96 double GetXmax() const { return fXmax; }
97
99 double GetYmax() const { return fYmax; }
100
102 double GetZref() const { return fZref; }
103
105 double GetZmin() const { return fZmin; }
106
108 double GetZmax() const { return fZmax; }
109
111 fvec GetZsimdVec() const { return fStation.fZ; }
112
114 void Reset();
115
117 void SetDetectorID(EDetectorID inID);
118
120 void SetFieldStatus(int fieldStatus);
121
125 void SetFieldFunction(const std::function<void(const double (&xyz)[3], double (&B)[3])>& getFieldValue);
126
128 void SetGeoLayerID(int geoLayerID);
129
131 [[deprecated("Please, use constructor to set station ID")]] void SetStationID(int inID);
132
134 void SetStationType(int inType); // TODO: this is a temporary solution (S.Zh.)
135
138 void SetTimeInfo(int inTimeInfo);
139
141 void SetTrackingStatus(bool flag);
142
144 void SetXmax(double aSize);
145
147 void SetYmax(double aSize);
148
150 void SetZref(double inZ);
151
153 void SetZmin(double inZ);
154
156 void SetZmax(double inZ);
157
159 void Swap(StationInitializer& other) noexcept;
160
163 std::string ToString(int verbosityLevel = 0, int indentLevel = 0) const;
164
165 private:
167 int fStationID{-1};
168 bool fTrackingStatus{false};
169 double fXmax{0};
170 double fYmax{0};
171 double fZref{0};
172 double fZmin{0};
173 double fZmax{0};
177 };
178
180 inline void swap(StationInitializer& a, StationInitializer& b) noexcept { a.Swap(b); }
181} // namespace cbm::algo::ca
A base class which provides interface to L1Algo station geometry.
double fYmax
Maximum distance between station center and its edge in y direction.
bool fTrackingStatus
Tracking status: true - station is used for tracking.
EDetectorID GetDetectorID() const
Gets detector ID.
void SetYmax(double aSize)
Sets maximum distance between station center and its edge in y direction.
double GetXmax() const
Gets maximum distance between station center and its edge in x direction.
void SetStationID(int inID)
Sets station ID.
double GetYmax() const
Gets maximum distance between station center and its edge in y direction.
double fXmax
Maximum distance between station center and its edge in x direction.
int GetStationID() const
Gets station ID.
EInitKey
Enumeration of fields, which must be initialized so the object can pass the threshold.
@ kTimeInfo
if time info is used (flag)
@ kTrackingStatus
flag, if station is used in tracking or not
@ kFieldSlice
ca::Station.ca::FieldSlice object initialization
@ kGeoLayerID
index of geo layer in geometrical setup (including possibly inactive stations)
@ kFieldStatus
if station is placed in field (flag)
double GetZmax() const
Gets max z of the station [cm].
~StationInitializer() noexcept=default
Destructor.
void SetZmax(double inZ)
Sets max z of the station.
void SetZmin(double inZ)
Sets min z of the station.
void SetStationType(int inType)
Sets type of station.
void SetZref(double inZ)
Sets reference z position of the station.
bool GetTrackingStatus() const
Gets tracking status: true - station is active for tracking, false - station exists,...
double GetZref() const
Gets double precised z position of the station [cm].
fvec GetZsimdVec() const
Gets SIMD vectorized z position of the station [cm].
ManagementFlags_t fManagementFlags
bitset flags to manage internal behaviour of the class
void SetGeoLayerID(int geoLayerID)
Sets geometry ID (index of the layer in the geometrical setup)
std::string ToString(int verbosityLevel=0, int indentLevel=0) const
String representation of class contents.
StationInitializer()=default
Default constructor.
void SetTimeInfo(int inTimeInfo)
Sets flag: 0 - time information is not provided by this detector type 1 - time information is provide...
void Swap(StationInitializer &other) noexcept
Swap method for easy implementation of move constructor and copy and move assignment operator.
Station< fvec > fStation
ca::Station structure, describes a station in L1Algo
std::bitset< static_cast< int >(EManagementFlag::kEnd)> ManagementFlags_t
InitController_t fInitController
Class fileds initialization flags.
int GetFieldStatus() const
Gets field status: 0 - station is outside the field, 1 - station is inside the field.
void SetFieldStatus(int fieldStatus)
Sets flag: true - station is placed in field, false - station is placed outside the field.
void SetDetectorID(EDetectorID inID)
Sets detector ID.
const Station< fvec > & GetStation() const
Gets a reference to ca::Station info field of the L1BaseStation info.
void SetTrackingStatus(bool flag)
Sets tracking status: true - station is active for tracking, false - station exists,...
void Reset()
Resets fields to the default values.
double GetZmin() const
Gets min z of the station [cm].
EManagementFlag
Enumeration for internal logic control.
@ kThicknessMapMoved
if the thickness map was moved from the StationInitializer instance
void SetXmax(double aSize)
Sets maximum distance between station center and its edge in x direction.
const InitController_t & GetInitController() const
Gets a const reference to the ca::ObjectInitController object.
void SetFieldFunction(const std::function< void(const double(&xyz)[3], double(&B)[3])> &getFieldValue)
Sets arrays of the approcimation.
int GetStationType() const
Gets station type.
TODO: SZh 8.11.2022: add selection of parameterisation.
Definition CaBranch.h:14
void swap(StationInitializer &a, StationInitializer &b) noexcept
swap function for two StationInitializer objects, expected to be used instead of std::swap
EDetectorID
Enumeration for the tracking detector subsystems in CBM-CA.
Definition CbmDefs.h:176