CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Attributes | Private Member Functions | Friends
PhysicsTools::Calibration::Histogram< Value_t, Axis_t > Class Template Reference

#include <Histogram.h>

Inheritance diagram for PhysicsTools::Calibration::Histogram< Value_t, Axis_t >:
CalibratedHistogramXML

Public Types

typedef PhysicsTools::Calibration::Range< Axis_t > Range
 

Public Member Functions

Value_t binContent (int bin) const
 
Value_t binError (int bin) const
 
Range binRange (int bin) const
 
bool empty () const
 
Value_t error (Axis_t x) const
 
void fill (Axis_t x, Value_t weight=1.0)
 
int findBin (Axis_t x) const
 
bool hasEquidistantBins () const
 
 Histogram ()
 
 Histogram (const Histogram &orig)
 
template<typename OValue_t , typename OAxis_t >
 Histogram (const Histogram< OValue_t, OAxis_t > &orig)
 
 Histogram (const std::vector< Axis_t > &binULimits)
 
template<typename OAxis_t >
 Histogram (const std::vector< OAxis_t > &binULimits)
 
 Histogram (unsigned int nBins, Axis_t min, Axis_t max)
 
template<typename OAxis_t >
 Histogram (unsigned int nBins, const PhysicsTools::Calibration::Range< OAxis_t > &range)
 
Value_t integral (Axis_t hBound, Axis_t lBound=0.0, int mode=1) const
 
Value_t normalization () const
 
Value_t normalizedError (Axis_t x) const
 
Value_t normalizedIntegral (Axis_t hBound, Axis_t lBound=0.0, int mode=1) const
 
Value_t normalizedValue (Axis_t x) const
 
int numberOfBins () const
 
Histogramoperator= (const Histogram &orig)
 
template<typename OValue_t , typename OAxis_t >
Histogramoperator= (const Histogram< OValue_t, OAxis_t > &orig)
 
Range range () const
 
void reset ()
 
void setBinContent (int bin, Value_t value)
 
template<typename OValue_t >
void setValues (const std::vector< OValue_t > &values)
 
void setValues (const std::vector< Value_t > &values)
 
const std::vector< Axis_t > upperLimits () const
 
Value_t value (Axis_t x) const
 
const std::vector< Value_t > & values () const
 
 ~Histogram ()
 

Protected Attributes

std::vector< Axis_t > binULimits
 
std::vector< Value_t > binValues
 
Range limits
 
Value_t total
 
std::atomic< bool > totalValid
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

template<typename Value_t, typename Axis_t = Value_t>
class PhysicsTools::Calibration::Histogram< Value_t, Axis_t >

Definition at line 35 of file Histogram.h.

Member Typedef Documentation

◆ Range

template<typename Value_t, typename Axis_t = Value_t>
typedef PhysicsTools::Calibration::Range<Axis_t> PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::Range

Definition at line 37 of file Histogram.h.

Constructor & Destructor Documentation

◆ Histogram() [1/7]

template<typename Value_t, typename Axis_t = Value_t>
PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::Histogram ( )

◆ Histogram() [2/7]

template<typename Value_t, typename Axis_t = Value_t>
PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::Histogram ( const Histogram< Value_t, Axis_t > &  orig)

◆ Histogram() [3/7]

template<typename Value_t, typename Axis_t = Value_t>
template<typename OValue_t , typename OAxis_t >
PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::Histogram ( const Histogram< OValue_t, OAxis_t > &  orig)

◆ Histogram() [4/7]

template<typename Value_t, typename Axis_t = Value_t>
PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::Histogram ( const std::vector< Axis_t > &  binULimits)

◆ Histogram() [5/7]

template<typename Value_t, typename Axis_t = Value_t>
template<typename OAxis_t >
PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::Histogram ( const std::vector< OAxis_t > &  binULimits)

◆ Histogram() [6/7]

