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

dE/dx wire gain calibration constants More...

#include <CDCDedx2DCell.h>

Inheritance diagram for CDCDedx2DCell:
Collaboration diagram for CDCDedx2DCell:

Public Member Functions

 CDCDedx2DCell ()
 Default constructor.
 
 CDCDedx2DCell (short version, const std::vector< TH2F > &twodgains)
 Constructor.
 
 ~CDCDedx2DCell ()
 Destructor.
 
CDCDedx2DCelloperator*= (CDCDedx2DCell const &rhs)
 Combine payloads.
 
short getVersion () const
 Get the version for the 2D correction.
 
unsigned int getSize () const
 Get the number of histograms for the 2D correction.
 
const TH2F * getHist (int layer) const
 Get the 2D histogram for the correction for this layer.
 
double getMean (unsigned int layer, int dbin, int ebin) const
 Return dE/dx mean value for the given bin. More...
 
double getMean (unsigned int layer, double doca, double enta) const
 Return dE/dx mean value for given DOCA and entrance angle. More...
 

Private Member Functions

 ClassDef (CDCDedx2DCell, 5)
 ClassDef.
 

Private Attributes

short m_version
 dE/dx gains versus DOCA and entrance angle may be different for different layers, so store as a vector keep a version number to identify which layers are valid More...
 
std::vector< TH2F > m_twodgains
 2D histograms of doca/enta gains, layer dependent
 

Detailed Description

dE/dx wire gain calibration constants

Definition at line 26 of file CDCDedx2DCell.h.

Member Function Documentation

◆ getMean() [1/2]

double getMean ( unsigned int  layer,
double  doca,
double  enta 
) const
inline

Return dE/dx mean value for given DOCA and entrance angle.

Parameters
layercontinuous layer number
docadistance of closest approach
entaentrance angle

Definition at line 114 of file CDCDedx2DCell.h.

115  {
116  if (layer > 56) {
117  B2ERROR("Asking for a CDC layer beyond 56!");
118  return 0;
119  }
120 
121  int mylayer = 0;
122  if (layer >= 8 && m_twodgains.size() == 2) mylayer = 1;
123  else if (m_twodgains.size() == 56) mylayer = layer;
124 
125  // assume rotational symmetry
126  if (enta < -3.1416 / 2.0) enta += 3.1416 / 2.0;
127  if (enta > 3.1416 / 2.0) enta -= 3.1416 / 2.0;
128 
129  // iterate bin number by one since TH2F bins start at 1 not 0
130  double dbinsize = m_twodgains[mylayer].GetXaxis()->GetBinCenter(2) - m_twodgains[mylayer].GetXaxis()->GetBinCenter(1);
131  int dbin = std::floor((doca - m_twodgains[mylayer].GetXaxis()->GetBinLowEdge(1)) / dbinsize) + 1;
132 
133  double ebinsize = m_twodgains[mylayer].GetYaxis()->GetBinCenter(2) - m_twodgains[mylayer].GetYaxis()->GetBinCenter(1);
134  // int ebin = std::floor((std::sin(enta) - m_twodgains[mylayer].GetYaxis()->GetBinLowEdge(1)) / ebinsize) + 1;
135  int ebin = std::floor((enta - m_twodgains[mylayer].GetYaxis()->GetBinLowEdge(1)) / ebinsize) + 1;
136 
137  double mean = 1.0;
138  if (dbin > 0 && dbin <= m_twodgains[mylayer].GetNbinsX() && ebin > 0 && ebin <= m_twodgains[mylayer].GetNbinsY())
139  mean = m_twodgains[mylayer].GetBinContent(dbin, ebin);
140  else if (dbin > m_twodgains[mylayer].GetNbinsX() && ebin > 0 && ebin <= m_twodgains[mylayer].GetNbinsY())
141  mean = m_twodgains[mylayer].GetBinContent(m_twodgains[mylayer].GetNbinsX(), ebin);
142  else
143  // B2WARNING("Problem with 2D CDC dE/dx calibration! " << doca << "\t" << dbin << "\t" << std::sin(enta) << "\t" << ebin);
144  B2WARNING("Problem with 2D CDC dE/dx calibration! " << doca << "\t" << dbin << "\t" << enta << "\t" << ebin);
145 
146  return mean;
147  };
std::vector< TH2F > m_twodgains
2D histograms of doca/enta gains, layer dependent

◆ getMean() [2/2]

double getMean ( unsigned int  layer,
int  dbin,
int  ebin 
) const
inline

Return dE/dx mean value for the given bin.

Parameters
layerlayer number
dbindoca bin number
ebinenta bin number

Definition at line 100 of file CDCDedx2DCell.h.

Member Data Documentation

◆ m_version

short m_version
private

dE/dx gains versus DOCA and entrance angle may be different for different layers, so store as a vector keep a version number to identify which layers are valid

version number for 2D correction

Definition at line 153 of file CDCDedx2DCell.h.


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