Belle II Software development
CDCAlphaScaleFactorForAsymmetry Class Reference

Database object for scale factors on alpha for CDC hit charge asymmetry. More...

#include <CDCAlphaScaleFactorForAsymmetry.h>

Inheritance diagram for CDCAlphaScaleFactorForAsymmetry:

Public Types

enum  {
  c_nLayers = 56 ,
  c_nAlphaBins = 150
}
 Constants. More...
 

Public Member Functions

 CDCAlphaScaleFactorForAsymmetry ()
 Default constructor.
 
void setScaleFactors (const std::array< std::array< float, c_nAlphaBins >, c_nLayers > &inputScales)
 Set the factors in the list.
 
unsigned short getEntries () const
 Get the no.
 
std::array< std::array< float, c_nAlphaBins >, c_nLayersgetScaleFactors () const
 Get the whole list.
 
std::array< float, c_nAlphaBinsgetScaleFactors (unsigned short iCLayer) const
 Get the factors for the iCLayer.
 
double getScaleFactor (unsigned short iCLayer, double alpha) const
 Get the factor for one hit.
 
void dump () const
 Print all contents.
 

Private Member Functions

 ClassDef (CDCAlphaScaleFactorForAsymmetry, 1)
 ClassDef.
 

Private Attributes

std::array< std::array< float, c_nAlphaBins >, c_nLayersm_Scales
 scale factors
 
double c_AlphaBinWidth = 0.01
 bin width on alpha
 

Detailed Description

Database object for scale factors on alpha for CDC hit charge asymmetry.

Needed only for MC production.

Definition at line 25 of file CDCAlphaScaleFactorForAsymmetry.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Constants.

Enumerator
c_nLayers 

no.

of layers

c_nAlphaBins 

no.

of alpha angle bins per layer

Definition at line 30 of file CDCAlphaScaleFactorForAsymmetry.h.

30 {c_nLayers = 56,
31 c_nAlphaBins = 150,
32 };

Constructor & Destructor Documentation

◆ CDCAlphaScaleFactorForAsymmetry()

Default constructor.

Definition at line 38 of file CDCAlphaScaleFactorForAsymmetry.h.

38{}

Member Function Documentation

◆ dump()

void dump ( ) const
inline

Print all contents.

Definition at line 97 of file CDCAlphaScaleFactorForAsymmetry.h.

98 {
99 std::cout << " " << std::endl;
100 std::cout << "Scale factor list" << std::endl;
101 std::cout << "#entries= " << c_nLayers* c_nAlphaBins << std::endl;
102 std::cout << "the ratio of data to MC for the hit efficiency of positively charged tracks comparing to negitively charged tracks" <<
103 std::endl;
104
105 for (unsigned short iLayer = 0; iLayer < c_nLayers; iLayer++) {
106 std::cout << "Scale factors for Layer " << iLayer << " : " << std::endl;
107 for (unsigned short i = 0; i < c_nAlphaBins; ++i) {
108 std::cout << " Alpha in ( " << i * 0.01 << " , " << (i + 1) * 0.01 << " ), Scale factor: " << m_Scales[iLayer][i] << std::endl;
109 }
110 }
111 }

◆ getEntries()

unsigned short getEntries ( ) const
inline

Get the no.

of entries in the list

Definition at line 53 of file CDCAlphaScaleFactorForAsymmetry.h.

54 {
55 return c_nLayers * c_nAlphaBins ;
56 }

◆ getScaleFactor()

double getScaleFactor ( unsigned short iCLayer,
double alpha ) const
inline

Get the factor for one hit.

Parameters
iCLayerlayerID
alphaalpha value
Returns
the scale factor for this hit

Definition at line 84 of file CDCAlphaScaleFactorForAsymmetry.h.

85 {
86 if (alpha > (M_PI / 2)) alpha = alpha - M_PI;
87 if (alpha < -(M_PI / 2)) alpha = alpha + M_PI;
88 int alpha_bin = std::trunc(std::abs(alpha) / c_AlphaBinWidth);
89 if (alpha_bin > c_nAlphaBins) alpha_bin = c_nAlphaBins - 1 ;
90 return m_Scales[iCLayer][alpha_bin];
91 }

◆ getScaleFactors() [1/2]

std::array< std::array< float, c_nAlphaBins >, c_nLayers > getScaleFactors ( ) const
inline

Get the whole list.

Definition at line 61 of file CDCAlphaScaleFactorForAsymmetry.h.

62 {
63 return m_Scales;
64 }

◆ getScaleFactors() [2/2]

std::array< float, c_nAlphaBins > getScaleFactors ( unsigned short iCLayer) const
inline

Get the factors for the iCLayer.

Parameters
iCLayerlayerID
Returns
scale factors for the iCLayer

Definition at line 71 of file CDCAlphaScaleFactorForAsymmetry.h.

72 {
73 if (iCLayer >= c_nLayers)
74 B2FATAL("Required iCLayer is invalid ! Should be 0 to 55 .");
75 return m_Scales[iCLayer] ;
76 }

◆ setScaleFactors()

void setScaleFactors ( const std::array< std::array< float, c_nAlphaBins >, c_nLayers > & inputScales)
inline

Set the factors in the list.

Parameters
inputScalesfactors

Definition at line 45 of file CDCAlphaScaleFactorForAsymmetry.h.

46 {
47 m_Scales = inputScales;
48 }

Member Data Documentation

◆ c_AlphaBinWidth

double c_AlphaBinWidth = 0.01
private

bin width on alpha

Definition at line 115 of file CDCAlphaScaleFactorForAsymmetry.h.

◆ m_Scales

std::array<std::array<float, c_nAlphaBins>, c_nLayers> m_Scales
private

scale factors

Definition at line 114 of file CDCAlphaScaleFactorForAsymmetry.h.


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