Belle II Software development
CDCDedx1DCell Class Reference

dE/dx wire gain calibration constants More...

#include <CDCDedx1DCell.h>

Inheritance diagram for CDCDedx1DCell:

Public Member Functions

 CDCDedx1DCell ()
 Default constructor.
 
 CDCDedx1DCell (short version, const std::vector< std::vector< double > > &onedgains)
 Constructor.
 
 ~CDCDedx1DCell ()
 Destructor.
 
CDCDedx1DCelloperator*= (CDCDedx1DCell const &rhs)
 Combine payloads.
 
short getVersion () const
 Get the version for the 1D cleanup.
 
unsigned int getSize () const
 Get the number of bins for the entrance angle correction.
 
unsigned int getNBins (unsigned int layer) const
 Get the number of bins for the entrance angle correction.
 
double getMean (unsigned int layer, unsigned int bin) const
 Return dE/dx mean value for the given bin.
 
void setMean (unsigned int layer, unsigned int bin, double value)
 Reset dE/dx mean value for the given bin.
 
double getMean (unsigned int layer, double enta) const
 Return dE/dx mean value for given entrance angle.
 

Private Member Functions

 ClassDef (CDCDedx1DCell, 5)
 ClassDef.
 

Private Attributes

short m_version
 dE/dx cleanup correction versus entrance angle may be different for different layers, so store as a vector of vectors keep a version number to identify which layers are valid
 
std::vector< std::vector< double > > m_onedgains
 dE/dx means in entrance angle bins
 

Detailed Description

dE/dx wire gain calibration constants

Definition at line 27 of file CDCDedx1DCell.h.

Constructor & Destructor Documentation

◆ CDCDedx1DCell() [1/2]

CDCDedx1DCell ( )
inline

Default constructor.

Definition at line 34 of file CDCDedx1DCell.h.

34: m_version(0), m_onedgains() {};
short m_version
dE/dx cleanup correction versus entrance angle may be different for different layers,...
std::vector< std::vector< double > > m_onedgains
dE/dx means in entrance angle bins

◆ CDCDedx1DCell() [2/2]

CDCDedx1DCell ( short  version,
const std::vector< std::vector< double > > &  onedgains 
)
inline

Constructor.

Definition at line 39 of file CDCDedx1DCell.h.

39: m_version(version), m_onedgains(onedgains) {};

◆ ~CDCDedx1DCell()

~CDCDedx1DCell ( )
inline

Destructor.

Definition at line 44 of file CDCDedx1DCell.h.

44{};

Member Function Documentation

◆ getMean() [1/2]

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

Return dE/dx mean value for given entrance angle.

Parameters
layercontinuous layer number
entaentrance angle (-pi/2 to pi/2)

Definition at line 134 of file CDCDedx1DCell.h.

135 {
136 if (layer > 56) {
137 B2ERROR("No such layer!");
138 return 0;
139 }
140
141 int mylayer = 0;
142 if (layer >= 8 && m_onedgains.size() == 2) mylayer = 1;
143 else if (m_onedgains.size() == 56) mylayer = layer;
144
145 double piby2 = TMath::Pi() / 2.0;
146 // assume rotational symmetry
147 if (enta < -piby2) enta += piby2;
148 if (enta > piby2) enta -= piby2;
149
150 double binsize = (m_onedgains[mylayer].size() != 0) ? 2.0 * piby2 / m_onedgains[mylayer].size() : 0.0;
151 int bin = (binsize != 0.0) ? std::floor((enta + piby2) / binsize) : -1;
152 if (bin < 0 || (unsigned)bin >= m_onedgains[mylayer].size()) {
153 B2WARNING("Problem with CDC dE/dx 1D binning!");
154 return 1.0;
155 }
156
157 return m_onedgains[mylayer][bin];
158 };

◆ getMean() [2/2]

double getMean ( unsigned int  layer,
unsigned int  bin 
) const
inline

Return dE/dx mean value for the given bin.

