![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
44 m_rootTool_unc(nullptr),
45 m_rootTool_con(nullptr),
46 m_appliedSystematics(nullptr),
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/2022_Summer_Prerecom_v1/map1.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 ");
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 ;
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");
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;
314 efficiencyScaleFactor=sfresult.
SF;
334 efficiencyScaleFactorError=sfresult.
Total;
340 double efficiencyScaleFactor = 1.0;
343 dec(inputObject) = efficiencyScaleFactor;
351 if(!systematic.
empty()){
353 return sys.find(systematic) !=
sys.end();
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;
402 ATH_MSG_ERROR(
"Unsupported combination of systematics passed to the tool!");
403 return StatusCode::FAILURE;
406 itr =
m_systFilter.insert(std::make_pair(systConfig, filteredSys)).first;
411 return StatusCode::SUCCESS;
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;}
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.
float getParameterByBaseName(const std::string &basename) const
returns: the parameter value for the given basename
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.
::StatusCode StatusCode
StatusCode definition for legacy code.
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.
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.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
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.