11#include <framework/logging/Logger.h>
52 B2WARNING(
"1D cell gain parameters do not match, cannot merge!");
55 for (
unsigned int layer = 0; layer <
getSize(); ++layer) {
56 double tempLayer = -1;
57 if (
getSize() == 2)tempLayer = layer * 20;
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) {
77 unsigned int getNBins(
unsigned int layer)
const
88 B2ERROR(
"ERROR! const vector not found");
94 B2ERROR(
"ERROR! Wrong # of constants vector array: getNBins()");
104 double getMean(
unsigned int layer,
unsigned int bin)
const
107 if (layer >= 8 &&
m_onedgains.size() == 2) mylayer = 1;
108 else if (
m_onedgains.size() == 56) mylayer = layer;
120 void setMean(
unsigned int layer,
unsigned int bin,
double value)
123 if (layer >= 8 &&
m_onedgains.size() == 2) mylayer = 1;
124 else if (
m_onedgains.size() == 56) mylayer = layer;
134 double getMean(
unsigned int layer,
double enta)
const
137 B2ERROR(
"No such layer!");
142 if (layer >= 8 &&
m_onedgains.size() == 2) mylayer = 1;
143 else if (
m_onedgains.size() == 56) mylayer = layer;
145 double piby2 = TMath::Pi() / 2.0;
147 if (enta < -piby2) enta += piby2;
148 if (enta > piby2) enta -= piby2;
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!");
dE/dx wire gain calibration constants
ClassDef(CDCDedx1DCell, 5)
ClassDef.
short m_version
dE/dx cleanup correction versus entrance angle may be different for different layers,...
CDCDedx1DCell(short version, const std::vector< std::vector< double > > &onedgains)
Constructor.
double getMean(unsigned int layer, unsigned int bin) const
Return dE/dx mean value for the given bin.
CDCDedx1DCell & operator*=(CDCDedx1DCell const &rhs)
Combine payloads.
double getMean(unsigned int layer, double enta) const
Return dE/dx mean value for given entrance angle.
~CDCDedx1DCell()
Destructor.
std::vector< std::vector< double > > m_onedgains
dE/dx means in entrance angle bins
void setMean(unsigned int layer, unsigned int bin, double value)
Reset dE/dx mean value for the given bin.
CDCDedx1DCell()
Default constructor.
unsigned int getNBins(unsigned int layer) const
Get the number of bins for the entrance angle correction.
short getVersion() const
Get the version for the 1D cleanup.
unsigned int getSize() const
Get the number of bins for the entrance angle correction.
Abstract base class for different kinds of events.