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 T GetX() const { return fX; }
62
64 T GetY() const { return fY; }
65
67 T GetZ() const { return fZ; }
68
70 T GetDz() const { return fDz; }
71
73 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(T x) { fX = x; }
89
92 void SetY(T y) { fY = y; }
93
96 void SetZ(T z) { fZ = z; }
97
100 void SetDz(T dz) { fDz = dz; }
101
104 void SetR(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
131 };
132} // namespace cbm::algo::kf
std::string ToString(CbmCutId id)
Convert CbmCutId to a string representation.
Definition CbmCutId.cxx:7
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.
T GetZ() const
Gets z-coordinate of the nominal target center.
Definition KfTarget.h:67
const MaterialMap & GetMaterial() const
Gets material map.
Definition KfTarget.h:76
T fR
Half-thickness of the target [cm].
Definition KfTarget.h:130
friend class Target
Definition KfTarget.h:27
T fX
x-coordinate of the nominal target center [cm]
Definition KfTarget.h:126
Target & operator=(const Target &other)=default
Copy assignment operator.
T GetY() const
Gets y-coordinate of the nominal target center.
Definition KfTarget.h:64
T GetDz() const
Gets target half-thickness.
Definition KfTarget.h:70
T fZ
z-coordinate of the nominal target center [cm]
Definition KfTarget.h:128
void SetZ(T z)
Sets x-coordinate of the nominal target center.
Definition KfTarget.h:96
T GetR() const
Gets transverse size of target.
Definition KfTarget.h:73
void SetDz(T dz)
Sets target half-thickness.
Definition KfTarget.h:100
void SetX(T x)
Sets x-coordinate of the nominal target center.
Definition KfTarget.h:88
T GetX() const
Gets x-coordinate of the nominal target center.
Definition KfTarget.h:61
~Target()=default
Destructor.
void SetY(T y)
Sets y-coordinate of the nominal target center.
Definition KfTarget.h:92
Target()=default
Default constructor.
MaterialMap fMaterial
Material map in the target region.
Definition KfTarget.h:125
T fY
y-coordinate of the nominal target center [cm]
Definition KfTarget.h:127
Target(const Target< I > &other)
Copy constructor.
Definition KfTarget.h:44
void SetR(T r)
Sets target transverse size.
Definition KfTarget.h:104
T fDz
Half-thickness of the target [cm].
Definition KfTarget.h:129
void serialize(Archive &ar, const unsigned int)
Definition KfTarget.h:115
constexpr T2 Undef
Undefined values.
Definition KfDefs.h:218