#include <CalibrationDataContainer.h>
Public Types | |
enum | CalibrationParametrization { kPt = 0, kEta = 1, kAbsEta = 2, kTagWeight = 3 } |
Public Member Functions | |
CalibrationDataContainer (const char *name="default") | |
std::vector< std::string > | listUncertainties () const |
retrieve the list of "uncertainties" accessible to this object. A few uncertainty names are predetermined: "result", "comment", "statistics", "systematics". Individual sources of systematic uncertainty can be added by the user. | |
CalibrationStatus | getUncertainties (const CalibrationDataVariables &x, std::map< std::string, Analysis::UncertaintyResult > &all) const |
std::string | getComment () const |
retrieve the comments entered for this calibration, if any | |
std::string | getHadronisation () const |
retrieve the 'hadronisation reference' entered for this calibration, if any | |
virtual CalibrationStatus | getResult (const CalibrationDataVariables &x, double &result, TObject *obj=0, bool extrapolate=false) const =0 |
virtual CalibrationStatus | getStatUncertainty (const CalibrationDataVariables &x, double &result) const =0 |
CalibrationStatus | getSystUncertainty (const CalibrationDataVariables &x, UncertaintyResult &result, TObject *obj=0) const |
virtual CalibrationStatus | getUncertainty (const std::string &unc, const CalibrationDataVariables &x, UncertaintyResult &result, TObject *obj=0) const =0 |
void | setResult (TObject *obj) |
insert the main object for this calibration | |
void | setComment (const std::string &text) |
insert the given text as comment for this calibration | |
void | setHadronisation (const std::string &text) |
insert the given text as the 'hadronisation reference' for this calibration | |
void | setUncertainty (const std::string &unc, TObject *obj) |
insert the relevant object for the requested source of 'uncertainty' | |
void | restrictToRange (bool restrict) |
bool | isRangeRestricted () const |
allow the user to inspect the above information | |
double | getLowerBound (unsigned int vartype, bool extrapolate=false) const |
double | getUpperBound (unsigned int vartype, bool extrapolate=false) const |
std::vector< std::pair< double, double > > | getBounds () const |
allow the user to inspect the bounds of validity | |
std::vector< unsigned int > | getVariableTypes () const |
Static Public Member Functions | |
static bool | isNearlyEqual (double a, double b) |
Protected Member Functions | |
int | typeFromString (const std::string &key) const |
CalibrationStatus | computeVariables (const CalibrationDataVariables &x, bool extrapolate=false) const |
virtual void | computeVariableTypes () const =0 |
decode the 'uncertainty' objects' names to determine the relevant variable types | |
Protected Attributes | |
std::vector< double > | m_lowerBounds |
std::vector< double > | m_upperBounds |
std::vector< double > | m_lowerBoundsExtrapolated |
std::vector< double > | m_upperBoundsExtrapolated |
(possibly looser) lower validity bounds for extrapolation | |
TObject * | m_objResult |
(possibly looser) upper validity bounds for extrapolation | |
TObject * | m_objSystematics |
don't persistify | |
double | m_vars [MaxCalibrationVars] |
don't persistify | |
std::vector< unsigned int > | m_variables |
don't persistify |
This is the interface for the objects to be stored in the calibration ROOT file. The base class inherits from a TMap, the idea bing that the map's keys are TObjString objects while the values are the objects of interest. The keys are meant to provide access in a flexible manner.
The following enums are intended to contain the list of (kinematic or other) variables in terms of which results (and the corresponding uncertainties) are given. They are useful mainly for internal purposes, but the user may access them nevertheless.
CalibrationStatus CalibrationDataContainer::computeVariables | ( | const CalibrationDataVariables & | x, | |
bool | extrapolate = false | |||
) | const [protected] |
compute the variables to be used for the given 'uncertainty'
x | user-supplied (kinematic or other) variables | |
unc | given source of uncertainty (can also be the central value) |
x | user-supplied (kinematic or other) variables | |
extrapolate | set to "true" for the evaluation of extrapolation uncertainties |
double CalibrationDataContainer::getLowerBound | ( | unsigned int | vartype, | |
bool | extrapolate = false | |||
) | const |
retrieve the lower bound of validity for the requested variable type
vartype | variable type | |
extrapolate | true only if an extrapolation uncertainty is requested |
virtual CalibrationStatus Analysis::CalibrationDataContainer::getResult | ( | const CalibrationDataVariables & | x, | |
double & | result, | |||
TObject * | obj = 0 , |
|||
bool | extrapolate = false | |||
) | const [pure virtual] |
retrieve the calibration result.
x | user-supplied (kinematic or other) variables | |
result | requested result | |
obj | object holding the requested result (it will be computed if not provided) | |
extrapolate | flag that extrapolation applies (should only be relevant when using eigenvector variations) |
Implemented in Analysis::CalibrationDataHistogramContainer, Analysis::CalibrationDataMappedHistogramContainer, and Analysis::CalibrationDataFunctionContainer.
virtual CalibrationStatus Analysis::CalibrationDataContainer::getStatUncertainty | ( | const CalibrationDataVariables & | x, | |
double & | result | |||
) | const [pure virtual] |
retrieve the calibration statistical uncertainty.
x | user-supplied (kinematic or other) variables | |
result | requested statistical uncertainty |
Implemented in Analysis::CalibrationDataHistogramContainer, Analysis::CalibrationDataMappedHistogramContainer, and Analysis::CalibrationDataFunctionContainer.
CalibrationStatus CalibrationDataContainer::getSystUncertainty | ( | const CalibrationDataVariables & | x, | |
UncertaintyResult & | result, | |||
TObject * | obj = 0 | |||
) | const |
retrieve the calibration total systematic uncertainty
CalibrationStatus Analysis::CalibrationDataContainer::getUncertainties | ( | const CalibrationDataVariables & | x, | |
std::map< std::string, Analysis::UncertaintyResult > & | all | |||
) | const |
retrieve the list of "uncertainties" accessible to this object. A few uncertainty names are predetermined: "result", "comment", "statistics", "systematics". Individual sources of systematic uncertainty can be added by the user.
virtual CalibrationStatus Analysis::CalibrationDataContainer::getUncertainty | ( | const std::string & | unc, | |
const CalibrationDataVariables & | x, | |||
UncertaintyResult & | result, | |||
TObject * | obj = 0 | |||
) | const [pure virtual] |
retrieve the calibration uncertainty due to the given source.
x | user-supplied (kinematic or other) variables | |
unc | uncertainty specification | |
result | requested uncertainty (for both positive and negative variation, if available) | |
obj | object holding the requested uncertainty information (it will be computed if not provided) |
Implemented in Analysis::CalibrationDataHistogramContainer, Analysis::CalibrationDataMappedHistogramContainer, and Analysis::CalibrationDataFunctionContainer.
double CalibrationDataContainer::getUpperBound | ( | unsigned int | vartype, | |
bool | extrapolate = false | |||
) | const |
retrieve the upper bound of validity for the requested variable type
vartype | variable type | |
extrapolate | true only if an extrapolation uncertainty is requested |
std::vector< unsigned int > CalibrationDataContainer::getVariableTypes | ( | ) | const |
utility to retrieve variable types
bool CalibrationDataContainer::isNearlyEqual | ( | double | a, | |
double | b | |||
) | [static] |
utility for comparison of doubles
void Analysis::CalibrationDataContainer::restrictToRange | ( | bool | restrict | ) | [inline] |
If true, this will restrict the variables used to be within the (specified) range of validity. Note that this is a policy decision and as such not intrinsic to the data; but it is cumbersome to carry this information around everywhere.
int CalibrationDataContainer::typeFromString | ( | const std::string & | key | ) | const [protected] |
Connection between variable names (on histogram axes etc.) and variable 'types' as used in actual evaluations. Normal result values are positive (or 0); a negative return value indicates that the string is not known)
TObject* Analysis::CalibrationDataContainer::m_objResult [mutable, protected] |
(possibly looser) upper validity bounds for extrapolation
cached variables for code speed-up
std::vector<unsigned int> Analysis::CalibrationDataContainer::m_variables [mutable, protected] |
don't persistify
specification of variable type per object (result / uncertainty)