Belle II Software development
PhotonState.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11#include <top/reconstruction_cpp/RaytracerBase.h>
12#include <top/reconstruction_cpp/func.h>
13#include <Math/Vector3D.h>
14#include <Math/Point3D.h>
15
16
17namespace Belle2 {
22 namespace TOP {
23
28
29 public:
30
40
45 {}
46
52 PhotonState(const ROOT::Math::XYZPoint& position, const ROOT::Math::XYZVector& direction);
53
61 PhotonState(const ROOT::Math::XYZPoint& position, double kx, double ky, double kz);
62
70 PhotonState(const ROOT::Math::XYZPoint& position, const ROOT::Math::XYZVector& trackDir, double thc, double fic);
71
75 PhotonState& flipKy() {m_ky = -m_ky; return *this;}
76
81 static void setMaxPropagationLen(double maxLen) {s_maxLen = maxLen;}
82
87 ROOT::Math::XYZPoint getPosition() const {return ROOT::Math::XYZPoint(m_x, m_y, m_z);}
88
93 double getX() const {return m_x;}
94
99 double getY() const {return m_y;}
100
105 double getZ() const {return m_z;}
106
112 double getUnfoldedX(double x) const {return func::unfold(x, m_nx, m_A);}
113
119 double getUnfoldedY(double y) const {return (func::unfold(y - m_y0, m_ny, m_B) + m_y0);}
120
125 double getXD() const {return getUnfoldedX(m_x);}
126
131 double getYD() const {return m_yD;}
132
137 double getZD() const {return m_zD;}
138
143 ROOT::Math::XYZVector getDirection() const {return ROOT::Math::XYZVector(m_kx, m_ky, m_kz);}
144
149 double getKx() const {return m_kx;}
150
155 double getKy() const {return m_ky;}
156
161 double getKz() const {return m_kz;}
162
167 double getPropagationLen() const {return m_propLen;}
168
173 int getNx() const {return m_nx;}
174
179 int getNy() const {return m_ny;}
180
185 double getA() const {return m_A;}
186
192 double getB() const {return m_B;}
193
198 EType getSegmentType() const {return m_type;}
199
204 bool getPropagationStatus() const {return m_status;}
205
211 bool getTotalReflStatus(double cosTotal) const
212 {
213 return ((m_nx == 0 or m_cosx < cosTotal) and (m_ny == 0 or m_cosy < cosTotal));
214 }
215
221 bool isInside(const RaytracerBase::BarSegment& bar) const;
222
229 bool isInside(const RaytracerBase::BarSegment& bar, const RaytracerBase::Mirror& mirror) const;
230
236 bool isInside(const RaytracerBase::Prism& prism) const;
237
243 void propagate(const RaytracerBase::BarSegment& bar);
244
257
264 void propagateExact(const RaytracerBase::BarSegment& bar, const RaytracerBase::Mirror& mirror);
265
271 void propagate(const RaytracerBase::Prism& prism);
272
273 private:
274
275 double m_x = 0;
276 double m_y = 0;
277 double m_z = 0;
278 double m_kx = 0;
279 double m_ky = 0;
280 double m_kz = 0;
281 double m_propLen = 0;
282 int m_nx = 0;
283 int m_ny = 0;
284 double m_cosx = 0;
285 double m_cosy = 0;
286 double m_A = 0;
287 double m_B = 0;
288 double m_y0 = 0;
289 double m_yD = 0;
290 double m_zD = 0;
292 bool m_status = false;
293
294 static double s_maxLen;
295
296 };
297
298 } // namespace TOP
300} // namespace Belle2
301
double m_y0
origin in y for unfolding
EType m_type
quartz segment type at last propagation step
double getZD() const
Returns detection position z in unfolded prism.
double m_cosy
maximal cosine of impact angle to surface in y
double getPropagationLen() const
Returns total propagation length since initial position.
int m_nx
signed number of reflections in x at last propagation step
double getUnfoldedY(double y) const
Unfolds the position in y.
double getX() const
Returns position in x.
Definition PhotonState.h:93
double m_zD
unfolded prism detection position in z
ROOT::Math::XYZPoint getPosition() const
Returns position as 3D vector.
Definition PhotonState.h:87
double getKy() const
Returns direction in y.
ROOT::Math::XYZVector getDirection() const
Returns direction as 3D unit vector.
void propagate(const RaytracerBase::BarSegment &bar)
Propagate photon to the exit of bar segment.
double m_x
position in x
static double s_maxLen
maximal allowed propagation length
int getNx() const
Returns number of reflections in x at last propagation step.
double getYD() const
Returns detection position y in unfolded prism.
PhotonState()
Default constructor.
Definition PhotonState.h:44
double m_ky
direction in y
double getA() const
Returns width (dimension in x) of the quartz segment at last propagation step.
double m_A
width of the quartz segment (dimension in x) for unfolding
bool getTotalReflStatus(double cosTotal) const
Returns total internal reflection status.
double m_cosx
maximal cosine of impact angle to surface in x
int m_ny
signed number of reflections in y at last propagation step
double m_kx
direction in x
double getZ() const
Returns position in z.
double m_yD
unfolded prism detection position in y
double m_B
thickness of the quartz segment (dimension in y) for unfolding
bool m_status
propagation status
double getY() const
Returns position in y.
Definition PhotonState.h:99
int getNy() const
Returns number of reflections in y at last propagation step.
void propagateSemiLinear(const RaytracerBase::BarSegment &bar, const RaytracerBase::Mirror &mirror)
Propagate photon to the mirror and reflect it using semi-linear mirror optics.
bool getPropagationStatus() const
Returns propagation status.
double m_z
position in z
static void setMaxPropagationLen(double maxLen)
Sets maximal allowed propagation length.
Definition PhotonState.h:81
double getB() const
Returns thickness (dimension in y) of the quartz segment at last propagation step.
EType
enumerator for the type of quartz segments
Definition PhotonState.h:34
@ c_BarSegment
bar segment
Definition PhotonState.h:36
@ c_MirrorSegment
mirror segment
Definition PhotonState.h:37
double getKz() const
Returns direction in z.
double m_y
position in y
EType getSegmentType() const
Returns the type of the quartz segment at last propagation.
double m_propLen
propagation length since initial position
void propagateExact(const RaytracerBase::BarSegment &bar, const RaytracerBase::Mirror &mirror)
Propagate photon to the mirror and reflect it using exact mirror optics.
double getKx() const
Returns direction in x.
double getUnfoldedX(double x) const
Unfolds the position in x.
bool isInside(const RaytracerBase::BarSegment &bar) const
Checks if photon is inside the bar segment (including surface).
double m_kz
direction in z
double getXD() const
Returns detection position x in unfolded prism.
PhotonState & flipKy()
Changes sign of direction y component.
Definition PhotonState.h:75
double unfold(double x, int nx, double A)
unfold a coordinate.
Definition func.h:51
Abstract base class for different kinds of events.
bar segment data in module local frame.
spherical mirror data in module local frame.
prism data in module local frame.