11#include <framework/logging/Logger.h>
51 B2WARNING(
"Cosine gain parameters do not match, cannot merge!");
54 std::vector<double> rhsgains = rhs.
getCosCor();
56 for (
unsigned int bin = 0; bin <
m_cosgains.size(); ++bin) {
57 m_cosgains[bin] *= rhsgains[std::floor(bin / scale + 0.001)];
91 if (std::abs(costh) > 1)
return 0;
96 int bin = std::floor((costh - 0.5 * binsize + 1.0) / binsize);
101 int thisbin = bin, nextbin = bin + 1;
102 if ((costh + 1) < (binsize / 2) || (costh > 0 && std::fabs(costh) < (binsize / 2))) {
103 thisbin = bin + 1; nextbin = bin + 2;
105 if ((costh - 1) > -1.0 * (binsize / 2) || (costh < 0 && std::fabs(costh) < (binsize / 2))) {
106 thisbin = bin - 1; nextbin = bin;
109 double frac = ((costh - 0.5 * binsize + 1.0) / binsize) - thisbin;
111 if (thisbin < 0 || (
unsigned)nextbin >=
m_cosgains.size()) {
112 B2WARNING(
"Problem with extrapolation of CDC dE/dx cosine correction");
dE/dx wire gain calibration constants
CDCDedxCosineCor()
Default constructor.
std::vector< double > getCosCor() const
Get the cosine correction.
~CDCDedxCosineCor()
Destructor.
double getMean(double costh) const
Return dE/dx mean value for given cos(theta)
CDCDedxCosineCor(const std::vector< double > &cosgains)
Constructor.
CDCDedxCosineCor & operator*=(CDCDedxCosineCor const &rhs)
Combine payloads.
std::vector< double > m_cosgains
dE/dx gains in cos(theta) bins
ClassDef(CDCDedxCosineCor, 8)
ClassDef.
double getMean(unsigned int bin) const
Return dE/dx mean value for the given bin.
unsigned int getSize() const
Get the number of bins for the cosine correction.
void setCosCor(int bin, double value)
Set the cosine correction.
Abstract base class for different kinds of events.