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
34 enum EType {
38 c_Prism = 3
39 };
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
242 void propagate(const RaytracerBase::BarSegment& bar);
243
254
260 void propagateExact(const RaytracerBase::BarSegment& bar, const RaytracerBase::Mirror& mirror);
261
266 void propagate(const RaytracerBase::Prism& prism);
267
268 private:
269
270 double m_x = 0;
271 double m_y = 0;
272 double m_z = 0;
273 double m_kx = 0;
274 double m_ky = 0;
275 double m_kz = 0;
276 double m_propLen = 0;
277 int m_nx = 0;
278 int m_ny = 0;
279 double m_cosx = 0;
280 double m_cosy = 0;
281 double m_A = 0;
282 double m_B = 0;
283 double m_y0 = 0;
284 double m_yD = 0;
285 double m_zD = 0;
287 bool m_status = false;
289 static double s_maxLen;
291 };
292
293 } // namespace TOP
295} // namespace Belle2
296
State of the Cerenkov photon in the quartz optics.
Definition: PhotonState.h:27
double m_y0
origin in y for unfolding
Definition: PhotonState.h:283
EType m_type
quartz segment type at last propagation step
Definition: PhotonState.h:286
double getZD() const
Returns detection position z in unfolded prism.
Definition: PhotonState.h:137
double m_cosy
maximal cosine of impact angle to surface in y
Definition: PhotonState.h:280
double getPropagationLen() const
Returns total propagation length since initial position.
Definition: PhotonState.h:167
int m_nx
signed number of reflections in x at last propagation step
Definition: PhotonState.h:277
double getUnfoldedY(double y) const
Unfolds the position in y.
Definition: PhotonState.h:119
double getX() const
Returns position in x.
Definition: PhotonState.h:93
double m_zD
unfolded prism detection position in z
Definition: PhotonState.h:285
ROOT::Math::XYZPoint getPosition() const
Returns position as 3D vector.
Definition: PhotonState.h:87
double getKy() const
Returns direction in y.
Definition: PhotonState.h:155
ROOT::Math::XYZVector getDirection() const
Returns direction as 3D unit vector.
Definition: PhotonState.h:143
void propagate(const RaytracerBase::BarSegment &bar)
Propagate photon to the exit of bar segment.
Definition: PhotonState.cc:82
double m_x
position in x
Definition: PhotonState.h:270
static double s_maxLen
maximal allowed propagation length
Definition: PhotonState.h:289
int getNx() const
Returns number of reflections in x at last propagation step.
Definition: PhotonState.h:173
double getYD() const
Returns detection position y in unfolded prism.
Definition: PhotonState.h:131
PhotonState()
Default constructor.
Definition: PhotonState.h:44
double m_ky
direction in y
Definition: PhotonState.h:274
double getA() const
Returns width (dimension in x) of the quartz segment at last propagation step.
Definition: PhotonState.h:185
double m_A
width of the quartz segment (dimension in x) for unfolding
Definition: PhotonState.h:281
bool getTotalReflStatus(double cosTotal) const
Returns total internal reflection status.
Definition: PhotonState.h:211
double m_cosx
maximal cosine of impact angle to surface in x
Definition: PhotonState.h:279
int m_ny
signed number of reflections in y at last propagation step
Definition: PhotonState.h:278
double m_kx
direction in x
Definition: PhotonState.h:273
double getZ() const
Returns position in z.
Definition: PhotonState.h:105
double m_yD
unfolded prism detection position in y
Definition: PhotonState.h:284
double m_B
thickness of the quartz segment (dimension in y) for unfolding
Definition: PhotonState.h:282
bool m_status
propagation status
Definition: PhotonState.h:287
double getY() const
Returns position in y.
Definition: PhotonState.h:99
int getNy() const
Returns number of reflections in y at last propagation step.
Definition: PhotonState.h:179
void propagateSemiLinear(const RaytracerBase::BarSegment &bar, const RaytracerBase::Mirror &mirror)
Propagate photon to the mirror and reflect it using semi-linear mirror optics.
Definition: PhotonState.cc:110
bool getPropagationStatus() const
Returns propagation status.
Definition: PhotonState.h:204
double m_z
position in z
Definition: PhotonState.h:272
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.
Definition: PhotonState.h:192
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.
Definition: PhotonState.h:161
double m_y
position in y
Definition: PhotonState.h:271
EType getSegmentType() const
Returns the type of the quartz segment at last propagation.
Definition: PhotonState.h:198
double m_propLen
propagation length since initial position
Definition: PhotonState.h:276
void propagateExact(const RaytracerBase::BarSegment &bar, const RaytracerBase::Mirror &mirror)
Propagate photon to the mirror and reflect it using exact mirror optics.
Definition: PhotonState.cc:176
double getKx() const
Returns direction in x.
Definition: PhotonState.h:149
double getUnfoldedX(double x) const
Unfolds the position in x.
Definition: PhotonState.h:112
bool isInside(const RaytracerBase::BarSegment &bar) const
Checks if photon is inside the bar segment (including surface).
Definition: PhotonState.cc:51
double m_kz
direction in z
Definition: PhotonState.h:275
double getXD() const
Returns detection position x in unfolded prism.
Definition: PhotonState.h:125
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:31
Abstract base class for different kinds of events.
bar segment data in module local frame.
Definition: RaytracerBase.h:49
spherical mirror data in module local frame.
Definition: RaytracerBase.h:80
prism data in module local frame.