|
ATLAS Offline Software
|
#include <JvtEfficiencyToolBase.h>
|
virtual | ~JvtEfficiencyToolBase () override=default |
|
virtual StatusCode | initialize () override |
| Dummy implementation of the initialisation function. More...
|
|
virtual CorrectionCode | getEfficiencyScaleFactor (const xAOD::Jet &jet, float &sf) const override |
| Calculate the efficiency scale factor for the provided jet. More...
|
|
virtual CorrectionCode | getInefficiencyScaleFactor (const xAOD::Jet &jet, float &sf) const override |
| Calculate the inefficiency scale factor for the provided jet. 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 |
|
virtual bool | isAffectedBySystematic (const SystematicVariation &systematic) const |
| returns: whether this tool is affected by the given systematic guarantee: no-fail More...
|
|
virtual SystematicSet | affectingSystematics () const |
| returns: the list of all systematics this tool can be affected by guarantee: strong failures: out of memory II More...
|
|
virtual SystematicSet | recommendedSystematics () const |
| returns: the list of all systematics this tool can be affected by guarantee: strong failures: out of memory II More...
|
|
const SystematicSet & | appliedSystematics () const |
| returns: the list of systematics that have been applied to this tool. More...
|
|
std::string | appliedSystematicsString () const |
| returns: a string representation of appliedSystematics() guarantee: strong failures: out of memory II rationale: this is meant to be used when printing out the applied systematics for debugging purposes (or when embedding them in a string). More...
|
|
virtual StatusCode | applySystematicVariation (const SystematicSet &systConfig) |
| effects: configure this tool for the given list of systematic variations. More...
|
|
void | testInvariant () const |
| effects: test the invariance of this object guarantee: no-fail More...
|
|
Definition at line 18 of file JvtEfficiencyToolBase.h.
◆ StoreGateSvc_t
◆ ~JvtEfficiencyToolBase()
virtual CP::JvtEfficiencyToolBase::~JvtEfficiencyToolBase |
( |
| ) |
|
|
overridevirtualdefault |
◆ addAffectingSystematic()
effects: add a systematic to the list of registered systematics.
It will optionally also add this sytematic to the recommended set. side effects: this will add the systematic to the global list of systematics, if not already there guarantee: strong failures: out of memory II
Definition at line 111 of file SystematicsTool.cxx.
117 reg.registerSystematic( systematic );
121 return StatusCode::FAILURE;
124 return StatusCode::SUCCESS;
◆ addAffectingSystematics()
◆ addRecommendedSystematic()
effects: add a systematic to the list of recommended systematics failures: unsupported systematic
Definition at line 127 of file SystematicsTool.cxx.
134 if( reg.addSystematicToRecommended( systematic ) !=
135 StatusCode::SUCCESS ) {
136 return StatusCode::FAILURE;
138 return StatusCode::SUCCESS;
◆ addRecommendedSystematics()
StatusCode CP::SystematicsTool::addRecommendedSystematics |
( |
const SystematicSet & |
systematics | ) |
|
|
protectedinherited |
effects: add a SystematicSet to the recommended systematics.
Definition at line 151 of file SystematicsTool.cxx.
158 if( reg.addSystematicsToRecommended(
systematics ) !=
159 StatusCode::SUCCESS ) {
160 return StatusCode::FAILURE;
162 return StatusCode::SUCCESS;
◆ affectingSystematics()
SystematicSet CP::SystematicsTool::affectingSystematics |
( |
| ) |
const |
|
virtualinherited |
◆ appliedSystematics()
returns: the list of systematics that have been applied to this tool.
this is not including systematics that were applied, but do not affect this tool guarantee: no-fail
Definition at line 54 of file SystematicsTool.cxx.
58 std::cerr <<
"SystematicsTool::appliedSystematics WARNING: "
59 <<
"no systematic configuration has been applied yet. "
60 <<
"Returning NULL" << std::endl;
61 static const SystematicSet
dummy;
◆ appliedSystematicsString()
std::string CP::SystematicsTool::appliedSystematicsString |
( |
| ) |
const |
|
inherited |
returns: a string representation of appliedSystematics() guarantee: strong failures: out of memory II rationale: this is meant to be used when printing out the applied systematics for debugging purposes (or when embedding them in a string).
Definition at line 67 of file SystematicsTool.cxx.
◆ applySystematicVariation()
StatusCode CP::SystematicsTool::applySystematicVariation |
( |
const SystematicSet & |
systConfig | ) |
|
|
virtualinherited |
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). guarantee: basic failures: out of memory II 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
Implements CP::ISystematicsTool.
Reimplemented in CP::JetQGTagger, CP::JetJvtEfficiency, and met::METSystematicsTool.
Definition at line 73 of file SystematicsTool.cxx.
85 SystematicSet myAppliedSystematics;
87 filterForAffectingSystematics( systConfig,
89 myAppliedSystematics ) !=
90 StatusCode::SUCCESS ) {
91 return StatusCode::FAILURE;
96 (std::make_pair(systConfig, myAppliedSystematics)).first;
102 StatusCode::SUCCESS ) {
103 return StatusCode::FAILURE;
108 return StatusCode::SUCCESS;
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
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.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
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.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
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.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
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.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
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
◆ getEfficiencyScaleFactor()
◆ getEffImpl()
CorrectionCode CP::JvtEfficiencyToolBase::getEffImpl |
( |
float |
x, |
|
|
float |
y, |
|
|
float & |
sf |
|
) |
| const |
|
protected |
◆ getInefficiencyScaleFactor()
◆ getIneffImpl()
CorrectionCode CP::JvtEfficiencyToolBase::getIneffImpl |
( |
float |
x, |
|
|
float |
y, |
|
|
float & |
sf |
|
) |
| const |
|
protected |
Definition at line 137 of file JvtEfficiencyToolBase.cxx.
142 float baseFactor, errorTerm, effFactor, errorEffTerm;
143 if (!getBinContentAndError(*
m_jvtHist,
x,
y, baseFactor, errorTerm) ||
144 !getBinContentAndError(*
m_effHist,
x,
y, effFactor, errorEffTerm)) {
151 sf = (1 - baseFactor * effFactor) / (1 - effFactor);
◆ getKey()
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.
- See also
- asg::AsgTool::getName
- Parameters
-
ptr | The bare pointer to the object that the event store should know about |
- Returns
- The hashed key of the object in the store. If not found, an invalid (zero) key.
Definition at line 119 of file AsgTool.cxx.
121 #ifdef XAOD_STANDALONE
127 return (
proxy ==
nullptr ? 0 :
proxy->sgkey() );
128 #endif // XAOD_STANDALONE
◆ getName()
const std::string & asg::AsgTool::getName |
( |
const void * |
ptr | ) |
const |
|
inherited |
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.
- See also
- asg::AsgTool::getKey
- Parameters
-
ptr | The bare pointer to the object that the event store should know about |
- Returns
- The string name of the object in the store. If not found, an empty string.
Definition at line 106 of file AsgTool.cxx.
108 #ifdef XAOD_STANDALONE
114 static const std::string
dummy =
"";
116 #endif // XAOD_STANDALONE
◆ getProperty()
template<class T >
const T* asg::AsgTool::getProperty |
( |
const std::string & |
name | ) |
const |
|
inherited |
Get one of the tool's properties.
◆ initHists()
StatusCode CP::JvtEfficiencyToolBase::initHists |
( |
const std::string & |
file, |
|
|
const std::string & |
wp |
|
) |
| |
|
protected |
Read the input histograms. Passing an empty 'file' string uses dummy SFs.
Definition at line 85 of file JvtEfficiencyToolBase.cxx.
89 return StatusCode::SUCCESS;
92 if (resolved.empty()) {
94 return StatusCode::FAILURE;
96 std::unique_ptr<TFile>
fIn(TFile::Open(resolved.c_str(),
"READ"));
99 return StatusCode::FAILURE;
102 std::string jvtName =
"Jvt" +
wp;
106 "Could not open SF histogram "
107 << jvtName <<
". Please check the supported working points.");
108 return StatusCode::FAILURE;
111 std::string effName =
"Eff" +
wp;
115 "Could not open efficiency histogram "
116 << jvtName <<
". Please check the supported working points.");
117 return StatusCode::FAILURE;
121 return StatusCode::SUCCESS;
◆ initialize()
StatusCode CP::JvtEfficiencyToolBase::initialize |
( |
| ) |
|
|
overridevirtual |
◆ inputHandles()
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.
◆ isAffectedBySystematic()
◆ isInRange()
bool CP::JvtEfficiencyToolBase::isInRange |
( |
const xAOD::Jet & |
jet | ) |
const |
|
protected |
◆ msg() [1/2]
◆ msg() [2/2]
◆ msg_level_name()
const std::string & asg::AsgTool::msg_level_name |
( |
| ) |
const |
|
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:
MSG::name( msg().level() )
This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.
- Returns
- The string name of the current minimum message level that's printed
Definition at line 101 of file AsgTool.cxx.
◆ msgLvl()
◆ outputHandles()
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.
◆ print()
void asg::AsgTool::print |
( |
| ) |
const |
|
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.
◆ recommendedSystematics()
SystematicSet CP::SystematicsTool::recommendedSystematics |
( |
| ) |
const |
|
virtualinherited |
◆ renounce()
◆ renounceArray()
◆ sysApplySystematicVariation()
virtual StatusCode CP::SystematicsTool::sysApplySystematicVariation |
( |
const SystematicSet & |
systConfig | ) |
|
|
protectedpure virtualinherited |
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ testInvariant()
void CP::SystematicsTool::testInvariant |
( |
| ) |
const |
|
inherited |
effects: test the invariance of this object guarantee: no-fail
Definition at line 165 of file SystematicsTool.cxx.
◆ updateVHKA()
◆ m_accIsHS
◆ m_affectingSystematics
description: members directly corresponding to accessors
Definition at line 146 of file SystematicsTool.h.
◆ m_appliedSysSigma
int CP::JvtEfficiencyToolBase::m_appliedSysSigma = 0 |
|
protected |
◆ m_appliedSystematics
description: pointer to currenty applied systematics
Definition at line 151 of file SystematicsTool.h.
◆ m_detStore
◆ m_doTruthRequirement
Gaudi::Property<bool> CP::JvtEfficiencyToolBase::m_doTruthRequirement |
|
protected |
Initial value:{
this, "DoTruthReq", true,
"Use the truth-matching requirement. **Strongly** recommended"}
Definition at line 37 of file JvtEfficiencyToolBase.h.
◆ m_dummySFError
Gaudi::Property<float> CP::JvtEfficiencyToolBase::m_dummySFError |
|
protected |
Initial value:{
this, "DummySFError", 0.1, "The amount by which to vary the dummy SF"}
Definition at line 50 of file JvtEfficiencyToolBase.h.
◆ m_effHist
std::unique_ptr<TH2> CP::JvtEfficiencyToolBase::m_effHist |
|
protected |
◆ m_etaAcc
◆ m_evtStore
◆ m_jetContainer
Gaudi::Property<std::string> CP::JvtEfficiencyToolBase::m_jetContainer |
|
protected |
Initial value:{
this, "JetContainer", "",
"The name of the jet container, used to correctly initialize the read handles"}
Definition at line 34 of file JvtEfficiencyToolBase.h.
◆ m_jetEtaName
Gaudi::Property<std::string> CP::JvtEfficiencyToolBase::m_jetEtaName |
|
protected |
Initial value:{
this, "JetEtaName", "eta", "The name of the jet eta to use."}
Definition at line 53 of file JvtEfficiencyToolBase.h.
◆ m_jvtHist
std::unique_ptr<TH2> CP::JvtEfficiencyToolBase::m_jvtHist |
|
protected |
◆ m_maxEta
Gaudi::Property<float> CP::JvtEfficiencyToolBase::m_maxEta |
|
protected |
Initial value:{
this, "MaxEtaForJvt", 2.5, "All jets with |eta| above this are out of range"}
Definition at line 44 of file JvtEfficiencyToolBase.h.
◆ m_maxPtForJvt
Gaudi::Property<float> CP::JvtEfficiencyToolBase::m_maxPtForJvt |
|
protected |
Initial value:{
this,
"MaxPtForJvt", 60
e3,
"All jets with pT above this are out of range"}
Definition at line 48 of file JvtEfficiencyToolBase.h.
◆ m_minEta
Gaudi::Property<float> CP::JvtEfficiencyToolBase::m_minEta |
|
protected |
Initial value:{
this, "MinEtaForJvt", -1, "All jets with |eta| below this are out of range"}
Definition at line 42 of file JvtEfficiencyToolBase.h.
◆ m_minPtForJvt
Gaudi::Property<float> CP::JvtEfficiencyToolBase::m_minPtForJvt |
|
protected |
Initial value:{
this,
"MinPtForJvt", 20
e3,
"All jets with pT below this are out of range"}
Definition at line 46 of file JvtEfficiencyToolBase.h.
◆ m_recommendedSystematics
◆ m_systFilterMap
◆ m_truthHSLabel
Initial value:{
this, "TruthHSLabel", "isJvtHS", "Label for truth-matched jets"}
Definition at line 40 of file JvtEfficiencyToolBase.h.
◆ m_useDummySFs
bool CP::JvtEfficiencyToolBase::m_useDummySFs {false} |
|
protected |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
std::string name() const
returns: the systematics joined into a single string.
virtual void setOwner(IDataHandleHolder *o)=0
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
@ OutOfValidityRange
Input object is out of validity range.
@ Error
Some error happened during the object correction.
const_iterator end() const
description: const iterator to the end of the set
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
void insert(const SystematicVariation &systematic)
description: insert a systematic into the set
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
iterator find(const SystematicVariation &sys) const
description: find an element in the set
@ Ok
The correction was done successfully.
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
#define RCU_CHANGE_INVARIANT(x)
#define RCU_READ_INVARIANT(x)
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.