template<typename Value_t, typename Axis_t = Value_t>
template<typename OAxis_t >
PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::Histogram ( unsigned int  nBins,
const PhysicsTools::Calibration::Range< OAxis_t > &  range 
)

◆ Histogram() [7/7]

template<typename Value_t, typename Axis_t = Value_t>
PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::Histogram ( unsigned int  nBins,
Axis_t  min,
Axis_t  max 
)

◆ ~Histogram()

template<typename Value_t, typename Axis_t = Value_t>
PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::~Histogram ( )

Member Function Documentation

◆ binContent()

template<typename Value_t, typename Axis_t = Value_t>
Value_t PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::binContent ( int  bin) const
inline

◆ binError()

template<typename Value_t, typename Axis_t = Value_t>
Value_t PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::binError ( int  bin) const
inline

Definition at line 71 of file Histogram.h.

71 { return std::sqrt(binContent(bin)); }

Referenced by PhysicsTools::Calibration::Histogram< float >::error().

◆ binRange()

template<typename Value_t, typename Axis_t = Value_t>
Range PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::binRange ( int  bin) const

◆ empty()

template<typename Value_t, typename Axis_t = Value_t>
bool PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::empty ( ) const
inline

Definition at line 78 of file Histogram.h.

78 { return binValues.empty(); }

◆ error()

template<typename Value_t, typename Axis_t = Value_t>
Value_t PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::error ( Axis_t  x) const
inline

Definition at line 72 of file Histogram.h.

72 { return binError(findBin(x)); }

Referenced by Page1Parser.Page1Parser::check_for_whole_start_tag().

◆ fill()

template<typename Value_t, typename Axis_t = Value_t>
void PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::fill ( Axis_t  x,
Value_t  weight = 1.0 
)

◆ findBin()

template<typename Value_t, typename Axis_t = Value_t>
int PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::findBin ( Axis_t  x) const

◆ hasEquidistantBins()

template<typename Value_t, typename Axis_t = Value_t>
bool PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::hasEquidistantBins ( ) const
inline

Definition at line 79 of file Histogram.h.

79 { return binULimits.empty(); }

◆ integral()

template<typename Value_t, typename Axis_t = Value_t>
Value_t PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::integral ( Axis_t  hBound,
Axis_t  lBound = 0.0,
int  mode = 1 
) const

◆ normalization()

template<typename Value_t, typename Axis_t = Value_t>
Value_t PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::normalization ( ) const

◆ normalizedError()

template<typename Value_t, typename Axis_t = Value_t>
Value_t PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::normalizedError ( Axis_t  x) const
inline

Definition at line 73 of file Histogram.h.

73 { return std::sqrt(binContent(findBin(x))) / normalization(); }

◆ normalizedIntegral()

template<typename Value_t, typename Axis_t = Value_t>
Value_t PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::normalizedIntegral ( Axis_t  hBound,
Axis_t  lBound = 0.0,
int  mode = 1 
) const
inline

Definition at line 96 of file Histogram.h.

96  {
97  return integral(hBound, lBound, mode) / normalization();
98  }

Referenced by HistogramProbabilityEstimator::probability().

◆ normalizedValue()

template<typename Value_t, typename Axis_t = Value_t>
Value_t PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::normalizedValue ( Axis_t  x) const
inline

Definition at line 69 of file Histogram.h.

69 { return binContent(findBin(x)) / normalization(); }

◆ numberOfBins()

template<typename Value_t, typename Axis_t = Value_t>
int PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::numberOfBins ( ) const
inline

Definition at line 80 of file Histogram.h.

80 { return binValues.size() - 2; }

◆ operator=() [1/2]

template<typename Value_t, typename Axis_t = Value_t>
Histogram& PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::operator= ( const Histogram< Value_t, Axis_t > &  orig)

◆ operator=() [2/2]

template<typename Value_t, typename Axis_t = Value_t>
template<typename OValue_t , typename OAxis_t >
Histogram& PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::operator= ( const Histogram< OValue_t, OAxis_t > &  orig)

