Belle II Software development
PhotonState Class Reference

State of the Cerenkov photon in the quartz optics. More...

#include <PhotonState.h>

Public Types

enum  EType {
  c_Undefined = 0 ,
  c_BarSegment = 1 ,
  c_MirrorSegment = 2 ,
  c_Prism = 3
}
 enumerator for the type of quartz segments More...
 

Public Member Functions

 PhotonState ()
 Default constructor.
 
 PhotonState (const ROOT::Math::XYZPoint &position, const ROOT::Math::XYZVector &direction)
 Constructor with position and direction vectors.
 
 PhotonState (const ROOT::Math::XYZPoint &position, double kx, double ky, double kz)
 Constructor with position vector and direction components.
 
 PhotonState (const ROOT::Math::XYZPoint &position, const ROOT::Math::XYZVector &trackDir, double thc, double fic)
 Constructor with position, track direction and cerenkov angles.
 
PhotonStateflipKy ()
 Changes sign of direction y component.
 
ROOT::Math::XYZPoint getPosition () const
 Returns position as 3D vector.
 
double getX () const
 Returns position in x.
 
double getY () const
 Returns position in y.
 
double getZ () const
 Returns position in z.
 
double getUnfoldedX (double x) const
 Unfolds the position in x.
 
double getUnfoldedY (double y) const
 Unfolds the position in y.
 
double getXD () const
 Returns detection position x in unfolded prism.
 
double getYD () const
 Returns detection position y in unfolded prism.
 
double getZD () const
 Returns detection position z in unfolded prism.
 
ROOT::Math::XYZVector getDirection () const
 Returns direction as 3D unit vector.
 
double getKx () const
 Returns direction in x.
 
double getKy () const
 Returns direction in y.
 
double getKz () const
 Returns direction in z.
 
double getPropagationLen () const
 Returns total propagation length since initial position.
 
int getNx () const
 Returns number of reflections in x at last propagation step.
 
int getNy () const
 Returns number of reflections in y at last propagation step.
 
double getA () const
 Returns width (dimension in x) of the quartz segment at last propagation step.
 
double getB () const
 Returns thickness (dimension in y) of the quartz segment at last propagation step.
 
EType getSegmentType () const
 Returns the type of the quartz segment at last propagation.
 
bool getPropagationStatus () const
 Returns propagation status.
 
bool getTotalReflStatus (double cosTotal) const
 Returns total internal reflection status.
 
bool isInside (const RaytracerBase::BarSegment &bar) const
 Checks if photon is inside the bar segment (including surface).
 
bool isInside (const RaytracerBase::BarSegment &bar, const RaytracerBase::Mirror &mirror) const
 Checks if photon is inside the mirror segment (including surface).
 
bool isInside (const RaytracerBase::Prism &prism) const
 Checks if photon is inside the prism (including surface).
 
void propagate (const RaytracerBase::BarSegment &bar)
 Propagate photon to the exit of bar segment.
 
void propagateSemiLinear (const RaytracerBase::BarSegment &bar, const RaytracerBase::Mirror &mirror)
 Propagate photon to the mirror and reflect it using semi-linear mirror optics.
 
void propagateExact (const RaytracerBase::BarSegment &bar, const RaytracerBase::Mirror &mirror)
 Propagate photon to the mirror and reflect it using exact mirror optics.
 
void propagate (const RaytracerBase::Prism &prism)
 Propagate photon in the prism to the detector plane.
 

Static Public Member Functions

static void setMaxPropagationLen (double maxLen)
 Sets maximal allowed propagation length.
 

Private Attributes

double m_x = 0
 position in x
 
double m_y = 0
 position in y
 
double m_z = 0
 position in z
 
double m_kx = 0
 direction in x
 
double m_ky = 0
 direction in y
 
double m_kz = 0
 direction in z
 
double m_propLen = 0
 propagation length since initial position
 
int m_nx = 0
 signed number of reflections in x at last propagation step
 
int m_ny = 0
 signed number of reflections in y at last propagation step
 
double m_cosx = 0
 maximal cosine of impact angle to surface in x
 
double m_cosy = 0
 maximal cosine of impact angle to surface in y
 
