Belle II Software development
CDCPropSpeeds Class Reference

Database object for signal propagation speed along the wire. More...

#include <CDCPropSpeeds.h>

Inheritance diagram for CDCPropSpeeds:

Public Types

enum  { c_nSlayers = 56 }
 Constant. More...
 

Public Member Functions

 CDCPropSpeeds ()
 Default constructor.
 
void setSpeed (unsigned short iCLayer, float speed)
 Set the speed in the list.
 
void addSpeed (unsigned short iCLayer, float delta)
 Update the speed in the list.
 
unsigned short getEntries () const
 Get the no.
 
std::vector< float > getSpeeds () const
 Get the whole list.
 
float getSpeed (unsigned short iCLayer) const
 Get the speed for the specified layer.
 
void dump () const
 Print out contents.
 
void outputToFile (std::string fileName) const
 Output the contents in text file format.
 

Private Member Functions

 ClassDef (CDCPropSpeeds, 1)
 ClassDef.
 

Private Attributes

std::vector< float > m_speeds = std::vector<float>(c_nSlayers)
 list of speed
 

Detailed Description

Database object for signal propagation speed along the wire.

Definition at line 25 of file CDCPropSpeeds.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Constant.

Definition at line 31 of file CDCPropSpeeds.h.

31{c_nSlayers = 56};

Constructor & Destructor Documentation

◆ CDCPropSpeeds()

CDCPropSpeeds ( )
inline

Default constructor.

Definition at line 36 of file CDCPropSpeeds.h.

36{}

Member Function Documentation

◆ addSpeed()

void addSpeed ( unsigned short  iCLayer,
float  delta 
)
inline

Update the speed in the list.

Parameters
iCLayer(continuous) layer-id,
deltadelta-speed for the layer

Definition at line 53 of file CDCPropSpeeds.h.

54 {
55 m_speeds.at(iCLayer) += delta;
56 }
std::vector< float > m_speeds
list of speed

◆ dump()

void dump ( ) const
inline

Print out contents.

Definition at line 87 of file CDCPropSpeeds.h.

88 {
89 std::cout << " " << std::endl;
90 std::cout << "PropSpeed list" << std::endl;
91 std::cout << "#entries= " << m_speeds.size() << std::endl;
92 std::cout << "in order of clayer and speed (cm/ns)" << std::endl;
93
94 for (unsigned short iCL = 0; iCL < m_speeds.size(); ++iCL) {
95 std::cout << iCL << " " << m_speeds[iCL] << std::endl;
96 }
97 }

◆ getEntries()

unsigned short getEntries ( ) const
inline

Get the no.

of entries in the list

Definition at line 61 of file CDCPropSpeeds.h.

62 {
63 return m_speeds.size();
64 }

◆ getSpeed()

float getSpeed ( unsigned short  iCLayer) const
inline

Get the speed for the specified layer.

Parameters
iCLayer(continuous) layer-id.
Returns
propagation speed for the layer

Definition at line 79 of file CDCPropSpeeds.h.

80 {
81 return m_speeds[iCLayer];
82 }

◆ getSpeeds()

std::vector< float > getSpeeds ( ) const
inline

Get the whole list.

Definition at line 69 of file CDCPropSpeeds.h.

70 {
71 return m_speeds;
72 }

◆ outputToFile()

void outputToFile ( std::string  fileName) const
inline

Output the contents in text file format.

Definition at line 102 of file CDCPropSpeeds.h.

103 {
104 std::ofstream fout(fileName);
105
106 if (fout.bad()) {
107 B2ERROR("Specified output file could not be opened!");
108 } else {
109 for (unsigned short iCL = 0; iCL < m_speeds.size(); ++iCL) {
110 fout << std::setw(2) << std::right << iCL << " " << std::setw(15) << std::scientific << std::setprecision(
111 8) << m_speeds[iCL] << std::endl;
112 }
113 fout.close();
114 }
115 }

◆ setSpeed()

void setSpeed ( unsigned short  iCLayer,
float  speed 
)
inline

Set the speed in the list.

Parameters
iCLayer(continuous) layer-id,
speedpropagation speed for the layer

Definition at line 43 of file CDCPropSpeeds.h.

44 {
45 m_speeds.at(iCLayer) = speed;
46 }

Member Data Documentation

◆ m_speeds

std::vector<float> m_speeds = std::vector<float>(c_nSlayers)
private

list of speed

Definition at line 119 of file CDCPropSpeeds.h.


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