Belle II Software  release-08-01-10
FastRaytracer Class Reference

Fast photon propagation in quartz optics. More...

#include <FastRaytracer.h>

Inheritance diagram for FastRaytracer:
Collaboration diagram for FastRaytracer:

Public Types

enum  EGeometry {
  c_Unified = 0 ,
  c_Segmented = 1
}
 Treatement of quartz geometry. More...
 
enum  EOptics {
  c_SemiLinear = 0 ,
  c_Exact = 1
}
 Treatement of spherical mirror optics. More...
 

Public Member Functions

 FastRaytracer (int moduleID, EGeometry geometry=c_Unified, EOptics optics=c_SemiLinear)
 Constructor. More...
 
void clear () const
 Clear mutable variables.
 
void propagate (const PhotonState &photon, bool averaging=false) const
 Propagate photon to photo-detector plane. More...
 
const std::vector< PhotonState > & getPhotonStates () const
 Returns photon states (results of propagation). More...
 
const std::vector< PhotonState > & getExtraStates () const
 Returns extra states. More...
 
bool getPropagationStatus () const
 Returns propagation status. More...
 
bool getTotalReflStatus (double cosTotal) const
 Returns total internal reflection status. More...
 
double getPropagationLen () const
 Returns total propagation length since initial position. More...
 
double getPropagationLenDelta () const
 Returns total propagation length difference between true and flipped prism. More...
 
double getXD () const
 Returns unfolded position in x at virtual Detector plane. More...
 
double getYD () const
 Returns unfolded position in y at virtual Detector plane. More...
 
double getInPlaneYD () const
 Returns unfolded position in y such that the prism unfolded windows are turned over into the real Detector plane. More...
 
double getZD () const
 Returns unfolded position in z of virtual Detector plane. More...
 
double getYB () const
 Returns unfolded position in y at Bar-prism-connection plane. More...
 
int getNx () const
 Returns signed number of reflections in x. More...
 
int getNxm () const
 Returns signed number of reflections in x before mirror. More...
 
int getNxb () const
 Returns signed number of reflections in x after mirror and before prism. More...
 
int getNxe () const
 Returns signed number of reflections in x inside prism. More...
 
int getNy () const
 Returns signed number of reflections in y. More...
 
int getNym () const
 Returns signed number of reflections in y before mirror. More...
 
int getNyb () const
 Returns signed number of reflections in y after mirror and before prism. More...
 
int getNye () const
 Returns signed number of reflections in y inside prism. More...
 
int getNys () const
 Returns number of reflections on slanted prism surface. More...
 
int getModuleID () const
 Returns slot ID. More...
 
EGeometry getGeometry () const
 Returns quartz geometry treatement. More...
 
EOptics getOptics () const
 Returns treatement of spherical mirror optics. More...
 
const std::vector< BarSegment > & getBars () const
 Returns geometry data of bar segments. More...
 
const MirrorgetMirror () const
 Returns geometry data of spherical mirror. More...
 
const PrismgetPrism () const
 Returns geometry data of prism. More...
 
void setMirrorCenter (double xc, double yc)
 Sets the mirror center-of-curvature. More...
 

Protected Attributes

int m_moduleID = 0
 slot ID
 
EGeometry m_geometry = c_Unified
 quartz geometry
 
EOptics m_optics = c_SemiLinear
 spherical mirror optics
 
std::vector< BarSegmentm_bars
 geometry data of bar segments
 
Mirror m_mirror
 spherical mirror geometry data
 
Prism m_prism
 prism geometry data
 

Private Attributes

std::vector< PhotonStatem_photonStates
 photon states at propagation steps
 
std::vector< PhotonStatem_extraStates
 extra storage
 
bool m_status = false
 propagation status
 
int m_Nxm = 0
 number of reflections in x before mirror
 
int m_Nxb = 0
 number of reflections in x after mirror and before prism
 
int m_Nxe = 0
 number of reflections in x inside prism
 
int m_Nym = 0
 number of reflections in y before mirror
 
int m_Nyb = 0
 number of reflections in y after mirror and before prism
 
int m_Nye = 0
 number of reflections in y inside prism
 

Detailed Description

Fast photon propagation in quartz optics.

Definition at line 26 of file FastRaytracer.h.

Member Enumeration Documentation

◆ EGeometry

enum EGeometry
inherited

Treatement of quartz geometry.

Enumerator
c_Unified 

single bar with average width and thickness

c_Segmented 

segmented bars

Definition at line 33 of file RaytracerBase.h.

33  {
34  c_Unified = 0,
35  c_Segmented = 1
36  };
@ c_Unified
single bar with average width and thickness
Definition: RaytracerBase.h:34
@ c_Segmented
segmented bars
Definition: RaytracerBase.h:35

◆ EOptics

