|
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/2024_FinalRun2_Recommendation_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 ;
153 ATH_MSG_ERROR(
"Could not initialize the TElectronEfficiencyCorrectionTool!");
154 return StatusCode::FAILURE;
160 std::map<float, std::vector<float>> pteta_bins_unc;
165 for (
const auto& [pt_unc, eta_unc]: pteta_bins_unc) {
171 return StatusCode::FAILURE;
174 return StatusCode::SUCCESS ;
197 const double energy = cluster->
e();
199 if ( std::abs(egam->
eta()) < 999.) {
200 const double cosheta = std::cosh(egam->
eta());
201 et = (cosheta != 0.) ?
energy / cosheta : 0.;
210 std::map<float, std::vector<float>>::const_iterator itr_pt =
m_pteta_bins.begin();
220 <<
eta2 <<
" Returning SF = 1 + / - 1");
227 <<
et <<
" Returning SF = 1 + / - 1");
234 <<
et / 1
e3 <<
"GeV Returning SF = 1 + / - 1");
253 "Pileup tool not run before using PhotonEfficiencyTool! SFs do not "
254 "reflect PU distribution in data");
257 runnumber = randomrunnumber(*(eventInfo));
270 bool excludeTRT =
false;
301 efficiencyScaleFactor=sfresult.
SF;
321 efficiencyScaleFactorError=sfresult.
Total;
327 double efficiencyScaleFactor = 1.0;
330 dec(inputObject) = efficiencyScaleFactor;
338 if(!systematic.
empty()){
340 return sys.find(systematic) !=
sys.end();
360 if (
registry.registerSystematics(*
this) != StatusCode::SUCCESS) {
361 ATH_MSG_ERROR(
"Failed to add systematic to list of recommended systematics.");
362 return StatusCode::FAILURE;
364 return StatusCode::SUCCESS;
389 ATH_MSG_ERROR(
"Unsupported combination of systematics passed to the tool!");
390 return StatusCode::FAILURE;
393 itr =
m_systFilter.insert(std::make_pair(systConfig, filteredSys)).first;
398 return StatusCode::SUCCESS;
409 if(mapFileName.empty()){
415 std::string correction_type =
"ID_Tight";
416 if(!trigWP.empty()) correction_type =
"Trigger_"+trigWP+
"_"+isoWP;
417 else if(!isoWP.empty()) correction_type =
"ISO_"+isoWP;
420 if(trigWP.empty()) {correction_type += isConv ?
"_Converted" :
"_Unconverted";}
425 std::ifstream is(mapFileName);
434 int nPos = strLine.find(
'=');
436 if ((
signed int)std::string::npos == nPos)
continue;
437 std::string strKey = strLine.substr(0,nPos);
438 std::string strVal = strLine.substr(nPos + 1, strLine.length() - nPos + 1);
441 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.