CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes
Exhume::Weight Class Referenceabstract

#include <Weight.h>

Inheritance diagram for Exhume::Weight:
Exhume::Event Exhume::TwoSpace Exhume::DiPhoton Exhume::GG Exhume::QQ

Public Member Functions

std::map< double, double > GetFuncMap ()
 
std::map< double, double > GetLineShape ()
 
double GetTotalIntegral ()
 
 Weight ()
 
virtual ~Weight ()
 

Protected Member Functions

void AddPoint (const double &, const double &)
 
double GetFunc (const double &xx_)
 
double GetValue (const double &xx_)
 
virtual double WeightFunc (const double &)=0
 
void WeightInit (const double &, const double &)
 

Protected Attributes

double Max_
 
double TotalIntegral
 

Private Attributes

std::map< double, double > FuncMap
 
std::map< double, double > LineShape
 
unsigned int NPoints
 

Detailed Description

Definition at line 14 of file Weight.h.

Constructor & Destructor Documentation

◆ Weight()

Exhume::Weight::Weight ( )
inline

Definition at line 16 of file Weight.h.

References NPoints.

16 { NPoints = 1000; };
unsigned int NPoints
Definition: Weight.h:58

◆ ~Weight()

virtual Exhume::Weight::~Weight ( )
inlinevirtual

Definition at line 17 of file Weight.h.

17 {};

Member Function Documentation

◆ AddPoint()

void Exhume::Weight::AddPoint ( const double &  ,
const double &   
)
protected

◆ GetFunc()

double Exhume::Weight::GetFunc ( const double &  xx_)
inlineprotected

Definition at line 27 of file Weight.h.

References FuncMap, Max_, and WeightFunc().

27  {
28  if (xx_ > Max_) {
29  return (WeightFunc(xx_));
30  }
31 
32  std::map<double, double>::iterator high_, low_;
33  high_ = FuncMap.upper_bound(xx_);
34  low_ = high_;
35  low_--;
36 
37  return (low_->second + (high_->second - low_->second) * (xx_ - low_->first) / (high_->first - low_->first));
38  };
double Max_
Definition: Weight.h:54
std::map< double, double > FuncMap
Definition: Weight.h:59
virtual double WeightFunc(const double &)=0

◆ GetFuncMap()

std::map<double, double> Exhume::Weight::GetFuncMap ( )
inline

Definition at line 18 of file Weight.h.

References FuncMap.

18 { return (FuncMap); };
std::map< double, double > FuncMap
Definition: Weight.h:59

◆ GetLineShape()

std::map<double, double> Exhume::Weight::GetLineShape ( )
inline

Definition at line 21 of file Weight.h.

References LineShape.

21 { return (LineShape); };
std::map< double, double > LineShape
Definition: Weight.h:60

◆ GetTotalIntegral()

double Exhume::Weight::GetTotalIntegral ( )
inline

Definition at line 19 of file Weight.h.

References TotalIntegral.

19 { return (TotalIntegral); };
double TotalIntegral
Definition: Weight.h:55

◆ GetValue()

double Exhume::Weight::GetValue ( const double &  xx_)
inlineprotected

Definition at line 40 of file Weight.h.

References LineShape.

40  {
41  std::map<double, double>::iterator high_, low_;
42  high_ = LineShape.upper_bound(xx_);
43 
44  if (high_ == LineShape.end())
45  high_--;
46 
47  low_ = high_;
48  low_--;
49 
50  return (low_->second + (high_->second - low_->second) * (xx_ - low_->first) / (high_->first - low_->first));
51  };
std::map< double, double > LineShape
Definition: Weight.h:60

◆ WeightFunc()

virtual double Exhume::Weight::WeightFunc ( const double &  )
protectedpure virtual

Implemented in Exhume::Event, and Exhume::TwoSpace.

Referenced by GetFunc().

◆ WeightInit()

void Exhume::Weight::WeightInit ( const double &  ,
const double &   
)
protected

Member Data Documentation

◆ FuncMap

std::map<double, double> Exhume::Weight::FuncMap
private

Definition at line 59 of file Weight.h.

Referenced by GetFunc(), and GetFuncMap().

◆ LineShape

std::map<double, double> Exhume::Weight::LineShape
private

Definition at line 60 of file Weight.h.

Referenced by GetLineShape(), and GetValue().

◆ Max_

double Exhume::Weight::Max_
protected

Definition at line 54 of file Weight.h.

Referenced by GetFunc(), and Exhume::Event::SetMassRange().

◆ NPoints

unsigned int Exhume::Weight::NPoints
private

Definition at line 58 of file Weight.h.

Referenced by Weight().

◆ TotalIntegral

double Exhume::Weight::TotalIntegral
protected

Definition at line 55 of file Weight.h.

Referenced by GetTotalIntegral().