ATLAS Offline Software
|
Class to correct electron and photon MC variables. More...
#include <ElectronPhotonVariableCorrectionBase.h>
Public Types | |
enum | EGammaObjects { EGammaObjects::Failure = 0, EGammaObjects::unconvertedPhotons = 1, EGammaObjects::convertedPhotons, EGammaObjects::allPhotons, EGammaObjects::allElectrons, EGammaObjects::allEGammaObjects } |
Define the categories of EGamma objects tool can be applied to. More... | |
Public Member Functions | |
ElectronPhotonVariableCorrectionBase (const std::string &myname) | |
Standard constructor. More... | |
~ElectronPhotonVariableCorrectionBase () | |
Standard destructor. More... | |
virtual StatusCode | initialize () override |
Initialize the class instance. More... | |
const CP::CorrectionCode | applyCorrection (xAOD::Photon &photon) const |
Apply the correction given in the conf file to the passed photon. More... | |
const CP::CorrectionCode | applyCorrection (xAOD::Electron &electron) const |
Apply the correction given in the conf file to the passed electron. More... | |
const CP::CorrectionCode | correctedCopy (const xAOD::Photon &in_photon, xAOD::Photon *&out_photon) const |
Make a corrected copy of the passed photon according to the given conf file. More... | |
const CP::CorrectionCode | correctedCopy (const xAOD::Electron &in_electron, xAOD::Electron *&out_electron) const |
Make a corrected copy of the passed electron according to the given conf file. More... | |
const std::string & | getCorrectionVariable () |
Returns the variable which should be corrected according to the passed configuration file. More... | |
ElectronPhotonVariableCorrectionBase::EGammaObjects | isAppliedTo () |
Returns the type of EGamma object to which the correction should be applied. More... | |
bool | applyToConvertedPhotons () const |
Check if the ApplyTo flag passed in the conf file is compatible with converted photons. More... | |
bool | applyToUnconvertedPhotons () const |
Check if the ApplyTo flag passed in the conf file is compatible with uconverted photons. More... | |
bool | applyToElectrons () const |
Check if the ApplyTo flag passed in the conf file is compatible with electrons. More... | |
virtual void | print () const |
Print the state of the tool. More... | |
ServiceHandle< StoreGateSvc > & | evtStore () |
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More... | |
const ServiceHandle< StoreGateSvc > & | evtStore () const |
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More... | |
const ServiceHandle< StoreGateSvc > & | detStore () const |
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More... | |
virtual StatusCode | sysInitialize () override |
Perform system initialization for an algorithm. More... | |
virtual StatusCode | sysStart () override |
Handle START transition. More... | |
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
Return this algorithm's input handles. More... | |
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
Return this algorithm's output handles. More... | |
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
Declare a new Gaudi property. More... | |
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
Declare a new Gaudi property. More... | |
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
Declare a new Gaudi property. More... | |
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
Declare a new Gaudi property. More... | |
void | updateVHKA (Gaudi::Details::PropertyBase &) |
MsgStream & | msg () const |
MsgStream & | msg (const MSG::Level lvl) const |
bool | msgLvl (const MSG::Level lvl) const |
Protected Member Functions | |
void | renounceArray (SG::VarHandleKeyArray &handlesArray) |
remove all handles from I/O resolution More... | |
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > | renounce (T &h) |
void | extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps) |
Add StoreName to extra input/output deps as needed. More... | |
Private Types | |
enum | parameterType { parameterType::Failure = 0, parameterType::EtaDependentTGraph = 1, parameterType::PtDependentTGraph, parameterType::EtaBinned, parameterType::PtBinned, parameterType::EtaTimesPtBinned, parameterType::EtaTimesPhiTH2, parameterType::EventDensity } |
Use enum and not string for type of function parameter in order to do faster comparisons. More... | |
typedef ServiceHandle< StoreGateSvc > | StoreGateSvc_t |
Private Member Functions | |
ElectronPhotonVariableCorrectionBase::parameterType | stringToParameterType (const std::string &input) const |
Convert input string to a parameter function type. More... | |
ElectronPhotonVariableCorrectionBase::EGammaObjects | stringToEGammaObject (const std::string &input) const |
Convert input string to egamma object type. More... | |
bool | passedCorrectPhotonType (const xAOD::Photon &photon) const |
Check if the photon which was passed to the tool has the correct type, if only (un)converted photons were requested to be corrected. More... | |
bool | isEqualToUncorrectedDiscontinuity (const float value) const |
Check if the value passed is equal to one of the values passed via the UncorrectedDiscontinuites flag and should thus not be corrected. More... | |
const StatusCode | getParameterInformationFromConf (TEnv &env, const int parameter_number, const ElectronPhotonVariableCorrectionBase::parameterType type) |
Get the relevant information for a correction function parameter from the given conf file. More... | |
const StatusCode | getEtaPtBinningsFromConf (const bool getEtaBins, const bool getPtBins, const TString &binValues, const TString &interpolate, TEnv &env, const int parameter_number) |
Get the eta and pt binning as well as the respective correction values from the given conf file. More... | |
const StatusCode | getObjectFromRootFile (TEnv &env, const int parameter_number, const TString &filePathKey, const TString &nameKey, std::unique_ptr< TObject > &return_object) |
Get a TObject storing corrections (i.e. More... | |
const StatusCode | getCorrectionParameters (const float pt, const float eta, const float ph, std::vector< float > &properties) const |
Get the actual parameters of the TF1 function used for the current e/y object to be corrected. More... | |
const StatusCode | get1DBinnedParameter (float &return_parameter_value, const float evalPoint, const std::vector< float > &binning, const int parameter_number) const |
Get the correction function parameter value if its type is eta- or pT-binned. More... | |
const StatusCode | get2DBinnedParameter (float &return_parameter_value, const float etaEvalPoint, const float ptEvalPoint, const int parameter_number) const |
Get the correction function parameter value if its type is eta- and pT-binned. More... | |
const StatusCode | get2DHistParameter (float &return_parameter_value, const float etaEvalPoint, const float phiEvalPoint, const int parameter_number) const |
Get the correction function parameter value if its type is eta- and pT-binned. More... | |
bool | getInterpolationFlag (const int parameter_number) const |
Return the interpolation flag of parameter parameter_number as a boolean. More... | |
const StatusCode | interpolate (float &return_parameter_value, const float evalPoint, const int bin, const std::vector< float > &binning, const std::vector< float > &binValues) const |
Given a point x, approximates the value via linear interpolation based on the two nearest bin centers. More... | |
const StatusCode | getBinCenter (float &return_bin_center, const std::vector< float > &binning, const int bin_int) const |
Get the bin center of a bin bin_int using the binning binning. More... | |
const StatusCode | getDensity (float &value, const std::string &eventShapeContainer) const |
Get the events energy density from the eventShape. More... | |
const StatusCode | getKinematicProperties (const xAOD::Egamma &egamma_object, float &pt, float &eta, float &phi) const |
Get the e/y kinematic properties. More... | |
void | correct (float &return_corrected_variable, const float original_variable, const std::vector< float > &properties, unsigned int rndSeed=0) const |
Actual application of the correction to the variable. More... | |
TRandom3 * | getTLSRandomGen (unsigned int seed) const |
Getting thread safe random number generator (and resetting its seed) More... | |
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
specialization for handling Gaudi::Property<SG::VarHandleKey> More... | |
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More... | |
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
specialization for handling Gaudi::Property<SG::VarHandleBase> More... | |
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More... | |
Static Private Member Functions | |
static const StatusCode | findBin (int &return_bin, const float evalPoint, const std::vector< float > &binning) |
Find the bin number in which the evalPoint is located in the binning binning. More... | |
static float | interpolate_function (const float value, const float left_bin_center, const float left_bin_value, const float right_bin_center, const float right_bin_value) |
Returns the linearly intrpolated value of value given the bin centers and bin values. More... | |
Private Attributes | |
std::string | m_configFile |
The name of the configuration file. More... | |
std::string | m_correctionVariable |
The name of the variable to correct. More... | |
bool | m_doGaussianSmearing = false |
Whether to apply normal correction or smearing correction. More... | |
boost::thread_specific_ptr< TRandom3 > | m_TRandom_tls |
thread-safe TRandom3 for setting seed of random smearing correction More... | |
std::vector< float > | m_uncorrectedDiscontinuities |
Values of discontinuities in the variable which should not be corrected. More... | |
std::string | m_correctionFunctionString |
Function to use for the variable correction, TFormula style. More... | |
std::unique_ptr< TFormula > | m_correctionFunctionTFormula |
The actual TFormula correction function. More... | |
int | m_numberOfFunctionParameters {} |
Number of parameters of the variable correction function. More... | |
std::vector< parameterType > | m_ParameterTypeVector |
Map of the correction function parameter number to the parameter type. More... | |
std::vector< TGraph * > | m_graphCopies |
Copy of the TGraph from the root file, stored if needed by the respective correction function parameter. More... | |
std::vector< TH2 * > | m_TH2Copies |
Copy of the TH2 from the root file, stored if needed by the respective correction function parameter. More... | |
std::vector< float > | m_useAbsEtaTH2 |
Store the lowest eta bin boundary: used for checking if the respective TH2 needs the eta or abs(eta) value for evaluation. More... | |
std::vector< std::vector< float > > | m_binValues |
List of eta/pt dependent values, stored if needed by the respective correction function parameter. More... | |
std::vector< float > | m_etaBins |
List of bin boundaries in eta, stored if needed by any correction function parameter. More... | |
bool | m_useAbsEtaBinned {} |
Store if the eta binned parameters need the eta or abs(eta) value for evaluation. More... | |
std::vector< float > | m_ptBins |
List of bin boundaries in pT, stored if needed by any correction function parameter. More... | |
std::vector< bool > | m_interpolatePtFlags |
List of bools whether a parameter should use linear interpolation in pT if it's some kind of pT binned parameter. More... | |
ElectronPhotonVariableCorrectionBase::EGammaObjects | m_applyToObjects {} |
The type of objects to which the specific conf file settings are allowed to be applied to. More... | |
bool | m_retrievedEtaBinning = false |
Store if already retrieved eta binning. More... | |
bool | m_retrievedPtBinning = false |
Store if already retrieved pt binning. More... | |
std::unique_ptr< SG::AuxElement::Accessor< float > > | m_variableToCorrect |
Accessor for the variable to be corrected. More... | |
std::unique_ptr< SG::AuxElement::Accessor< float > > | m_originalVariable |
Accessor to store the original value of the corrected variable. More... | |
StoreGateSvc_t | m_evtStore |
Pointer to StoreGate (event store by default) More... | |
StoreGateSvc_t | m_detStore |
Pointer to StoreGate (detector store by default) More... | |
std::vector< SG::VarHandleKeyArray * > | m_vhka |
bool | m_varHandleArraysDeclared |
Class to correct electron and photon MC variables.
Tool to correct electron and photon MC variables.
For a detailed documentation, please refer to the gitlab readme
Definition at line 41 of file ElectronPhotonVariableCorrectionBase.h.
|
privateinherited |
Definition at line 388 of file AthCommonDataStore.h.
Define the categories of EGamma objects tool can be applied to.
The tool can be applied to electrons and photons, but the latter could also have different corrections according to whether they are converted or unconverted photons. The categories are designed in such a way, that the analyzer can freely choose whether he_she_* wants all objects (i.e. e and y) to be corrected in the same way, or wheter he_she_* wants to apply different corrections to different types of objects.
Enumerator | |
---|---|
Failure | |
unconvertedPhotons | |
convertedPhotons | |
allPhotons | |
allElectrons | |
allEGammaObjects |
Definition at line 102 of file ElectronPhotonVariableCorrectionBase.h.
|
strongprivate |
Use enum and not string for type of function parameter in order to do faster comparisons.
Enumerator | |
---|---|
Failure | |
EtaDependentTGraph | |
PtDependentTGraph | |
EtaBinned | |
PtBinned | |
EtaTimesPtBinned | |
EtaTimesPhiTH2 | |
EventDensity |
Definition at line 131 of file ElectronPhotonVariableCorrectionBase.h.
ElectronPhotonVariableCorrectionBase::ElectronPhotonVariableCorrectionBase | ( | const std::string & | myname | ) |
Standard constructor.
myname | Internal name of the class instance, so they can be distinguished |
Definition at line 37 of file ElectronPhotonVariableCorrectionBase.cxx.
|
inline |
const CP::CorrectionCode ElectronPhotonVariableCorrectionBase::applyCorrection | ( | xAOD::Electron & | electron | ) | const |
Apply the correction given in the conf file to the passed electron.
electron | The electron which should be corrected |
Pass an electron which should be corrected by the tool to this function. The tool gets the original electron variable value, corrects it according to the configuration file given, and overwrites the original value of the variable. The original variable is saved as <variable_name>_original. Note that the variable to be corrected should be an auxiliary variable, and that the electron or electron container, respectively, must not be const if you want to use this function. If you are running on const objects, please make a deep / shallow copy of the container or use the correctedCopy function of this class.
Definition at line 256 of file ElectronPhotonVariableCorrectionBase.cxx.
const CP::CorrectionCode ElectronPhotonVariableCorrectionBase::applyCorrection | ( | xAOD::Photon & | photon | ) | const |
Apply the correction given in the conf file to the passed photon.
photon | The photon which should be corrected |
Pass a photon which should be corrected by the tool to this function. The tool gets the original photon variable value, corrects it according to the configuration file given, and overwrites the original value of the variable. The original variable is saved as <variable_name>_original. Note that the variable to be corrected should be an auxiliary variable, and that the photon or photon container, respectively, must not be const if you want to use this function. If you are running on const objects, please make a deep / shallow copy of the container or use the correctedCopy function of this class.
Definition at line 202 of file ElectronPhotonVariableCorrectionBase.cxx.
bool ElectronPhotonVariableCorrectionBase::applyToConvertedPhotons | ( | ) | const |
Check if the ApplyTo flag passed in the conf file is compatible with converted photons.
Definition at line 1065 of file ElectronPhotonVariableCorrectionBase.cxx.
bool ElectronPhotonVariableCorrectionBase::applyToElectrons | ( | ) | const |
Check if the ApplyTo flag passed in the conf file is compatible with electrons.
Definition at line 1081 of file ElectronPhotonVariableCorrectionBase.cxx.
bool ElectronPhotonVariableCorrectionBase::applyToUnconvertedPhotons | ( | ) | const |
Check if the ApplyTo flag passed in the conf file is compatible with uconverted photons.
Definition at line 1073 of file ElectronPhotonVariableCorrectionBase.cxx.
|
private |
Actual application of the correction to the variable.
return_corrected_variable | The corrected variable value is saved in this parameter |
original_variable | The original value of the corrected variable |
properties | Function parameters for the evaluation. |
rndSeed | A random seed determined from pT, eta and phi, in case a Gaussian smearing is used. |
Definition at line 347 of file ElectronPhotonVariableCorrectionBase.cxx.
const CP::CorrectionCode ElectronPhotonVariableCorrectionBase::correctedCopy | ( | const xAOD::Electron & | in_electron, |
xAOD::Electron *& | out_electron | ||
) | const |
Make a corrected copy of the passed electron according to the given conf file.
in_electron | The original electron of which a corrected copy should be made |
out_electron | Empty new electron where the corrected copy will be stored in |
Makes a corrected copy of the passed electron object according to the correction provided in the configuration file. The in_electron is copied to the out_electron, which is then passed to the applyCorrection function.
Definition at line 393 of file ElectronPhotonVariableCorrectionBase.cxx.
const CP::CorrectionCode ElectronPhotonVariableCorrectionBase::correctedCopy | ( | const xAOD::Photon & | in_photon, |
xAOD::Photon *& | out_photon | ||
) | const |
Make a corrected copy of the passed photon according to the given conf file.
in_photon | The original photon of which a corrected copy should be made |
out_photon | Empty new photon where the corrected copy will be stored in |
Makes a corrected copy of the passed photon object according to the correction provided in the configuration file. The in_photon is copied to the out_photon, which is then passed to the applyCorrection function.
Definition at line 387 of file ElectronPhotonVariableCorrectionBase.cxx.
|
inlineprivateinherited |
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
|
inlineprivateinherited |
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
|
inlineprivateinherited |
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
|
inlineprivateinherited |
specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>
Definition at line 199 of file AthCommonDataStore.h.
|
inlineinherited |
Declare a new Gaudi property.
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
|
inlineinherited |
Declare a new Gaudi property.
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
|
inlineinherited |
Definition at line 259 of file AthCommonDataStore.h.
|
inlineinherited |
Declare a new Gaudi property.
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
|
inlineinherited |
Declare a new Gaudi property.
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
|
inlineinherited |
Definition at line 145 of file AthCommonDataStore.h.
|
inlineinherited |
The standard StoreGateSvc/DetectorStore
Returns (kind of) a pointer to the StoreGateSvc
.
Definition at line 95 of file AthCommonDataStore.h.
|
inlineinherited |
The standard StoreGateSvc
(event store) Returns (kind of) a pointer to the StoreGateSvc
.
Definition at line 85 of file AthCommonDataStore.h.
|
inlineinherited |
The standard StoreGateSvc
(event store) Returns (kind of) a pointer to the StoreGateSvc
.
Definition at line 90 of file AthCommonDataStore.h.
|
protectedinherited |
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
|
staticprivate |
Find the bin number in which the evalPoint is located in the binning binning.
return_bin | The respective bin number is saved in this parameter |
evalPoint | The evaluation point for which the bin number should be found |
binning | The binning which should be evaluated |
Definition at line 845 of file ElectronPhotonVariableCorrectionBase.cxx.
|
private |
Get the correction function parameter value if its type is eta- or pT-binned.
return_parameter_value | The respective correction function parameter value is saved in this parameter |
evalPoint | pT or eta evaluation point - i.e., the eta or pT value of the current e/y object to be corrected. Used to find the correct eta/pT bin to use for the correction |
binning | The eta or pT binning |
parameter_number | The number of the parameter with respect to the correction TF1. Needed in order to retrieve the correct values matching this parameter. |
Definition at line 751 of file ElectronPhotonVariableCorrectionBase.cxx.
|
private |
Get the correction function parameter value if its type is eta- and pT-binned.
return_parameter_value | The respective correction function parameter value is saved in this parameter |
etaEvalPoint | eta evaluation point - i.e., the eta value of the current e/y object to be corrected. Used to find the correct eta bin to use for the correction |
ptEvalPoint | pT evaluation point - i.e., the pT value of the current e/y object to be corrected. Used to find the correct pT bin to use for the correction |
parameter_number | The number of the parameter with respect to the correction TF1. Needed in order to retrieve the correct values matching this parameter. |
Definition at line 773 of file ElectronPhotonVariableCorrectionBase.cxx.
|
private |
Get the correction function parameter value if its type is eta- and pT-binned.
return_parameter_value | The respective correction function parameter value is saved in this parameter |
etaEvalPoint | eta evaluation point - i.e., the eta value of the current e/y object to be corrected. Used to find the correct eta bin to use for the correction |
phiEvalPoint | phi evaluation point - i.e., the phi value of the current e/y object to be corrected. Used to find the correct phi bin to use for the correction |
parameter_number | The number of the parameter with respect to the correction TF1. Needed in order to retrieve the correct values matching this parameter. |
Definition at line 824 of file ElectronPhotonVariableCorrectionBase.cxx.
|
private |
Get the bin center of a bin bin_int using the binning binning.
return_bin_center | The bin center is saved in this parameter |
binning | The binning which should be used to find the bin centers |
bin_int | The bin for which the bin center should be found |
Definition at line 955 of file ElectronPhotonVariableCorrectionBase.cxx.
|
private |
Get the actual parameters of the TF1 function used for the current e/y object to be corrected.
pt | The pT of the current e/y object to be corrected |
eta | The eta of the current e/y object to be corrected |
phi | The phi of the current e/y object to be corrected |
properties | Vector of parameters to use. |
As every electron/photon has different values of pT/eta, the correction function must be adapted accordingly for every e/y. The according values of each of the correction function parameters are updated with this function.
Definition at line 681 of file ElectronPhotonVariableCorrectionBase.cxx.
|
inline |
Returns the variable which should be corrected according to the passed configuration file.
Definition at line 95 of file ElectronPhotonVariableCorrectionBase.h.
|
private |
Get the events energy density from the eventShape.
value | The respective correction function parameter value is saved in this parameter |
eventShapeContainer | The name of the respective event shape container to use |
Definition at line 996 of file ElectronPhotonVariableCorrectionBase.cxx.
|
private |
Get the eta and pt binning as well as the respective correction values from the given conf file.
getEtaBins | if to get the eta binning and bin values |
getPtBins | if to get the pt binning and bin values |
binValues | the conf file key to retrieve the bin values |
interpolate | the conf file key on wheather to interpolate the pt values |
env | The given TEnv,, which is used to read out the current conf file |
parameter_number | The parameter number with respect to the m_correctionFunctionTF1 |
Definition at line 538 of file ElectronPhotonVariableCorrectionBase.cxx.
|
private |
Return the interpolation flag of parameter parameter_number as a boolean.
parameter_number | Number of the parameter for which the interpolation flag should be checked |
Definition at line 881 of file ElectronPhotonVariableCorrectionBase.cxx.
|
inherited |
Get the (hashed) key of an object that is in the event store.
This is a bit of a special one. StoreGateSvc
and xAOD::TEvent
both provide ways for getting the SG::sgkey_t
key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.
In order to allow tools to efficiently perform this operation, they can use this helper function.
ptr | The bare pointer to the object that the event store should know about |
Definition at line 119 of file AsgTool.cxx.
|
private |
Get the e/y kinematic properties.
egamma_object | The e/y object to get the kinematic properties of |
pt | The pT value is saved in this parameter |
eta | The eta value is saved in this parameter |
As every electron/photon has different values of pT/eta, the correction function must be adapted accordingly for every e/y. The according values of eta and pt are updated with this function.
Definition at line 424 of file ElectronPhotonVariableCorrectionBase.cxx.
Get the name of an object that is / should be in the event store.
This is a bit of a special one. StoreGateSvc
and xAOD::TEvent
both provide ways for getting the std::string
name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.
In order to allow tools to efficiently perform this operation, they can use this helper function.
ptr | The bare pointer to the object that the event store should know about |
Definition at line 106 of file AsgTool.cxx.
|
private |
Get a TObject storing corrections (i.e.
TGraph or TH2) from a root file
env | The configuration file to search for the relevant information (file path, object name) |
parameter_number | The number of the respective parameter, used to display error messages correctly |
filePathKey | The key for finding the file path in env |
nameKey | The key for finding the object name in env |
return_object | The retrieved TObject will be saved in this variable |
The TObject with the name matching the key nameKey stored in the file with path matching filePathKey in the configuration file env will be retrieved and saved in return_object.
Definition at line 615 of file ElectronPhotonVariableCorrectionBase.cxx.
|
private |
Get the relevant information for a correction function parameter from the given conf file.
env | The given TEnv, which is used to read out the current conf file |
parameter_number | The parameter number with respect to the m_correctionFunctionTF1 |
type | The type of the respective parameter with this parameter_number |
The relevant information for the parameter with the given parameter number and given parameter type is retrieved from the current configuration file, and saved in the according member variables of the class, i.e. m_graphCopies, m_binValues, m_etaBins, m_ptBins
Definition at line 460 of file ElectronPhotonVariableCorrectionBase.cxx.
Get one of the tool's properties.
|
private |
Getting thread safe random number generator (and resetting its seed)
Definition at line 1089 of file ElectronPhotonVariableCorrectionBase.cxx.
|
overridevirtual |
Initialize the class instance.
Reads out the configuration file set via the setProperty(ConfigFile, "/path/to/conf/file.conf") function and sets up the class instance accordingly
Reimplemented from asg::AsgTool.
Definition at line 47 of file ElectronPhotonVariableCorrectionBase.cxx.
|
overridevirtualinherited |
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
|
private |
Given a point x, approximates the value via linear interpolation based on the two nearest bin centers.
Re-implementation of Double_t TH1::Interpolate( Double_t x) const.
return_parameter_value | The interpolated parameter value is saved in this parameter |
evalPoint | The point for which the interpolation should be done |
bin | The bin in which the evalPoint is located with respect to binning |
binning | The binning based on which the interpolation should be done |
binValues | The bin values according to the binning given in binning |
Definition at line 895 of file ElectronPhotonVariableCorrectionBase.cxx.
|
staticprivate |
Returns the linearly intrpolated value of value given the bin centers and bin values.
value | The x-value at which the interpolation should be done |
left_bin_center | The x-value of the left bin center used for the interpolation |
left_bin_value | The y-value of the left bin at the left bin center |
right_bin_center | The x-value of the right bin center used for the interpolation |
right_bin_value | The y-value of the right bin at the right bin center |
Definition at line 991 of file ElectronPhotonVariableCorrectionBase.cxx.
|
inline |
Returns the type of EGamma object to which the correction should be applied.
Definition at line 112 of file ElectronPhotonVariableCorrectionBase.h.
|
private |
Check if the value passed is equal to one of the values passed via the UncorrectedDiscontinuites flag and should thus not be corrected.
value | The value which should be checked |
Definition at line 403 of file ElectronPhotonVariableCorrectionBase.cxx.
|
inlineinherited |
Definition at line 24 of file AthCommonMsg.h.
|
inlineinherited |
Definition at line 27 of file AthCommonMsg.h.
|
inherited |
A deprecated function for getting the message level's name.
Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:
This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.
Definition at line 101 of file AsgTool.cxx.
|
inlineinherited |
Definition at line 30 of file AthCommonMsg.h.
|
overridevirtualinherited |
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
|
private |
Check if the photon which was passed to the tool has the correct type, if only (un)converted photons were requested to be corrected.
photon | The photon which was passed to the tool to be corrected |
Definition at line 1055 of file ElectronPhotonVariableCorrectionBase.cxx.
|
virtualinherited |
Print the state of the tool.
Implements asg::IAsgTool.
Reimplemented in JetRecTool, JetFinder, JetModifiedMassDrop, JetFromPseudojet, JetReclusterer, JetReclusteringTool, JetTruthLabelingTool, JetPileupLabelingTool, HI::HIPileupTool, JetDumper, JetBottomUpSoftDrop, JetRecursiveSoftDrop, JetSoftDrop, JetConstituentsRetriever, JetSubStructureMomentToolsBase, JetSplitter, JetToolRunner, JetPruner, JetPseudojetRetriever, JetTrimmer, AsgHelloTool, and KtDeltaRTool.
Definition at line 131 of file AsgTool.cxx.
|
inlineprotectedinherited |
Definition at line 380 of file AthCommonDataStore.h.
|
inlineprotectedinherited |
remove all handles from I/O resolution
Definition at line 364 of file AthCommonDataStore.h.
|
private |
Convert input string to egamma object type.
input | The string to convert to ElectronPhotonVariableCorrectionBase::EGammaObjects |
Definition at line 1034 of file ElectronPhotonVariableCorrectionBase.cxx.
|
private |
Convert input string to a parameter function type.
input | The string to convert to ElectronPhotonVariableCorrectionBase::parameterType |
Definition at line 1009 of file ElectronPhotonVariableCorrectionBase.cxx.
|
overridevirtualinherited |
Perform system initialization for an algorithm.
We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.
Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.
|
overridevirtualinherited |
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
|
inlineinherited |
Definition at line 308 of file AthCommonDataStore.h.
|
private |
The type of objects to which the specific conf file settings are allowed to be applied to.
Definition at line 176 of file ElectronPhotonVariableCorrectionBase.h.
|
private |
List of eta/pt dependent values, stored if needed by the respective correction function parameter.
Definition at line 166 of file ElectronPhotonVariableCorrectionBase.h.
|
private |
The name of the configuration file.
Definition at line 142 of file ElectronPhotonVariableCorrectionBase.h.
|
private |
Function to use for the variable correction, TFormula style.
Definition at line 152 of file ElectronPhotonVariableCorrectionBase.h.
|
private |
The actual TFormula correction function.
Definition at line 154 of file ElectronPhotonVariableCorrectionBase.h.
|
private |
The name of the variable to correct.
Definition at line 144 of file ElectronPhotonVariableCorrectionBase.h.
|
privateinherited |
Pointer to StoreGate (detector store by default)
Definition at line 393 of file AthCommonDataStore.h.
|
private |
Whether to apply normal correction or smearing correction.
Definition at line 146 of file ElectronPhotonVariableCorrectionBase.h.
|
private |
List of bin boundaries in eta, stored if needed by any correction function parameter.
Definition at line 168 of file ElectronPhotonVariableCorrectionBase.h.
|
privateinherited |
Pointer to StoreGate (event store by default)
Definition at line 390 of file AthCommonDataStore.h.
|
private |
Copy of the TGraph from the root file, stored if needed by the respective correction function parameter.
Definition at line 160 of file ElectronPhotonVariableCorrectionBase.h.
|
private |
List of bools whether a parameter should use linear interpolation in pT if it's some kind of pT binned parameter.
Definition at line 174 of file ElectronPhotonVariableCorrectionBase.h.
|
private |
Number of parameters of the variable correction function.
Definition at line 156 of file ElectronPhotonVariableCorrectionBase.h.
|
private |
Accessor to store the original value of the corrected variable.
Definition at line 184 of file ElectronPhotonVariableCorrectionBase.h.
|
private |
Map of the correction function parameter number to the parameter type.
Definition at line 158 of file ElectronPhotonVariableCorrectionBase.h.
|
private |
List of bin boundaries in pT, stored if needed by any correction function parameter.
Definition at line 172 of file ElectronPhotonVariableCorrectionBase.h.
|
private |
Store if already retrieved eta binning.
Definition at line 178 of file ElectronPhotonVariableCorrectionBase.h.
|
private |
Store if already retrieved pt binning.
Definition at line 180 of file ElectronPhotonVariableCorrectionBase.h.
|
private |
Copy of the TH2 from the root file, stored if needed by the respective correction function parameter.
Definition at line 162 of file ElectronPhotonVariableCorrectionBase.h.
|
mutableprivate |
thread-safe TRandom3 for setting seed of random smearing correction
Definition at line 148 of file ElectronPhotonVariableCorrectionBase.h.
|
private |
Values of discontinuities in the variable which should not be corrected.
Definition at line 150 of file ElectronPhotonVariableCorrectionBase.h.
|
private |
Store if the eta binned parameters need the eta or abs(eta) value for evaluation.
Definition at line 170 of file ElectronPhotonVariableCorrectionBase.h.
|
private |
Store the lowest eta bin boundary: used for checking if the respective TH2 needs the eta or abs(eta) value for evaluation.
Definition at line 164 of file ElectronPhotonVariableCorrectionBase.h.
|
privateinherited |
Definition at line 399 of file AthCommonDataStore.h.
|
private |
Accessor for the variable to be corrected.
Definition at line 182 of file ElectronPhotonVariableCorrectionBase.h.
|
privateinherited |
Definition at line 398 of file AthCommonDataStore.h.