Parameters
layeris layer number between 0-55
binis enta bin number

Definition at line 104 of file CDCDedx1DCell.h.

105 {
106 int mylayer = 0;
107 if (layer >= 8 && m_onedgains.size() == 2) mylayer = 1;
108 else if (m_onedgains.size() == 56) mylayer = layer;
109
110 if (bin < m_onedgains[mylayer].size())
111 return m_onedgains[mylayer][bin];
112 else return 1.0;
113 };

◆ getNBins()

unsigned int getNBins ( unsigned int  layer) const
inline

Get the number of bins for the entrance angle correction.

Definition at line 77 of file CDCDedx1DCell.h.

78 {
79 if (m_onedgains.size() == 0) {
80 B2ERROR("ERROR!");
81 return 0;
82 }
83
84 if (m_onedgains.size() == 2) {
85 if (layer == 0) return m_onedgains[0].size();
86 else if (layer == 1) return m_onedgains[1].size();
87 else {
88 B2ERROR("ERROR! const vector not found");
89 return 0;
90 }
91 } else if (m_onedgains.size() == 56) {
92 return m_onedgains[layer].size();
93 } else {
94 B2ERROR("ERROR! Wrong # of constants vector array: getNBins()");
95 return 0;
96 }
97 return 0;
98 };

◆ getSize()

unsigned int getSize ( ) const
inline

Get the number of bins for the entrance angle correction.

Definition at line 73 of file CDCDedx1DCell.h.

73{ return m_onedgains.size(); };

◆ getVersion()

short getVersion ( ) const
inline

Get the version for the 1D cleanup.

Definition at line 69 of file CDCDedx1DCell.h.

69{ return m_version; };

◆ operator*=()

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

Combine payloads.

Definition at line 49 of file CDCDedx1DCell.h.

50 {
51 if (m_version != rhs.getVersion()) {
52 B2WARNING("1D cell gain parameters do not match, cannot merge!");
53 return *this;
54 }
55 for (unsigned int layer = 0; layer < getSize(); ++layer) {
56 double tempLayer = -1; //out of bound layer
57 if (getSize() == 2)tempLayer = layer * 20; // 20 to make <8 and >=8 difference
58 else if (getSize() == 56)tempLayer = layer;
59 else B2ERROR("ERROR! Wrong # of constants vector array");
60 for (unsigned int bin = 0; bin < getNBins(layer); ++bin) {
61 m_onedgains[layer][bin] *= rhs.getMean(tempLayer, bin);
62 }
63 }
64 return *this;
65 }
unsigned int getNBins(unsigned int layer) const
Get the number of bins for the entrance angle correction.
Definition: CDCDedx1DCell.h:77
unsigned int getSize() const
Get the number of bins for the entrance angle correction.
Definition: CDCDedx1DCell.h:73

◆ setMean()

void setMean ( unsigned int  layer,
unsigned int  bin,
double  value 
)
inline

Reset dE/dx mean value for the given bin.

Parameters
layeris layer number between 0-55
binis enta bin number
valueis constant for requested entabin and layer

Definition at line 120 of file CDCDedx1DCell.h.

121 {
122 int mylayer = 0;
123 if (layer >= 8 && m_onedgains.size() == 2) mylayer = 1;
124 else if (m_onedgains.size() == 56) mylayer = layer;
125
126 if (bin < m_onedgains[mylayer].size()) m_onedgains[mylayer][bin] = value;
127 else m_onedgains[mylayer][bin] = 1.0;
128 };

Member Data Documentation

◆ m_onedgains

std::vector<std::vector<double> > m_onedgains
private

dE/dx means in entrance angle bins

Definition at line 165 of file CDCDedx1DCell.h.

◆ m_version

short m_version
private

dE/dx cleanup correction versus entrance angle may be different for different layers, so store as a vector of vectors keep a version number to identify which layers are valid

version number for 1D cleanup correction

Definition at line 164 of file CDCDedx1DCell.h.


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