CbmRoot
Loading...
Searching...
No Matches
KfTarget.h
Go to the documentation of this file.
1/* Copyright (C) 2024 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergei Zharko [committer] */
4
9
10#pragma once
11
12#include "KfDefs.h"
13#include "KfMaterialMap.h"
14
15#include <boost/serialization/access.hpp>
16
17#include <string>
18
19namespace cbm::algo::kf
20{
24 template<typename T>
25 class alignas(VcMemAlign) Target {
26 template<typename I>
27 friend class Target;
28
29 public:
31 Target() = default;
32
39 Target(double x, double y, double z, double dz, double r);
40
43 template<typename I>
44 Target(const Target<I>& other)
45 : fMaterial(other.fMaterial)
46 , fX(utils::simd::Cast<I, T>(other.fX))
47 , fY(utils::simd::Cast<I, T>(other.fY))
48 , fZ(utils::simd::Cast<I, T>(other.fZ))
49 , fDz(utils::simd::Cast<I, T>(other.fDz))
50 , fR(utils::simd::Cast<I, T>(other.fR))
51 {
52 }
53
55 ~Target() = default;
56
58 Target& operator=(const Target& other) = default;
59
61 const T& GetX() const { return fX; }
62
64 const T& GetY() const { return fY; }
65
67 const T& GetZ() const { return fZ; }
68
70 const T& GetDz() const { return fDz; }
71
73 const T& GetR() const { return fR; }
74
76 const MaterialMap& GetMaterial() const { return fMaterial; }
77
80 void SetMaterial(const MaterialMap& material);
81
84 void SetMaterial(MaterialMap&& material);
85
88 void SetX(const T& x) { fX = x; }
89
92 void SetY(const T& y) { fY = y; }
93
96 void SetZ(const T& z) { fZ = z; }
97
100 void SetDz(const T& dz) { fDz = dz; }
101
104 void SetR(const T& r) { fR = r; }
105
109 std::string ToString(int indentLevel = 0, int vebose = 1) const;
110
111 private:
113 friend class boost::serialization::access;
114 template<class Archive>
115 void serialize(Archive& ar, const unsigned int /*version*/)
116 {
117 ar& fMaterial;
118 ar& fX;
119 ar& fY;
120 ar& fZ;
121 ar& fDz;
122 ar& fR;
123 }
124
125 MaterialMap fMaterial{};
126 T fX{defs::Undef<T>};
127 T fY{defs::Undef<T>};
128 T fZ{defs::Undef<T>};
129 T fDz{defs::Undef<T>};
130 T fR{defs::Undef<T>};
131 };
132} // namespace cbm::algo::kf
std::string ToString(ECbmModuleId modId)
Definition CbmDefs.cxx:70
Common constant definitions for the Kalman Filter library.
A map of station thickness in units of radiation length (X0) to the specific point in XY plane.
A geometry layer in the target region.
Definition KfTarget.h:25
void SetR(const T &r)
Sets target transverse size.
Definition KfTarget.h:104
const T & GetDz() const
Gets target half-thickness.
Definition KfTarget.h:70
const T & GetY() const
Gets y-coordinate of the nominal target center.
Definition KfTarget.h:64
const MaterialMap & GetMaterial() const
Gets material map.
Definition KfTarget.h:76
void SetDz(const T &dz)
Sets target half-thickness.
Definition KfTarget.h:100
void SetY(const T &y)
Sets y-coordinate of the nominal target center.
Definition KfTarget.h:92
Target & operator=(const Target &other)=default
Copy assignment operator.
void SetZ(const T &z)
Sets x-coordinate of the nominal target center.
Definition KfTarget.h:96
const T & GetX() const
Gets x-coordinate of the nominal target center.
Definition KfTarget.h:61
~Target()=default
Destructor.
const T & GetR() const
Gets transverse size of target.
Definition KfTarget.h:73
Target()=default
Default constructor.
void SetX(const T &x)
Sets x-coordinate of the nominal target center.
Definition KfTarget.h:88
Target(const Target< I > &other)
Copy constructor.
Definition KfTarget.h:44
const T & GetZ() const
Gets z-coordinate of the nominal target center.
Definition KfTarget.h:67
void serialize(Archive &ar, const unsigned int)
Definition KfTarget.h:115