double m_A = 0
 width of the quartz segment (dimension in x) for unfolding
 
double m_B = 0
 thickness of the quartz segment (dimension in y) for unfolding
 
double m_y0 = 0
 origin in y for unfolding
 
double m_yD = 0
 unfolded prism detection position in y
 
double m_zD = 0
 unfolded prism detection position in z
 
EType m_type = c_Undefined
 quartz segment type at last propagation step
 
bool m_status = false
 propagation status
 

Static Private Attributes

static double s_maxLen = 10000
 maximal allowed propagation length
 

Detailed Description

State of the Cerenkov photon in the quartz optics.

Definition at line 27 of file PhotonState.h.

Member Enumeration Documentation

◆ EType

enum EType

enumerator for the type of quartz segments

Enumerator
c_Undefined 

undefined

c_BarSegment 

bar segment

c_MirrorSegment 

mirror segment

c_Prism 

prism

Definition at line 34 of file PhotonState.h.

34 {
35 c_Undefined = 0,
36 c_BarSegment = 1,
37 c_MirrorSegment = 2,
38 c_Prism = 3
39 };
@ c_BarSegment
bar segment
Definition: PhotonState.h:36
@ c_MirrorSegment
mirror segment
Definition: PhotonState.h:37

Constructor & Destructor Documentation

◆ PhotonState() [1/4]

PhotonState ( )
inline

Default constructor.

Definition at line 44 of file PhotonState.h.

45 {}

◆ PhotonState() [2/4]

PhotonState ( const ROOT::Math::XYZPoint &  position,
const ROOT::Math::XYZVector &  direction 
)

Constructor with position and direction vectors.

Parameters
positioninitial photon position (must be inside quartz)
directioninitial direction vector (must be unit vector)

Definition at line 26 of file PhotonState.cc.

26 :
27 m_x(position.X()), m_y(position.Y()), m_z(position.Z()),
28 m_kx(direction.X()), m_ky(direction.Y()), m_kz(direction.Z()),
29 m_status(true)
30 {}
double m_x
position in x
Definition: PhotonState.h:270
double m_ky
direction in y
Definition: PhotonState.h:274
double m_kx
direction in x
Definition: PhotonState.h:273
bool m_status
propagation status
Definition: PhotonState.h:287
double m_z
position in z
Definition: PhotonState.h:272
double m_y
position in y
Definition: PhotonState.h:271
double m_kz
direction in z
Definition: PhotonState.h:275

◆ PhotonState() [3/4]

PhotonState ( const ROOT::Math::XYZPoint &  position,
double  kx,
double  ky,
double  kz 
)

Constructor with position vector and direction components.

Parameters
positioninitial photon position (must be inside quartz)
kxinitial direction x-component (must be unit vector)
kyinitial direction y-component (must be unit vector)
kzinitial direction z-component (must be unit vector)

Definition at line 33 of file PhotonState.cc.

33 :
34 m_x(position.X()), m_y(position.Y()), m_z(position.Z()),
35 m_kx(kx), m_ky(ky), m_kz(kz),
36 m_status(true)
37 {}

◆ PhotonState() [4/4]

PhotonState ( const ROOT::Math::XYZPoint &  position,
const ROOT::Math::XYZVector &  trackDir,
double  thc,
double  fic 
)

Constructor with position, track direction and cerenkov angles.

Parameters
positioninitial photon position (must be inside quartz)
trackDirtrack direction vector (must be unit vector)
thcCerenkov (polar) angle
ficCerenkov azimuthal angle

Definition at line 39 of file PhotonState.cc.

40 :
41 m_x(position.X()), m_y(position.Y()), m_z(position.Z()),
42 m_status(true)
43 {
44 ROOT::Math::XYZVector dir(cos(fic) * sin(thc), sin(fic) * sin(thc), cos(thc));
45 func::rotateUz(dir, trackDir);
46 m_kx = dir.X();
47 m_ky = dir.Y();
48 m_kz = dir.Z();
49 }
void rotateUz(ROOT::Math::XYZVector &vec, const ROOT::Math::XYZVector &z_Axis)
Replacement for a function TVector3::RotateUz which is not implemented in GenVector classes.
Definition: func.h:114

Member Function Documentation

◆ flipKy()

