Belle II Software development
RaytracerBase Class Reference

Base class with geometry data. More...

#include <RaytracerBase.h>

Inheritance diagram for RaytracerBase:
FastRaytracer InverseRaytracer YScanner

Classes

struct  BarSegment
 bar segment data in module local frame. More...
 
struct  Mirror
 spherical mirror data in module local frame. More...
 
struct  Prism
 prism data in module local frame. More...
 

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

 RaytracerBase (int moduleID, EGeometry geometry=c_Unified, EOptics optics=c_SemiLinear)
 Constructor.
 
int getModuleID () const
 Returns slot ID.
 
EGeometry getGeometry () const
 Returns quartz geometry treatement.
 
EOptics getOptics () const
 Returns treatement of spherical mirror optics.
 
const std::vector< BarSegment > & getBars () const
 Returns geometry data of bar segments.
 
const MirrorgetMirror () const
 Returns geometry data of spherical mirror.
 
const PrismgetPrism () const
 Returns geometry data of prism.
 
void setMirrorCenter (double xc, double yc)
 Sets the mirror center-of-curvature.
 

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
 

Detailed Description

Base class with geometry data.

Definition at line 27 of file RaytracerBase.h.

Member Enumeration Documentation

◆ EGeometry

enum EGeometry

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

Treatement of spherical mirror optics.

Enumerator
c_SemiLinear 

semi-linear approximation

c_Exact 

exact optics

Definition at line 41 of file RaytracerBase.h.

41 {
42 c_SemiLinear = 0,
43 c_Exact = 1
44 };
@ c_SemiLinear
semi-linear approximation
Definition: RaytracerBase.h:42

Constructor & Destructor Documentation

◆ RaytracerBase()

RaytracerBase ( int  moduleID,
EGeometry  geometry = c_Unified,
EOptics  optics = c_SemiLinear 
)
explicit

Constructor.

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

Definition at line 78 of file RaytracerBase.cc.

78 :
79 m_moduleID(moduleID), m_geometry(geometry), m_optics(optics)
80 {
81 const auto* geo = TOPGeometryPar::Instance()->getGeometry();
82 if (not geo->isModuleIDValid(moduleID)) {
83 B2FATAL("TOP::RaytracerBase: invalid slot number, moduleID = " << moduleID);
84 return;
85 }
86 const auto& module = geo->getModule(moduleID);
87
88 m_prism = Prism(module);
89 m_mirror = Mirror(module);
90
91 if (geometry == c_Unified) {
92 m_bars.push_back(BarSegment(module));
93 } else {
94 m_bars.push_back(BarSegment(module.getBarSegment2(), m_prism.zR));
95 m_bars.push_back(BarSegment(module.getBarSegment1(), m_bars.back().zR));
96 m_bars.push_back(BarSegment(module.getMirrorSegment(), m_bars.back().zR));
97 }
98 }
EOptics m_optics
spherical mirror optics
Mirror m_mirror
spherical mirror geometry data
Prism m_prism
prism geometry data
EGeometry m_geometry
quartz geometry
std::vector< BarSegment > m_bars
geometry data of bar segments
const TOPGeometry * getGeometry() const
Returns pointer to geometry object using basf2 units.
static TOPGeometryPar * Instance()
Static method to obtain the pointer to its instance.
double zR
maximal z, i.e position of prism-bar joint

Member Function Documentation

◆ getBars()

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

Returns geometry data of bar segments.

Returns
geometry data of bar segments

Definition at line 161 of file RaytracerBase.h.

161{return m_bars;}

◆ getGeometry()

EGeometry getGeometry ( ) const
inline

Returns quartz geometry treatement.

Returns
quartz geometry treatement

Definition at line 149 of file RaytracerBase.h.

149{return m_geometry;}

◆ getMirror()

const Mirror & getMirror ( ) const
inline

Returns geometry data of spherical mirror.

Returns
geometry data of spherical mirror

Definition at line 167 of file RaytracerBase.h.

167{return m_mirror;}

◆ getModuleID()

int getModuleID ( ) const
inline

Returns slot ID.

Returns
slot ID

Definition at line 143 of file RaytracerBase.h.

143{return m_moduleID;}

◆ getOptics()

EOptics getOptics ( ) const
inline

Returns treatement of spherical mirror optics.

Returns
spherical mirror optics

Definition at line 155 of file RaytracerBase.h.

155{return m_optics;}

◆ getPrism()

const Prism & getPrism ( ) const
inline

Returns geometry data of prism.

Returns
geometry data of prism

Definition at line 173 of file RaytracerBase.h.

173{return m_prism;}

◆ setMirrorCenter()

void setMirrorCenter ( double  xc,
double  yc 
)

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
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

Member Data Documentation

◆ m_bars

std::vector<BarSegment> m_bars
protected

geometry data of bar segments

Definition at line 188 of file RaytracerBase.h.

◆ m_geometry

EGeometry m_geometry = c_Unified
protected

quartz geometry

Definition at line 185 of file RaytracerBase.h.

◆ m_mirror

Mirror m_mirror
protected

spherical mirror geometry data

Definition at line 189 of file RaytracerBase.h.

◆ m_moduleID

int m_moduleID = 0
protected

slot ID

Definition at line 184 of file RaytracerBase.h.

◆ m_optics

EOptics m_optics = c_SemiLinear
protected

spherical mirror optics

Definition at line 186 of file RaytracerBase.h.

◆ m_prism

Prism m_prism
protected

prism geometry data

Definition at line 190 of file RaytracerBase.h.


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