Belle II Software development
CurvWithArcLength2DCache Class Reference

Class representing a curvature value that also caches two dimensional arc length to each layer in the CDC. More...

#include <StandardAxes.h>

Public Member Functions

 CurvWithArcLength2DCache (float curv)
 Make cache for one curvature value.
 
 operator float () const
 Unpack the curvature.
 
float getArcLength2D (ILayer iCLayer, bool secondArm=false) const
 Return the two dimensional arc length to the given layer id.
 

Private Attributes

float m_curv
 Memory for the curvature.
 
std::array< float, 56 > m_arcLength2DByICLayer
 Memory for two dimensional arc length at each layer.
 
std::array< float, 56 > m_secondaryArcLength2DByICLayer
 Memory for two dimensional arc length at each layer on the second arm.
 

Friends

std::ostream & operator<< (std::ostream &output, const CurvWithArcLength2DCache &value)
 Output operator for debugging.
 

Detailed Description

Class representing a curvature value that also caches two dimensional arc length to each layer in the CDC.

Definition at line 44 of file StandardAxes.h.

Constructor & Destructor Documentation

◆ CurvWithArcLength2DCache()

CurvWithArcLength2DCache ( float  curv)
explicit

Make cache for one curvature value.

Definition at line 18 of file StandardAxes.cc.

19 : m_curv(curv)
21{
23
24 for (const CDCWireLayer& wireLayer : wireTopology.getWireLayers()) {
25 ILayer iCLayer = wireLayer.getICLayer();
26 double cylindricalR = (wireLayer.getOuterCylindricalR() + wireLayer.getInnerCylindricalR()) / 2;
27 double factor = GeneralizedCircle::arcLengthFactor(cylindricalR, curv);
28
29 // Fall back when the closest approach to the layer is the apogee
30 double arcLength2D = cylindricalR * std::fmin(factor, M_PI);
31 double r = 1.0 / fabs(m_curv);
32
33 m_arcLength2DByICLayer[iCLayer] = arcLength2D;
34 m_secondaryArcLength2DByICLayer[iCLayer] = 2 * M_PI * r - arcLength2D;
35 }
36}
Class representing a sense wire layer in the central drift chamber.
Definition: CDCWireLayer.h:42
Class representing the sense wire arrangement in the whole of the central drift chamber.
const std::vector< Belle2::TrackFindingCDC::CDCWireLayer > & getWireLayers() const
Getter for the underlying storing layer vector.
static CDCWireTopology & getInstance()
Getter for the singleton instance of the wire topology.
std::array< float, 56 > m_secondaryArcLength2DByICLayer
Memory for two dimensional arc length at each layer on the second arm.
Definition: StandardAxes.h:75
std::array< float, 56 > m_arcLength2DByICLayer
Memory for two dimensional arc length at each layer.
Definition: StandardAxes.h:72
double arcLengthFactor(const double directDistance) const
Helper function the calculate the factor between the length of a secant line and the length on the ar...

Member Function Documentation

◆ getArcLength2D()

float getArcLength2D ( ILayer  iCLayer,
bool  secondArm = false 
) const
inline

Return the two dimensional arc length to the given layer id.

Definition at line 56 of file StandardAxes.h.

57 {
58 return secondArm ? m_secondaryArcLength2DByICLayer[iCLayer] : m_arcLength2DByICLayer[iCLayer];
59 }

◆ operator float()

operator float ( ) const
inlineexplicit

Unpack the curvature.

Definition at line 50 of file StandardAxes.h.

51 {
52 return m_curv;
53 }

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  output,
const CurvWithArcLength2DCache value 
)
friend

Output operator for debugging.

Definition at line 62 of file StandardAxes.h.

63 {
64 return output << value.m_curv;
65 }

Member Data Documentation

◆ m_arcLength2DByICLayer

std::array<float, 56> m_arcLength2DByICLayer
private

Memory for two dimensional arc length at each layer.

Definition at line 72 of file StandardAxes.h.

◆ m_curv

float m_curv
private

Memory for the curvature.

Definition at line 69 of file StandardAxes.h.

◆ m_secondaryArcLength2DByICLayer

std::array<float, 56> m_secondaryArcLength2DByICLayer
private

Memory for two dimensional arc length at each layer on the second arm.

Definition at line 75 of file StandardAxes.h.


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