Belle II Software development
CDCDedxMomentumCor Class Reference

dE/dx wire gain calibration constants More...

#include <CDCDedxMomentumCor.h>

Inheritance diagram for CDCDedxMomentumCor:

Public Member Functions

 CDCDedxMomentumCor ()
 Default constructor.
 
 CDCDedxMomentumCor (const std::vector< double > &momcor)
 Constructor.
 
 ~CDCDedxMomentumCor ()
 Destructor.
 
CDCDedxMomentumCoroperator*= (CDCDedxMomentumCor const &rhs)
 Combine payloads.
 
unsigned int getSize () const
 Get the number of bins for the momentum correction.
 
std::vector< double > getMomCor () const
 Get the momentum correction.
 
double getMean (unsigned int bin) const
 Return dE/dx mean value for given bin.
 
double getMean (double mom) const
 Return dE/dx mean value for given cos(theta)
 

Private Member Functions

 ClassDef (CDCDedxMomentumCor, 5)
 ClassDef.
 

Private Attributes

std::vector< double > m_momcor
 dE/dx gains in momentum bins
 

Detailed Description

dE/dx wire gain calibration constants

Definition at line 26 of file CDCDedxMomentumCor.h.

Constructor & Destructor Documentation

◆ CDCDedxMomentumCor() [1/2]

CDCDedxMomentumCor ( )
inline

Default constructor.

Definition at line 33 of file CDCDedxMomentumCor.h.

33: m_momcor() {};
std::vector< double > m_momcor
dE/dx gains in momentum bins

◆ CDCDedxMomentumCor() [2/2]

CDCDedxMomentumCor ( const std::vector< double > &  momcor)
inlineexplicit

Constructor.

Definition at line 38 of file CDCDedxMomentumCor.h.

38: m_momcor(momcor) {};

◆ ~CDCDedxMomentumCor()

~CDCDedxMomentumCor ( )
inline

Destructor.

Definition at line 43 of file CDCDedxMomentumCor.h.

43{};

Member Function Documentation

◆ getMean() [1/2]

double getMean ( double  mom) const
inline

Return dE/dx mean value for given cos(theta)

Parameters
momfor const from momentum value

Definition at line 81 of file CDCDedxMomentumCor.h.

82 {
83 if (std::abs(mom) > 10.0) return 0;
84
85 // gains are stored at the center of the bins
86 // find the bin center immediately preceding this value of mom
87 double binsize = 10.0 / m_momcor.size();
88 int bin = std::floor(mom / binsize);
89
90 return m_momcor[bin];
91 };

◆ getMean() [2/2]

double getMean ( unsigned int  bin) const
inline

Return dE/dx mean value for given bin.

Parameters
binfor const from bin number

Definition at line 72 of file CDCDedxMomentumCor.h.

73 {
74 if (bin > m_momcor.size()) return 1.0;
75 else return m_momcor[bin];
76 }

◆ getMomCor()

std::vector< double > getMomCor ( ) const
inline

Get the momentum correction.

Definition at line 67 of file CDCDedxMomentumCor.h.

67{return m_momcor; };

◆ getSize()

unsigned int getSize ( ) const
inline

Get the number of bins for the momentum correction.

Definition at line 63 of file CDCDedxMomentumCor.h.

63{ return m_momcor.size(); };

◆ operator*=()

CDCDedxMomentumCor & operator*= ( CDCDedxMomentumCor const &  rhs)
inline

Combine payloads.

Definition at line 48 of file CDCDedxMomentumCor.h.

49 {
50 if (m_momcor.size() != rhs.getSize()) {
51 B2WARNING("Momentum correction parameters do not match, cannot merge!");
52 return *this;
53 }
54 std::vector<double> rhsgains = rhs.getMomCor();
55 for (unsigned int bin = 0; bin < m_momcor.size(); ++bin) {
56 m_momcor[bin] *= rhsgains[bin];
57 }
58 return *this;
59 }

Member Data Documentation

◆ m_momcor

std::vector<double> m_momcor
private

dE/dx gains in momentum bins

Definition at line 95 of file CDCDedxMomentumCor.h.


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