|
ATLAS Offline Software
|
#include <AsgPhotonEfficiencyCorrectionTool.h>
|
| AsgPhotonEfficiencyCorrectionTool (const std::string &myname) |
| Standard constructor. More...
|
|
virtual | ~AsgPhotonEfficiencyCorrectionTool () |
| Standard destructor. More...
|
|
virtual StatusCode | initialize () override |
| Gaudi Service Interface method implementations. More...
|
|
virtual CP::CorrectionCode | getEfficiencyScaleFactor (const xAOD::Egamma &inputObject, double &efficiencyScaleFactor) const override |
| Add some method for now as a first step to move the tool to then new interface. More...
|
|
virtual CP::CorrectionCode | getEfficiencyScaleFactorError (const xAOD::Egamma &inputObject, double &efficiencyScaleFactorError) const override |
| Get the "photon scale factor error" as a return value. More...
|
|
virtual CP::CorrectionCode | applyEfficiencyScaleFactor (xAOD::Egamma &inputObject) const override |
| Decorate the photon with its scale factor. More...
|
|
virtual bool | isAffectedBySystematic (const CP::SystematicVariation &systematic) const override |
| The methods below should notify the user of what is actually in the list , without him having to go in the wiki. More...
|
|
virtual CP::SystematicSet | affectingSystematics () const override |
| returns: the list of all systematics this tool can be affected by More...
|
|
virtual CP::SystematicSet | recommendedSystematics () const override |
| returns: the list of all systematics this tool recommends to use More...
|
|
const CP::SystematicSet & | appliedSystematics () const |
| returns: the currently applied systematics More...
|
|
virtual StatusCode | applySystematicVariation (const CP::SystematicSet &systConfig) override |
| Configure this tool for the given systematics. More...
|
|
StatusCode | registerSystematics () |
| Register the systematics with the registry and add them to the recommended list. More...
|
|
virtual void | print () const =0 |
| Print the state of the tool. 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 |
|
◆ Result
◆ StoreGateSvc_t
◆ AsgPhotonEfficiencyCorrectionTool()
AsgPhotonEfficiencyCorrectionTool::AsgPhotonEfficiencyCorrectionTool |
( |
const std::string & |
myname | ) |
|
Standard constructor.
Definition at line 42 of file AsgPhotonEfficiencyCorrectionTool.cxx.
56 "File that stores the correction factors for simulation for converted photons");
59 "File that stores the correction factors for simulation for unconverted photons");
61 declareProperty(
"MapFilePath",
m_mapFile =
"PhotonEfficiencyCorrection/2015_2025/rel22.2/2024_FinalRun2_Recommendation_v1/map0.txt",
62 "Full path to the map file");
65 "Force the DataType of the Photon to specified value");
71 declareProperty(
"IsoKey",
m_isoWP=
"",
"Set isolation WP, if this string is empty the tool will return ID SF");
78 "Set if use RandomRunNumber from eventinfo");
80 "Set default run number manually");
82 "boolean to treat barrel standalone TRT conversion as unconverted for Run3 ");
◆ ~AsgPhotonEfficiencyCorrectionTool()
AsgPhotonEfficiencyCorrectionTool::~AsgPhotonEfficiencyCorrectionTool |
( |
| ) |
|
|
virtual |
◆ affectingSystematics()
◆ appliedSystematics()
◆ applyEfficiencyScaleFactor()
◆ applySystematicVariation()
StatusCode AsgPhotonEfficiencyCorrectionTool::applySystematicVariation |
( |
const CP::SystematicSet & |
systConfig | ) |
|
|
overridevirtual |
◆ calculate()
I think these calculate methods are only used internally.
Definition at line 194 of file AsgPhotonEfficiencyCorrectionTool.cxx.
210 const double energy = cluster->
e();
212 if ( std::abs(egam->
eta()) < 999.) {
213 const double cosheta = std::cosh(egam->
eta());
214 et = (cosheta != 0.) ?
energy / cosheta : 0.;
223 std::map<float, std::vector<float>>::const_iterator itr_pt =
m_pteta_bins.begin();
233 <<
eta2 <<
" Returning SF = 1 + / - 1");
240 <<
et <<
" Returning SF = 1 + / - 1");
247 <<
et / 1
e3 <<
"GeV Returning SF = 1 + / - 1");
264 if (!randomrunnumber.isAvailable(*eventInfo)) {
266 "Pileup tool not run before using PhotonEfficiencyTool! SFs do not "
267 "reflect PU distribution in data");
270 runnumber = randomrunnumber(*(eventInfo));
283 bool excludeTRT =
false;
◆ 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()
◆ getEfficiencyScaleFactorError()
◆ getFileName()
std::string AsgPhotonEfficiencyCorrectionTool::getFileName |
( |
const std::string & |
isoWP, |
|
|
const std::string & |
trigWP, |
|
|
bool |
isConv |
|
) |
| |
|
private |
Definition at line 418 of file AsgPhotonEfficiencyCorrectionTool.cxx.
422 if(mapFileName.empty()){
428 std::string correction_type =
"ID_Tight";
429 if(!trigWP.empty()) correction_type =
"Trigger_"+trigWP+
"_"+isoWP;
430 else if(!isoWP.empty()) correction_type =
"ISO_"+isoWP;
433 if(trigWP.empty()) {correction_type += isConv ?
"_Converted" :
"_Unconverted";}
438 std::ifstream is(mapFileName);
447 int nPos = strLine.find(
'=');
449 if ((
signed int)std::string::npos == nPos)
continue;
450 std::string strKey = strLine.substr(0,nPos);
451 std::string strVal = strLine.substr(nPos + 1, strLine.length() - nPos + 1);
454 if(0==correction_type.compare(strKey)) {
value=strVal;
break;}
◆ 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.
◆ initialize()
StatusCode AsgPhotonEfficiencyCorrectionTool::initialize |
( |
| ) |
|
|
overridevirtual |
Gaudi Service Interface method implementations.
Reimplemented from asg::AsgTool.
Definition at line 99 of file AsgPhotonEfficiencyCorrectionTool.cxx.
102 std::vector < std::string > corrFileNameList;
114 ATH_MSG_ERROR (
"Fail to resolve input file name, check if you set MapFilePath or CorrectionFileName properly" );
115 return StatusCode::FAILURE ;
119 for (
auto &
i : corrFileNameList){
126 return StatusCode::FAILURE ;
155 return StatusCode::FAILURE;
160 return StatusCode::FAILURE;
166 ATH_MSG_ERROR(
"Could not initialize the TElectronEfficiencyCorrectionTool!");
167 return StatusCode::FAILURE;
173 std::map<float, std::vector<float>> pteta_bins_unc;
178 for (
const auto& [pt_unc, eta_unc]: pteta_bins_unc) {
184 return StatusCode::FAILURE;
187 return StatusCode::SUCCESS ;
◆ 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()
◆ 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() [1/2]
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.
◆ print() [2/2]
virtual void asg::IAsgTool::print |
( |
| ) |
const |
|
pure virtualinherited |
Print the state of the tool.
Implemented in JetRecTool, JetFinder, JetModifiedMassDrop, JetFromPseudojet, JetReclusterer, JetReclusteringTool, JetTruthLabelingTool, JetPileupLabelingTool, HI::HIPileupTool, asg::AsgTool, JetDumper, JetBottomUpSoftDrop, JetRecursiveSoftDrop, JetSoftDrop, JetConstituentsRetriever, JetSubStructureMomentToolsBase, JetSplitter, JetToolRunner, JetPruner, JetPseudojetRetriever, JetTrimmer, AsgHelloTool, and KtDeltaRTool.
◆ recommendedSystematics()
CP::SystematicSet AsgPhotonEfficiencyCorrectionTool::recommendedSystematics |
( |
| ) |
const |
|
overridevirtual |
◆ registerSystematics()
StatusCode AsgPhotonEfficiencyCorrectionTool::registerSystematics |
( |
| ) |
|
Register the systematics with the registry and add them to the recommended list.
Definition at line 371 of file AsgPhotonEfficiencyCorrectionTool.cxx.
373 if (
registry.registerSystematics(*
this) != StatusCode::SUCCESS) {
374 ATH_MSG_ERROR(
"Failed to add systematic to list of recommended systematics.");
375 return StatusCode::FAILURE;
377 return StatusCode::SUCCESS;
◆ renounce()
◆ renounceArray()
◆ 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.
◆ updateVHKA()
◆ m_appliedSystematics
◆ m_corrFileNameConv
std::string AsgPhotonEfficiencyCorrectionTool::m_corrFileNameConv |
|
private |
◆ m_corrFileNameUnconv
std::string AsgPhotonEfficiencyCorrectionTool::m_corrFileNameUnconv |
|
private |
◆ m_dataTypeOverwrite
int AsgPhotonEfficiencyCorrectionTool::m_dataTypeOverwrite |
|
private |
◆ m_defaultRandomRunNumber
int AsgPhotonEfficiencyCorrectionTool::m_defaultRandomRunNumber |
|
private |
◆ m_detStore
◆ m_evtStore
◆ m_file_prefix_ID
std::string AsgPhotonEfficiencyCorrectionTool::m_file_prefix_ID ="efficiencySF.offline." |
|
private |
◆ m_file_prefix_ISO
std::string AsgPhotonEfficiencyCorrectionTool::m_file_prefix_ISO ="efficiencySF.Isolation." |
|
private |
◆ m_file_prefix_Trig
std::string AsgPhotonEfficiencyCorrectionTool::m_file_prefix_Trig ="efficiencySF." |
|
private |
◆ m_file_prefix_TrigEff
std::string AsgPhotonEfficiencyCorrectionTool::m_file_prefix_TrigEff ="efficiency." |
|
private |
◆ m_isoWP
std::string AsgPhotonEfficiencyCorrectionTool::m_isoWP |
|
private |
◆ m_mapFile
std::string AsgPhotonEfficiencyCorrectionTool::m_mapFile |
|
private |
◆ m_pteta_bins
std::map<float, std::vector<float> > AsgPhotonEfficiencyCorrectionTool::m_pteta_bins |
|
private |
◆ m_removeTRTConversion
bool AsgPhotonEfficiencyCorrectionTool::m_removeTRTConversion |
|
private |
◆ m_resultName
std::string AsgPhotonEfficiencyCorrectionTool::m_resultName |
|
private |
◆ m_resultPrefix
std::string AsgPhotonEfficiencyCorrectionTool::m_resultPrefix |
|
private |
◆ m_rootTool_con
◆ m_rootTool_unc
◆ m_sysSubstring
std::string AsgPhotonEfficiencyCorrectionTool::m_sysSubstring |
|
private |
◆ m_systFilter
◆ m_trigger
std::string AsgPhotonEfficiencyCorrectionTool::m_trigger |
|
private |
◆ m_useRandomRunNumber
bool AsgPhotonEfficiencyCorrectionTool::m_useRandomRunNumber |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
Extra patterns decribing particle interation process.
std::string find(const std::string &s)
return a remapped string
Helper class to provide type-safe access to aux data.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Class to wrap a set of SystematicVariations.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
float getParameterByBaseName(const std::string &basename) const
returns: the parameter value for the given basename
virtual void setOwner(IDataHandleHolder *o)=0
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
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.
Description of a calorimeter cluster.
bool isConvertedPhoton(const xAOD::Egamma *eg, bool excludeTRT=false)
is the object a converted photon
Helper class to provide type-safe access to aux data.
const xAOD::CaloCluster * caloCluster(size_t index=0) const
Pointer to the xAOD::CaloCluster/s that define the electron candidate.
MsgStream & msg() const
The standard message stream.
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
Class describing the basic event information.
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
@ Ok
The correction was done successfully.
#define ATH_MSG_WARNING(x)
bool empty() const
returns: whether this is an empty systematic, i.e.
This module implements the central registry for handling systematic uncertainties with CP tools.
Return value from object correction CP tools.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
virtual double e() const
The total energy of the particle.
static StatusCode filterForAffectingSystematics(const SystematicSet &systConfig, const SystematicSet &affectingSystematics, SystematicSet &filteredSystematics)
description: filter the systematics for the affected systematics returns: success guarantee: strong f...
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.