11#include <framework/logging/Logger.h>
50 const std::vector<unsigned int>& layerToGroup);
90 unsigned int getGroup(
unsigned int layer)
const
93 B2ERROR(
"Layer out of range");
94 return std::numeric_limits<unsigned int>::max();
101 B2INFO(
"Invalid cosine correction payload state");
102 return std::numeric_limits<unsigned int>::max();
109 unsigned int getSize(
unsigned int layer)
const
112 const unsigned int group =
getGroup(layer);
151 void setCosCor(
unsigned int bin,
double value);
159 void setCosCor(
unsigned int group,
unsigned int bin,
double value);
166 double getMean(
unsigned int bin)
const;
173 double getMean(
double costh)
const;
181 double getMean(
unsigned int layer,
unsigned int bin)
const;
189 double getMean(
unsigned int layer,
double costh)
const;
212 bool multiplyGains(std::vector<double>& lhs,
const std::vector<double>& rhs)
const;
dE/dx cosine gain calibration constants
unsigned int getNGroups() const
Get number of groups in grouped mode.
std::vector< std::vector< double > > m_groupCosgains
grouped dE/dx gains [group][bin]
unsigned int getSize(unsigned int layer) const
Get the number of bins.
std::vector< unsigned int > m_layerToGroup
map from layer index to group index
ClassDef(CDCDedxCosineCor, 9)
ClassDef.
CDCDedxCosineCor()
Default constructor.
~CDCDedxCosineCor()
Destructor.
void setCosCor(unsigned int bin, double value)
Set old-style cosine correction.
double getMeanFromVector(const std::vector< double > &gains, double costh) const
Helper to interpolate/extrapolate from one vector of gains.
bool multiplyGains(std::vector< double > &lhs, const std::vector< double > &rhs) const
Multiply lhs by rhs with possible rebinning.
bool isGrouped() const
Check whether grouped mode is used.
CDCDedxCosineCor(const std::vector< double > &cosgains)
Old payloads Constructor.
const std::vector< std::vector< double > > & getGroupCosCor() const
Get the grouped calibration constants.
CDCDedxCosineCor & operator*=(const CDCDedxCosineCor &rhs)
Combine payloads.
std::vector< double > m_cosgains
old-style dE/dx gains in cos(theta) bins
bool isValidGroupedPayload() const
Validate grouped payload content.
const std::vector< double > & getCosCor() const
Get the old-style calibration constants.
const std::vector< unsigned int > & getLayerMap() const
Get the Layer-to-group map.
unsigned int getNLayers() const
Number of layers.
double getMean(unsigned int bin) const
Return dE/dx mean value for the given bin in old mode.
unsigned int getGroup(unsigned int layer) const
Get group index for layer.
Abstract base class for different kinds of events.