CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
MaximalValue Class Reference

#include <CompMethods.h>

Public Member Functions

 MaximalValue (double val, double err)
 
double spread (TH1F &hist)
 
double spreadError (TH1F &hist)
 
double value (TH1F &hist)
 
double valueError (TH1F &hist)
 
 ~MaximalValue ()
 

Private Member Functions

std::pair< int, int > contour (TH1F &, double &)
 
double spread (TH1F &hist, double frac)
 

Private Attributes

double err_
 
double val_
 

Detailed Description

Definition at line 14 of file CompMethods.h.

Constructor & Destructor Documentation

MaximalValue::MaximalValue ( double  val,
double  err 
)
inline

Definition at line 18 of file CompMethods.h.

18 :val_(val), err_(err){};
double val_
Definition: CompMethods.h:28
double err_
Definition: CompMethods.h:33
MaximalValue::~MaximalValue ( )
inline

Definition at line 19 of file CompMethods.h.

19 {};

Member Function Documentation

std::pair< int, int > MaximalValue::contour ( TH1F &  hist,
double &  frac 
)
private

Definition at line 79 of file CompMethods.cc.

References cropTnPTrees::frac.

80 {
81  int idx=hist.GetMaximumBin(), jdx=hist.GetMaximumBin();
82  if(0<=frac && frac<=1){
83  while( hist.GetBinContent(idx)/hist.GetMaximum()>frac) --idx;
84  while( hist.GetBinContent(jdx)/hist.GetMaximum()>frac) ++jdx;
85  }
86  return std::pair<int, int>(idx, jdx);
87 }
double MaximalValue::spread ( TH1F &  hist)
inline

Definition at line 22 of file CompMethods.h.

References spread().

Referenced by FitHist::fillTargetHistogramBin(), spread(), spreadError(), and valueError().

22 { return spread(hist, 0.5); };
double spread(TH1F &hist)
Definition: CompMethods.h:22
double MaximalValue::spread ( TH1F &  hist,
double  frac 
)
inlineprivate

Definition at line 28 of file CompMethods.h.

28 { return std::fabs(hist.GetBinCenter(contour(hist, frac).second)-hist.GetBinCenter(contour(hist, frac).first)); };
std::pair< int, int > contour(TH1F &, double &)
Definition: CompMethods.cc:79
U second(std::pair< T, U > const &p)
bool first
Definition: L1TdeRCT.cc:79
double MaximalValue::spreadError ( TH1F &  hist)
inline

Definition at line 23 of file CompMethods.h.

References err_, and spread().

Referenced by FitHist::fillTargetHistogramBin().

23 { return std::fabs(spread(hist, 0.5-err_)-spread(hist, 0.5+err_))/2; };
double spread(TH1F &hist)
Definition: CompMethods.h:22
double err_
Definition: CompMethods.h:33
double MaximalValue::value ( TH1F &  hist)
inline

Definition at line 20 of file CompMethods.h.

Referenced by FitHist::fillTargetHistogramBin().

20 { return hist.GetBinCenter(hist.GetMaximumBin()); };
double MaximalValue::valueError ( TH1F &  hist)
inline

Definition at line 21 of file CompMethods.h.

References spread(), and val_.

Referenced by FitHist::fillTargetHistogramBin().

21 { return spread(hist, val_); };
double spread(TH1F &hist)
Definition: CompMethods.h:22
double val_
Definition: CompMethods.h:28

Member Data Documentation

double MaximalValue::err_
private

Definition at line 33 of file CompMethods.h.

Referenced by spreadError().

double MaximalValue::val_
private

Definition at line 28 of file CompMethods.h.

Referenced by valueError().