test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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>

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)
 
template<typename OAxis_t >
 Histogram (unsigned int nBins, const PhysicsTools::Calibration::Range< OAxis_t > &range)
 
 Histogram (unsigned int nBins, Axis_t min, Axis_t max)
 
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)
 
void setValues (const std::vector< Value_t > &values)
 
template<typename OValue_t >
void setValues (const std::vector< OValue_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 36 of file Histogram.h.

Member Typedef Documentation

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 38 of file Histogram.h.

Constructor & Destructor Documentation

template<typename Value_t, typename Axis_t = Value_t>
PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::Histogram ( )
template<typename Value_t, typename Axis_t = Value_t>
PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::Histogram ( const Histogram< Value_t, Axis_t > &  orig)
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)
template<typename Value_t, typename Axis_t = Value_t>
PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::Histogram ( const std::vector< Axis_t > &  binULimits)
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)
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 
)
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 
)
template<typename Value_t, typename Axis_t = Value_t>
PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::~Histogram ( )

Member Function Documentation

template<typename Value_t, typename Axis_t = Value_t>
Value_t PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::binContent ( int  bin) const
inline
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 74 of file Histogram.h.

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

74 { return std::sqrt(binContent(bin)); }
Value_t binContent(int bin) const
Definition: Histogram.h:69
T sqrt(T t)
Definition: SSEVec.h:18
template<typename Value_t, typename Axis_t = Value_t>
Range PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::binRange ( int  bin) const
template<typename Value_t, typename Axis_t = Value_t>
bool PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::empty ( ) const
inline

Definition at line 82 of file Histogram.h.

Referenced by Vispa.Gui.VispaWidget.TextField::setAutosizeFont(), and Vispa.Gui.VispaWidget.TextField::setAutotruncate().

82 { return binValues.empty(); }
std::vector< Value_t > binValues
Definition: Histogram.h:106
template<typename Value_t, typename Axis_t = Value_t>
Value_t PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::error ( Axis_t  x) const
inline
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 
)
template<typename Value_t, typename Axis_t = Value_t>
int PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::findBin ( Axis_t  x) const
template<typename Value_t, typename Axis_t = Value_t>
bool PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::hasEquidistantBins ( ) const
inline

Definition at line 83 of file Histogram.h.

83 { return binULimits.empty(); }
std::vector< Axis_t > binULimits
Definition: Histogram.h:105
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
template<typename Value_t, typename Axis_t = Value_t>
Value_t PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::normalization ( ) const
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 76 of file Histogram.h.

77  { return std::sqrt(binContent(findBin(x))) / normalization(); }
Value_t binContent(int bin) const
Definition: Histogram.h:69
T sqrt(T t)
Definition: SSEVec.h:18
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 101 of file Histogram.h.

102  { return integral(hBound, lBound, mode) / normalization(); }
Value_t integral(Axis_t hBound, Axis_t lBound=0.0, int mode=1) const
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 71 of file Histogram.h.

72  { return binContent(findBin(x)) / normalization(); }
Value_t binContent(int bin) const
Definition: Histogram.h:69
template<typename Value_t, typename Axis_t = Value_t>
int PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::numberOfBins ( ) const
inline

Definition at line 84 of file Histogram.h.

Referenced by LikelihoodPdf::normalization().

84 { return binValues.size() - 2; }
std::vector< Value_t > binValues
Definition: Histogram.h:106
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)
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)
template<typename Value_t, typename Axis_t = Value_t>
Range PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::range ( ) const
inline

Definition at line 94 of file Histogram.h.

template<typename Value_t, typename Axis_t = Value_t>
void PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::reset ( )
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
template<typename Value_t, typename Axis_t = Value_t>
void PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::setBinContent ( int  bin,
Value_t  value 
)
template<typename Value_t, typename Axis_t = Value_t>
void PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::setValues ( const std::vector< Value_t > &  values)
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)
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 67 of file Histogram.h.

67 { return binULimits; }
std::vector< Axis_t > binULimits
Definition: Histogram.h:105
template<typename Value_t, typename Axis_t = Value_t>
Value_t PhysicsTools::Calibration::Histogram< Value_t, Axis_t >::value ( Axis_t  x) const
inline
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 86 of file Histogram.h.

87  { return binValues; }
std::vector< Value_t > binValues
Definition: Histogram.h:106

Friends And Related Function Documentation

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

Definition at line 117 of file Histogram.h.

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

Definition at line 117 of file Histogram.h.

Member Data Documentation

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

Definition at line 107 of file Histogram.h.

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

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

Definition at line 110 of file Histogram.h.

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

Definition at line 112 of file Histogram.h.