CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes

Exhume::Weight Class Reference

#include <Weight.h>

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

List of all members.

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.

{NPoints = 1000;};
virtual Exhume::Weight::~Weight ( ) [inline, virtual]

Definition at line 19 of file Weight.h.

{};

Member Function Documentation

void Exhume::Weight::AddPoint ( const double &  ,
const double &   
) [protected]
double Exhume::Weight::GetFunc ( const double &  xx_) [inline, protected]

Definition at line 36 of file Weight.h.

References FuncMap, Max_, and WeightFunc().

                                            {
      if(xx_ > Max_){
        return(WeightFunc(xx_) );
      }

      std::map<double, double>::iterator high_, low_;
      high_ = FuncMap.upper_bound(xx_);
      low_ = high_;
      low_--;

      return( low_->second + 
              (high_->second - low_->second) * (xx_ - low_->first)/
              (high_->first - low_->first));
    };
std::map<double, double> Exhume::Weight::GetFuncMap ( ) [inline]

Definition at line 20 of file Weight.h.

References FuncMap.

                                              {
      return(FuncMap);
    };
std::map<double, double> Exhume::Weight::GetLineShape ( ) [inline]

Definition at line 27 of file Weight.h.

References LineShape.

                                                {
      return(LineShape);
    };
double Exhume::Weight::GetTotalIntegral ( ) [inline]

Definition at line 23 of file Weight.h.

References TotalIntegral.

                                    {
      return(TotalIntegral);
    };
double Exhume::Weight::GetValue ( const double &  xx_) [inline, protected]

Definition at line 51 of file Weight.h.

References LineShape.

                                             {

      std::map<double, double>::iterator high_, low_;
      high_ = LineShape.upper_bound(xx_);
      
      if(high_==LineShape.end())high_--;

      low_ = high_;
      low_--;

      return( low_->second + 
              (high_->second - low_->second) * (xx_ - low_->first)/
              (high_->first - low_->first));
    };
virtual double Exhume::Weight::WeightFunc ( const double &  ) [protected, pure 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().