Belle II Software  release-05-02-19
CDCDedxADCNonLinearity Class Reference

dE/dx eletronic ADC non-linearity correction for highly ionising particles (used in offline hadron saturation calibration) paramters are for X vs Y relation and sep for inner and outer layer vector array 0,1 for inner and 2,3 for outer layers More...

#include <CDCDedxADCNonLinearity.h>

Inheritance diagram for CDCDedxADCNonLinearity:
Collaboration diagram for CDCDedxADCNonLinearity:

Public Member Functions

 CDCDedxADCNonLinearity ()
 Default constructor.
 
 CDCDedxADCNonLinearity (const std::vector< std::vector< double >> &nonlinearity)
 Constructor.
 
 ~CDCDedxADCNonLinearity ()
 Destructor.
 
unsigned int getSize (int layer, int axis) const
 Get the number of bins for the non-linearity angle correction. More...
 
double getCorrectedADC (const double &ADC, const int layer) const
 Return corrected ADC with given parameters. More...
 
double getNonLinearityPar (int layer, int axis, unsigned int par) const
 return specific hadron parameter More...
 
void printNonLinearityPars (int layer, int axis) const
 print requested hadron parameter array More...
 
void setNonLinearityPar (unsigned int layer, unsigned int axis, unsigned int par, double value)
 set specific hadron parameter More...
 

Private Member Functions

 ClassDef (CDCDedxADCNonLinearity, 1)
 ClassDef.
 

Private Attributes

std::vector< std::vector< double > > m_nonlADC
 ADC vs corrected ADC mapping.
 

Detailed Description

dE/dx eletronic ADC non-linearity correction for highly ionising particles (used in offline hadron saturation calibration) paramters are for X vs Y relation and sep for inner and outer layer vector array 0,1 for inner and 2,3 for outer layers

Definition at line 37 of file CDCDedxADCNonLinearity.h.

Member Function Documentation

◆ getCorrectedADC()

double getCorrectedADC ( const double &  ADC,
const int  layer 
) const
inline

Return corrected ADC with given parameters.

Parameters
ADCuncorrected version
layerouter vs inner 0 to 56 indexing

Definition at line 86 of file CDCDedxADCNonLinearity.h.

86  {
87  if (layer >= 8) mylayer = 2;
88  }
89 
90  std::vector<double> tempX = m_nonlADC[mylayer];//inner or outer X array
91  std::vector<double> tempY = m_nonlADC[mylayer + 1];//inner or outer Y array
92 
93  if (tempX.size() != tempY.size()) {
94  B2WARNING("CDCDedxADCNonLinearity:returning uncorrected ADC as parameters range don't match: X=Y in bins");
95  return ADC;
96  }
97 
98  //Find bin for ADC correction
99  unsigned int ibin = TMath::BinarySearch(tempY.size(), tempY.data(), double(ADC));
100 
101  if (ibin >= tempY.size() - 1)ibin = tempY.size() - 2; //overflow to last bin
102  if (ibin >= tempY.size() - 1) {
103  B2WARNING("CDCDedxADCNonLinearity:returning uncorrected ADC as bins are not in range");
104  return ADC;
105  }
106 
107  double slope = (tempY[ibin + 1] - tempY[ibin]) / (tempX[ibin + 1] - tempX[ibin]);
108  return std::round(tempX[ibin] + (ADC - tempY[ibin]) / slope);
109  }
110 
116  double getNonLinearityPar(int layer, int axis, unsigned int par) const

◆ getNonLinearityPar()

double getNonLinearityPar ( int  layer,
int  axis,
unsigned int  par 
) const
inline

return specific hadron parameter

Parameters
layerouter(8-55) vs inner(0-7)
axis0 for X and 1 for Y
parnumber starts from 0

Definition at line 123 of file CDCDedxADCNonLinearity.h.

◆ getSize()

unsigned int getSize ( int  layer,
int  axis 
) const
inline

Get the number of bins for the non-linearity angle correction.

Parameters
layerouter vs inner 0 to 56 indexing
axis0 for X and 1 for Y

Definition at line 60 of file CDCDedxADCNonLinearity.h.

◆ printNonLinearityPars()

void printNonLinearityPars ( int  layer,
int  axis 
) const
inline

print requested hadron parameter array

Parameters
layerouter vs inner
axis0 for X and 1 for Y

Definition at line 153 of file CDCDedxADCNonLinearity.h.

◆ setNonLinearityPar()

void setNonLinearityPar ( unsigned int  layer,
unsigned int  axis,
unsigned int  par,
double  value 
)
inline

set specific hadron parameter

Parameters
layerouter(8-55) vs inner(0-7)
axis0 for X and 1 for Y
parnumber starts from 0
valueof parameter to set

Definition at line 183 of file CDCDedxADCNonLinearity.h.


The documentation for this class was generated from the following file:
Belle2::CDCDedxADCNonLinearity::m_nonlADC
std::vector< std::vector< double > > m_nonlADC
ADC vs corrected ADC mapping.
Definition: CDCDedxADCNonLinearity.h:207
Belle2::CDCDedxADCNonLinearity::getNonLinearityPar
double getNonLinearityPar(int layer, int axis, unsigned int par) const
return specific hadron parameter
Definition: CDCDedxADCNonLinearity.h:123