dE/dx wire gain calibration constants
More...
#include <CDCDedx1DCell.h>
|
| CDCDedx1DCell () |
| Default constructor.
|
|
| CDCDedx1DCell (short version, const std::vector< std::vector< double > > &onedgains) |
| Constructor.
|
|
| ~CDCDedx1DCell () |
| Destructor.
|
|
CDCDedx1DCell & | operator*= (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.
|
|
|
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
|
|
dE/dx wire gain calibration constants
Definition at line 26 of file CDCDedx1DCell.h.
◆ CDCDedx1DCell() [1/2]
Default constructor.
Definition at line 33 of file CDCDedx1DCell.h.
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 |
◆ ~CDCDedx1DCell()
◆ getMean() [1/2]
double getMean |
( |
unsigned int |
layer, |
|
|
double |
enta |
|
) |
| const |
|
inline |
Return dE/dx mean value for given entrance angle.
- Parameters
-
layer | continuous layer number |
enta | entrance angle (-pi/2 to pi/2) |
Definition at line 132 of file CDCDedx1DCell.h.
133 {
134 if (layer > 56) {
135 B2ERROR("No such layer!");
136 return 0;
137 }
138
139 unsigned int mylayer = 0;
140 if (layer >= 8 &&
m_onedgains.size() == 2) mylayer = 1;
141 else if (
m_onedgains.size() == 56) mylayer = layer;
142
144
145 double piby2 = M_PI / 2.0;
146
147 if (enta < -piby2) enta += piby2;
148 if (enta > piby2) enta -= piby2;
149
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
158 };
◆ getMean() [2/2]
double getMean |
( |
unsigned int |
layer, |
|
|
unsigned int |
bin |
|
) |
| const |
|
inline |
Return dE/dx mean value for the given bin.
- Parameters
-
layer | is layer number between 0-55 |
bin | is enta bin number |
Definition at line 103 of file CDCDedx1DCell.h.
104 {
105 unsigned int mylayer = 0;
106 if (layer >= 8 &&
m_onedgains.size() == 2) mylayer = 1;
107 else if (
m_onedgains.size() == 56) mylayer = layer;
108
110
111 return 1.0;
112 };
◆ getNBins()
unsigned int getNBins |
( |
unsigned int |
layer | ) |
const |
|
inline |
Get the number of bins for the entrance angle correction.
Definition at line 76 of file CDCDedx1DCell.h.
77 {
79 B2ERROR("ERROR!");
80 return 0;
81 }
82
86 else {
87 B2ERROR("ERROR! const vector not found");
88 return 0;
89 }
92 } else {
93 B2ERROR("ERROR! Wrong # of constants vector array: getNBins()");
94 return 0;
95 }
96 return 0;
97 };
◆ getSize()
unsigned int getSize |
( |
| ) |
const |
|
inline |
Get the number of bins for the entrance angle correction.
Definition at line 72 of file CDCDedx1DCell.h.
◆ getVersion()
short getVersion |
( |
| ) |
const |
|
inline |
◆ operator*=()
Combine payloads.
Definition at line 48 of file CDCDedx1DCell.h.
49 {
51 B2WARNING("1D cell gain parameters do not match, cannot merge!");
52 return *this;
53 }
54 for (
unsigned int layer = 0; layer <
getSize(); ++layer) {
55 double tempLayer = -1;
56 if (
getSize() == 2)tempLayer = layer * 20;
57 else if (
getSize() == 56)tempLayer = layer;
58 else B2ERROR("ERROR! Wrong # of constants vector array");
59 for (
unsigned int bin = 0; bin <
getNBins(layer); ++bin) {
60 m_onedgains[layer][bin] *= rhs.getMean(tempLayer, bin);
61 }
62 }
63 return *this;
64 }
unsigned int getNBins(unsigned int layer) const
Get the number of bins for the entrance angle correction.
unsigned int getSize() const
Get the number of bins for the entrance angle correction.
◆ setMean()
void setMean |
( |
unsigned int |
layer, |
|
|
unsigned int |
bin, |
|
|
double |
value |
|
) |
| |
|
inline |
Reset dE/dx mean value for the given bin.
- Parameters
-
layer | is layer number between 0-55 |
bin | is enta bin number |
value | is constant for requested entabin and layer |
Definition at line 119 of file CDCDedx1DCell.h.
120 {
121 unsigned int mylayer = 0;
122 if (layer >= 8 &&
m_onedgains.size() == 2) mylayer = 1;
123 else if (
m_onedgains.size() == 56) mylayer = layer;
124
126 };
◆ m_onedgains
std::vector<std::vector<double> > m_onedgains |
|
private |
◆ 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
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: