GammaCombo  Rev:Unversioneddirectory
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
PDF_Abs Class Reference

#include <PDF_Abs.h>

Inheritance diagram for PDF_Abs:
Inheritance graph
[legend]

Public Member Functions

bool bkgpdfset ()
 
virtual void build ()
 Shortcut for buildCov() and buildPdf(). More...
 
void buildCov ()
 Build both the covariance and the correlation matrix (members covMatrix and corMatrix) from the stat and syst correlation matrics and the respective errors. More...
 
virtual void buildPdf ()
 
virtual bool checkConsistency ()
 Perform a couple of consistency checks to make it easier to find bugs: More...
 
void deleteToys ()
 
TString getBaseName ()
 Return the base name, which is the name without any unique ID. More...
 
RooAbsPdf * getBkgPdf ()
 
TString getCorrelationSourceString ()
 
TString getErrorSourceString ()
 
int getGcId ()
 
vector< TString > getLatexObservables ()
 
TString getName ()
 
int getNobs ()
 
RooArgList * getObservables ()
 
TString getObservableSourceString ()
 
float getObservableValue (TString obsname)
 Return the numerical value of an observable of a given name. More...
 
RooArgList * getParameters ()
 
RooAbsPdf * getPdf ()
 
void getSubCorrelationStat (TMatrixDSym &target, vector< int > &indices)
 Return a submatrix of the statistical correlation matrix, defined by the rows and columns provided. More...
 
void getSubCorrelationSyst (TMatrixDSym &target, vector< int > &indices)
 Return a submatrix of the systematic correlation matrix, defined by the rows and columns provided. More...
 
RooArgList * getTheory ()
 
TString getTitle ()
 
unsigned long long getUniqueGlobalID ()
 
TString getUniqueID ()
 
bool hasObservable (TString obsname)
 Check if this PDF has an observable of the given name. More...
 
virtual void initObservables ()
 
virtual void initParameters ()
 
virtual void initRelations ()
 
bool isCrossCorPdf ()
 
void loadExtParameters (RooFitResult *r)
 Set all parameters to values found in a provided fit result. More...
 
 PDF_Abs (int nObs)
 Gamma Combination Author: Till Moritz Karbach, morit.nosp@m.z.ka.nosp@m.rbach.nosp@m.@cer.nosp@m.n.ch Date: August 2012. More...
 
 PDF_Abs (int nObs, ParametersAbs &pars)
 
void print () const
 Print this PDF in a verbose way: More...
 
void printObservables ()
 
void printParameters ()
 
void resetCorrelations ()
 Set all correlations to zero. More...
 
bool ScaleError (TString obsname, float scale)
 Scale the error of a given observable. More...
 
virtual void setCorrelations (TString c)
 
void setErrorSourceString (TString source)
 
void setGcId (int id)
 
void setName (TString myName)
 
void setNObs (int val)
 
void setObservable (TString name, float value)
 Set the observed central value of an observable. More...
 
virtual void setObservables (TString c)
 
void setObservableSourceString (TString source)
 
void setObservablesToy ()
 Set all observables to 'toy' values drawn from the PDF using the current parameter values. More...
 
void setObservablesTruth ()
 Set all observables to 'truth' values computed from the current parameters. More...
 
void setSystCorrelation (TMatrixDSym &corSystMatrix)
 Set an external systematic correlation matrix. More...
 
void setTitle (TString t)
 
virtual void setUncertainties (TString c)
 
void setUncertainty (TString obsName, float stat, float syst)
 Set the uncertainties of an observable. More...
 
void storeErrorsInObs ()
 Store the errors as RooFit error into the observables to have them easily available for the pull computation. More...
 
virtual bool test ()
 Test PDF implementation. More...
 
void uniquify (int uID)
 used to uniquify all names when added More...
 
virtual ~PDF_Abs ()
 Clean off all objects in the trash bin. More...
 

Public Attributes

TMatrixDSym corMatrix
 
TString corSource
 
TMatrixDSym corStatMatrix
 
TMatrixDSym corSystMatrix
 
TMatrixDSym covMatrix
 
TString obsErrSource
 
TString obsValSource
 
vector< double > StatErr
 
vector< double > SystErr
 

Protected Member Functions

void addToTrash (TObject *)
 Add an object to the trash bin which gets emptied when this PDF object gets deleted. More...
 
void getSubMatrix (TMatrixDSym &target, TMatrixDSym &source, vector< int > &indices)
 Return a submatrix of a given input matrix, defined by the rows and columns provided. More...
 

Protected Attributes

