dE/dx wire gain calibration constants
More...
#include <CDCDedxCosineCor.h>
|
std::vector< double > | m_cosgains |
| dE/dx gains in cos(theta) bins
|
|
dE/dx wire gain calibration constants
Definition at line 26 of file CDCDedxCosineCor.h.
◆ CDCDedxCosineCor() [1/2]
Default constructor.
Definition at line 33 of file CDCDedxCosineCor.h.
std::vector< double > m_cosgains
dE/dx gains in cos(theta) bins
◆ CDCDedxCosineCor() [2/2]
Constructor.
- Parameters
-
cosgains | vector of calibration constants |
Definition at line 39 of file CDCDedxCosineCor.h.
◆ ~CDCDedxCosineCor()
◆ getCosCor()
const std::vector< double > & getCosCor |
( |
| ) |
const |
|
inline |
Get the calibration constants.
- Returns
- calibration constants
Definition at line 73 of file CDCDedxCosineCor.h.
◆ getMean() [1/2]
double getMean |
( |
double |
costh | ) |
const |
|
inline |
Return dE/dx mean value for given cos(theta)
- Parameters
-
costh | for const with costh theta value |
- Returns
- mean value
Definition at line 102 of file CDCDedxCosineCor.h.
103 {
104 if (std::abs(costh) > 1) return 0;
105
106
107
109 int bin = std::floor((costh - 0.5 * binsize + 1.0) / binsize);
110
111
112
113
114 int thisbin = bin, nextbin = bin + 1;
115 if ((costh + 1) < (binsize / 2) || (costh > 0 && std::fabs(costh) < (binsize / 2))) {
116 thisbin = bin + 1; nextbin = bin + 2;
117 } else {
118 if ((costh - 1) > -1.0 * (binsize / 2) || (costh < 0 && std::fabs(costh) < (binsize / 2))) {
119 thisbin = bin - 1; nextbin = bin;
120 }
121 }
122 double frac = ((costh - 0.5 * binsize + 1.0) / binsize) - thisbin;
123
124 if (thisbin < 0 || (
unsigned)nextbin >=
m_cosgains.size()) {
125 B2WARNING("Problem with extrapolation of CDC dE/dx cosine correction");
126 return 1.0;
127 }
129 };
◆ getMean() [2/2]
double getMean |
( |
unsigned int |
bin | ) |
const |
|
inline |
Return dE/dx mean value for the given bin.
- Parameters
-
bin | for const with cosine bin |
- Returns
- mean value
Definition at line 91 of file CDCDedxCosineCor.h.
◆ getSize()
unsigned int getSize |
( |
| ) |
const |
|
inline |
Get the number of bins for the cosine correction.
- Returns
- number of bins
Definition at line 67 of file CDCDedxCosineCor.h.
◆ operator*=()
Combine payloads.
Definition at line 49 of file CDCDedxCosineCor.h.
50 {
52 B2WARNING("Cosine gain parameters do not match, cannot merge!");
53 return *this;
54 }
55 std::vector<double> rhsgains = rhs.getCosCor();
56 int scale = std::floor(
m_cosgains.size() / rhs.getSize() + 0.001);
57 for (
unsigned int bin = 0; bin <
m_cosgains.size(); ++bin) {
58 m_cosgains[bin] *= rhsgains[std::floor(bin / scale + 0.001)];
59 }
60 return *this;
61 }
◆ setCosCor()
void setCosCor |
( |
unsigned int |
bin, |
|
|
double |
value |
|
) |
| |
|
inline |
Set the cosine correction.
- Parameters
-
bin | bin number |
value | value to be set |
Definition at line 80 of file CDCDedxCosineCor.h.
81 {
83 else B2ERROR("CDCDedxCosineCor: invalid bin number, value not set");
84 }
◆ m_cosgains
std::vector<double> m_cosgains |
|
private |
The documentation for this class was generated from the following file: