CMS 3D CMS Logo

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

Exhume::Weight::Weight ( )
inline

Definition at line 18 of file Weight.h.

References NPoints.

18 {NPoints = 1000;};
unsigned int NPoints
Definition: Weight.h:72
virtual Exhume::Weight::~Weight ( )
inlinevirtual

Definition at line 19 of file Weight.h.

19 {};

Member Function Documentation

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

Definition at line 36 of file Weight.h.

References FuncMap, Max_, and WeightFunc().

36  {
37  if(xx_ > Max_){
38  return(WeightFunc(xx_) );
39  }
40 
41  std::map<double, double>::iterator high_, low_;
42  high_ = FuncMap.upper_bound(xx_);
43  low_ = high_;
44  low_--;
45 
46  return( low_->second +
47  (high_->second - low_->second) * (xx_ - low_->first)/
48  (high_->first - low_->first));
49  };
double Max_
Definition: Weight.h:67
std::map< double, double > FuncMap
Definition: Weight.h:73
virtual double WeightFunc(const double &)=0
std::map<double, double> Exhume::Weight::GetFuncMap ( )
inline

Definition at line 20 of file Weight.h.

References FuncMap.

20  {
21  return(FuncMap);
22  };
std::map< double, double > FuncMap
Definition: Weight.h:73
std::map<double, double> Exhume::Weight::GetLineShape ( )
inline

Definition at line 27 of file Weight.h.

References LineShape.

27  {
28  return(LineShape);
29  };
std::map< double, double > LineShape
Definition: Weight.h:74
double Exhume::Weight::GetTotalIntegral ( )
inline

Definition at line 23 of file Weight.h.

References TotalIntegral.

23  {
24  return(TotalIntegral);
25  };
double TotalIntegral
Definition: Weight.h:68
double Exhume::Weight::GetValue ( const double &  xx_)
inlineprotected

Definition at line 51 of file Weight.h.

References LineShape.

51  {
52 
53  std::map<double, double>::iterator high_, low_;
54  high_ = LineShape.upper_bound(xx_);
55 
56  if(high_==LineShape.end())high_--;
57 
58  low_ = high_;
59  low_--;
60 
61  return( low_->second +
62  (high_->second - low_->second) * (xx_ - low_->first)/
63  (high_->first - low_->first));
64  };
std::map< double, double > LineShape
Definition: Weight.h:74
virtual double Exhume::Weight::WeightFunc ( const double &  )
protectedpure virtual

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

Referenced by GetFunc().

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

Member Data Documentation

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

Definition at line 73 of file Weight.h.

Referenced by GetFunc(), and GetFuncMap().

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

Definition at line 74 of file Weight.h.

Referenced by GetLineShape(), and GetValue().

double Exhume::Weight::Max_
protected

Definition at line 67 of file Weight.h.

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

unsigned int Exhume::Weight::NPoints
private

Definition at line 72 of file Weight.h.

Referenced by Weight().

double Exhume::Weight::TotalIntegral
protected

Definition at line 68 of file Weight.h.

Referenced by GetTotalIntegral().