Belle II Software  release-08-01-10
CDCDedxCosineCor Class Reference

dE/dx wire gain calibration constants More...

#include <CDCDedxCosineCor.h>

Inheritance diagram for CDCDedxCosineCor:
Collaboration diagram for CDCDedxCosineCor:

Public Member Functions

 CDCDedxCosineCor ()
 Default constructor.
 
 CDCDedxCosineCor (const std::vector< double > &cosgains)
 Constructor.
 
 ~CDCDedxCosineCor ()
 Destructor.
 
CDCDedxCosineCoroperator*= (CDCDedxCosineCor const &rhs)
 Combine payloads.
 
unsigned int getSize () const
 Get the number of bins for the cosine correction.
 
std::vector< double > getCosCor () const
 Get the cosine correction.
 
void setCosCor (int bin, double value)
 Set the cosine correction.
 
double getMean (unsigned int bin) const
 Return dE/dx mean value for the given bin. More...
 
double getMean (double costh) const
 Return dE/dx mean value for given cos(theta) More...
 

Private Member Functions

 ClassDef (CDCDedxCosineCor, 8)
 ClassDef.
 

Private Attributes

std::vector< double > m_cosgains
 dE/dx gains in cos(theta) bins
 

Detailed Description

dE/dx wire gain calibration constants

Definition at line 26 of file CDCDedxCosineCor.h.

Member Function Documentation

◆ getMean() [1/2]

double getMean ( double  costh) const
inline

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

Parameters
costhfor const with costh theta value

Definition at line 89 of file CDCDedxCosineCor.h.

90  {
91  if (std::abs(costh) > 1) return 0;
92 
93  // gains are stored at the center of the bins
94  // find the bin center immediately preceding this value of costh
95  double binsize = 2.0 / m_cosgains.size();
96  int bin = std::floor((costh - 0.5 * binsize + 1.0) / binsize);
97 
98  // extrapolation
99  // extrapolate backward for lowest half-bin and center positive half-bin
100  // extrapolate forward for highest half-bin and center negative half-bin
101  int thisbin = bin, nextbin = bin + 1;
102  if ((costh + 1) < (binsize / 2) || (costh > 0 && std::fabs(costh) < (binsize / 2))) {
103  thisbin = bin + 1; nextbin = bin + 2;
104  } else {
105  if ((costh - 1) > -1.0 * (binsize / 2) || (costh < 0 && std::fabs(costh) < (binsize / 2))) {
106  thisbin = bin - 1; nextbin = bin;
107  }
108  }
109  double frac = ((costh - 0.5 * binsize + 1.0) / binsize) - thisbin;
110 
111  if (thisbin < 0 || (unsigned)nextbin >= m_cosgains.size()) {
112  B2WARNING("Problem with extrapolation of CDC dE/dx cosine correction");
113  return 1.0;
114  }
115  return ((m_cosgains[nextbin] - m_cosgains[thisbin]) * frac + m_cosgains[thisbin]);
116  };
std::vector< double > m_cosgains
dE/dx gains in cos(theta) bins

◆ getMean() [2/2]

double getMean ( unsigned int  bin) const
inline

Return dE/dx mean value for the given bin.

Parameters
binfor const with cosine bin

Definition at line 80 of file CDCDedxCosineCor.h.


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