![]() |
ATLAS Offline Software
|
#include <BaseFakeBkgTool.h>
Classes | |
| struct | UncertaintyList |
| List of systematic variations (UID + sigma) to be considered This is implemented as a basic linked list, since unless in very rare cases it should only contain a single entry. More... | |
Public Member Functions | |
| BaseFakeBkgTool (const std::string &toolname) | |
| virtual | ~BaseFakeBkgTool () |
| virtual StatusCode | initialize () override |
| Dummy implementation of the initialisation function. | |
| virtual StatusCode | addEvent (const xAOD::IParticleContainer &particles, float extraWeight=1.f) override final |
| supply list of leptons / global variables, internal counters incremented Does not return anything; event weight(s) must be retrieved by subsequent call(s) to getEventWeight() (for tools inheriting from ILinearFakeBkgTool) | |
| virtual StatusCode | addEvent (const ConstDataVector< xAOD::IParticleContainer > &particles, float extraWeight=1.f) override final |
| supply list of leptons / global variables, internal counters incremented Does not return anything; event weight(s) must be retrieved by subsequent call(s) to getEventWeight() (for tools inheriting from ILinearFakeBkgTool) | |
| virtual StatusCode | register1DHistogram (TH1 *h1, const float *val) override |
| associates a 1D histogram to the tool, to obtain a binned estimate of the fake lepton background the 'val' argument points to a variable corresponding to the X axis of the histogram and that needs to be updated before each call to addEvent() undefined behaviour if the pointers are invalidated during the tool's lifetime | |
| virtual StatusCode | register2DHistogram (TH2 *h2, const float *xval, const float *yval) override |
| associates a 2D histogram to the tool, to obtain a binned estimate of the fake lepton background the 'xval' / 'yval' arguments point to variables corresponding to the X/Y axis of the histogram and that need to be updated before each call to addEvent() undefined behaviour if the pointers are invalidated during the tool's lifetime | |
| virtual StatusCode | register3DHistogram (TH3 *h3, const float *xval, const float *yval, const float *zval) override |
| associates a 3D histogram to the tool, to obtain a binned estimate of the fake lepton background the 'xval' / 'yval' / 'zval' arguments point to variables corresponding to the X/Y/Z axis of the histogram and that need to be updated before each call to addEvent() undefined behaviour if the pointers are invalidated during the tool's lifetime | |
| virtual bool | isAffectedBySystematic (const CP::SystematicVariation &systematic) const override |
| Declare the interface that this class provides. | |
| virtual CP::SystematicSet | affectingSystematics () const override |
| the list of all systematics this tool can be affected by | |
| virtual CP::SystematicSet | recommendedSystematics () const override |
| the list of all systematics this tool recommends to use | |
| virtual StatusCode | applySystematicVariation (const CP::SystematicSet &systConfig) override |
| effects: configure this tool for the given list of systematic variations. | |
| virtual CP::SystematicSet | affectingSystematicsFor (const std::string &nuisanceParameter) const override |
| These functions are slow, don't use them in the tools implementations. | |
| virtual std::string | getUncertaintyDescription (const CP::SystematicVariation &systematic) const override final |
| returns a human-readable description of the source of systematic uncertainty specified as argument | |
| virtual void | printUncertaintyDescription (const CP::SystematicVariation &systematic) const override final |
| prints a human-readable description of the source of systematic uncertainty specified as argument | |
| virtual bool | isSystematicUncertainty (const CP::SystematicVariation &systematic) const override final |
| checks whether the specified source of uncertainty originates from a systematic uncertainty in the efficiencies (as opposed to statistical) | |
| virtual bool | isStatisticalUncertainty (const CP::SystematicVariation &systematic) const override final |
| checks whether the specified source of uncertainty originates from a statistical uncertainty in the efficiencies (as opposed to systematic) | |
| virtual bool | affectsElectrons (const CP::SystematicVariation &systematic) const override final |
| checks whether the specified source of uncertainty affects electrons | |
| virtual bool | affectsMuons (const CP::SystematicVariation &systematic) const override final |
| checks whether the specified source of uncertainty affects muons | |
| virtual bool | affectsTaus (const CP::SystematicVariation &systematic) const override final |
| checks whether the specified source of uncertainty affects taus | |
| virtual bool | affectsRealEfficiencies (const CP::SystematicVariation &systematic) const override final |
| checks whether the specified source of uncertainty affects real efficiencies | |
| virtual bool | affectsFakeEfficiencies (const CP::SystematicVariation &systematic) const override final |
| checks whether the specified source of uncertainty affects fake efficiencies | |
| virtual bool | affectsFakeFactors (const CP::SystematicVariation &systematic) const override final |
| checks whether the specified source of uncertainty affects fake factors | |
| virtual const IFakeBkgSystDescriptor & | getSystDescriptor () const override |
| retrieves an interface to various helper methods to identify what the different SystematicVariations correspond to | |
Protected Member Functions | |
| virtual FakeBkgTools::Client | clientForDB ()=0 |
| This indicates which type of efficiencies/fake factor need to be filled. | |
| virtual StatusCode | addEventCustom ()=0 |
| FakeBkgTools::FinalState | getCachedFinalState (uint8_t nparticles, const std::string &strPID, const std::string &strProc, bool &success) |
| std::string | getListOfEfficienciesAffectedBy (uint16_t uid) const |
| StatusCode | CheckHistogramCompatibility (const TH1 *lhs, const TH1 *rhs) |
Protected Attributes | |
| bool | m_initialized = false |
| bool | m_needEventInfo = true |
| bool | m_convertWhenMissing = false |
| std::vector< FakeBkgTools::ParticleData > | m_particles |
| std::unique_ptr< FakeBkgTools::Database > | m_database |
| float | m_externalWeight |
| std::hash< std::string > | m_hasher |
| comes from Event passed to addEvent() | |
| std::set< FakeBkgTools::FinalState > | m_cachedFinalStates |
| std::map< TH1 *, const float * > | m_values_1dhisto_map |
| std::map< TH2 *, std::pair< const float *, const float * > > | m_values_2dhisto_map |
| std::map< TH3 *, std::tuple< const float *, const float *, const float * > > | m_values_3dhisto_map |
| std::string | m_selection = defaultSelection() |
| 'selection' settings used to compute the total yield / fill histograms | |
| std::string | m_process = defaultProcess() |
| 'process' settings used to compute the total yield / fill histograms | |
| std::string | m_energyUnit |
| property EnergyUnit user can choose between MeV or GeV to indicate the unit of the pT parametrization of efficiencies in the input files | |
| bool | m_useDB = true |
| std::vector< std::string > | m_inputFiles |
| property InputFiles | |
| std::string | m_tightDecoNameAndType |
| property TightDecoration | |
| CP::ISelectionReadAccessor * | m_tightAccessor = nullptr |
| this can't be a unique_ptr as this can cause issues with the dictionary in some particular circumstances | |
| std::string | m_progressFileName |
| property ProgressFileName | |
| std::string | m_progressFileDirectory |
| property ProgressFileDirectory | |
| UncertaintyList * | m_selectedUncertainties = nullptr |
| Pointer to a value of the 'm_systSetDict' map it must be invalidated each time the map is updated in principle only applySystematicVariation() needs to do that. | |
| std::unordered_map< CP::SystematicSet, UncertaintyList > | m_systSetDict |
| List of uncertainties in internal format, associated with a particular SystematicSet the m_selectedUncertainties pointer must be invalidated each time this map is updated in principle only applySystematicVariation() needs to do that. | |
| bool | m_unlimitedSystematicVariations = true |
| used to prevent multiple calls to applySystematicVariation() when unsupported set to true in a particular tool's constructor to disable the possibility of calling applySystematicVariation() more than once / after the first call to addEvent() | |
| bool | m_lockedSystematicVariations = false |
| when m_unlimitedSystematicVariations=false, keeps track of prior calls to applySystematicVariation() / addEvent() | |
| SG::ConstAccessor< float > | m_accRealEff |
| SG::ConstAccessor< float > | m_accFakeEff |
| only used when m_useDB is false | |
Private Member Functions | |
| template<class C> | |
| StatusCode | addEventImpl (const C &iparticles, float mcWeight) |
| only used when m_useDB is false | |
| bool | importEfficiencies (bool resetDB=false) |
| load the config file(s) storing efficiencies | |
| std::pair< uint16_t, float > | identifyCpSystematicVariation (const CP::SystematicVariation &systematic) const |
Friends | |
| struct | FakeBkgTools::Efficiency |
Definition at line 40 of file BaseFakeBkgTool.h.
| BaseFakeBkgTool::BaseFakeBkgTool | ( | const std::string & | toolname | ) |
Definition at line 25 of file BaseFakeBkgTool.cxx.
|
virtual |
Definition at line 70 of file BaseFakeBkgTool.cxx.
|
finaloverridevirtual |
supply list of leptons / global variables, internal counters incremented Does not return anything; event weight(s) must be retrieved by subsequent call(s) to getEventWeight() (for tools inheriting from ILinearFakeBkgTool)
Implements CP::IFakeBkgTool.
Definition at line 243 of file BaseFakeBkgTool.cxx.
|
finaloverridevirtual |
supply list of leptons / global variables, internal counters incremented Does not return anything; event weight(s) must be retrieved by subsequent call(s) to getEventWeight() (for tools inheriting from ILinearFakeBkgTool)
Implements CP::IFakeBkgTool.
Definition at line 238 of file BaseFakeBkgTool.cxx.
|
protectedpure virtual |
|
private |
only used when m_useDB is false
prevent further calls to applySystematicVariation() if not allowed
only retrieved if some of the efficiency parameters are event-level!
for standalone compilation, pp is already a reference and the * operator is redefined to a no-op so that this works
Definition at line 174 of file BaseFakeBkgTool.cxx.
|
overridevirtual |
the list of all systematics this tool can be affected by
Implements CP::IReentrantSystematicsTool.
Definition at line 438 of file BaseFakeBkgTool.cxx.
|
overridevirtual |
These functions are slow, don't use them in the tools implementations.
Implements CP::IFakeBkgSystDescriptor.
Definition at line 618 of file BaseFakeBkgTool.cxx.
|
finaloverridevirtual |
checks whether the specified source of uncertainty affects electrons
Implements CP::IFakeBkgSystDescriptor.
Definition at line 576 of file BaseFakeBkgTool.cxx.
|
finaloverridevirtual |
checks whether the specified source of uncertainty affects fake efficiencies
Implements CP::IFakeBkgSystDescriptor.
Definition at line 604 of file BaseFakeBkgTool.cxx.
|
finaloverridevirtual |
checks whether the specified source of uncertainty affects fake factors
Implements CP::IFakeBkgSystDescriptor.
Definition at line 611 of file BaseFakeBkgTool.cxx.
|
finaloverridevirtual |
checks whether the specified source of uncertainty affects muons
Implements CP::IFakeBkgSystDescriptor.
Definition at line 583 of file BaseFakeBkgTool.cxx.
|
finaloverridevirtual |
checks whether the specified source of uncertainty affects real efficiencies
Implements CP::IFakeBkgSystDescriptor.
Definition at line 597 of file BaseFakeBkgTool.cxx.
|
finaloverridevirtual |
checks whether the specified source of uncertainty affects taus
Implements CP::IFakeBkgSystDescriptor.
Definition at line 590 of file BaseFakeBkgTool.cxx.
|
overridevirtual |
effects: configure this tool for the given list of systematic variations.
any requested systematics that are not affecting this tool will be silently ignored (unless they cause other errors). failures: systematic unknown failures: requesting multiple variations on the same systematic (e.g. up & down) failures: requesting an unsupported variation on an otherwise supported systematic (e.g. a 2 sigma variation and the tool only supports 1 sigma variations) failures: unsupported combination of supported systematic failures: other tool specific errors
prevent further calls to applySystematicVariation() if not allowed
Implements CP::ISystematicsTool.
Definition at line 465 of file BaseFakeBkgTool.cxx.
|
protected |
Definition at line 359 of file BaseFakeBkgTool.cxx.
|
protectedpure virtual |
This indicates which type of efficiencies/fake factor need to be filled.
Definition at line 75 of file BaseFakeBkgTool.cxx.
|
protected |
no longer fill cache if it becomes too large
Definition at line 248 of file BaseFakeBkgTool.cxx.
|
protected |
Definition at line 385 of file BaseFakeBkgTool.cxx.
|
inlineoverridevirtual |
retrieves an interface to various helper methods to identify what the different SystematicVariations correspond to
Implements CP::IFakeBkgTool.
Definition at line 74 of file BaseFakeBkgTool.h.
|
finaloverridevirtual |
returns a human-readable description of the source of systematic uncertainty specified as argument
need to add more info (bin index, etc)
Implements CP::IFakeBkgSystDescriptor.
Definition at line 519 of file BaseFakeBkgTool.cxx.
|
private |
Definition at line 417 of file BaseFakeBkgTool.cxx.
|
private |
load the config file(s) storing efficiencies
XML parsing error
ROOT histograms importing error, or unknown error
Definition at line 127 of file BaseFakeBkgTool.cxx.
|
overridevirtual |
Dummy implementation of the initialisation function.
It's here to allow the dual-use tools to skip defining an initialisation function. Since many are doing so...
Reimplemented from asg::AsgTool.
Definition at line 80 of file BaseFakeBkgTool.cxx.
|
overridevirtual |
Declare the interface that this class provides.
returns: whether this tool is affected by the given systematics
Implements CP::ISystematicsTool.
Definition at line 433 of file BaseFakeBkgTool.cxx.
|
finaloverridevirtual |
checks whether the specified source of uncertainty originates from a statistical uncertainty in the efficiencies (as opposed to systematic)
Implements CP::IFakeBkgSystDescriptor.
Definition at line 569 of file BaseFakeBkgTool.cxx.
|
finaloverridevirtual |
checks whether the specified source of uncertainty originates from a systematic uncertainty in the efficiencies (as opposed to statistical)
Implements CP::IFakeBkgSystDescriptor.
Definition at line 562 of file BaseFakeBkgTool.cxx.
|
finaloverridevirtual |
prints a human-readable description of the source of systematic uncertainty specified as argument
Implements CP::IFakeBkgSystDescriptor.
Definition at line 513 of file BaseFakeBkgTool.cxx.
|
overridevirtual |
the list of all systematics this tool recommends to use
Implements CP::IReentrantSystematicsTool.
Definition at line 460 of file BaseFakeBkgTool.cxx.
|
overridevirtual |
associates a 1D histogram to the tool, to obtain a binned estimate of the fake lepton background the 'val' argument points to a variable corresponding to the X axis of the histogram and that needs to be updated before each call to addEvent() undefined behaviour if the pointers are invalidated during the tool's lifetime
Implements CP::IFakeBkgTool.
Definition at line 269 of file BaseFakeBkgTool.cxx.
|
overridevirtual |
associates a 2D histogram to the tool, to obtain a binned estimate of the fake lepton background the 'xval' / 'yval' arguments point to variables corresponding to the X/Y axis of the histogram and that need to be updated before each call to addEvent() undefined behaviour if the pointers are invalidated during the tool's lifetime
Implements CP::IFakeBkgTool.
Definition at line 299 of file BaseFakeBkgTool.cxx.
|
overridevirtual |
associates a 3D histogram to the tool, to obtain a binned estimate of the fake lepton background the 'xval' / 'yval' / 'zval' arguments point to variables corresponding to the X/Y/Z axis of the histogram and that need to be updated before each call to addEvent() undefined behaviour if the pointers are invalidated during the tool's lifetime
Implements CP::IFakeBkgTool.
Definition at line 329 of file BaseFakeBkgTool.cxx.
|
friend |
Definition at line 187 of file BaseFakeBkgTool.h.
|
protected |
only used when m_useDB is false
Definition at line 177 of file BaseFakeBkgTool.h.
|
protected |
Definition at line 175 of file BaseFakeBkgTool.h.
|
protected |
Definition at line 99 of file BaseFakeBkgTool.h.
|
protected |
Definition at line 80 of file BaseFakeBkgTool.h.
|
protected |
Definition at line 91 of file BaseFakeBkgTool.h.
|
protected |
property EnergyUnit user can choose between MeV or GeV to indicate the unit of the pT parametrization of efficiencies in the input files
Definition at line 122 of file BaseFakeBkgTool.h.
|
protected |
Definition at line 95 of file BaseFakeBkgTool.h.
|
protected |
comes from Event passed to addEvent()
Definition at line 97 of file BaseFakeBkgTool.h.
|
protected |
Definition at line 78 of file BaseFakeBkgTool.h.
|
protected |
property InputFiles
Definition at line 127 of file BaseFakeBkgTool.h.
|
protected |
when m_unlimitedSystematicVariations=false, keeps track of prior calls to applySystematicVariation() / addEvent()
Definition at line 173 of file BaseFakeBkgTool.h.
|
protected |
Definition at line 79 of file BaseFakeBkgTool.h.
|
protected |
Definition at line 85 of file BaseFakeBkgTool.h.
|
protected |
'process' settings used to compute the total yield / fill histograms
Definition at line 118 of file BaseFakeBkgTool.h.
|
protected |
property ProgressFileDirectory
Definition at line 139 of file BaseFakeBkgTool.h.
|
protected |
property ProgressFileName
Definition at line 136 of file BaseFakeBkgTool.h.
|
protected |
Pointer to a value of the 'm_systSetDict' map it must be invalidated each time the map is updated in principle only applySystematicVariation() needs to do that.
Definition at line 161 of file BaseFakeBkgTool.h.
|
protected |
'selection' settings used to compute the total yield / fill histograms
Definition at line 115 of file BaseFakeBkgTool.h.
|
protected |
List of uncertainties in internal format, associated with a particular SystematicSet the m_selectedUncertainties pointer must be invalidated each time this map is updated in principle only applySystematicVariation() needs to do that.
Definition at line 166 of file BaseFakeBkgTool.h.
|
protected |
this can't be a unique_ptr as this can cause issues with the dictionary in some particular circumstances
Definition at line 133 of file BaseFakeBkgTool.h.
|
protected |
property TightDecoration
Definition at line 130 of file BaseFakeBkgTool.h.
|
protected |
used to prevent multiple calls to applySystematicVariation() when unsupported set to true in a particular tool's constructor to disable the possibility of calling applySystematicVariation() more than once / after the first call to addEvent()
Definition at line 170 of file BaseFakeBkgTool.h.
|
protected |
Definition at line 124 of file BaseFakeBkgTool.h.
|
protected |
Definition at line 108 of file BaseFakeBkgTool.h.
|
protected |
Definition at line 109 of file BaseFakeBkgTool.h.
|
protected |
Definition at line 110 of file BaseFakeBkgTool.h.