int gcId
 
bool isBkgPdfSet
 
int iToyObs
 
vector< TString > latexObservables
 
bool m_isCrossCorPdf
 
TString name
 
int nObs
 
int nToyObs
 
RooArgList * observables
 
RooArgList * parameters
 
RooAbsPdf * pdf
 
RooAbsPdf * pdfBkg
 
RooArgList * theory
 
TString title
 
RooDataSet * toyBkgObservables
 
RooDataSet * toyObservables
 
map< string, TObject * > trash
 

Private Member Functions

void printCorMatrix (TString title, TString source, const TMatrixDSym &cor) const
 Helper function for print(): it prints correlation matrices, stat, syst, stat+syst. More...
 
TString uniquifyThisString (TString s, int uID)
 Helper function for uniquify(). More...
 

Private Attributes

unsigned long long uniqueGlobalID
 
TString uniqueID
 

Static Private Attributes

static unsigned long long counter = 0
 

Detailed Description

Definition at line 52 of file PDF_Abs.h.

Constructor & Destructor Documentation

§ PDF_Abs() [1/2]

PDF_Abs::PDF_Abs ( int  nObs)

Gamma Combination Author: Till Moritz Karbach, morit.nosp@m.z.ka.nosp@m.rbach.nosp@m.@cer.nosp@m.n.ch Date: August 2012.

Definition at line 10 of file PDF_Abs.cpp.

§ PDF_Abs() [2/2]

PDF_Abs::PDF_Abs ( int  nObs,
ParametersAbs pars 
)

§ ~PDF_Abs()

PDF_Abs::~PDF_Abs ( )
virtual

Clean off all objects in the trash bin.

See also addToTrash().

Definition at line 48 of file PDF_Abs.cpp.

Member Function Documentation

§ addToTrash()

void PDF_Abs::addToTrash ( TObject *  o)
protected

Add an object to the trash bin which gets emptied when this PDF object gets deleted.

If an object of the same name is already in the trash, we'll delete that and replace by the new one. This way we can call e.g. buildPdf() more than once.

Definition at line 163 of file PDF_Abs.cpp.

§ bkgpdfset()

bool PDF_Abs::bkgpdfset ( )
inline

Definition at line 61 of file PDF_Abs.h.

§ build()

void PDF_Abs::build ( )
virtual

Shortcut for buildCov() and buildPdf().

Definition at line 97 of file PDF_Abs.cpp.

§ buildCov()

void PDF_Abs::buildCov ( )

Build both the covariance and the correlation matrix (members covMatrix and corMatrix) from the stat and syst correlation matrics and the respective errors.

Definition at line 253 of file PDF_Abs.cpp.

§ buildPdf()

void PDF_Abs::buildPdf ( )
virtual

Reimplemented in PDF_Circle, PDF_Cartesian, PDF_Gaus2d, PDF_DsK, PDF_DsK_gamma, PDF_Gaus, PDF_GausB, and PDF_rb.

Definition at line 89 of file PDF_Abs.cpp.

§ checkConsistency()

bool PDF_Abs::checkConsistency ( )
virtual

Perform a couple of consistency checks to make it easier to find bugs:

  • check if all observables end with '_obs'
  • check if all predicted observables end with '_th'
  • check if the 'observables' and 'theory' lists are correctly ordered

Definition at line 515 of file PDF_Abs.cpp.

§ deleteToys()

void PDF_Abs::deleteToys ( )
inline

Definition at line 63 of file PDF_Abs.h.

§ getBaseName()

TString PDF_Abs::getBaseName ( )

Return the base name, which is the name without any unique ID.

Definition at line 180 of file PDF_Abs.cpp.

§ getBkgPdf()

RooAbsPdf* PDF_Abs::getBkgPdf ( )
inline

Definition at line 78 of file PDF_Abs.h.

§ getCorrelationSourceString()

TString PDF_Abs::getCorrelationSourceString ( )
inline

Definition at line 64 of file PDF_Abs.h.

§ getErrorSourceString()

TString PDF_Abs::getErrorSourceString ( )
inline

Definition at line 66 of file PDF_Abs.h.

§ getGcId()

int PDF_Abs::getGcId ( )
inline

Definition at line 67 of file PDF_Abs.h.

§ getLatexObservables()

vector<TString> PDF_Abs::getLatexObservables ( )
inline

Definition at line 73 of file PDF_Abs.h.

§ getName()

TString PDF_Abs::getName ( )
inline

Definition at line 68 of file PDF_Abs.h.

§ getNobs()

