19 #ifndef CondFormatsL1TObjects_L1MuScale_h
20 #define CondFormatsL1TObjects_L1MuScale_h
43 virtual float getCenter(
unsigned packed)
const = 0;
46 virtual float getLowEdge(
unsigned packed)
const = 0;
49 virtual float getHighEdge(
unsigned packed)
const = 0;
61 virtual unsigned getNBins()
const = 0;
64 virtual float getValue(
unsigned i)
const = 0;
111 L1MuBinnedScale(
unsigned int nbits,
bool signedPacking,
int NBins,
const std::vector<double>& Scale,
int idx_offset=0)
144 m_Scale.push_back( xmin +
i * (xmax-xmin) / m_NBins ) ;
173 edm::LogWarning(
"ScaleRangeViolation") <<
"L1MuBinnedScale::getPacked: value out of scale range: " << value << std::endl;
176 else if (value >=
m_Scale[m_NBins]) idx = m_NBins-1;
200 std::ostringstream str;
202 str <<
" ind | low edge | center | high edge" << std::endl;
203 str <<
"-------------------------------------------" << std::endl;
206 str << std::setw(4) << ipack <<
207 " | " << std::setw(10) <<
getLowEdge(ipack) <<
208 " | " << std::setw(10) <<
getCenter(ipack) <<
209 " | " << std::setw(10) <<
getHighEdge(ipack) << std::endl;
288 m_Scale.push_back( xmin +
i * (xmax-xmin) / m_NBins ) ;
302 return center * fsign;
316 edm::LogWarning(
"NotImplemented") <<
"L1MuSymmetricBinnedScale::getHighEdge not implemented" << std::endl;
322 float absval = fabs ( value );
324 <<
"L1MuSymmetricBinnedScale::getPacked: value out of scale range!!! abs(val) = "
329 if (idx >= m_NBins) idx = m_NBins-1;
345 std::ostringstream str;
347 str <<
" ind | low edge | center" << std::endl;
348 str <<
"-------------------------------------------" << std::endl;
351 str << std::setw(4) << ipack <<
352 " | " << std::setw(10) <<
getLowEdge(ipack) <<
353 " | " << std::setw(10) <<
getCenter(ipack) << std::endl;
virtual float getScaleMax() const =0
get the upper edge of the last bin
virtual float getScaleMin() const
get the lower edge of the first bin
static int idxFromPacked(unsigned packed, unsigned int nbits)
get the value from the packed notation (always positive)
std::vector< float > m_Scale
virtual float getScaleMax() const
get the upper edge of the last bin (posivie half)
virtual float getLowEdge(unsigned packed) const =0
get the low edge of bin represented by packed
virtual ~L1MuSymmetricBinnedScale()
destructor
virtual std::string print() const
virtual unsigned getNBins() const
get number of bins
virtual float getCenter(unsigned packed) const =0
get the center of bin represented by packed
virtual float getHighEdge(unsigned packed) const
get the upper edge of bin represented by packed
virtual unsigned getPacked(float value) const
pack a value
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)
virtual float getLowEdge(unsigned packed) const
get the low edge of bin represented by packed
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 (+/-)
virtual float getValue(unsigned i) const =0
get value of the underlying vector for bin i
virtual float getScaleMin() const =0
get the lower edge of the first bin
L1MuSymmetricBinnedScale(int nbits, int NBins, float xmin, float xmax)
virtual ~L1MuBinnedScale()
destructor
virtual float getCenter(unsigned packed) const
get the center of bin represented by packed
virtual float getScaleMax() const
get the upper edge of the last bin
virtual unsigned packedFromIdx(int idx) const
get the packed notation of a value, check range
virtual float getCenter(unsigned packed) const
get the center of bin represented by packed
virtual float getHighEdge(unsigned packed) const
get the upper edge of bin represented by packed
L1MuPseudoSignedPacking m_packing
L1MuSymmetricBinnedScale()
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
virtual float getValue(unsigned i) const
get value of the underlying vector for bin i
virtual unsigned getNBins() const =0
get number of bins
virtual unsigned getNBins() const
get number of bins
L1MuBinnedScale(unsigned int nbits, bool signedPacking, int NBins, const std::vector< double > &Scale, int idx_offset=0)
virtual int idxFromPacked(unsigned packed) const
get the value from the packed notation (+/-)
virtual float getScaleMin() const
get the lower edge of the first bin (positive half)
virtual unsigned getPacked(float value) const =0
pack a value
virtual float getValue(unsigned i) const
get value of the underlying vector for bin i
static unsigned packedFromIdx(int idx, unsigned int nbits)
get the packed notation of a value, check the range
virtual float getLowEdge(unsigned packed) const
get the low edge of bin represented by packed
virtual std::string print() const
virtual std::string print() const =0
virtual int signFromPacked(unsigned packed) const
get the (pseudo-)sign from the packed notation (0=positive, 1=negative)
int get_idx(unsigned packed) const
virtual unsigned getPacked(float value) const
pack a value