19 #ifndef CondFormatsL1TObjects_L1MuScale_h
20 #define CondFormatsL1TObjects_L1MuScale_h
45 virtual float getCenter(
unsigned packed)
const = 0;
48 virtual float getLowEdge(
unsigned packed)
const = 0;
51 virtual float getHighEdge(
unsigned packed)
const = 0;
63 virtual unsigned getNBins()
const = 0;
66 virtual float getValue(
unsigned i)
const = 0;
108 unsigned int nbits,
bool signedPacking,
int NBins,
const std::vector<double>& Scale,
int idx_offset = 0)
137 m_Scale.push_back(xmin +
i * (xmax - xmin) / m_NBins);
162 <<
"L1MuBinnedScale::getPacked: value out of scale range: " << value << std::endl;
166 else if (value >=
m_Scale[m_NBins])
191 std::ostringstream
str;
193 str <<
" ind | low edge | center | high edge" << std::endl;
194 str <<
"-------------------------------------------" << std::endl;
197 str << std::setw(4) << ipack <<
" | " << std::setw(10) <<
getLowEdge(ipack) <<
" | " << std::setw(10)
275 m_Scale.push_back(xmin +
i * (xmax - xmin) / m_NBins);
290 return center * fsign;
305 edm::LogWarning(
"NotImplemented") <<
"L1MuSymmetricBinnedScale::getHighEdge not implemented" << std::endl;
311 float absval = fabs(value);
314 <<
"L1MuSymmetricBinnedScale::getPacked: value out of scale range!!! abs(val) = " << absval
337 std::ostringstream
str;
339 str <<
" ind | low edge | center" << std::endl;
340 str <<
"-------------------------------------------" << std::endl;
343 str << std::setw(4) << ipack <<
" | " << std::setw(10) <<
getLowEdge(ipack) <<
" | " << std::setw(10)
virtual float getScaleMax() const =0
get the upper edge of the last bin
static int idxFromPacked(unsigned packed, unsigned int nbits)
get the value from the packed notation (always positive)
float getLowEdge(unsigned packed) const override
get the low edge of bin represented by packed
std::vector< float > m_Scale
float getScaleMax() const override
get the upper edge of the last bin (posivie half)
std::string print() const override
float getLowEdge(unsigned packed) const override
get the low edge of bin represented by packed
virtual float getLowEdge(unsigned packed) const =0
get the low edge of bin represented by packed
virtual float getCenter(unsigned packed) const =0
get the center of bin represented by packed
unsigned getNBins() const override
get number of bins
static unsigned packedFromIdx(int idx, unsigned int nbits)
get the packed notation of a value, check range
L1MuSymmetricBinnedScale(int nbits, int NBins, const std::vector< double > &Scale)
unsigned getPacked(float value) const override
pack a value
float getScaleMin() const override
get the lower edge of the first bin
float getValue(unsigned i) const override
get value of the underlying vector for bin i
virtual float getHighEdge(unsigned packed) const =0
get the upper edge of bin represented by packed
L1MuBinnedScale(unsigned int nbits, bool signedPacking, int NBins, float xmin, float xmax, int idx_offset=0)
std::vector< float > m_Scale
static int idxFromPacked(unsigned packed, unsigned int nbits)
get the value from the packed notation (+/-)
int idxFromPacked(unsigned packed) const override
get the value from the packed notation (+/-)
virtual float getValue(unsigned i) const =0
get value of the underlying vector for bin i
Abs< T >::type abs(const T &t)
float getScaleMin() const override
get the lower edge of the first bin (positive half)
virtual float getScaleMin() const =0
get the lower edge of the first bin
~L1MuSymmetricBinnedScale() override
destructor
L1MuSymmetricBinnedScale(int nbits, int NBins, float xmin, float xmax)
unsigned getNBins() const override
get number of bins
float getValue(unsigned i) const override
get value of the underlying vector for bin i
L1MuPseudoSignedPacking m_packing
L1MuSymmetricBinnedScale()
int signFromPacked(unsigned packed) const override
get the (pseudo-)sign from the packed notation (0=positive, 1=negative)
~L1MuBinnedScale() override
destructor
virtual unsigned getNBins() const =0
get number of bins
float getHighEdge(unsigned packed) const override
get the upper edge of bin represented by packed
#define COND_SERIALIZABLE
float getScaleMax() const override
get the upper edge of the last bin
L1MuBinnedScale(unsigned int nbits, bool signedPacking, int NBins, const std::vector< double > &Scale, int idx_offset=0)
float getHighEdge(unsigned packed) const override
get the upper edge of bin represented by packed
unsigned getPacked(float value) const override
pack a value
virtual unsigned getPacked(float value) const =0
pack a value
static unsigned packedFromIdx(int idx, unsigned int nbits)
get the packed notation of a value, check the range
float getCenter(unsigned packed) const override
get the center of bin represented by packed
unsigned packedFromIdx(int idx) const override
get the packed notation of a value, check range
float getCenter(unsigned packed) const override
get the center of bin represented by packed
Log< level::Warning, false > LogWarning
virtual std::string print() const =0
int get_idx(unsigned packed) const
std::string print() const override