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;
115 L1MuBinnedScale(
unsigned int nbits,
bool signedPacking,
int NBins,
const std::vector<double>& Scale,
int idx_offset=0)
148 m_Scale.push_back( xmin +
i * (xmax-xmin) / m_NBins ) ;
177 edm::LogWarning(
"ScaleRangeViolation") <<
"L1MuBinnedScale::getPacked: value out of scale range: " << value << std::endl;
180 else if (value >=
m_Scale[m_NBins]) idx = m_NBins-1;
204 std::ostringstream str;
206 str <<
" ind | low edge | center | high edge" << std::endl;
207 str <<
"-------------------------------------------" << std::endl;
210 str << std::setw(4) << ipack <<
211 " | " << std::setw(10) <<
getLowEdge(ipack) <<
212 " | " << std::setw(10) <<
getCenter(ipack) <<
213 " | " << std::setw(10) <<
getHighEdge(ipack) << std::endl;
294 m_Scale.push_back( xmin +
i * (xmax-xmin) / m_NBins ) ;
308 return center * fsign;
322 edm::LogWarning(
"NotImplemented") <<
"L1MuSymmetricBinnedScale::getHighEdge not implemented" << std::endl;
328 float absval = fabs ( value );
330 <<
"L1MuSymmetricBinnedScale::getPacked: value out of scale range!!! abs(val) = "
335 if (idx >= m_NBins) idx = m_NBins-1;
351 std::ostringstream str;
353 str <<
" ind | low edge | center" << std::endl;
354 str <<
"-------------------------------------------" << std::endl;
357 str << std::setw(4) << ipack <<
358 " | " << std::setw(10) <<
getLowEdge(ipack) <<
359 " | " << 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
Abs< T >::type abs(const T &t)
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
volatile std::atomic< bool > shutdown_flag false
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