PhotonState & flipKy ( )
inline

Changes sign of direction y component.

Definition at line 75 of file PhotonState.h.

75{m_ky = -m_ky; return *this;}

◆ getA()

double getA ( ) const
inline

Returns width (dimension in x) of the quartz segment at last propagation step.

Returns
width

Definition at line 185 of file PhotonState.h.

185{return m_A;}
double m_A
width of the quartz segment (dimension in x) for unfolding
Definition: PhotonState.h:281

◆ getB()

double getB ( ) const
inline

Returns thickness (dimension in y) of the quartz segment at last propagation step.

For prism it is the size of exit window.

Returns
thickness

Definition at line 192 of file PhotonState.h.

192{return m_B;}
double m_B
thickness of the quartz segment (dimension in y) for unfolding
Definition: PhotonState.h:282

◆ getDirection()

ROOT::Math::XYZVector getDirection ( ) const
inline

Returns direction as 3D unit vector.

Returns
direction

Definition at line 143 of file PhotonState.h.

143{return ROOT::Math::XYZVector(m_kx, m_ky, m_kz);}

◆ getKx()

double getKx ( ) const
inline

Returns direction in x.

Returns
direction in x

Definition at line 149 of file PhotonState.h.

149{return m_kx;}

◆ getKy()

double getKy ( ) const
inline

Returns direction in y.

Returns
direction in y

Definition at line 155 of file PhotonState.h.

155{return m_ky;}

◆ getKz()

double getKz ( ) const
inline

Returns direction in z.

Returns
direction in z

Definition at line 161 of file PhotonState.h.

161{return m_kz;}

◆ getNx()

int getNx ( ) const
inline

Returns number of reflections in x at last propagation step.

Returns
signed number of reflections

Definition at line 173 of file PhotonState.h.

173{return m_nx;}
int m_nx
signed number of reflections in x at last propagation step
Definition: PhotonState.h:277

◆ getNy()

int getNy ( ) const
inline

Returns number of reflections in y at last propagation step.

Returns
signed number of reflections

Definition at line 179 of file PhotonState.h.

179{return m_ny;}
int m_ny
signed number of reflections in y at last propagation step
Definition: PhotonState.h:278

◆ getPosition()

ROOT::Math::XYZPoint getPosition ( ) const
inline

Returns position as 3D vector.

Returns
position

Definition at line 87 of file PhotonState.h.

87{return ROOT::Math::XYZPoint(m_x, m_y, m_z);}

◆ getPropagationLen()

double getPropagationLen ( ) const
inline

Returns total propagation length since initial position.

Returns
propagation length

Definition at line 167 of file PhotonState.h.

167{return m_propLen;}
double m_propLen
propagation length since initial position
Definition: PhotonState.h:276

◆ getPropagationStatus()

bool getPropagationStatus ( ) const
inline

Returns propagation status.

Returns
true on success

Definition at line 204 of file PhotonState.h.

204{return m_status;}

◆ getSegmentType()

EType getSegmentType ( ) const
inline

Returns the type of the quartz segment at last propagation.

Returns
type quartz segment type

Definition at line 198 of file PhotonState.h.

198{return m_type;}
EType m_type
quartz segment type at last propagation step
Definition: PhotonState.h:286

◆ getTotalReflStatus()

bool getTotalReflStatus ( double  cosTotal) const
inline

Returns total internal reflection status.

Parameters
cosTotalcosine of total reflection angle
Returns
true if totally reflected

Definition at line 211 of file PhotonState.h.

212 {
213 return ((m_nx == 0 or m_cosx < cosTotal) and (m_ny == 0 or m_cosy < cosTotal));
214 }
double m_cosy
maximal cosine of impact angle to surface in y
Definition: PhotonState.h:280
double m_cosx
maximal cosine of impact angle to surface in x
Definition: PhotonState.h:279

◆ getUnfoldedX()

double getUnfoldedX ( double  x) const
inline

Unfolds the position in x.

Parameters
xposition to unfold
Returns
unfolded position

Definition at line 112 of file PhotonState.h.

112{return func::unfold(x, m_nx, m_A);}
double unfold(double x, int nx, double A)
unfold a coordinate.
Definition: func.h:31