int PDF_Abs::getNobs ( )
inline

Definition at line 69 of file PDF_Abs.h.

§ getObservables()

RooArgList* PDF_Abs::getObservables ( )
inline

Definition at line 72 of file PDF_Abs.h.

§ getObservableSourceString()

TString PDF_Abs::getObservableSourceString ( )
inline

Definition at line 74 of file PDF_Abs.h.

§ getObservableValue()

float PDF_Abs::getObservableValue ( TString  obsname)

Return the numerical value of an observable of a given name.

Parameters
obsname- observable name. If the PDF was uniquified before by calling uniquify(), it has to include the unique ID string.
Returns
- the value

Definition at line 651 of file PDF_Abs.cpp.

§ getParameters()

RooArgList* PDF_Abs::getParameters ( )
inline

Definition at line 76 of file PDF_Abs.h.

§ getPdf()

RooAbsPdf* PDF_Abs::getPdf ( )
inline

Definition at line 77 of file PDF_Abs.h.

§ getSubCorrelationStat()

void PDF_Abs::getSubCorrelationStat ( TMatrixDSym &  target,
vector< int > &  indices 
)

Return a submatrix of the statistical correlation matrix, defined by the rows and columns provided.

Parameters
target- the output matrix
indices- vector of the row/column indices that should make up the submatrix

Definition at line 700 of file PDF_Abs.cpp.

§ getSubCorrelationSyst()

void PDF_Abs::getSubCorrelationSyst ( TMatrixDSym &  target,
vector< int > &  indices 
)

Return a submatrix of the systematic correlation matrix, defined by the rows and columns provided.

Parameters
target- the output matrix
indices- vector of the row/column indices that should make up the submatrix

Definition at line 712 of file PDF_Abs.cpp.

§ getSubMatrix()

void PDF_Abs::getSubMatrix ( TMatrixDSym &  target,
TMatrixDSym &  source,
vector< int > &  indices 
)
protected

Return a submatrix of a given input matrix, defined by the rows and columns provided.

Parameters
source- the input matrix
target- the output matrix
indices- vector of the row/column indices that should make up the submatrix

Definition at line 669 of file PDF_Abs.cpp.

§ getTheory()

RooArgList* PDF_Abs::getTheory ( )
inline

Definition at line 81 of file PDF_Abs.h.

§ getTitle()

TString PDF_Abs::getTitle ( )
inline

Definition at line 82 of file PDF_Abs.h.

§ getUniqueGlobalID()

unsigned long long PDF_Abs::getUniqueGlobalID ( )
inline

Definition at line 71 of file PDF_Abs.h.

§ getUniqueID()

TString PDF_Abs::getUniqueID ( )
inline

Definition at line 70 of file PDF_Abs.h.

§ hasObservable()

bool PDF_Abs::hasObservable ( TString  obsname)

Check if this PDF has an observable of the given name.

Parameters
obsname- observable name
Returns
true if found

Definition at line 595 of file PDF_Abs.cpp.

§ initObservables()

void PDF_Abs::initObservables ( )
virtual

Reimplemented in PDF_Datasets, PDF_Circle, PDF_Cartesian, PDF_Gaus2d, PDF_DsK, PDF_DsK_gamma, PDF_Gaus, PDF_GausB, and PDF_rb.

Definition at line 88 of file PDF_Abs.cpp.

§ initParameters()

void PDF_Abs::initParameters ( )
virtual

Reimplemented in PDF_Datasets, PDF_Circle, PDF_Cartesian, PDF_Gaus2d, PDF_DsK, PDF_DsK_gamma, PDF_Gaus, PDF_GausB, and PDF_rb.

Definition at line 86 of file PDF_Abs.cpp.

§ initRelations()

void PDF_Abs::initRelations ( )
virtual

Reimplemented in PDF_Circle, PDF_Cartesian, PDF_Gaus2d, PDF_DsK, PDF_DsK_gamma, PDF_Gaus, PDF_GausB, and PDF_rb.

Definition at line 87 of file PDF_Abs.cpp.

§ isCrossCorPdf()

bool PDF_Abs::isCrossCorPdf ( )
inline

Definition at line 84 of file PDF_Abs.h.

§ loadExtParameters()

void PDF_Abs::loadExtParameters ( RooFitResult *  r)

Set all parameters to values found in a provided fit result.

Definition at line 238 of file PDF_Abs.cpp.

§ print()

void PDF_Abs::print ( ) const

Print this PDF in a verbose way:

  • observables
  • correlations
  • parameters

Definition at line 338 of file PDF_Abs.cpp.

