Belle II Software development
BKLMSimulationPar Class Reference

Provides BKLM simulation parameters. More...

#include <BKLMSimulationPar.h>

Inheritance diagram for BKLMSimulationPar:

Public Member Functions

 BKLMSimulationPar ()
 Default constructor.
 
 BKLMSimulationPar (const GearDir &)
 Constructor.
 
 ~BKLMSimulationPar ()
 Default destructor.
 
void read (const GearDir &)
 Get simulation parameters from Gearbox.
 
double getHitTimeMax (void) const
 Get the maximum global time for a recorded sim hit.
 
int getNPhiDivision (void) const
 Get number of divisions for phi strips.
 
int getNZDivision (void) const
 Get number of divisions for z strips.
 
int getMaxMultiplicity (void) const
 Get the maximum multiplicity in the RPC strip cumulative prob density functions.
 
int getNPhiMultiplicity (int division) const
 Get number of kind of multiplicity for phistrips.
 
int getNZMultiplicity (int division) const
 Get number of kind of multiplicity for zstrips.
 
double getPhiWeight (int division, int nmutiplicity) const
 Get weight table for phi.
 
double getZWeight (int division, int nmutiplicity) const
 Get weight table for z.
 
double getPhiMultiplicityCDF (double stripDiv, int mult) const
 Get the RPC phi-strip cumulative prob density function.
 
double getZMultiplicityCDF (double stripDiv, int mult) const
 Get the RPC z-strip cumulative prob density function.
 

Private Member Functions

 ClassDef (BKLMSimulationPar, 3)
 Class version.
 

Private Attributes

double m_HitTimeMax
 Maximum global time for a recorded sim hit.
 
double m_PhiMultiplicityCDF [c_NDIV+1][c_MAX_NHIT]
 RPC phiStrip multiplicity cumulative probability distribution table.
 
double m_ZMultiplicityCDF [c_NDIV+1][c_MAX_NHIT]
 RPC zStrip multiplicity cumulative probability distribution table.
 
int m_NPhiDiv
 Number of division for phistrips.
 
int m_NZDiv
 Number of division for zstrips.
 
int m_NPhiMultiplicity [c_NDIV+1]
 Number of kind of multiplicity of phistrips in each division.
 
int m_NZMultiplicity [c_NDIV+1]
 Number of weights of zstrips in each division.
 
double m_PhiWeight [c_NDIV+1][c_MAX_NHIT]
 RPC phiStrip weight table.
 
double m_ZWeight [c_NDIV+1][c_MAX_NHIT]
 RPC zStrip weight table.
 

Static Private Attributes

static const int c_NDIV = 5
 Number of divisions.
 
static const int c_MAX_NHIT = 10
 Maximum number of hits.
 

Detailed Description

Provides BKLM simulation parameters.

Definition at line 24 of file BKLMSimulationPar.h.

Constructor & Destructor Documentation

◆ BKLMSimulationPar() [1/2]

BKLMSimulationPar ( )
inline

Default constructor.

Definition at line 35 of file BKLMSimulationPar.h.

36 {
37 }

◆ BKLMSimulationPar() [2/2]

BKLMSimulationPar ( const GearDir content)
explicit

Constructor.

Definition at line 21 of file BKLMSimulationPar.cc.

22{
23 read(content);
24}
void read(const GearDir &)
Get simulation parameters from Gearbox.

◆ ~BKLMSimulationPar()

Default destructor.

Definition at line 26 of file BKLMSimulationPar.cc.

27{
28}

Member Function Documentation

◆ getHitTimeMax()

double getHitTimeMax ( void  ) const
inline

Get the maximum global time for a recorded sim hit.

Definition at line 49 of file BKLMSimulationPar.h.

50 {
51 return m_HitTimeMax;
52 }
double m_HitTimeMax
Maximum global time for a recorded sim hit.

◆ getMaxMultiplicity()

int getMaxMultiplicity ( void  ) const
inline

Get the maximum multiplicity in the RPC strip cumulative prob density functions.

Definition at line 67 of file BKLMSimulationPar.h.

68 {
69 return c_MAX_NHIT;
70 }
static const int c_MAX_NHIT
Maximum number of hits.

◆ getNPhiDivision()

int getNPhiDivision ( void  ) const
inline

Get number of divisions for phi strips.

Definition at line 55 of file BKLMSimulationPar.h.

56 {
57 return m_NPhiDiv;
58 }
int m_NPhiDiv
Number of division for phistrips.

◆ getNPhiMultiplicity()

int getNPhiMultiplicity ( int  division) const
inline

Get number of kind of multiplicity for phistrips.

Definition at line 73 of file BKLMSimulationPar.h.

74 {
75 return m_NPhiMultiplicity[division];
76 }
int m_NPhiMultiplicity[c_NDIV+1]
Number of kind of multiplicity of phistrips in each division.

◆ getNZDivision()

int getNZDivision ( void  ) const
inline

Get number of divisions for z strips.

Definition at line 61 of file BKLMSimulationPar.h.

62 {
63 return m_NZDiv;
64 }
int m_NZDiv
Number of division for zstrips.

◆ getNZMultiplicity()

int getNZMultiplicity ( int  division) const
inline

Get number of kind of multiplicity for zstrips.

Definition at line 79 of file BKLMSimulationPar.h.

80 {
81 return m_NZMultiplicity[division];
82 }
int m_NZMultiplicity[c_NDIV+1]
Number of weights of zstrips in each division.

◆ getPhiMultiplicityCDF()

double getPhiMultiplicityCDF ( double  stripDiv,
int  mult 
) const

Get the RPC phi-strip cumulative prob density function.

Definition at line 93 of file BKLMSimulationPar.cc.

94{
95 if (mult < 0)
96 return 0.0;
97 if (mult >= c_MAX_NHIT)
98 return 1.0;
99 int stripIndex = (int) fabs(stripDiv * c_NDIV / 0.5);
100 if (stripIndex > c_NDIV)
101 return 0.0;
102 return m_PhiMultiplicityCDF[stripIndex][mult];
103}
double m_PhiMultiplicityCDF[c_NDIV+1][c_MAX_NHIT]
RPC phiStrip multiplicity cumulative probability distribution table.
static const int c_NDIV
Number of divisions.

◆ getPhiWeight()

double getPhiWeight ( int  division,
int  nmutiplicity 
) const
inline

Get weight table for phi.

Definition at line 85 of file BKLMSimulationPar.h.

86 {
87 return m_PhiWeight[division][nmutiplicity];
88 }
double m_PhiWeight[c_NDIV+1][c_MAX_NHIT]
RPC phiStrip weight table.

◆ getZMultiplicityCDF()

double getZMultiplicityCDF ( double  stripDiv,
int  mult 
) const

Get the RPC z-strip cumulative prob density function.

Definition at line 105 of file BKLMSimulationPar.cc.

106{
107 if (mult < 0)
108 return 0.0;
109 if (mult >= c_MAX_NHIT)
110 return 1.0;
111 int stripIndex = (int) fabs(stripDiv * c_NDIV / 0.5);
112 if (stripIndex > c_NDIV)
113 return 0.0;
114 return m_ZMultiplicityCDF[stripIndex][mult];
115}
double m_ZMultiplicityCDF[c_NDIV+1][c_MAX_NHIT]
RPC zStrip multiplicity cumulative probability distribution table.

◆ getZWeight()

double getZWeight ( int  division,
int  nmutiplicity 
) const
inline

Get weight table for z.

Definition at line 91 of file BKLMSimulationPar.h.

92 {
93 return m_ZWeight[division][nmutiplicity];
94 }
double m_ZWeight[c_NDIV+1][c_MAX_NHIT]
RPC zStrip weight table.

◆ read()

void read ( const GearDir content)

Get simulation parameters from Gearbox.

Definition at line 30 of file BKLMSimulationPar.cc.

31{
32 if (!content) {
33 B2FATAL("The GearDir to look for BKLM simulation parameters is not valid.");
34 return;
35 }
36 char name[40];
37 double weight[c_MAX_NHIT];
38
39 for (int div = 0; div <= c_NDIV; ++div) {
40 for (int j = 0; j < c_MAX_NHIT; ++j) {
41 m_PhiMultiplicityCDF[div][j] = 1.0;
42 m_ZMultiplicityCDF[div][j] = 1.0;
43 }
44 }
45
46 m_HitTimeMax = content.getWithUnit("/HitTimeMax");
47
48 GearDir phiContent(content);
49 phiContent.append("/RPCStripMultiplicity/Phi");
50 m_NPhiDiv = phiContent.getNumberNodes("/Division");
51 int nDiv = std::min(phiContent.getNumberNodes("/Division"), c_NDIV + 1);
52 for (int div = 0; div < nDiv; ++div) {
53 sprintf(name, "/Division[@id=\"%d\"]", div);
54 GearDir divContent(phiContent);
55 divContent.append(name);
56 m_NPhiMultiplicity[div] = divContent.getNumberNodes("/Weight");
57 int nWeight = std::min(divContent.getNumberNodes("/Weight"), c_MAX_NHIT - 1);
58 weight[0] = 0.0;
59 for (int j = 1; j <= nWeight; ++j) {
60 sprintf(name, "/Weight[@multiplicity=\"%d\"]", j);
61 m_PhiWeight[div][j] = divContent.getDouble(name);
62 weight[j] = divContent.getDouble(name) + weight[j - 1];
63 weight[0] = weight[j];
64 }
65 for (int j = 1; j < c_MAX_NHIT; ++j) {
66 m_PhiMultiplicityCDF[div][j] = (j <= nWeight ? weight[j] / weight[0] : 1.0);
67 }
68 }
69
70 GearDir zContent(content);
71 zContent.append("/RPCStripMultiplicity/Z");
72 nDiv = std::min(zContent.getNumberNodes("/Division"), c_NDIV + 1);
73 m_NZDiv = zContent.getNumberNodes("/Division");
74 for (int div = 0; div < nDiv; ++div) {
75 sprintf(name, "/Division[@id=\"%d\"]", div);
76 GearDir divContent(zContent);
77 divContent.append(name);
78 int nWeight = std::min(divContent.getNumberNodes("/Weight"), c_MAX_NHIT - 1);
79 m_NZMultiplicity[div] = divContent.getNumberNodes("/Weight");
80 weight[0] = 0.0;
81 for (int j = 1; j <= nWeight; ++j) {
82 sprintf(name, "/Weight[@multiplicity=\"%d\"]", j);
83 m_ZWeight[div][j] = divContent.getDouble(name);
84 weight[j] = divContent.getDouble(name) + weight[j - 1];
85 weight[0] = weight[j];
86 }
87 for (int j = 1; j < c_MAX_NHIT; ++j) {
88 m_ZMultiplicityCDF[div][j] = (j <= nWeight ? weight[j] / weight[0] : 1.0);
89 }
90 }
91}
GearDir is the basic class used for accessing the parameter store.
Definition: GearDir.h:31

Member Data Documentation

◆ c_MAX_NHIT

const int c_MAX_NHIT = 10
staticprivate

Maximum number of hits.

Definition at line 30 of file BKLMSimulationPar.h.

◆ c_NDIV

const int c_NDIV = 5
staticprivate

Number of divisions.

Definition at line 27 of file BKLMSimulationPar.h.

◆ m_HitTimeMax

double m_HitTimeMax
private

Maximum global time for a recorded sim hit.

Definition at line 105 of file BKLMSimulationPar.h.

◆ m_NPhiDiv

int m_NPhiDiv
private

Number of division for phistrips.

Definition at line 114 of file BKLMSimulationPar.h.

◆ m_NPhiMultiplicity

int m_NPhiMultiplicity[c_NDIV+1]
private

Number of kind of multiplicity of phistrips in each division.

Definition at line 120 of file BKLMSimulationPar.h.

◆ m_NZDiv

int m_NZDiv
private

Number of division for zstrips.

Definition at line 117 of file BKLMSimulationPar.h.

◆ m_NZMultiplicity

int m_NZMultiplicity[c_NDIV+1]
private

Number of weights of zstrips in each division.

Definition at line 123 of file BKLMSimulationPar.h.

◆ m_PhiMultiplicityCDF

double m_PhiMultiplicityCDF[c_NDIV+1][c_MAX_NHIT]
private

RPC phiStrip multiplicity cumulative probability distribution table.

Definition at line 108 of file BKLMSimulationPar.h.

◆ m_PhiWeight

double m_PhiWeight[c_NDIV+1][c_MAX_NHIT]
private

RPC phiStrip weight table.

Definition at line 126 of file BKLMSimulationPar.h.

◆ m_ZMultiplicityCDF

double m_ZMultiplicityCDF[c_NDIV+1][c_MAX_NHIT]
private

RPC zStrip multiplicity cumulative probability distribution table.

Definition at line 111 of file BKLMSimulationPar.h.

◆ m_ZWeight

double m_ZWeight[c_NDIV+1][c_MAX_NHIT]
private

RPC zStrip weight table.

Definition at line 129 of file BKLMSimulationPar.h.


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