◆ getUnfoldedY()

double getUnfoldedY ( double  y) const
inline

Unfolds the position in y.

Parameters
yposition to unfold
Returns
unfolded position

Definition at line 119 of file PhotonState.h.

119{return (func::unfold(y - m_y0, m_ny, m_B) + m_y0);}
double m_y0
origin in y for unfolding
Definition: PhotonState.h:283

◆ getX()

double getX ( ) const
inline

Returns position in x.

Returns
position in x

Definition at line 93 of file PhotonState.h.

93{return m_x;}

◆ getXD()

double getXD ( ) const
inline

Returns detection position x in unfolded prism.

Returns
detection position x in unfolded prism

Definition at line 125 of file PhotonState.h.

125{return getUnfoldedX(m_x);}
double getUnfoldedX(double x) const
Unfolds the position in x.
Definition: PhotonState.h:112

◆ getY()

double getY ( ) const
inline

Returns position in y.

Returns
position in y

Definition at line 99 of file PhotonState.h.

99{return m_y;}

◆ getYD()

double getYD ( ) const
inline

Returns detection position y in unfolded prism.

Returns
detection position y in unfolded prism

Definition at line 131 of file PhotonState.h.

131{return m_yD;}
double m_yD
unfolded prism detection position in y
Definition: PhotonState.h:284

◆ getZ()

double getZ ( ) const
inline

Returns position in z.

Returns
position in z

Definition at line 105 of file PhotonState.h.

105{return m_z;}

◆ getZD()

double getZD ( ) const
inline

Returns detection position z in unfolded prism.

Returns
detection position z in unfolded prism

Definition at line 137 of file PhotonState.h.

137{return m_zD;}
double m_zD
unfolded prism detection position in z
Definition: PhotonState.h:285

◆ isInside() [1/3]

bool isInside ( const RaytracerBase::BarSegment bar) const

Checks if photon is inside the bar segment (including surface).

Parameters
barbar segment data
Returns
true if inside

Definition at line 51 of file PhotonState.cc.

52 {
53 if (std::abs(m_x) > bar.A / 2) return false;
54 if (std::abs(m_y) > bar.B / 2) return false;
55 if (m_z < bar.zL or m_z > bar.zR) return false;
56 return true;
57 }

◆ isInside() [2/3]

bool isInside ( const RaytracerBase::BarSegment bar,
const RaytracerBase::Mirror mirror 
) const

Checks if photon is inside the mirror segment (including surface).

Parameters
barbar segment data
mirrorspherical mirror data
Returns
true if inside

Definition at line 60 of file PhotonState.cc.

61 {
62 if (std::abs(m_x) > bar.A / 2) return false;
63 if (std::abs(m_y) > bar.B / 2) return false;
64 if (m_z < bar.zL) return false;
65 double Rsq = pow(m_x - mirror.xc, 2) + pow(m_y - mirror.yc, 2) + pow(m_z - mirror.zc, 2);
66 if (Rsq > pow(mirror.R, 2)) return false;
67 return true;
68 }

◆ isInside() [3/3]

bool isInside ( const RaytracerBase::Prism prism) const

Checks if photon is inside the prism (including surface).

Parameters
prismprism data
Returns
true if inside

Definition at line 71 of file PhotonState.cc.

72 {
73 if (std::abs(m_x) > prism.A / 2) return false;
74 if (m_z < prism.zL or m_z > prism.zR) return false;
75 if (m_y > prism.yUp or m_y < prism.yDown) return false;
76 double y = prism.yDown + (prism.yDown + prism.B / 2) / (prism.zFlat - prism.zR) * (m_z - prism.zFlat);
77 if (m_y < y) return false;
78 return true;
79 }

◆ propagate() [1/2]

void propagate ( const RaytracerBase::BarSegment bar)

Propagate photon to the exit of bar segment.

Parameters
barbar segment data

Definition at line 82 of file PhotonState.cc.