◆ range()

template<typename Value_t, typename Axis_t = Value_t>
Range PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::range ( ) const
inline

Definition at line 89 of file Histogram.h.

89 { return limits; }

◆ reset()

template<typename Value_t, typename Axis_t = Value_t>
void PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::reset ( )

◆ serialize()

template<typename Value_t, typename Axis_t = Value_t>
template<class Archive >
void PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::serialize ( Archive &  ar,
const unsigned int  version 
)
private

◆ setBinContent()

template<typename Value_t, typename Axis_t = Value_t>
void PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::setBinContent ( int  bin,
Value_t  value 
)

◆ setValues() [1/2]

template<typename Value_t, typename Axis_t = Value_t>
template<typename OValue_t >
void PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::setValues ( const std::vector< OValue_t > &  values)

◆ setValues() [2/2]

template<typename Value_t, typename Axis_t = Value_t>
void PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::setValues ( const std::vector< Value_t > &  values)

◆ upperLimits()

template<typename Value_t, typename Axis_t = Value_t>
const std::vector<Axis_t> PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::upperLimits ( ) const
inline

Definition at line 65 of file Histogram.h.

65 { return binULimits; }

◆ value()

template<typename Value_t, typename Axis_t = Value_t>
Value_t PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::value ( Axis_t  x) const
inline

◆ values()

template<typename Value_t, typename Axis_t = Value_t>
const std::vector<Value_t>& PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::values ( ) const
inline

Definition at line 82 of file Histogram.h.

82 { return binValues; }

Friends And Related Function Documentation

◆ boost::serialization::access

template<typename Value_t, typename Axis_t = Value_t>
friend class boost::serialization::access
friend

Definition at line 113 of file Histogram.h.

◆ cond::serialization::access

template<typename Value_t, typename Axis_t = Value_t>
template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 113 of file Histogram.h.

Member Data Documentation

◆ binULimits

template<typename Value_t, typename Axis_t = Value_t>
std::vector<Axis_t> PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::binULimits
protected

◆ binValues

template<typename Value_t, typename Axis_t = Value_t>
std::vector<Value_t> PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::binValues
protected

◆ limits

template<typename Value_t, typename Axis_t = Value_t>
Range PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::limits
protected

Definition at line 103 of file Histogram.h.

Referenced by PhysicsTools::Calibration::Histogram< float >::range().

◆ total

template<typename Value_t, typename Axis_t = Value_t>
Value_t PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::total
mutableprotected

Definition at line 106 of file Histogram.h.

◆ totalValid

template<typename Value_t, typename Axis_t = Value_t>
std::atomic<bool> PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::totalValid
mutableprotected

Definition at line 108 of file Histogram.h.

PhysicsTools::Calibration::Histogram::findBin
int findBin(Axis_t x) const
PhysicsTools::Calibration::Histogram::limits
Range limits
Definition: Histogram.h:103
PhysicsTools::Calibration::Histogram::normalization
Value_t normalization() const
ALCARECOPromptCalibProdSiPixelAli0T_cff.mode
mode
Definition: ALCARECOPromptCalibProdSiPixelAli0T_cff.py:96
PhysicsTools::Calibration::Histogram::binContent
Value_t binContent(int bin) const
Definition: Histogram.h:67
DDAxes::x
PhysicsTools::Calibration::Histogram::binError
Value_t binError(int bin) const
Definition: Histogram.h:71
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
PhysicsTools::Calibration::Histogram::binValues
std::vector< Value_t > binValues
Definition: Histogram.h:102
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
PhysicsTools::Calibration::Histogram::binULimits
std::vector< Axis_t > binULimits
Definition: Histogram.h:101
PhysicsTools::Calibration::Histogram::integral
Value_t integral(Axis_t hBound, Axis_t lBound=0.0, int mode=1) const