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
GSUtilities Class Reference

#include <GSUtilities.h>

Public Member Functions

double cdf (const double &) const
 value of integral(pdf) More...
 
double combinedMean () const
 mean value of combined state More...
 
double dpdf1 (const double &) const
 first derivative of pdf More...
 
double dpdf2 (const double &) const
 second derivative of pdf More...
 
double errorCombinedMean () const
 
float errorHighestWeight () const
 
float errorMode ()
 
float getMax (float)
 
float getMin (float)
 
 GSUtilities (const unsigned nComp, const float *weights, const float *parameters, const float *errors)
 constructor from arrays of weights, parameters and standard deviations More...
 
float maxWeight () const
 
float mode () const
 mode More...
 
double pdf (const double &) const
 value of the pdf More...
 
float quantile (const float) const
 
 ~GSUtilities ()
 

Private Member Functions

double findMode (const double) const
 
double gauss (const double &, const double &, const double &) const
 value of gaussian distribution More...
 
double gaussInt (const double &, const double &, const double &) const
 integrated value of gaussian distribution More...
 

Private Attributes

float * theErrors
 
unsigned theNComp
 
float * theParameters
 
float * theWeights
 

Detailed Description

Some utilities for analysing 1D Gaussian mixtures. Copied from ORCA's EgammaGSUtilities.

Definition at line 8 of file GSUtilities.h.

Constructor & Destructor Documentation

GSUtilities::GSUtilities ( const unsigned  nComp,
const float *  weights,
const float *  parameters,
const float *  errors 
)
inline

constructor from arrays of weights, parameters and standard deviations

Definition at line 11 of file GSUtilities.h.

References i, theErrors, theNComp, theParameters, and theWeights.

12  :
13  theNComp(nComp),
14  theWeights(0),
15  theParameters(0),
16  theErrors(0)
17  {
18  if ( theNComp ) {
19  theWeights = new float[theNComp];
20  theParameters = new float[theNComp];
21  theErrors = new float[theNComp];
22  }
23  const float* wPtr1(weights);
24  const float* pPtr1(parameters);
25  const float* ePtr1(errors);
26  float* wPtr2(theWeights);
27  float* pPtr2(theParameters);
28  float* ePtr2(theErrors);
29  for ( unsigned i=0; i<theNComp; i++ ) {
30  *(wPtr2++) = weights ? *(wPtr1++) : 1.;
31  *(pPtr2++) = *(pPtr1++);
32  *(ePtr2++) = *(ePtr1++);
33  }
34  }
int i
Definition: DBlmapReader.cc:9
unsigned theNComp
Definition: GSUtilities.h:80
float * theErrors
Definition: GSUtilities.h:83
float * theWeights
Definition: GSUtilities.h:81
float * theParameters
Definition: GSUtilities.h:82
GSUtilities::~GSUtilities ( )
inline

Definition at line 35 of file GSUtilities.h.

References theErrors, theParameters, and theWeights.

36  {
37  delete [] theWeights;
38  delete [] theParameters;
39  delete [] theErrors;
40  }
float * theErrors
Definition: GSUtilities.h:83
float * theWeights
Definition: GSUtilities.h:81
float * theParameters
Definition: GSUtilities.h:82

Member Function Documentation

double GSUtilities::cdf ( const double &  x) const

value of integral(pdf)

Definition at line 157 of file GSUtilities.cc.

double GSUtilities::combinedMean ( ) const

mean value of combined state

Definition at line 210 of file GSUtilities.cc.

double GSUtilities::dpdf1 ( const double &  x) const

first derivative of pdf

Definition at line 166 of file GSUtilities.cc.

double GSUtilities::dpdf2 ( const double &  x) const

second derivative of pdf

Definition at line 178 of file GSUtilities.cc.

double GSUtilities::errorCombinedMean ( ) const

Definition at line 222 of file GSUtilities.cc.

float GSUtilities::errorHighestWeight ( ) const

Definition at line 73 of file GSUtilities.cc.

float GSUtilities::errorMode ( )

Definition at line 249 of file GSUtilities.cc.

double GSUtilities::findMode ( const double  xStart) const
private

mean value of combined state double combinedMean() const; mode from starting value

Definition at line 122 of file GSUtilities.cc.

double GSUtilities::gauss ( const double &  x,
const double &  mean,
const double &  sigma 
) const
private

value of gaussian distribution

Definition at line 190 of file GSUtilities.cc.

double GSUtilities::gaussInt ( const double &  x,
const double &  mean,
const double &  sigma 
) const
private

integrated value of gaussian distribution

Definition at line 203 of file GSUtilities.cc.

float GSUtilities::getMax ( float  x)

Definition at line 291 of file GSUtilities.cc.

float GSUtilities::getMin ( float  x)

Definition at line 278 of file GSUtilities.cc.

float GSUtilities::maxWeight ( ) const

Definition at line 232 of file GSUtilities.cc.

float GSUtilities::mode ( void  ) const

mode

Definition at line 88 of file GSUtilities.cc.

double GSUtilities::pdf ( const double &  x) const

value of the pdf

Definition at line 148 of file GSUtilities.cc.

float GSUtilities::quantile ( const float  q) const

normalised integral from -inf to x (taking into account under- & overflows)

Definition at line 12 of file GSUtilities.cc.

Member Data Documentation

float* GSUtilities::theErrors
private

Definition at line 83 of file GSUtilities.h.

Referenced by GSUtilities(), and ~GSUtilities().

unsigned GSUtilities::theNComp
private

Definition at line 80 of file GSUtilities.h.

Referenced by GSUtilities().

float* GSUtilities::theParameters
private

Definition at line 82 of file GSUtilities.h.

Referenced by GSUtilities(), and ~GSUtilities().

float* GSUtilities::theWeights
private

Definition at line 81 of file GSUtilities.h.

Referenced by GSUtilities(), and ~GSUtilities().