83 {
84 if (not m_status) return;
85
86 m_cosx = std::abs(m_kx);
87 m_cosy = std::abs(m_ky);
88 m_A = bar.A;
89 m_B = bar.B;
91
92 double z = bar.zR;
93 if (m_kz < 0) z = bar.zL;
94 if (z == m_z) return;
95
96 m_status = false;
97
98 double len = (z - m_z) / m_kz;
99 if (len < 0 or len > s_maxLen) return;
100 m_propLen += len;
101
102 func::fold(m_x + len * m_kx, bar.A, m_x, m_kx, m_nx);
103 func::fold(m_y + len * m_ky, bar.B, m_y, m_ky, m_ny);
104 m_z = z;
105
106 m_status = true;
107 }
static double s_maxLen
maximal allowed propagation length
Definition: PhotonState.h:289
void fold(double xu, double A, double &x, double &kx, int &nx)
fold a coordinate (inverse of unfold).
Definition: func.h:59

◆ propagate() [2/2]

void propagate ( const RaytracerBase::Prism prism)

Propagate photon in the prism to the detector plane.

Parameters
prismprism data

Definition at line 247 of file PhotonState.cc.

248 {
249 if (not m_status) return;
250
251 m_status = false;
252
253 m_cosx = std::abs(m_kx);
254 m_A = prism.A;
255 m_B = prism.yUp - prism.yDown;
256 m_y0 = (prism.yUp + prism.yDown) / 2;
257 m_type = c_Prism;
258
259 if (m_kz > 0) {
260 if (m_z >= prism.zR or std::abs(m_ky / m_kz) < std::abs(prism.slope)) return;
261 if (std::abs(m_y + m_ky / m_kz * (prism.zR - m_z)) < prism.B / 2) return;
262 }
263 double ky_in = m_ky;
264 double kz_in = m_kz;
265
266 if (m_z > prism.zFlat) {
267
268 int step = 1;
269 int ii = 0;
270 if (m_ky < 0) {
271 step = -1;
272 ii = 1;
273 m_y = std::min(m_y, prism.yUp);
274 }
275
276 unsigned k = prism.k0;
277 while (k < prism.unfoldedWindows.size()) {
278 const auto& win = prism.unfoldedWindows[k];
279 double s = m_ky * win.sz - m_kz * win.sy;
280 if (s == 0) {
281 k += step;
282 ii = (ii + 1) % 2;
283 continue;
284 }
285 double len = ((win.y0 - m_y) * win.sz - (win.z0 - m_z) * win.sy) / s;
286 m_yD = m_y + len * m_ky;
287 m_zD = m_z + len * m_kz;
288 double yu = m_yD - win.y0;
289 double zu = m_zD - win.z0;
290 double y = yu * win.sy + zu * win.sz;
291 if (y >= prism.yDown and y <= prism.yUp) {
292 if (len < 0 or len > s_maxLen) return;
293 double ky = m_ky * win.sy + m_kz * win.sz;
294 double kz = m_kz * win.sy - m_ky * win.sz;
295 m_x += len * m_kx;
296 m_y = y;
297 m_ky = ky;
298 m_ny = k - prism.k0;
299 m_z = prism.zFlat;
300 m_kz = m_ny % 2 == 0 ? kz : -kz;
301 m_propLen += len;
302 goto success;
303 }
304 m_cosy = std::max(m_cosy, std::abs(ky_in * win.nsy[ii] + kz_in * win.nsz[ii]));
305 k += step;
306 ii = (ii + 1) % 2;
307 }
308 B2DEBUG(20, "TOP::PhotonState::propagate: unfolded prism window not found"
309 << LogVar("yUp", prism.yUp) << LogVar("yDown", prism.yDown) << LogVar("zR", prism.zR)
310 << LogVar("y", m_y) << LogVar("z", m_z)
311 << LogVar("ky", ky_in) << LogVar("kz", kz_in));
312 return;
313 } else {
314 m_yD = m_y;
315 m_zD = m_z;
316 }
317
318success:
319 double len = (prism.zD - m_z) / m_kz;
320 if (len < 0 or len > s_maxLen) return;
321 func::fold(m_x + len * m_kx, prism.A, m_x, m_kx, m_nx);
322 m_y += len * m_ky;
323 m_z = prism.zD;
324 m_propLen += len;
325 m_yD += len * ky_in;
326 m_zD += len * kz_in;
327
328 m_status = true;
329 }
Class to store variables with their name which were sent to the logging service.