enum EOptics
inherited

Treatement of spherical mirror optics.

Enumerator
c_SemiLinear 

semi-linear approximation

c_Exact 

exact optics

Definition at line 41 of file RaytracerBase.h.

Constructor & Destructor Documentation

◆ FastRaytracer()

FastRaytracer ( int  moduleID,
EGeometry  geometry = c_Unified,
EOptics  optics = c_SemiLinear 
)
inlineexplicit

Constructor.

Parameters
moduleIDslot ID
geometrytreatement of quartz geometry
opticstreatement of spherical mirror optics

Definition at line 36 of file FastRaytracer.h.

36  :
37  RaytracerBase(moduleID, geometry, optics)
38  {};
RaytracerBase(int moduleID, EGeometry geometry=c_Unified, EOptics optics=c_SemiLinear)
Constructor.

Member Function Documentation

◆ getBars()

const std::vector<BarSegment>& getBars ( ) const
inlineinherited

Returns geometry data of bar segments.

Returns
geometry data of bar segments

Definition at line 161 of file RaytracerBase.h.

◆ getExtraStates()

const std::vector<PhotonState>& getExtraStates ( ) const
inline

Returns extra states.

Returns
extra states

Definition at line 62 of file FastRaytracer.h.

◆ getGeometry()

EGeometry getGeometry ( ) const
inlineinherited

Returns quartz geometry treatement.

Returns
quartz geometry treatement

Definition at line 149 of file RaytracerBase.h.

◆ getInPlaneYD()

double getInPlaneYD ( ) const

Returns unfolded position in y such that the prism unfolded windows are turned over into the real Detector plane.

Reliable only if propagation status is true. For reflected photons unfolding is done up to spherical mirror.

Returns
unfolded position in y at real Detector plane

Definition at line 143 of file FastRaytracer.cc.

144  {
145  if (m_photonStates.empty()) return 0;
146 
147  double y = m_photonStates.back().getY();
148  for (int i = m_photonStates.size() - 1; i > 0; i--) {
149  const auto& photonState = m_photonStates[i];
150  if (photonState.getSegmentType() == PhotonState::c_MirrorSegment) break;
151  y = photonState.getUnfoldedY(y);
152  }
153  return y;
154  }
std::vector< PhotonState > m_photonStates
photon states at propagation steps
@ c_MirrorSegment
mirror segment
Definition: PhotonState.h:37

◆ getMirror()

const Mirror& getMirror ( ) const
inlineinherited

Returns geometry data of spherical mirror.

Returns
geometry data of spherical mirror

Definition at line 167 of file RaytracerBase.h.

◆ getModuleID()

int getModuleID ( ) const
inlineinherited

Returns slot ID.

Returns
slot ID

Definition at line 143 of file RaytracerBase.h.

◆ getNx()

int getNx ( ) const

Returns signed number of reflections in x.

Reliable only if propagation status is true.

Returns
number of reflections in x

Definition at line 180 of file FastRaytracer.cc.

◆ getNxb()

int getNxb ( ) const
inline

Returns signed number of reflections in x after mirror and before prism.

Reliable only if propagation status is true.

Returns
number of reflections in x

Definition at line 152 of file FastRaytracer.h.

◆ getNxe()

int getNxe ( ) const
inline

Returns signed number of reflections in x inside prism.

Reliable only if propagation status is true.

Returns
number of reflections in x

Definition at line 159 of file FastRaytracer.h.

◆ getNxm()

int getNxm ( ) const
inline

Returns signed number of reflections in x before mirror.

Reliable only if propagation status is true.

Returns
number of reflections in x

Definition at line 145 of file FastRaytracer.h.

◆ getNy()

int getNy ( ) const

Returns signed number of reflections in y.

Reliable only if propagation status is true.

Returns
number of reflections in y

Definition at line 189 of file FastRaytracer.cc.

◆ getNyb()

int getNyb ( ) const
inline

Returns signed number of reflections in y after mirror and before prism.

Reliable only if propagation status is true.

Returns
number of reflections in y

Definition at line 180 of file FastRaytracer.h.

◆ getNye()

int getNye ( ) const
inline

Returns signed number of reflections in y inside prism.

Reliable only if propagation status is true.

Returns
number of reflections in y

Definition at line 187 of file FastRaytracer.h.

◆ getNym()

int getNym ( ) const
inline

Returns signed number of reflections in y before mirror.

Reliable only if propagation status is true.

Returns
number of reflections in y

Definition at line 173 of file FastRaytracer.h.

◆ getNys()

int getNys ( ) const

Returns number of reflections on slanted prism surface.

Reliable only if propagation status is true.

Returns
number of reflections on slanted prism surface

Definition at line 197 of file FastRaytracer.cc.

◆ getOptics()

