ATLAS Offline Software
AsgPhotonEfficiencyCorrectionTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
13 // Include this class's header
15 
16 // STL includes
17 #include <cfloat>
18 #include <climits>
19 #include <iostream>
20 #include <string>
21 
22 // Include the return object
23 #include "PATCore/PATCoreEnums.h"
24 
25 // xAOD includes
26 #include "xAODEgamma/Egamma.h"
30 
31 // ROOT includes
32 #include "TSystem.h"
33 #define MAXETA 2.47
34 #define MIN_ET 7000.0
35 
37 
38 
39 // =============================================================================
40 // Standard constructor
41 // =============================================================================
43  AsgTool(myname),
44  m_rootTool_unc(nullptr),
45  m_rootTool_con(nullptr),
46  m_appliedSystematics(nullptr),
47  m_sysSubstring("")
48 {
49 
50  // Create an instances of the underlying ROOT tools
53 
54  // Declare the needed properties
55  declareProperty( "CorrectionFileNameConv", m_corrFileNameConv="",
56  "File that stores the correction factors for simulation for converted photons");
57 
58  declareProperty( "CorrectionFileNameUnconv", m_corrFileNameUnconv="",
59  "File that stores the correction factors for simulation for unconverted photons");
60 
61  declareProperty("MapFilePath", m_mapFile = "PhotonEfficiencyCorrection/2015_2025/rel22.2/2022_Summer_Prerecom_v1/map1.txt",
62  "Full path to the map file");
63 
64  declareProperty( "ForceDataType", m_dataTypeOverwrite=-1,
65  "Force the DataType of the Photon to specified value");
66 
67  declareProperty( "ResultPrefix", m_resultPrefix="", "The prefix string for the result");
68  declareProperty( "ResultName", m_resultName="", "The string for the result");
69 
70  // Properties needed for isolation corrections
71  declareProperty( "IsoKey", m_isoWP="", "Set isolation WP, if this string is empty the tool will return ID SF");
72 
73  // Properties needed for trigger SF
74  declareProperty( "TriggerKey", m_trigger="", "Set trigger, if this string is empty the tool will return ID SF");
75 
76  // Properties related to the receiving of event run number
77  declareProperty("UseRandomRunNumber", m_useRandomRunNumber = true,
78  "Set if use RandomRunNumber from eventinfo");
79  declareProperty("DefaultRandomRunNumber", m_defaultRandomRunNumber = 999999,
80  "Set default run number manually");
81  declareProperty("removeTRTConversion", m_removeTRTConversion = true,
82  "boolean to treat barrel standalone TRT conversion as unconverted for Run3 ");
83 
84 
85 }
86 
87 // =============================================================================
88 // Standard destructor
89 // =============================================================================
91 {
92  if ( m_rootTool_unc ) delete m_rootTool_unc;
93  if ( m_rootTool_con ) delete m_rootTool_con;
94 }
95 
96 // =============================================================================
97 // Athena initialize method
98 // =============================================================================
100 {
101  // Resolve the paths to the input files
102  std::vector < std::string > corrFileNameList;
103 
104  // First check if the tool is initialized using the input files or map
105  if(!m_mapFile.empty()){ // using map file
106  corrFileNameList.push_back(getFileName(m_isoWP,m_trigger,true)); // converted photons input
107  corrFileNameList.push_back(getFileName(m_isoWP,m_trigger,false)); // unconverted photons input
108  }
109  else if(!m_corrFileNameConv.empty() && !m_corrFileNameUnconv.empty()){ // initialize the tool using input files (old scheme)
110  corrFileNameList.push_back(m_corrFileNameConv);
111  corrFileNameList.push_back(m_corrFileNameUnconv);
112  }
113  else{
114  ATH_MSG_ERROR ( "Fail to resolve input file name, check if you set MapFilePath or CorrectionFileName properly" );
115  return StatusCode::FAILURE ;
116  }
117 
118  // once the input files are retrieved, update the path using PathResolver or TOOL/data folder
119  for (auto & i : corrFileNameList){
120 
121  //Using the PathResolver to locate the file
122  std::string filename = PathResolverFindCalibFile( i );
123 
124  if (filename.empty()){
125  ATH_MSG_ERROR ( "Could NOT resolve file name " << i );
126  return StatusCode::FAILURE ;
127  } else{
128  ATH_MSG_INFO(" Using path = "<<filename);
129  }
130 
131  i = filename;
132 
133  }
134 
135  // Set prefix for sustematics if this is ISO, Trigger or ID SF
136  if( corrFileNameList[0].find(m_file_prefix_Trig) != std::string::npos) m_sysSubstring="TRIGGER_";
137  if( corrFileNameList[0].find(m_file_prefix_ID) != std::string::npos) m_sysSubstring="ID_";
138  if( corrFileNameList[0].find(m_file_prefix_ISO) != std::string::npos) m_sysSubstring="ISO_";
139  if( corrFileNameList[0].find(m_file_prefix_TrigEff) != std::string::npos) m_sysSubstring="TRIGGER_";
140  if(m_sysSubstring.empty()) {ATH_MSG_ERROR ( "Invalid input file" ); return StatusCode::FAILURE;}
141 
142  // Configure the underlying Root tool
143  m_rootTool_con->addFileName( corrFileNameList[0] );
144  m_rootTool_unc->addFileName( corrFileNameList[1] );
145 
146  // Forward the message level
147  m_rootTool_con->msg().setLevel(this->msg().level());
148  m_rootTool_unc->msg().setLevel(this->msg().level());
149 
150 
151  // Check if ForceDataType is set up properly (should be 3 for AtlFast2)
152  if(TString(corrFileNameList[0]).Contains("AFII") && m_dataTypeOverwrite!=3)
153  {
154  ATH_MSG_ERROR("Property ForceDataType is set to "<< m_dataTypeOverwrite << ", while it should be 3 for FastSim");
155  return StatusCode::FAILURE;
156  }
157  if(!TString(corrFileNameList[0]).Contains("AFII") && m_dataTypeOverwrite!=1)
158  {
159  ATH_MSG_ERROR("Property ForceDataType is set to "<< m_dataTypeOverwrite << ", while it should be 1 for FullSim");
160  return StatusCode::FAILURE;
161  }
162 
163  // We need to initialize the underlying ROOT TSelectorTool
164  if ( (0 == m_rootTool_con->initialize()) || (0 == m_rootTool_unc->initialize()) )
165  {
166  ATH_MSG_ERROR("Could not initialize the TElectronEfficiencyCorrectionTool!");
167  return StatusCode::FAILURE;
168  }
169 
170  // get the map of pt/eta bins
171  // let's start with converted
173  std::map<float, std::vector<float>> pteta_bins_unc;
174  // now let's get unconverted
175  m_rootTool_unc->getNbins(pteta_bins_unc);
176  // let's loop the unconverted map and copy over to the common one
177  // in this tool we only ever care about et, so don't care if we overwrite eta information
178  for (const auto& [pt_unc, eta_unc]: pteta_bins_unc) {
179  m_pteta_bins[pt_unc] = eta_unc;
180  }
181 
182  // Add the recommended systematics to the registry
183  if ( registerSystematics() != StatusCode::SUCCESS) {
184  return StatusCode::FAILURE;
185  }
186 
187  return StatusCode::SUCCESS ;
188 }
189 
190 
191 // =============================================================================
192 // The main accept method: the actual cuts are applied here
193 // =============================================================================
195 {
196 
197  if ( !egam ) {
198  ATH_MSG_ERROR ( "Did NOT get a valid egamma pointer!" );
200  }
201 
202  // retrieve transverse energy from e/cosh(etaS2)
203  const xAOD::CaloCluster* cluster = egam->caloCluster();
204  if (!cluster){
205  ATH_MSG_ERROR("No cluster associated to the Photon \n");
207  }
208 
209  // use et from cluster because it is immutable under syst variations of ele energy scale
210  const double energy = cluster->e();
211  double et = 0.;
212  if ( std::abs(egam->eta()) < 999.) {
213  const double cosheta = std::cosh(egam->eta());
214  et = (cosheta != 0.) ? energy / cosheta : 0.;
215  }
216 
217  // eta from second layer
218  double eta2 = cluster->etaBE(2);
219 
220  // allow for a 5% margin at the lowest pT bin boundary (i.e. increase et by 5%
221  // for sub-threshold electrons). This assures that electrons that pass the
222  // threshold only under syst variations of energy get a scale factor assigned.
223  std::map<float, std::vector<float>>::const_iterator itr_pt = m_pteta_bins.begin();
224  if (itr_pt!=m_pteta_bins.end() && et<itr_pt->first) {
225  et=et*1.05;
226  }
227 
228  // Check if photon in the range to get the SF
229  if (std::abs(eta2) > MAXETA) {
230  result.SF = 1;
231  result.Total = 1;
232  ATH_MSG_DEBUG("No correction factor provided for eta "
233  << eta2 << " Returning SF = 1 + / - 1");
235  }
236  if (et < MIN_ET) {
237  result.SF = 1;
238  result.Total = 1;
239  ATH_MSG_DEBUG("No correction factor provided for eT "
240  << et << " Returning SF = 1 + / - 1");
242  }
243  if (itr_pt != m_pteta_bins.end() && et < itr_pt->first) {
244  result.SF = 1;
245  result.Total = 1;
246  ATH_MSG_DEBUG("No scale factor uncertainty provided for et "
247  << et / 1e3 << "GeV Returning SF = 1 + / - 1");
249  }
250 
251  // Get the run number
252  const xAOD::EventInfo* eventInfo =
253  evtStore()->retrieve<const xAOD::EventInfo>("EventInfo");
254  if (!eventInfo) {
255  ATH_MSG_ERROR("Could not retrieve EventInfo object!");
257  }
258 
259  // Retrieve the proper random Run Number
260  unsigned int runnumber = m_defaultRandomRunNumber;
261  if (m_useRandomRunNumber) {
262  static const SG::AuxElement::Accessor<unsigned int> randomrunnumber(
263  "RandomRunNumber");
264  if (!randomrunnumber.isAvailable(*eventInfo)) {
266  "Pileup tool not run before using PhotonEfficiencyTool! SFs do not "
267  "reflect PU distribution in data");
269  }
270  runnumber = randomrunnumber(*(eventInfo));
271  }
272 
273  /* For now the dataType must be set by the user. May be added to the IParticle
274  * class later. */
275  // probably event info should be able to tell us if it's data, fullsim, AF,..
278  if (m_dataTypeOverwrite >= 0)
280 
281 
282  //exclude TRT
283  bool excludeTRT = false;
284  if(runnumber >= 410000 && m_removeTRTConversion) excludeTRT = true;
285  // check if converted
286  const bool isConv = xAOD::EgammaHelpers::isConvertedPhoton(egam, excludeTRT);
287 
288  // Call the ROOT tool to get an answer (for photons we need just the total)
289  const int status = isConv ? m_rootTool_con->calculate(dataType, runnumber,
290  eta2, et, result, true)
292  eta2, et, result, true);
293 
294  // if status 0 something went wrong
295  if (!status) {
296  result.SF = 1;
297  result.Total = 1;
299  }
300 
301  return CP::CorrectionCode::Ok;
302 }
303 
304 CP::CorrectionCode AsgPhotonEfficiencyCorrectionTool::getEfficiencyScaleFactor(const xAOD::Egamma& inputObject, double& efficiencyScaleFactor) const{
305 
306  Result sfresult;
307  CP::CorrectionCode status = calculate(&inputObject, sfresult);
308 
309  if ( status != CP::CorrectionCode::Ok ) {
310  return status;
311  }
312 
313  if(m_appliedSystematics==nullptr){
314  efficiencyScaleFactor=sfresult.SF;
315  return CP::CorrectionCode::Ok;
316  }
317 
318  //Get the result + the uncertainty
319  float sigma(0);
321  efficiencyScaleFactor=sfresult.SF+sigma*sfresult.Total;
322  return CP::CorrectionCode::Ok;
323 }
324 
325 CP::CorrectionCode AsgPhotonEfficiencyCorrectionTool::getEfficiencyScaleFactorError(const xAOD::Egamma& inputObject, double& efficiencyScaleFactorError) const{
326 
327  Result sfresult;
328  CP::CorrectionCode status = calculate(&inputObject, sfresult);
329 
330  if ( status != CP::CorrectionCode::Ok ) {
331  return status;
332  }
333 
334  efficiencyScaleFactorError=sfresult.Total;
335  return CP::CorrectionCode::Ok;
336 }
337 
339 
340  double efficiencyScaleFactor = 1.0;
341  CP::CorrectionCode result = getEfficiencyScaleFactor(inputObject, efficiencyScaleFactor);
343  dec(inputObject) = efficiencyScaleFactor;
344  return result;
345 }
346 
347 //=======================================================================
348 // Systematics Interface
349 //=======================================================================
351  if(!systematic.empty()){
353  return sys.find(systematic) != sys.end();
354  }
355  return true;
356 }
357 
358 
361  CP::SystematicSet mySysSet;
362 
364  mySysSet.insert(CP::SystematicVariation("PH_EFF_"+m_sysSubstring+"Uncertainty", 1));
365  mySysSet.insert(CP::SystematicVariation("PH_EFF_"+m_sysSubstring+"Uncertainty", -1));
366 
367  return mySysSet;
368 }
369 
373  if (registry.registerSystematics(*this) != StatusCode::SUCCESS) {
374  ATH_MSG_ERROR("Failed to add systematic to list of recommended systematics.");
375  return StatusCode::FAILURE;
376  }
377  return StatusCode::SUCCESS;
378 }
379 
382  CP::SystematicSet mySysSet;
383  mySysSet.insert(CP::SystematicVariation("PH_EFF_"+m_sysSubstring+"Uncertainty", 1));
384  mySysSet.insert(CP::SystematicVariation("PH_EFF_"+m_sysSubstring+"Uncertainty", -1));
385 
386  return mySysSet;
387 }
388 
389 
391 applySystematicVariation ( const CP::SystematicSet& systConfig )
392 {
393  // First, check if we already know this systematic configuration
394  auto itr = m_systFilter.find(systConfig);
395 
396  // If it's a new input set, we need to filter it
397  if( itr == m_systFilter.end() ){
398 
399  CP::SystematicSet affectingSys = affectingSystematics();
400  CP::SystematicSet filteredSys;
401  if (!CP::SystematicSet::filterForAffectingSystematics(systConfig, affectingSys, filteredSys)){
402  ATH_MSG_ERROR("Unsupported combination of systematics passed to the tool!");
403  return StatusCode::FAILURE;
404  }
405  // Insert filtered set into the map
406  itr = m_systFilter.insert(std::make_pair(systConfig, filteredSys)).first;
407  }
408 
409  CP::SystematicSet& mySysConf = itr->second;
410  m_appliedSystematics = &mySysConf;
411  return StatusCode::SUCCESS;
412 }
413 
414 //===============================================================================
415 // Map Key Feature
416 //===============================================================================
417 // Gets the correction filename from map
418 std::string AsgPhotonEfficiencyCorrectionTool::getFileName(const std::string& isoWP, const std::string& trigWP, bool isConv) {
419 
420  // First locate the map file:
421  std::string mapFileName = PathResolverFindCalibFile( m_mapFile );
422  if(mapFileName.empty()){
423  ATH_MSG_ERROR ( "Can't read map file " << m_mapFile );
424  return mapFileName; // return an empty string
425  }
426 
427  // Construct correction type:
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;
431 
432  // trigger SF same for con/unc photons
433  if(trigWP.empty()) {correction_type += isConv ? "_Converted" : "_Unconverted";}
434 
435  std::string value;
436 
437  // Read the map file to find the proper correction filename
438  std::ifstream is(mapFileName);
439  if (!is.is_open()){
440  ATH_MSG_ERROR("Couldn't read Map File" + mapFileName);
441  return "";
442  }
443  while (!is.eof()) {
444  std::string strLine;
445  getline(is,strLine);
446 
447  int nPos = strLine.find('=');
448 
449  if ((signed int)std::string::npos == nPos) continue; // no '=', invalid line;
450  std::string strKey = strLine.substr(0,nPos);
451  std::string strVal = strLine.substr(nPos + 1, strLine.length() - nPos + 1);
452 
453  // check if this is the right key, if the right one stop the search
454  if(0==correction_type.compare(strKey)) {value=strVal; break;}
455  }
456 
457  return value;
458 
459 }
python.Dso.registry
registry
Definition: Control/AthenaServices/python/Dso.py:159
AsgPhotonEfficiencyCorrectionTool::getEfficiencyScaleFactorError
virtual CP::CorrectionCode getEfficiencyScaleFactorError(const xAOD::Egamma &inputObject, double &efficiencyScaleFactorError) const override
Get the "photon scale factor error" as a return value.
Definition: AsgPhotonEfficiencyCorrectionTool.cxx:325
AsgPhotonEfficiencyCorrectionTool::m_dataTypeOverwrite
int m_dataTypeOverwrite
Force the data type to a given value.
Definition: AsgPhotonEfficiencyCorrectionTool.h:121
CP::SystematicVariation::CONTINUOUS
@ CONTINUOUS
Definition: SystematicVariation.h:79
et
Extra patterns decribing particle interation process.
pdg_comparison.sigma
sigma
Definition: pdg_comparison.py:324
AsgPhotonEfficiencyCorrectionTool::affectingSystematics
virtual CP::SystematicSet affectingSystematics() const override
returns: the list of all systematics this tool can be affected by
Definition: AsgPhotonEfficiencyCorrectionTool.cxx:360
get_generator_info.result
result
Definition: get_generator_info.py:21
ParticleGun_SamplingFraction.eta2
eta2
Definition: ParticleGun_SamplingFraction.py:96
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
AsgPhotonEfficiencyCorrectionTool::AsgPhotonEfficiencyCorrectionTool
AsgPhotonEfficiencyCorrectionTool(const std::string &myname)
Standard constructor.
Definition: AsgPhotonEfficiencyCorrectionTool.cxx:42
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:66
AsgPhotonEfficiencyCorrectionTool::m_defaultRandomRunNumber
int m_defaultRandomRunNumber
Definition: AsgPhotonEfficiencyCorrectionTool.h:137
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Data
@ Data
Definition: BaseObject.h:11
AsgPhotonEfficiencyCorrectionTool::m_pteta_bins
std::map< float, std::vector< float > > m_pteta_bins
Definition: AsgPhotonEfficiencyCorrectionTool.h:133
AsgPhotonEfficiencyCorrectionTool::m_useRandomRunNumber
bool m_useRandomRunNumber
Definition: AsgPhotonEfficiencyCorrectionTool.h:136
AsgPhotonEfficiencyCorrectionTool.h
AsgPhotonEfficiencyCorrectionTool::m_file_prefix_ID
std::string m_file_prefix_ID
Definition: AsgPhotonEfficiencyCorrectionTool.h:103
MAXETA
#define MAXETA
Definition: AsgPhotonEfficiencyCorrectionTool.cxx:33
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition: SystematicSet.h:31
downloadSingle.dataType
string dataType
Definition: downloadSingle.py:18
AsgPhotonEfficiencyCorrectionTool::m_file_prefix_TrigEff
std::string m_file_prefix_TrigEff
Definition: AsgPhotonEfficiencyCorrectionTool.h:106
athena.value
value
Definition: athena.py:122
AsgPhotonEfficiencyCorrectionTool::getFileName
std::string getFileName(const std::string &isoWP, const std::string &trigWP, bool isConv)
Definition: AsgPhotonEfficiencyCorrectionTool.cxx:418
AsgPhotonEfficiencyCorrectionTool::~AsgPhotonEfficiencyCorrectionTool
virtual ~AsgPhotonEfficiencyCorrectionTool()
Standard destructor.
Definition: AsgPhotonEfficiencyCorrectionTool.cxx:90
xAOD::Egamma_v1
Definition: Egamma_v1.h:56
AsgPhotonEfficiencyCorrectionTool::m_rootTool_unc
Root::TElectronEfficiencyCorrectionTool * m_rootTool_unc
Pointer to the underlying ROOT based tool.
Definition: AsgPhotonEfficiencyCorrectionTool.h:87
AsgPhotonEfficiencyCorrectionTool::applyEfficiencyScaleFactor
virtual CP::CorrectionCode applyEfficiencyScaleFactor(xAOD::Egamma &inputObject) const override
Decorate the photon with its scale factor.
Definition: AsgPhotonEfficiencyCorrectionTool.cxx:338
CP::SystematicVariation
Definition: SystematicVariation.h:47
AsgPhotonEfficiencyCorrectionTool::initialize
virtual StatusCode initialize() override
Gaudi Service Interface method implementations.
Definition: AsgPhotonEfficiencyCorrectionTool.cxx:99
CP::SystematicSet::getParameterByBaseName
float getParameterByBaseName(const std::string &basename) const
returns: the parameter value for the given basename
Definition: SystematicSet.cxx:193
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
AsgPhotonEfficiencyCorrectionTool::isAffectedBySystematic
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 i...
Definition: AsgPhotonEfficiencyCorrectionTool.cxx:350
PATCore::ParticleDataType::DataType
DataType
Definition: PATCoreEnums.h:22
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
AsgPhotonEfficiencyCorrectionTool::m_file_prefix_ISO
std::string m_file_prefix_ISO
Definition: AsgPhotonEfficiencyCorrectionTool.h:104
xAOD::CaloCluster_v1::etaBE
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
Definition: CaloCluster_v1.cxx:644
Egamma.h
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
CP::CorrectionCode::OutOfValidityRange
@ OutOfValidityRange
Input object is out of validity range.
Definition: CorrectionCode.h:37
Root::TElectronEfficiencyCorrectionTool::Result
Definition: TElectronEfficiencyCorrectionTool.h:42
CP::CorrectionCode::Error
@ Error
Some error happened during the object correction.
Definition: CorrectionCode.h:36
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
AsgPhotonEfficiencyCorrectionTool::m_isoWP
std::string m_isoWP
Isolation working point.
Definition: AsgPhotonEfficiencyCorrectionTool.h:124
EgammaxAODHelpers.h
xAOD::EgammaHelpers::isConvertedPhoton
bool isConvertedPhoton(const xAOD::Egamma *eg, bool excludeTRT=false)
is the object a converted photon
Definition: EgammaxAODHelpers.cxx:26
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CheckAppliedSFs.e3
e3
Definition: CheckAppliedSFs.py:264
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:58
AsgPhotonEfficiencyCorrectionTool::m_resultName
std::string m_resultName
The string for the result.
Definition: AsgPhotonEfficiencyCorrectionTool.h:118
AsgPhotonEfficiencyCorrectionTool::m_resultPrefix
std::string m_resultPrefix
The prefix string for the result.
Definition: AsgPhotonEfficiencyCorrectionTool.h:115
AsgPhotonEfficiencyCorrectionTool::getEfficiencyScaleFactor
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.
Definition: AsgPhotonEfficiencyCorrectionTool.cxx:304
lumiFormat.i
int i
Definition: lumiFormat.py:92
AsgPhotonEfficiencyCorrectionTool::recommendedSystematics
virtual CP::SystematicSet recommendedSystematics() const override
returns: the list of all systematics this tool recommends to use
Definition: AsgPhotonEfficiencyCorrectionTool.cxx:381
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
PATCoreEnums.h
xAOD::Egamma_v1::caloCluster
const xAOD::CaloCluster * caloCluster(size_t index=0) const
Pointer to the xAOD::CaloCluster/s that define the electron candidate.
Definition: Egamma_v1.cxx:388
asg::AsgMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AsgMessaging.cxx:49
Root::TElectronEfficiencyCorrectionTool::Result::SF
double SF
Definition: TElectronEfficiencyCorrectionTool.h:43
AsgPhotonEfficiencyCorrectionTool::calculate
CP::CorrectionCode calculate(const xAOD::Egamma *egam, Result &result) const
I think these calculate methods are only used internally.
Definition: AsgPhotonEfficiencyCorrectionTool.cxx:194
AsgPhotonEfficiencyCorrectionTool::m_systFilter
std::unordered_map< CP::SystematicSet, CP::SystematicSet > m_systFilter
Systematics filter map.
Definition: AsgPhotonEfficiencyCorrectionTool.h:91
AsgPhotonEfficiencyCorrectionTool::m_file_prefix_Trig
std::string m_file_prefix_Trig
Definition: AsgPhotonEfficiencyCorrectionTool.h:105
Root::TElectronEfficiencyCorrectionTool
Definition: TElectronEfficiencyCorrectionTool.h:36
DeMoScan.runnumber
runnumber
Definition: DeMoScan.py:266
Root::TElectronEfficiencyCorrectionTool::initialize
int initialize()
Initialize this class.
Definition: TElectronEfficiencyCorrectionTool.cxx:87
AsgPhotonEfficiencyCorrectionTool::applySystematicVariation
virtual StatusCode applySystematicVariation(const CP::SystematicSet &systConfig) override
Configure this tool for the given systematics.
Definition: AsgPhotonEfficiencyCorrectionTool.cxx:391
PathResolver.h
AsgPhotonEfficiencyCorrectionTool::m_mapFile
std::string m_mapFile
map filename
Definition: AsgPhotonEfficiencyCorrectionTool.h:130
AsgPhotonEfficiencyCorrectionTool::registerSystematics
StatusCode registerSystematics()
Register the systematics with the registry and add them to the recommended list.
Definition: AsgPhotonEfficiencyCorrectionTool.cxx:371
CP::SystematicSet::insert
void insert(const SystematicVariation &systematic)
description: insert a systematic into the set
Definition: SystematicSet.cxx:88
Result
Definition: fbtTestBasics.cxx:47
Result
Root::TElectronEfficiencyCorrectionTool::Result Result
Definition: AsgPhotonEfficiencyCorrectionTool.cxx:36
EventInfo.h
Root::TElectronEfficiencyCorrectionTool::addFileName
void addFileName(const std::string &val)
This is more of an utility so the initialize is different wrt to an athena component.
Definition: TElectronEfficiencyCorrectionTool.h:66
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:431
AsgPhotonEfficiencyCorrectionTool::m_corrFileNameUnconv
std::string m_corrFileNameUnconv
Definition: AsgPhotonEfficiencyCorrectionTool.h:112
AsgPhotonEfficiencyCorrectionTool::m_rootTool_con
Root::TElectronEfficiencyCorrectionTool * m_rootTool_con
Definition: AsgPhotonEfficiencyCorrectionTool.h:88
AsgPhotonEfficiencyCorrectionTool::appliedSystematics
const CP::SystematicSet & appliedSystematics() const
returns: the currently applied systematics
Definition: AsgPhotonEfficiencyCorrectionTool.h:70
CP::CorrectionCode::Ok
@ Ok
The correction was done successfully.
Definition: CorrectionCode.h:38
AsgPhotonEfficiencyCorrectionTool::m_appliedSystematics
CP::SystematicSet * m_appliedSystematics
Currently applied systematics.
Definition: AsgPhotonEfficiencyCorrectionTool.h:94
AsgPhotonEfficiencyCorrectionTool::m_trigger
std::string m_trigger
Trigger name for trigger SF.
Definition: AsgPhotonEfficiencyCorrectionTool.h:127
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
CP::SystematicVariation::empty
bool empty() const
returns: whether this is an empty systematic, i.e.
Definition: SystematicVariation.cxx:294
CP::SystematicRegistry
This module implements the central registry for handling systematic uncertainties with CP tools.
Definition: SystematicRegistry.h:25
Root::TElectronEfficiencyCorrectionTool::getNbins
int getNbins(std::map< float, std::vector< float >> &ptEta) const
Helpers to get the binning of the uncertainties in a std::map (pt, eta)
Definition: TElectronEfficiencyCorrectionTool.cxx:538
DeMoScan.first
bool first
Definition: DeMoScan.py:534
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
MIN_ET
#define MIN_ET
Definition: AsgPhotonEfficiencyCorrectionTool.cxx:34
CP::CorrectionCode
Return value from object correction CP tools.
Definition: CorrectionCode.h:31
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
SG::ConstAccessor< T, AuxAllocator_t< T > >::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
xAOD::Egamma_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: Egamma_v1.cxx:70
merge.status
status
Definition: merge.py:17
AsgPhotonEfficiencyCorrectionTool::m_sysSubstring
std::string m_sysSubstring
Definition: AsgPhotonEfficiencyCorrectionTool.h:97
AsgPhotonEfficiencyCorrectionTool::m_corrFileNameConv
std::string m_corrFileNameConv
The list of input file names.
Definition: AsgPhotonEfficiencyCorrectionTool.h:111
AsgPhotonEfficiencyCorrectionTool::m_removeTRTConversion
bool m_removeTRTConversion
Definition: AsgPhotonEfficiencyCorrectionTool.h:140
Root::TElectronEfficiencyCorrectionTool::calculate
int calculate(const PATCore::ParticleDataType::DataType dataType, const unsigned int runnumber, const double cluster_eta, const double et, Result &result, const bool onlyTotal=false) const
The main calculate method: dataType PATCore::ParticleDataType::DataType (e.g DATA,...
Definition: TElectronEfficiencyCorrectionTool.cxx:152
xAOD::CaloCluster_v1::e
virtual double e() const
The total energy of the particle.
Definition: CaloCluster_v1.cxx:265
CP::SystematicSet::filterForAffectingSystematics
static StatusCode filterForAffectingSystematics(const SystematicSet &systConfig, const SystematicSet &affectingSystematics, SystematicSet &filteredSystematics)
description: filter the systematics for the affected systematics returns: success guarantee: strong f...
Definition: SystematicSet.cxx:213
Root::TElectronEfficiencyCorrectionTool::Result::Total
double Total
Definition: TElectronEfficiencyCorrectionTool.h:44
CP::SystematicRegistry::getInstance
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.
Definition: SystematicRegistry.cxx:25