◆ propagateExact()

void propagateExact ( const RaytracerBase::BarSegment bar,
const RaytracerBase::Mirror mirror 
)

Propagate photon to the mirror and reflect it using exact mirror optics.

Parameters
barmirror segment data
mirrorspherical mirror data

Definition at line 176 of file PhotonState.cc.

177 {
178 if (not m_status) return;
179
180 m_cosx = std::abs(m_kx);
181 m_cosy = std::abs(m_ky);
182 m_A = bar.A;
183 m_B = bar.B;
185
186 m_status = false;
187
188 if (m_kz < 0) return;
189
190 double len = 0;
191 if (m_z < mirror.zb) {
192 len = (mirror.zb - m_z) / m_kz;
193 if (len > s_maxLen) return;
194 }
195
196 double xm = m_x + len * m_kx;
197 int nx = lround(xm / bar.A);
198 double ym = m_y + len * m_ky;
199 int ny = lround(ym / bar.B);
200 int i = 0;
201 while (true) {
202 double xc = func::unfold(mirror.xc, nx, bar.A);
203 double yc = func::unfold(mirror.yc, ny, bar.B);
204 double x = m_x - xc;
205 double y = m_y - yc;
206 double z = m_z - mirror.zc;
207 double rdir = x * m_kx + y * m_ky + z * m_kz;
208 double rr = x * x + y * y + z * z;
209 double D = rdir * rdir + (mirror.R * mirror.R - rr);
210 if (D < 0) return;
211 D = sqrt(D);
212 len = (D - rdir);
213 if (len < 0 or len > s_maxLen) return;
214 double xmm = m_x + len * m_kx;
215 int nxx = lround(xmm / bar.A);
216 double ymm = m_y + len * m_ky;
217 int nyy = lround(ymm / bar.B);
218 if (nxx == nx and nyy == ny) break;
219 i++;
220 if (i == 10) {
221 if (std::abs(xmm - xm) < 0.001 and std::abs(ymm - ym) < 0.001) break;
222 B2DEBUG(20, "TOP::PhotonState::propagateExact: not converging");
223 return;
224 }
225 nx = nxx;
226 ny = nyy;
227 }
228
229 m_propLen += len;
230
231 func::fold(m_x + len * m_kx, bar.A, m_x, m_kx, m_nx);
232 func::fold(m_y + len * m_ky, bar.B, m_y, m_ky, m_ny);
233 m_z += len * m_kz;
234
235 double normX = (m_x - mirror.xc) / mirror.R;
236 double normY = (m_y - mirror.yc) / mirror.R;
237 double normZ = (m_z - mirror.zc) / mirror.R;
238 double s = 2 * (m_kx * normX + m_ky * normY + m_kz * normZ);
239 m_kx -= s * normX;
240 m_ky -= s * normY;
241 m_kz -= s * normZ;
242
243 m_status = true;
244 }
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28

◆ propagateSemiLinear()

void propagateSemiLinear ( const RaytracerBase::BarSegment bar,
const RaytracerBase::Mirror mirror 
)

Propagate photon to the mirror and reflect it using semi-linear mirror optics.

Semi-linear: mirror surface approximated with a cylinder along y-axis and using linear optics approximation in y for the photon reflection. Useful to get rid of some of the discontinuities in the TOP image at given wavelength, which are anyway smeared-out by the dispersion and other processes.

Parameters
barmirror segment data
mirrorspherical mirror data

Definition at line 110 of file PhotonState.cc.

