28 : fDetectorID(detectorID)
29 , fStationID(stationID)
31 fInitController.SetFlag(EInitKey::kDetectorID);
32 fInitController.SetFlag(EInitKey::kStationID);
48 std::stringstream msg;
49 msg <<
"StationInitializer::GetStation: attempt to get a Station object from uninitialized L1BaseStation with "
51 LOG(fatal) << msg.str();
65 LOG(warn) <<
"StationInitializer::SetDetectorID: Attempt of detector ID redifinition";
73 const std::function<
void(
const double (&xyz)[3],
double (&B)[3])>& getFieldValue)
76 LOG(warn) <<
"StationInitializer::SetFieldSlice: Attempt to redifine field slice for station with detectorID = "
82 LOG(fatal) <<
"Attempt to set magnetic field slice before setting z position of the station";
85 LOG(fatal) <<
"Attempt to set magnetic field slice before Xmax size of the station";
88 LOG(fatal) <<
"Attempt to set magnetic field slice before Ymax size of the station";
93 auto glambda = [&](
double x,
double y,
double z) -> std::tuple<double, double, double> {
94 double xyz[3] = {
x,
y, z};
96 getFieldValue(xyz, B);
97 return std::tuple<double, double, double>(B[0], B[1], B[2]);
130 LOG(warn) <<
"StationInitializer::SetStationID: Attempt of station ID redifinition";
143 LOG(warn) <<
"StationInitializer::SetStationType: Attempt of station type redifinition";
210 std::swap(fDetectorID, other.fDetectorID);
211 std::swap(fStationID, other.fStationID);
212 std::swap(fTrackingStatus, other.fTrackingStatus);
213 std::swap(fXmax, other.fXmax);
214 std::swap(fYmax, other.fYmax);
215 std::swap(fZref, other.fZref);
216 std::swap(fZmin, other.fZmin);
217 std::swap(fZmax, other.fZmax);
218 std::swap(fStation, other.fStation);
219 std::swap(fInitController, other.fInitController);
226 std::stringstream aStream{};
227 constexpr char indentChar =
'\t';
228 std::string indent(indentLevel, indentChar);
230 if (verbosityLevel == 0) {
231 aStream << indent <<
"StationInitializer object: {stationID, detectorID, z, address} = {" <<
fStationID <<
", "
234 else if (verbosityLevel > 0) {
235 aStream << indent <<
"StationInitializer object: at " <<
this <<
'\n';
236 aStream << indent << indentChar <<
"Station ID: " <<
fStationID <<
'\n';
237 aStream << indent << indentChar <<
"Detector ID: " <<
static_cast<int>(
fDetectorID) <<
'\n';
238 aStream << indent << indentChar <<
"ca::Station object:" <<
'\n';
239 aStream <<
fStation.ToString(verbosityLevel - 1, indentLevel + 1) <<
'\n';
240 aStream << indent << indentChar <<
"Additional fields:\n";
241 aStream << indent << indentChar << indentChar <<
"Zmin: " <<
fZmin <<
'\n';
242 aStream << indent << indentChar << indentChar <<
"Zmax: " <<
fZmax <<
'\n';
243 aStream << indent << indentChar << indentChar <<
"Xmax: " <<
fXmax <<
'\n';
244 aStream << indent << indentChar << indentChar <<
"Ymax: " <<
fYmax <<
'\n';
246 return aStream.str();
Compile-time constants definition for the CA tracking algorithm.
An interface for the CA Station object initialization.
bool GetFlag(InitKeyEnum bitKey) const
void SetFlag(InitKeyEnum bitKey, bool newStatus=true)
bool IsFinalized() const
Checks, if the object is finalized, i.e. all its fields were set up.
A base class which provides interface to L1Algo station geometry.
int fStationID
Local ID of a station.
double fYmax
Maximum distance between station center and its edge in y direction.
bool fTrackingStatus
Tracking status: true - station is used for tracking.
void SetYmax(double aSize)
Sets maximum distance between station center and its edge in y direction.
void SetStationID(int inID)
Sets station ID.
double fXmax
Maximum distance between station center and its edge in x direction.
@ kYmax
max size in Y direction
@ kZmin
min z of the station
@ kZref
reference z of the station
@ kTimeInfo
if time info is used (flag)
@ kTrackingStatus
flag, if station is used in tracking or not
@ kZmax
max z of the station
@ 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)
@ kXmax
max size in X direction
EDetectorID fDetectorID
Detector ID.
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.
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
InitController_t fInitController
Class fileds initialization flags.
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.
void SetXmax(double aSize)
Sets maximum distance between station center and its edge in x direction.
void SetFieldFunction(const std::function< void(const double(&xyz)[3], double(&B)[3])> &getFieldValue)
Sets arrays of the approcimation.
kf::FieldSlice< DataT > fieldSlice
Magnetic field near the station.
A magnetic field approximation on the two-dimensional plane.
EDetectorID
Enumeration for the tracking detector subsystems in CBM-CA.