§ printCorMatrix()

void PDF_Abs::printCorMatrix ( TString  title,
TString  source,
const TMatrixDSym &  cor 
) const
private

Helper function for print(): it prints correlation matrices, stat, syst, stat+syst.

Definition at line 312 of file PDF_Abs.cpp.

§ printObservables()

void PDF_Abs::printObservables ( )

Definition at line 422 of file PDF_Abs.cpp.

§ printParameters()

void PDF_Abs::printParameters ( )

Definition at line 403 of file PDF_Abs.cpp.

§ resetCorrelations()

void PDF_Abs::resetCorrelations ( )

Set all correlations to zero.

Definition at line 144 of file PDF_Abs.cpp.

§ ScaleError()

bool PDF_Abs::ScaleError ( TString  obsname,
float  scale 
)

Scale the error of a given observable.

Both stat and syst errors are being scaled by the same factor. In order to become effective, the PDF needs to be rebuild by calling buildCov() and buildPdf().

Parameters
obsname- observable name. It may or may not include a unique ID string, both works.
scale- the scale factor the current error is being multiplied with
Returns
- true if successful

Definition at line 612 of file PDF_Abs.cpp.

§ setCorrelations()

void PDF_Abs::setCorrelations ( TString  c)
virtual

Reimplemented in PDF_Circle, PDF_Cartesian, PDF_Gaus2d, PDF_Gaus, PDF_GausB, and PDF_rb.

Definition at line 92 of file PDF_Abs.cpp.

§ setErrorSourceString()

void PDF_Abs::setErrorSourceString ( TString  source)
inline

Definition at line 94 of file PDF_Abs.h.

§ setGcId()

void PDF_Abs::setGcId ( int  id)
inline

Definition at line 95 of file PDF_Abs.h.

§ setName()

void PDF_Abs::setName ( TString  myName)
inline

Definition at line 96 of file PDF_Abs.h.

§ setNObs()

void PDF_Abs::setNObs ( int  val)
inline

Definition at line 102 of file PDF_Abs.h.

§ setObservable()

void PDF_Abs::setObservable ( TString  obsName,
float  value 
)

Set the observed central value of an observable.

To be used in setObservables() of the derived PDF classes.

Parameters
obsName- observable name
value- central value

Definition at line 477 of file PDF_Abs.cpp.

§ setObservables()

void PDF_Abs::setObservables ( TString  c)
virtual

Reimplemented in PDF_Circle, PDF_Cartesian, PDF_Gaus2d, PDF_Gaus, PDF_GausB, and PDF_rb.

Definition at line 90 of file PDF_Abs.cpp.

§ setObservableSourceString()

void PDF_Abs::setObservableSourceString ( TString  source)
inline

Definition at line 101 of file PDF_Abs.h.

§ setObservablesToy()

void PDF_Abs::setObservablesToy ( )

Set all observables to 'toy' values drawn from the PDF using the current parameter values.

A certain number of toys is pregenerated to speed up when doing mulitple toy fits.

Definition at line 122 of file PDF_Abs.cpp.

§ setObservablesTruth()

void PDF_Abs::setObservablesTruth ( )

Set all observables to 'truth' values computed from the current parameters.

Definition at line 107 of file PDF_Abs.cpp.

§ setSystCorrelation()

void PDF_Abs::setSystCorrelation ( TMatrixDSym &  corSystMatrix)

Set an external systematic correlation matrix.

After modifying, call buildCov() and buildPdf();

Definition at line 463 of file PDF_Abs.cpp.

§ setTitle()

void PDF_Abs::setTitle ( TString  t)
inline

Definition at line 103 of file PDF_Abs.h.

§ setUncertainties()

void PDF_Abs::setUncertainties ( TString  c)
virtual

Reimplemented in PDF_Circle, PDF_Cartesian, PDF_Gaus2d, PDF_Gaus, PDF_GausB, and PDF_rb.

Definition at line 91 of file PDF_Abs.cpp.

§ setUncertainty()

void PDF_Abs::setUncertainty ( TString  obsName,
float  stat,
float  syst 
)

Set the uncertainties of an observable.

To be used in setUncertainties() of the derived PDF classes. This function fills the StatErr and SystErr arrays in the correct place.

Parameters
obsName- observable name
stat- statistical error
syst- systematic error

Definition at line 494 of file PDF_Abs.cpp.

§ storeErrorsInObs()

void PDF_Abs::storeErrorsInObs ( )

Store the errors as RooFit error into the observables to have them easily available for the pull computation.