111 {
112 if (not m_status) return;
113
114 m_cosx = std::abs(m_kx);
115 m_cosy = std::abs(m_ky);
116 m_A = bar.A;
117 m_B = bar.B;
119
120 m_status = false;
121
122 if (m_kz < 0) return;
123
124 double len = 0;
125 if (m_z < mirror.zb) {
126 len = (mirror.zb - m_z) / m_kz;
127 if (len > s_maxLen) return;
128 }
129
130 double xm = m_x + len * m_kx;
131 int nx = lround(xm / bar.A);
132 double ss = m_kx * m_kx + m_kz * m_kz;
133 if (ss == 0) return;
134 int i = 0;
135 while (true) {
136 double xc = func::unfold(mirror.xc, nx, bar.A);
137 double x = m_x - xc;
138 double z = m_z - mirror.zc;
139 double rdir = x * m_kx + z * m_kz;
140 double rr = x * x + z * z;
141 double D = rdir * rdir + (mirror.R * mirror.R - rr) * ss;
142 if (D < 0) return;
143 D = sqrt(D);
144 len = (D - rdir) / ss;
145 if (len < 0 or len > s_maxLen) return;
146 double xmm = m_x + len * m_kx;
147 int nxx = lround(xmm / bar.A);
148 if (nxx == nx) break;
149 i++;
150 if (i == 10) {
151 if (std::abs(xmm - xm) < 0.001) break;
152 B2DEBUG(20, "TOP::PhotonState::propagateSemiLinear: not converging");
153 return;
154 }
155 nx = nxx;
156 xm = xmm;
157 }
158
159 m_propLen += len;
160
161 func::fold(m_x + len * m_kx, bar.A, m_x, m_kx, m_nx);
162 func::fold(m_y + len * m_ky, bar.B, m_y, m_ky, m_ny);
163 m_y = mirror.yc;
164 m_z += len * m_kz;
165
166 double normX = (m_x - mirror.xc) / mirror.R;
167 double normZ = (m_z - mirror.zc) / mirror.R;
168 double s = 2 * (m_kx * normX + m_kz * normZ);
169 m_kx -= s * normX;
170 m_kz -= s * normZ;
171
172 m_status = true;
173 }

◆ setMaxPropagationLen()

static void setMaxPropagationLen ( double  maxLen)
inlinestatic

Sets maximal allowed propagation length.

Parameters
maxLenmaximal allowed propagation length

Definition at line 81 of file PhotonState.h.

81{s_maxLen = maxLen;}

Member Data Documentation

◆ m_A

double m_A = 0
private

width of the quartz segment (dimension in x) for unfolding

Definition at line 281 of file PhotonState.h.

◆ m_B

double m_B = 0
private

thickness of the quartz segment (dimension in y) for unfolding

Definition at line 282 of file PhotonState.h.

◆ m_cosx

double m_cosx = 0
private

maximal cosine of impact angle to surface in x

Definition at line 279 of file PhotonState.h.

◆ m_cosy

double m_cosy = 0
private

maximal cosine of impact angle to surface in y

Definition at line 280 of file PhotonState.h.

◆ m_kx

double m_kx = 0
private

direction in x

Definition at line 273 of file PhotonState.h.

◆ m_ky

double m_ky = 0
private

direction in y

Definition at line 274 of file PhotonState.h.

◆ m_kz

double m_kz = 0
private

direction in z

Definition at line 275 of file PhotonState.h.

◆ m_nx

int m_nx = 0
private

signed number of reflections in x at last propagation step

Definition at line 277 of file PhotonState.h.

◆ m_ny

int m_ny = 0
private

signed number of reflections in y at last propagation step

Definition at line 278 of file PhotonState.h.

◆ m_propLen

double m_propLen = 0
private

propagation length since initial position

Definition at line 276 of file PhotonState.h.

◆ m_status

bool m_status = false
private

propagation status

Definition at line 287 of file PhotonState.h.

◆ m_type

EType m_type = c_Undefined
private

quartz segment type at last propagation step

Definition at line 286 of file PhotonState.h.

◆ m_x

double m_x = 0
private

position in x

Definition at line 270 of file PhotonState.h.

◆ m_y

double m_y = 0
private

position in y

Definition at line 271 of file PhotonState.h.

◆ m_y0

double m_y0 = 0
private

origin in y for unfolding

Definition at line 283 of file PhotonState.h.

◆ m_yD

double m_yD = 0
private

unfolded prism detection position in y

Definition at line 284 of file PhotonState.h.

◆ m_z

double m_z = 0
private

position in z

Definition at line 272 of file PhotonState.h.

◆ m_zD

double m_zD = 0
private

unfolded prism detection position in z

Definition at line 285 of file PhotonState.h.

◆ s_maxLen

double s_maxLen = 10000
staticprivate

maximal allowed propagation length

Definition at line 289 of file PhotonState.h.


The documentation for this class was generated from the following files: