Belle II Software development
CDCCorrToThresholds Class Reference

Database object for correcting a simple threshold model in MC. More...

#include <CDCCorrToThresholds.h>

Inheritance diagram for CDCCorrToThresholds:

Public Member Functions

 CDCCorrToThresholds ()
 Default constructor.
 
void setParam (unsigned short id, double param)
 Set the paramseter in the array.
 
unsigned short getEntries () const
 Get the no.
 
std::array< float, c_maxNSenseLayers > getParams () const
 Get the whole array.
 
float getParam (unsigned short id) const
 Get the parameter for the id.
 
void dump () const
 Print all contents.
 
void outputToFile (std::string fileName) const
 Output the contents in text file format.
 

Private Member Functions

 ClassDef (CDCCorrToThresholds, 2)
 ClassDef.
 

Private Attributes

std::array< float, c_maxNSenseLayers > m_crs
 cr array
 

Detailed Description

Database object for correcting a simple threshold model in MC.

Definition at line 27 of file CDCCorrToThresholds.h.

Constructor & Destructor Documentation

◆ CDCCorrToThresholds()

CDCCorrToThresholds ( )
inline

Default constructor.

Definition at line 33 of file CDCCorrToThresholds.h.

33{}

Member Function Documentation

◆ dump()

void dump ( ) const
inline

Print all contents.

Definition at line 74 of file CDCCorrToThresholds.h.

75 {
76 std::cout << " " << std::endl;
77 std::cout << "Correction parametres" << std::endl;
78 std::cout << "#entries= " << m_crs.size() << std::endl;
79 std::cout << "in order of id and parameter" << std::endl;
80
81 for (unsigned id = 0; id < c_maxNSenseLayers; ++id) {
82 std::cout << id << " " << m_crs[id] << std::endl;
83 }
84 }
std::array< float, c_maxNSenseLayers > m_crs
cr array

◆ getEntries()

unsigned short getEntries ( ) const
inline

Get the no.

of entries in the array

Definition at line 48 of file CDCCorrToThresholds.h.

49 {
50 return m_crs.size();
51 }

◆ getParam()

float getParam ( unsigned short  id) const
inline

Get the parameter for the id.

Parameters
idlayerID
Returns
parameter for the id

Definition at line 66 of file CDCCorrToThresholds.h.

67 {
68 return m_crs[id];
69 }

◆ getParams()

std::array< float, c_maxNSenseLayers > getParams ( ) const
inline

Get the whole array.

Definition at line 56 of file CDCCorrToThresholds.h.

57 {
58 return m_crs;
59 }

◆ outputToFile()

void outputToFile ( std::string  fileName) const
inline

Output the contents in text file format.

Definition at line 90 of file CDCCorrToThresholds.h.

91 {
92 std::ofstream fout(fileName);
93
94 if (fout.bad()) {
95 B2ERROR("Specified output file could not be opened!");
96 } else {
97 for (unsigned id = 0; id < c_maxNSenseLayers; ++id) {
98 fout << id << " " << m_crs[id] << std::endl;
99 }
100 }
101 fout.close();
102 }

◆ setParam()

void setParam ( unsigned short  id,
double  param 
)
inline

Set the paramseter in the array.

Parameters
idlayerID(0-55)
paramparameter for correction

Definition at line 40 of file CDCCorrToThresholds.h.

41 {
42 m_crs[id] = param;
43 }

Member Data Documentation

◆ m_crs

std::array<float, c_maxNSenseLayers> m_crs
private

cr array

Definition at line 105 of file CDCCorrToThresholds.h.


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