EOptics getOptics ( ) const
inlineinherited

Returns treatement of spherical mirror optics.

Returns
spherical mirror optics

Definition at line 155 of file RaytracerBase.h.

◆ getPhotonStates()

const std::vector<PhotonState>& getPhotonStates ( ) const
inline

Returns photon states (results of propagation).

Returns
photon states

Definition at line 56 of file FastRaytracer.h.

◆ getPrism()

const Prism& getPrism ( ) const
inlineinherited

Returns geometry data of prism.

Returns
geometry data of prism

Definition at line 173 of file RaytracerBase.h.

◆ getPropagationLen()

double getPropagationLen ( ) const

Returns total propagation length since initial position.

If averaging is ON the return value equals to arithmetic average of true and flipped prism.

Returns
propagation length

Definition at line 100 of file FastRaytracer.cc.

◆ getPropagationLenDelta()

double getPropagationLenDelta ( ) const

Returns total propagation length difference between true and flipped prism.

Returns
propagation length difference (or 0 if averaging is OFF)

Definition at line 107 of file FastRaytracer.cc.

◆ getPropagationStatus()

bool getPropagationStatus ( ) const
inline

Returns propagation status.

Returns
true on success

Definition at line 68 of file FastRaytracer.h.

◆ getTotalReflStatus()

bool getTotalReflStatus ( double  cosTotal) const

Returns total internal reflection status.

Reliable only if propagation status is true.

Parameters
cosTotalcosine of total reflection angle
Returns
true if totally reflected

Definition at line 92 of file FastRaytracer.cc.

◆ getXD()

double getXD ( ) const

Returns unfolded position in x at virtual Detector plane.

If averaging is ON the return value equals to arithmetic average of true and flipped prism. Reliable only if propagation status is true. For reflected photons unfolding is done up to spherical mirror.

Returns
unfolded position in x at virtual Detector plane

Definition at line 113 of file FastRaytracer.cc.

◆ getYB()

double getYB ( ) const

Returns unfolded position in y at Bar-prism-connection plane.

Reliable only if propagation status is true. For reflected photons unfolding is done up to spherical mirror.

Returns
unfolded position in y at Bar-prism-connection plane

Definition at line 165 of file FastRaytracer.cc.

◆ getYD()

double getYD ( ) const

Returns unfolded position in y at virtual Detector plane.

Reliable only if propagation status is true. For reflected photons unfolding is done up to spherical mirror.

Returns
unfolded position in y at virtual Detector plane

Definition at line 129 of file FastRaytracer.cc.

◆ getZD()

double getZD ( ) const

Returns unfolded position in z of virtual Detector plane.

If averaging is ON the return value equals to arithmetic average of true and flipped prism. Reliable only if propagation status is true.

Returns
unfolded position in z of virtual Detector plane

Definition at line 157 of file FastRaytracer.cc.

◆ propagate()

void propagate ( const PhotonState photon,
bool  averaging = false 
) const

Propagate photon to photo-detector plane.

Parameters
photoninitial photon state
averagingif true, propagate photon also in upside-down flipped prism

Definition at line 33 of file FastRaytracer.cc.

◆ setMirrorCenter()

void setMirrorCenter ( double  xc,
double  yc 
)
inherited

Sets the mirror center-of-curvature.

Parameters
xccenter of curvature in x
yccenter of curvature in y

Definition at line 100 of file RaytracerBase.cc.

101  {
102  m_mirror.xc = xc;
103  m_mirror.yc = yc;
104 
105  double zc = m_mirror.zc;
106  double R = m_mirror.R;
107  double zb = zc + R;
108  double Ah = m_bars.back().A / 2;
109  double Bh = m_bars.back().B / 2;
110  zb = std::min(zb, zc + sqrt(pow(R, 2) - pow(xc - Ah, 2) - pow(yc - Bh, 2)));
111  zb = std::min(zb, zc + sqrt(pow(R, 2) - pow(xc + Ah, 2) - pow(yc - Bh, 2)));
112  zb = std::min(zb, zc + sqrt(pow(R, 2) - pow(xc - Ah, 2) - pow(yc + Bh, 2)));
113  zb = std::min(zb, zc + sqrt(pow(R, 2) - pow(xc + Ah, 2) - pow(yc + Bh, 2)));
114  m_mirror.zb = zb;
115  }
double R
typedef autogenerated by FFTW
Mirror m_mirror
spherical mirror geometry data
std::vector< BarSegment > m_bars
geometry data of bar segments
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28
double yc
center of curvature in y
Definition: RaytracerBase.h:82
double xc
center of curvature in x
Definition: RaytracerBase.h:81
double zb
minimum of mirror surface in z
Definition: RaytracerBase.h:85
double zc
center of curvature in z
Definition: RaytracerBase.h:83

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