11#include <framework/logging/Logger.h>
65 if (ring > 1) B2ERROR(
"wrong index for injection ring ");
66 if (ring * 3 >=
m_injectionvar.size()) B2FATAL(
"CDCDedxInjectionTime: vector-of-vectors too short");
75 if (ring > 1) B2ERROR(
"wrong index for injection ring ");
76 if (ring * 3 + 1 >=
m_injectionvar.size()) B2FATAL(
"CDCDedxInjectionTime: vector-of-vectors too short");
85 if (ring > 1) B2ERROR(
"wrong index for injection ring ");
86 if (ring * 3 + 2 >=
m_injectionvar.size()) B2FATAL(
"CDCDedxInjectionTime: vector-of-vectors too short");
96 int nabove, nbelow, middle;
97 nabove =
array.size() + 1;
99 while (nabove - nbelow > 1) {
100 middle = (nabove + nbelow) / 2;
101 if (value ==
array[middle - 1])
return middle - 1;
102 if (value <
array[middle - 1]) nabove = middle;
103 else nbelow = middle;
113 double getCorrection(std::string svar,
unsigned int ring,
unsigned int time)
const;
127 int last =
vector.size() - 1;
129 else if (k > last) k = last;
CDCDedxInjectionTime(const std::vector< std::vector< double > > &vinjcalib)
Constructor.
std::vector< std::vector< double > > getConstVector() const
Return vector of all constant vector of payload.
int getTimeBin(const std::vector< unsigned int > &array, unsigned int value) const
Return time bin for the given time array.
double getSafely(unsigned int iv, int k) const
Helper: safe access to a vector element.
~CDCDedxInjectionTime()
Destructor.
const std::vector< double > & getResoVector(unsigned int ring) const
Return dedx reso vector.
const std::vector< double > & getTimeVector(unsigned int ring) const
Return time vector.
CDCDedxInjectionTime()
Default constructor.
void printCorrection(std::string svar, std::string sfx) const
Return dE/dx mean or norm-reso value for the given time and ring.
const std::vector< double > & getMeanVector(unsigned int ring) const
Return dedx mean vector.
double getCorrection(std::string svar, unsigned int ring, unsigned int time) const
Return dE/dx mean or norm-reso value for the given time and ring.
ClassDef(CDCDedxInjectionTime, 1)
ClassDef.
std::vector< std::vector< double > > m_injectionvar
CDC dE/dx injection time payloads for dEdx mean and reso.
Abstract base class for different kinds of events.