Definition at line 444 of file PDF_Abs.cpp.

§ test()

bool PDF_Abs::test ( )
virtual

Test PDF implementation.

Performs a fit to the minimum.

Definition at line 565 of file PDF_Abs.cpp.

§ uniquify()

void PDF_Abs::uniquify ( int  uID)

used to uniquify all names when added

Uniquify all relevant names by adding a unique ID following the pattern "UID2".

This way we can have mulitple instances of the same PDF in the same combination. The pattern is defined in uniquifyThisString().

Parameters
uID- unique ID

Definition at line 195 of file PDF_Abs.cpp.

§ uniquifyThisString()

TString PDF_Abs::uniquifyThisString ( TString  s,
int  uID 
)
private

Helper function for uniquify().

Compute a unique string by attaching "UID3" or similar to it.

Definition at line 226 of file PDF_Abs.cpp.

Member Data Documentation

§ corMatrix

TMatrixDSym PDF_Abs::corMatrix

Definition at line 114 of file PDF_Abs.h.

§ corSource

TString PDF_Abs::corSource

Definition at line 119 of file PDF_Abs.h.

§ corStatMatrix

TMatrixDSym PDF_Abs::corStatMatrix

Definition at line 115 of file PDF_Abs.h.

§ corSystMatrix

TMatrixDSym PDF_Abs::corSystMatrix

Definition at line 116 of file PDF_Abs.h.

§ counter

unsigned long long PDF_Abs::counter = 0
staticprivate

Definition at line 153 of file PDF_Abs.h.

§ covMatrix

TMatrixDSym PDF_Abs::covMatrix

Definition at line 113 of file PDF_Abs.h.

§ gcId

int PDF_Abs::gcId
protected

Definition at line 147 of file PDF_Abs.h.

§ isBkgPdfSet

bool PDF_Abs::isBkgPdfSet
protected

Definition at line 135 of file PDF_Abs.h.

§ iToyObs

int PDF_Abs::iToyObs
protected

Definition at line 146 of file PDF_Abs.h.

§ latexObservables

vector<TString> PDF_Abs::latexObservables
protected

Definition at line 139 of file PDF_Abs.h.

§ m_isCrossCorPdf

bool PDF_Abs::m_isCrossCorPdf
protected

Definition at line 138 of file PDF_Abs.h.

§ name

TString PDF_Abs::name
protected

Definition at line 131 of file PDF_Abs.h.

§ nObs

int PDF_Abs::nObs
protected

Definition at line 136 of file PDF_Abs.h.

§ nToyObs

int PDF_Abs::nToyObs
protected

Definition at line 143 of file PDF_Abs.h.

§ obsErrSource

TString PDF_Abs::obsErrSource

Definition at line 121 of file PDF_Abs.h.

§ observables

RooArgList* PDF_Abs::observables
protected

Definition at line 130 of file PDF_Abs.h.

§ obsValSource

TString PDF_Abs::obsValSource

Definition at line 120 of file PDF_Abs.h.

§ parameters

RooArgList* PDF_Abs::parameters
protected

Definition at line 128 of file PDF_Abs.h.

§ pdf

RooAbsPdf* PDF_Abs::pdf
protected

Definition at line 133 of file PDF_Abs.h.

§ pdfBkg

RooAbsPdf* PDF_Abs::pdfBkg
protected

Definition at line 134 of file PDF_Abs.h.

§ StatErr

vector<double> PDF_Abs::StatErr

Definition at line 117 of file PDF_Abs.h.

§ SystErr

vector<double> PDF_Abs::SystErr

Definition at line 118 of file PDF_Abs.h.

§ theory

RooArgList* PDF_Abs::theory
protected

Definition at line 129 of file PDF_Abs.h.

§ title

TString PDF_Abs::title
protected

Definition at line 132 of file PDF_Abs.h.

§ toyBkgObservables

RooDataSet* PDF_Abs::toyBkgObservables
protected

Definition at line 145 of file PDF_Abs.h.

§ toyObservables

RooDataSet* PDF_Abs::toyObservables
protected

Definition at line 144 of file PDF_Abs.h.

§ trash

map<string,TObject*> PDF_Abs::trash
protected

Definition at line 137 of file PDF_Abs.h.

§ uniqueGlobalID

unsigned long long PDF_Abs::uniqueGlobalID
private

Definition at line 154 of file PDF_Abs.h.

§ uniqueID

TString PDF_Abs::uniqueID
private

Definition at line 152 of file PDF_Abs.h.


The documentation for this class was generated from the following files: