CbmRoot
Loading...
Searching...
No Matches
KfActiveLayer.h
Go to the documentation of this file.
1/* Copyright (C) 2025 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergei Zharko [committer] */
4
9
10
11#pragma once
12
13#include "KfUtils.h"
14
15#include <boost/serialization/access.hpp>
16
17#include <string>
18
19namespace cbm::algo::kf
20{
24 template<typename F>
25 class alignas(VcMemAlign) ActiveLayer {
26 template<typename>
27 friend class ActiveLayer;
28 friend class boost::serialization::access;
29
30 public:
39 ActiveLayer(F zRef, F xMin, F xMax, F yMin, F yMax, EFieldType fieldType, bool isTimeMeasured);
40
44 template<typename FSrc>
46 : fZref(utils::simd::Cast<FSrc, F>(other.fZref))
47 , fXmin(utils::simd::Cast<FSrc, F>(other.fXmin))
48 , fXmax(utils::simd::Cast<FSrc, F>(other.fXmax))
49 , fYmin(utils::simd::Cast<FSrc, F>(other.fYmin))
50 , fYmax(utils::simd::Cast<FSrc, F>(other.fYmax))
51 , fFieldType(other.fFieldType)
52 , fTimeInfo(other.fTimeInfo)
53 {
54 }
55
57 ActiveLayer(const ActiveLayer&) = default;
58
61
63 ActiveLayer& operator=(const ActiveLayer&) = default;
64
67
69 F GetZref() const { return fZref; }
70
72 F GetXmin() const { return fXmin; }
73
75 F GetXmax() const { return fXmax; }
76
78 F GetYmin() const { return fYmin; }
79
81 F GetYmax() const { return fYmax; }
82
85
87 bool IsInField() const { return fFieldType != EFieldType::Null; }
88
90 bool IsTimeMeasured() const { return fTimeInfo; }
91
94 std::string ToString(int indentLevel = 0) const;
95
96 private:
103 bool fTimeInfo{false};
104
106 ActiveLayer() = default;
107
109 template<class Archive>
110 void serialize(Archive& ar, const unsigned int)
111 {
112 ar& fZref;
113 ar& fXmin;
114 ar& fXmax;
115 ar& fYmin;
116 ar& fYmax;
117 ar& fFieldType;
118 ar& fTimeInfo;
119 }
120 };
121} // namespace cbm::algo::kf
std::string ToString(CbmCutId id)
Convert CbmCutId to a string representation.
Definition CbmCutId.cxx:7
friend class ActiveLayer
F fYmin
lower bound for active plane in y-direction [cm]
EFieldType fFieldType
Type of magnetic field near the layer.
ActiveLayer & operator=(ActiveLayer &&)=default
Move assignment operator.
ActiveLayer & operator=(const ActiveLayer &)=default
Copy assignment operator.
EFieldType GetFieldType() const
Gets field type.
F GetXmax() const
Gets upper bound in x-direction [cm].
ActiveLayer()=default
Default constructor (for serialization)
ActiveLayer(const ActiveLayer &)=default
Standard copy constructor.
bool IsInField() const
Checks, if the layer is in magnetic field.
F fXmin
lower bound for active plane in x-direction [cm]
F GetZref() const
Gets reference z-coordinate of the layer [cm].
ActiveLayer(ActiveLayer &&)=default
Move constructor.
F fXmax
upper bound for active plane in x-direction [cm]
F fZref
reference z-coordinate of the layer [cm]
F fYmax
upper bound for active plane in y-direction [cm]
void serialize(Archive &ar, const unsigned int)
Serialization method.
bool fTimeInfo
If time-measurement accessible.
ActiveLayer(const ActiveLayer< FSrc > &other)
Type conversion copy constructor.
F GetYmin() const
Gets lower bound in y-direction [cm].
F GetYmax() const
Gets upper bound in y-direction [cm].
F GetXmin() const
Gets lower bound in x-direction [cm].
bool IsTimeMeasured() const
Checks, if time measurement available.
constexpr T2 Undef
Undefined values.
Definition KfDefs.h:218
EFieldType
Magnetic field type in different setup regions.
Definition KfDefs.h:126
@ Null
No magnetic field.
Definition KfDefs.h:128