ATLAS Offline Software
Classes | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
AsgPhotonEfficiencyCorrectionTool Class Referenceabstract

#include <AsgPhotonEfficiencyCorrectionTool.h>

Inheritance diagram for AsgPhotonEfficiencyCorrectionTool:
Collaboration diagram for AsgPhotonEfficiencyCorrectionTool:

Classes

struct  Accessors
 

Public Member Functions

 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...
 
CP::CorrectionCode getEfficiencyScaleFactor (columnar::EgammaId inputObject, columnar::EventInfoId eventInfo, double &efficiencyScaleFactor) const
 
virtual CP::CorrectionCode getEfficiencyScaleFactorError (const xAOD::Egamma &inputObject, double &efficiencyScaleFactorError) const override
 Get the "photon scale factor error" as a return value. More...
 
CP::CorrectionCode getEfficiencyScaleFactorError (columnar::EgammaId inputObject, columnar::EventInfoId eventInfo, double &efficiencyScaleFactorError) const
 
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::SystematicSetappliedSystematics () 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...
 
void callSingleEvent (columnar::EgammaRange photons, columnar::EventInfoId event) const
 
void callEvents (columnar::EventContextRange events) const override
 
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, V, H > &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
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef Root::TElectronEfficiencyCorrectionTool::Result Result
 
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

CP::CorrectionCode calculate (columnar::EgammaId egam, columnar::EventInfoId eventInfo, Result &result) const
 I think these calculate methods are only used internally. More...
 
std::string getFileName (const std::string &isoWP, const std::string &trigWP, bool isConv)
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

Root::TElectronEfficiencyCorrectionToolm_rootTool_unc
 Pointer to the underlying ROOT based tool. More...
 
Root::TElectronEfficiencyCorrectionToolm_rootTool_con
 
std::unordered_map< CP::SystematicSet, CP::SystematicSetm_systFilter
 Systematics filter map. More...
 
CP::SystematicSetm_appliedSystematics = nullptr
 Currently applied systematics. More...
 
std::string m_sysSubstring
 
std::string m_file_prefix_ID ="efficiencySF.offline."
 
std::string m_file_prefix_ISO ="efficiencySF.Isolation."
 
std::string m_file_prefix_Trig ="efficiencySF."
 
std::string m_file_prefix_TrigEff ="efficiency."
 
std::string m_corrFileNameConv
 The list of input file names. More...
 
std::string m_corrFileNameUnconv
 
std::string m_resultPrefix
 The prefix string for the result. More...
 
std::string m_resultName
 The string for the result. More...
 
int m_dataTypeOverwrite
 Force the data type to a given value. More...
 
std::string m_isoWP
 Isolation working point. More...
 
std::string m_trigger
 Trigger name for trigger SF. More...
 
std::string m_mapFile
 map filename More...
 
std::map< float, std::vector< float > > m_pteta_bins
 
bool m_useRandomRunNumber
 
int m_defaultRandomRunNumber
 
bool m_removeTRTConversion
 
Gaudi::Property< bool > m_allowMissingLinks { this, "AllowMissingLinks", false, "Allow missing links in the input objects. This should only be used by experts running on expert formats." }
 
std::unique_ptr< Accessorsm_accessors {std::make_unique<Accessors>(*this)}
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 41 of file AsgPhotonEfficiencyCorrectionTool.h.

Member Typedef Documentation

◆ Result

Definition at line 92 of file AsgPhotonEfficiencyCorrectionTool.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ AsgPhotonEfficiencyCorrectionTool()

AsgPhotonEfficiencyCorrectionTool::AsgPhotonEfficiencyCorrectionTool ( const std::string &  myname)

Standard constructor.

Definition at line 42 of file AsgPhotonEfficiencyCorrectionTool.cxx.

42  :
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/2024_FinalRun2_Recommendation_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 }

◆ ~AsgPhotonEfficiencyCorrectionTool()

AsgPhotonEfficiencyCorrectionTool::~AsgPhotonEfficiencyCorrectionTool ( )
virtual

Standard destructor.

Definition at line 90 of file AsgPhotonEfficiencyCorrectionTool.cxx.

91 {
92  if ( m_rootTool_unc ) delete m_rootTool_unc;
93  if ( m_rootTool_con ) delete m_rootTool_con;
94 }

Member Function Documentation

◆ affectingSystematics()

CP::SystematicSet AsgPhotonEfficiencyCorrectionTool::affectingSystematics ( ) const
overridevirtual

returns: the list of all systematics this tool can be affected by

returns: the list of all systematics this tool can be affected by (for now keep +-1 sigma variation, but ignore it later in applySystematicVariation() )

Implements CP::IReentrantSystematicsTool.

Definition at line 378 of file AsgPhotonEfficiencyCorrectionTool.cxx.

378  {
379  CP::SystematicSet mySysSet;
380 
382  mySysSet.insert(CP::SystematicVariation("PH_EFF_"+m_sysSubstring+"Uncertainty", 1));
383  mySysSet.insert(CP::SystematicVariation("PH_EFF_"+m_sysSubstring+"Uncertainty", -1));
384 
385  return mySysSet;
386 }

◆ appliedSystematics()

const CP::SystematicSet& AsgPhotonEfficiencyCorrectionTool::appliedSystematics ( ) const
inline

returns: the currently applied systematics

Definition at line 80 of file AsgPhotonEfficiencyCorrectionTool.h.

80  {
81  assert (m_appliedSystematics != nullptr);
82  return *m_appliedSystematics;
83  }

◆ applyEfficiencyScaleFactor()

CP::CorrectionCode AsgPhotonEfficiencyCorrectionTool::applyEfficiencyScaleFactor ( xAOD::Egamma ) const
overridevirtual

Decorate the photon with its scale factor.

Implements IAsgPhotonEfficiencyCorrectionTool.

Definition at line 356 of file AsgPhotonEfficiencyCorrectionTool.cxx.

356  {
357 
358  double efficiencyScaleFactor = 1.0;
359  CP::CorrectionCode result = getEfficiencyScaleFactor(inputObject, efficiencyScaleFactor);
361  dec(inputObject) = efficiencyScaleFactor;
362  return result;
363 }

◆ applySystematicVariation()

StatusCode AsgPhotonEfficiencyCorrectionTool::applySystematicVariation ( const CP::SystematicSet systConfig)
overridevirtual

Configure this tool for the given systematics.

Implements CP::ISystematicsTool.

Definition at line 408 of file AsgPhotonEfficiencyCorrectionTool.cxx.

410 {
411  // First, check if we already know this systematic configuration
412  auto itr = m_systFilter.find(systConfig);
413 
414  // If it's a new input set, we need to filter it
415  if( itr == m_systFilter.end() ){
416 
417  CP::SystematicSet affectingSys = affectingSystematics();
418  CP::SystematicSet filteredSys;
419  if (!CP::SystematicSet::filterForAffectingSystematics(systConfig, affectingSys, filteredSys)){
420  ATH_MSG_ERROR("Unsupported combination of systematics passed to the tool!");
421  return StatusCode::FAILURE;
422  }
423  // Insert filtered set into the map
424  itr = m_systFilter.insert(std::make_pair(systConfig, filteredSys)).first;
425  }
426 
427  CP::SystematicSet& mySysConf = itr->second;
428  m_appliedSystematics = &mySysConf;
429  return StatusCode::SUCCESS;
430 }

◆ calculate()

CP::CorrectionCode AsgPhotonEfficiencyCorrectionTool::calculate ( columnar::EgammaId  egam,
columnar::EventInfoId  eventInfo,
Result result 
) const
private

I think these calculate methods are only used internally.

Definition at line 181 of file AsgPhotonEfficiencyCorrectionTool.cxx.

182 {
183  const auto& acc = *m_accessors;
184 
185  // retrieve transverse energy from e/cosh(etaS2)
186  auto clusters = egam(acc.caloClusterAcc);
187  if (clusters.size()<1||!clusters[0].has_value()){
188  ATH_MSG_ERROR("No cluster associated to the Photon \n");
190  }
191  auto cluster = clusters[0].value();
192 
193  // use et from cluster because it is immutable under syst variations of ele energy scale
194  const double energy = cluster(acc.clusterEAcc);
195  double et = 0.;
196  if ( std::abs(egam(acc.etaAcc)) < 999.) {
197  const double cosheta = std::cosh(egam(acc.etaAcc));
198  et = (cosheta != 0.) ? energy / cosheta : 0.;
199  }
200 
201  // eta from second layer
202  double eta2 = cluster(acc.clusterEtaBEAcc,2);
203 
204  // allow for a 5% margin at the lowest pT bin boundary (i.e. increase et by 5%
205  // for sub-threshold electrons). This assures that electrons that pass the
206  // threshold only under syst variations of energy get a scale factor assigned.
207  std::map<float, std::vector<float>>::const_iterator itr_pt = m_pteta_bins.begin();
208  if (itr_pt!=m_pteta_bins.end() && et<itr_pt->first) {
209  et=et*1.05;
210  }
211 
212  // Check if photon in the range to get the SF
213  if (std::abs(eta2) > MAXETA) {
214  result.SF = 1;
215  result.Total = 1;
216  ATH_MSG_DEBUG("No correction factor provided for eta "
217  << eta2 << " Returning SF = 1 + / - 1");
219  }
220  if (et < MIN_ET) {
221  result.SF = 1;
222  result.Total = 1;
223  ATH_MSG_DEBUG("No correction factor provided for eT "
224  << et << " Returning SF = 1 + / - 1");
226  }
227  if (itr_pt != m_pteta_bins.end() && et < itr_pt->first) {
228  result.SF = 1;
229  result.Total = 1;
230  ATH_MSG_DEBUG("No scale factor uncertainty provided for et "
231  << et / 1e3 << "GeV Returning SF = 1 + / - 1");
233  }
234 
235  // Retrieve the proper random Run Number
236  unsigned int runnumber = m_defaultRandomRunNumber;
237  if (m_useRandomRunNumber) {
238  if (!acc.randomRunNumberAcc.isAvailable(eventInfo)) {
240  "Pileup tool not run before using PhotonEfficiencyTool! SFs do not "
241  "reflect PU distribution in data");
243  }
244  runnumber = acc.randomRunNumberAcc(eventInfo);
245  }
246 
247  /* For now the dataType must be set by the user. May be added to the IParticle
248  * class later. */
249  // probably event info should be able to tell us if it's data, fullsim, AF,..
252  if (m_dataTypeOverwrite >= 0)
254 
255 
256  //exclude TRT
257  bool excludeTRT = false;
258  if(runnumber >= 410000 && m_removeTRTConversion) excludeTRT = true;
259  // check if converted
260  const auto [isConv, missingLinks] = acc.isConvertedPhotonAcc(egam, excludeTRT);
261  if (missingLinks) { // missing vertex or track links
262  if (!m_allowMissingLinks.value()) {
263  ATH_MSG_ERROR("Missing vertex or track links when trying to calculate the conversion type. missingLinks=" << std::hex << missingLinks);
265  }
266  static std::atomic<bool> warned {false};
267  if (warned.exchange(true) == false) {
268  ATH_MSG_WARNING("Missing vertex or track links when trying to calculate the conversion type. missingLinks=" << std::hex << missingLinks);
269  ATH_MSG_WARNING("This may indicate that the DAOD is incorrectly missing some conversion vertices.");
270  ATH_MSG_WARNING("This is your only warning, repeat occurrences will be reported at the DEBUG level.");
271  } else {
272  ATH_MSG_DEBUG("Missing vertex or track links when trying to calculate the conversion type. missingLinks=" << std::hex << missingLinks);
273  }
274  result.SF = 1;
275  result.Total = 1;
277  }
278 
279 
280  // Call the ROOT tool to get an answer (for photons we need just the total)
281  const int status = isConv ? m_rootTool_con->calculate(dataType, runnumber,
282  eta2, et, result, true)
284  eta2, et, result, true);
285 
286  // if status 0 something went wrong
287  if (!status) {
288  result.SF = 1;
289  result.Total = 1;
291  }
292 
293  return CP::CorrectionCode::Ok;
294 }

◆ callEvents()

void AsgPhotonEfficiencyCorrectionTool::callEvents ( columnar::EventContextRange  events) const
override

Definition at line 502 of file AsgPhotonEfficiencyCorrectionTool.cxx.

503 {
504  const Accessors& acc = *m_accessors;
506  {
507  auto eventInfo = acc.eventInfoAcc(event);
508  callSingleEvent (acc.photonsAcc(event), eventInfo);
509  }
510 }

◆ callSingleEvent()

void AsgPhotonEfficiencyCorrectionTool::callSingleEvent ( columnar::EgammaRange  photons,
columnar::EventInfoId  event 
) const

Definition at line 479 of file AsgPhotonEfficiencyCorrectionTool.cxx.

480 {
481  const Accessors& acc = *m_accessors;
482  for (auto photon : photons)
483  {
484  double sf = 0;
486  {
488  case Ok:
489  acc.sfDec(photon) = sf;
490  acc.validDec(photon) = true;
491  break;
492  case OutOfValidityRange:
493  acc.sfDec(photon) = sf;
494  acc.validDec(photon) = false;
495  break;
496  default:
497  throw std::runtime_error("Error in getEfficiencyScaleFactor");
498  }
499  }
500 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation 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.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation 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.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation 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.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation 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.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

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() [1/2]

CP::CorrectionCode AsgPhotonEfficiencyCorrectionTool::getEfficiencyScaleFactor ( columnar::EgammaId  inputObject,
columnar::EventInfoId  eventInfo,
double &  efficiencyScaleFactor 
) const

Definition at line 309 of file AsgPhotonEfficiencyCorrectionTool.cxx.

309  {
310 
311  Result sfresult;
312  CP::CorrectionCode status = calculate(inputObject, eventInfo, sfresult);
313 
314  if ( status != CP::CorrectionCode::Ok ) {
315  return status;
316  }
317 
318  if(m_appliedSystematics==nullptr){
319  efficiencyScaleFactor=sfresult.SF;
320  return CP::CorrectionCode::Ok;
321  }
322 
323  //Get the result + the uncertainty
324  float sigma(0);
326  efficiencyScaleFactor=sfresult.SF+sigma*sfresult.Total;
327  return CP::CorrectionCode::Ok;
328 }

◆ getEfficiencyScaleFactor() [2/2]

CP::CorrectionCode AsgPhotonEfficiencyCorrectionTool::getEfficiencyScaleFactor ( const xAOD::Egamma inputObject,
double &  efficiencyScaleFactor 
) const
overridevirtual

Add some method for now as a first step to move the tool to then new interface.

Implements IAsgPhotonEfficiencyCorrectionTool.

Definition at line 296 of file AsgPhotonEfficiencyCorrectionTool.cxx.

296  {
297 
298  // Get the run number
299  const xAOD::EventInfo* eventInfo =
300  evtStore()->retrieve<const xAOD::EventInfo>("EventInfo");
301  if (!eventInfo) {
302  ATH_MSG_ERROR("Could not retrieve EventInfo object!");
304  }
305 
306  return getEfficiencyScaleFactor(columnar::EgammaId{inputObject}, columnar::EventInfoId{*eventInfo}, efficiencyScaleFactor);
307 }

◆ getEfficiencyScaleFactorError() [1/2]

CP::CorrectionCode AsgPhotonEfficiencyCorrectionTool::getEfficiencyScaleFactorError ( columnar::EgammaId  inputObject,
columnar::EventInfoId  eventInfo,
double &  efficiencyScaleFactorError 
) const

Definition at line 343 of file AsgPhotonEfficiencyCorrectionTool.cxx.

343  {
344 
345  Result sfresult;
346  CP::CorrectionCode status = calculate(inputObject, eventInfo, sfresult);
347 
348  if ( status != CP::CorrectionCode::Ok ) {
349  return status;
350  }
351 
352  efficiencyScaleFactorError=sfresult.Total;
353  return CP::CorrectionCode::Ok;
354 }

◆ getEfficiencyScaleFactorError() [2/2]

CP::CorrectionCode AsgPhotonEfficiencyCorrectionTool::getEfficiencyScaleFactorError ( const xAOD::Egamma ,
double &   
) const
overridevirtual

Get the "photon scale factor error" as a return value.

Implements IAsgPhotonEfficiencyCorrectionTool.

Definition at line 330 of file AsgPhotonEfficiencyCorrectionTool.cxx.

330  {
331 
332  // Get the run number
333  const xAOD::EventInfo* eventInfo =
334  evtStore()->retrieve<const xAOD::EventInfo>("EventInfo");
335  if (!eventInfo) {
336  ATH_MSG_ERROR("Could not retrieve EventInfo object!");
338  }
339 
340  return getEfficiencyScaleFactorError(columnar::EgammaId{inputObject}, columnar::EventInfoId{*eventInfo}, efficiencyScaleFactorError);
341 }

◆ getFileName()

std::string AsgPhotonEfficiencyCorrectionTool::getFileName ( const std::string &  isoWP,
const std::string &  trigWP,
bool  isConv 
)
private

Definition at line 436 of file AsgPhotonEfficiencyCorrectionTool.cxx.

436  {
437 
438  // First locate the map file:
439  std::string mapFileName = PathResolverFindCalibFile( m_mapFile );
440  if(mapFileName.empty()){
441  ATH_MSG_ERROR ( "Can't read map file " << m_mapFile );
442  return mapFileName; // return an empty string
443  }
444 
445  // Construct correction type:
446  std::string correction_type = "ID_Tight";
447  if(!trigWP.empty()) correction_type = "Trigger_"+trigWP+"_"+isoWP;
448  else if(!isoWP.empty()) correction_type = "ISO_"+isoWP;
449 
450  // trigger SF same for con/unc photons
451  if(trigWP.empty()) {correction_type += isConv ? "_Converted" : "_Unconverted";}
452 
453  std::string value;
454 
455  // Read the map file to find the proper correction filename
456  std::ifstream is(mapFileName);
457  if (!is.is_open()){
458  ATH_MSG_ERROR("Couldn't read Map File" + mapFileName);
459  return "";
460  }
461  while (!is.eof()) {
462  std::string strLine;
463  getline(is,strLine);
464 
465  int nPos = strLine.find('=');
466 
467  if ((signed int)std::string::npos == nPos) continue; // no '=', invalid line;
468  std::string strKey = strLine.substr(0,nPos);
469  std::string strVal = strLine.substr(nPos + 1, strLine.length() - nPos + 1);
470 
471  // check if this is the right key, if the right one stop the search
472  if(0==correction_type.compare(strKey)) {value=strVal; break;}
473  }
474 
475  return value;
476 
477 }

◆ getKey()

SG::sgkey_t asg::AsgTool::getKey ( const void *  ptr) const
inherited

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
ptrThe 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.

119  {
120 
121 #ifdef XAOD_STANDALONE
122  // In case we use @c xAOD::TEvent, we have a direct function call
123  // for this.
124  return evtStore()->event()->getKey( ptr );
125 #else
126  const SG::DataProxy* proxy = evtStore()->proxy( ptr );
127  return ( proxy == nullptr ? 0 : proxy->sgkey() );
128 #endif // XAOD_STANDALONE
129  }

◆ 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
ptrThe 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.

106  {
107 
108 #ifdef XAOD_STANDALONE
109  // In case we use @c xAOD::TEvent, we have a direct function call
110  // for this.
111  return evtStore()->event()->getName( ptr );
112 #else
113  const SG::DataProxy* proxy = evtStore()->proxy( ptr );
114  static const std::string dummy = "";
115  return ( proxy == nullptr ? dummy : proxy->name() );
116 #endif // XAOD_STANDALONE
117  }

◆ 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.

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  // We need to initialize the underlying ROOT TSelectorTool
151  if ( (0 == m_rootTool_con->initialize()) || (0 == m_rootTool_unc->initialize()) )
152  {
153  ATH_MSG_ERROR("Could not initialize the TElectronEfficiencyCorrectionTool!");
154  return StatusCode::FAILURE;
155  }
156 
157  // get the map of pt/eta bins
158  // let's start with converted
160  std::map<float, std::vector<float>> pteta_bins_unc;
161  // now let's get unconverted
162  m_rootTool_unc->getNbins(pteta_bins_unc);
163  // let's loop the unconverted map and copy over to the common one
164  // in this tool we only ever care about et, so don't care if we overwrite eta information
165  for (const auto& [pt_unc, eta_unc]: pteta_bins_unc) {
166  m_pteta_bins[pt_unc] = eta_unc;
167  }
168 
169  // Add the recommended systematics to the registry
170  if ( registerSystematics() != StatusCode::SUCCESS) {
171  return StatusCode::FAILURE;
172  }
173 
174  return StatusCode::SUCCESS ;
175 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

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()

bool AsgPhotonEfficiencyCorrectionTool::isAffectedBySystematic ( const CP::SystematicVariation systematic) const
overridevirtual

The methods below should notify the user of what is actually in the list , without him having to go in the wiki.

returns: whether this tool is affected by the given systematic

Implements CP::ISystematicsTool.

Definition at line 368 of file AsgPhotonEfficiencyCorrectionTool.cxx.

368  {
369  if(!systematic.empty()){
371  return sys.find(systematic) != sys.end();
372  }
373  return true;
374 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ 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.

101  {
102 
103  return MSG::name( msg().level() );
104  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

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() [2/2]

virtual void asg::IAsgTool::print ( ) const
pure virtualinherited

◆ recommendedSystematics()

CP::SystematicSet AsgPhotonEfficiencyCorrectionTool::recommendedSystematics ( ) const
overridevirtual

returns: the list of all systematics this tool recommends to use

Implements CP::IReentrantSystematicsTool.

Definition at line 399 of file AsgPhotonEfficiencyCorrectionTool.cxx.

399  {
400  CP::SystematicSet mySysSet;
401  mySysSet.insert(CP::SystematicVariation("PH_EFF_"+m_sysSubstring+"Uncertainty", 1));
402  mySysSet.insert(CP::SystematicVariation("PH_EFF_"+m_sysSubstring+"Uncertainty", -1));
403 
404  return mySysSet;
405 }

◆ registerSystematics()

StatusCode AsgPhotonEfficiencyCorrectionTool::registerSystematics ( )

Register the systematics with the registry and add them to the recommended list.

Definition at line 389 of file AsgPhotonEfficiencyCorrectionTool.cxx.

389  {
391  if (registry.registerSystematics(*this) != StatusCode::SUCCESS) {
392  ATH_MSG_ERROR("Failed to add systematic to list of recommended systematics.");
393  return StatusCode::FAILURE;
394  }
395  return StatusCode::SUCCESS;
396 }

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_accessors

std::unique_ptr<Accessors> AsgPhotonEfficiencyCorrectionTool::m_accessors {std::make_unique<Accessors>(*this)}
private

Definition at line 180 of file AsgPhotonEfficiencyCorrectionTool.h.

◆ m_allowMissingLinks

Gaudi::Property<bool> AsgPhotonEfficiencyCorrectionTool::m_allowMissingLinks { this, "AllowMissingLinks", false, "Allow missing links in the input objects. This should only be used by experts running on expert formats." }
private

Definition at line 152 of file AsgPhotonEfficiencyCorrectionTool.h.

◆ m_appliedSystematics

CP::SystematicSet* AsgPhotonEfficiencyCorrectionTool::m_appliedSystematics = nullptr
private

Currently applied systematics.

Definition at line 104 of file AsgPhotonEfficiencyCorrectionTool.h.

◆ m_corrFileNameConv

std::string AsgPhotonEfficiencyCorrectionTool::m_corrFileNameConv
private

The list of input file names.

Definition at line 121 of file AsgPhotonEfficiencyCorrectionTool.h.

◆ m_corrFileNameUnconv

std::string AsgPhotonEfficiencyCorrectionTool::m_corrFileNameUnconv
private

Definition at line 122 of file AsgPhotonEfficiencyCorrectionTool.h.

◆ m_dataTypeOverwrite

int AsgPhotonEfficiencyCorrectionTool::m_dataTypeOverwrite
private

Force the data type to a given value.

Definition at line 131 of file AsgPhotonEfficiencyCorrectionTool.h.

◆ m_defaultRandomRunNumber

int AsgPhotonEfficiencyCorrectionTool::m_defaultRandomRunNumber
private

Definition at line 147 of file AsgPhotonEfficiencyCorrectionTool.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_file_prefix_ID

std::string AsgPhotonEfficiencyCorrectionTool::m_file_prefix_ID ="efficiencySF.offline."
private

Definition at line 113 of file AsgPhotonEfficiencyCorrectionTool.h.

◆ m_file_prefix_ISO

std::string AsgPhotonEfficiencyCorrectionTool::m_file_prefix_ISO ="efficiencySF.Isolation."
private

Definition at line 114 of file AsgPhotonEfficiencyCorrectionTool.h.

◆ m_file_prefix_Trig

std::string AsgPhotonEfficiencyCorrectionTool::m_file_prefix_Trig ="efficiencySF."
private

Definition at line 115 of file AsgPhotonEfficiencyCorrectionTool.h.

◆ m_file_prefix_TrigEff

std::string AsgPhotonEfficiencyCorrectionTool::m_file_prefix_TrigEff ="efficiency."
private

Definition at line 116 of file AsgPhotonEfficiencyCorrectionTool.h.

◆ m_isoWP

std::string AsgPhotonEfficiencyCorrectionTool::m_isoWP
private

Isolation working point.

Definition at line 134 of file AsgPhotonEfficiencyCorrectionTool.h.

◆ m_mapFile

std::string AsgPhotonEfficiencyCorrectionTool::m_mapFile
private

map filename

Definition at line 140 of file AsgPhotonEfficiencyCorrectionTool.h.

◆ m_pteta_bins

std::map<float, std::vector<float> > AsgPhotonEfficiencyCorrectionTool::m_pteta_bins
private

Definition at line 143 of file AsgPhotonEfficiencyCorrectionTool.h.

◆ m_removeTRTConversion

bool AsgPhotonEfficiencyCorrectionTool::m_removeTRTConversion
private

Definition at line 150 of file AsgPhotonEfficiencyCorrectionTool.h.

◆ m_resultName

std::string AsgPhotonEfficiencyCorrectionTool::m_resultName
private

The string for the result.

Definition at line 128 of file AsgPhotonEfficiencyCorrectionTool.h.

◆ m_resultPrefix

std::string AsgPhotonEfficiencyCorrectionTool::m_resultPrefix
private

The prefix string for the result.

Definition at line 125 of file AsgPhotonEfficiencyCorrectionTool.h.

◆ m_rootTool_con

Root::TElectronEfficiencyCorrectionTool* AsgPhotonEfficiencyCorrectionTool::m_rootTool_con
private

Definition at line 98 of file AsgPhotonEfficiencyCorrectionTool.h.

◆ m_rootTool_unc

Root::TElectronEfficiencyCorrectionTool* AsgPhotonEfficiencyCorrectionTool::m_rootTool_unc
private

Pointer to the underlying ROOT based tool.

Definition at line 97 of file AsgPhotonEfficiencyCorrectionTool.h.

◆ m_sysSubstring

std::string AsgPhotonEfficiencyCorrectionTool::m_sysSubstring
private

Definition at line 107 of file AsgPhotonEfficiencyCorrectionTool.h.

◆ m_systFilter

std::unordered_map<CP::SystematicSet, CP::SystematicSet> AsgPhotonEfficiencyCorrectionTool::m_systFilter
private

Systematics filter map.

Definition at line 101 of file AsgPhotonEfficiencyCorrectionTool.h.

◆ m_trigger

std::string AsgPhotonEfficiencyCorrectionTool::m_trigger
private

Trigger name for trigger SF.

Definition at line 137 of file AsgPhotonEfficiencyCorrectionTool.h.

◆ m_useRandomRunNumber

bool AsgPhotonEfficiencyCorrectionTool::m_useRandomRunNumber
private

Definition at line 146 of file AsgPhotonEfficiencyCorrectionTool.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
python.Dso.registry
registry
Definition: Control/AthenaServices/python/Dso.py:158
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:330
AsgPhotonEfficiencyCorrectionTool::m_dataTypeOverwrite
int m_dataTypeOverwrite
Force the data type to a given value.
Definition: AsgPhotonEfficiencyCorrectionTool.h:131
et
Extra patterns decribing particle interation process.
CP::SystematicVariation::CONTINUOUS
@ CONTINUOUS
Definition: SystematicVariation.h:79
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:378
get_generator_info.result
result
Definition: get_generator_info.py:21
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:407
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
ParticleDataType::Data
@ Data
Definition: Event/EventKernel/EventKernel/IParticle.h:36
AsgPhotonEfficiencyCorrectionTool::m_defaultRandomRunNumber
int m_defaultRandomRunNumber
Definition: AsgPhotonEfficiencyCorrectionTool.h:147
AsgPhotonEfficiencyCorrectionTool::m_pteta_bins
std::map< float, std::vector< float > > m_pteta_bins
Definition: AsgPhotonEfficiencyCorrectionTool.h:143
AsgPhotonEfficiencyCorrectionTool::m_useRandomRunNumber
bool m_useRandomRunNumber
Definition: AsgPhotonEfficiencyCorrectionTool.h:146
AsgPhotonEfficiencyCorrectionTool::m_file_prefix_ID
std::string m_file_prefix_ID
Definition: AsgPhotonEfficiencyCorrectionTool.h:113
MAXETA
#define MAXETA
Definition: AsgPhotonEfficiencyCorrectionTool.cxx:33
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition: SystematicSet.h:31
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
downloadSingle.dataType
string dataType
Definition: downloadSingle.py:18
AsgPhotonEfficiencyCorrectionTool::m_file_prefix_TrigEff
std::string m_file_prefix_TrigEff
Definition: AsgPhotonEfficiencyCorrectionTool.h:116
athena.value
value
Definition: athena.py:124
AsgPhotonEfficiencyCorrectionTool::getFileName
std::string getFileName(const std::string &isoWP, const std::string &trigWP, bool isConv)
Definition: AsgPhotonEfficiencyCorrectionTool.cxx:436
AsgPhotonEfficiencyCorrectionTool::m_rootTool_unc
Root::TElectronEfficiencyCorrectionTool * m_rootTool_unc
Pointer to the underlying ROOT based tool.
Definition: AsgPhotonEfficiencyCorrectionTool.h:97
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
CP::SystematicVariation
Definition: SystematicVariation.h:47
CP::SystematicSet::getParameterByBaseName
float getParameterByBaseName(const std::string &basename) const
returns: the parameter value for the given basename
Definition: SystematicSet.cxx:193
python.DataFormatRates.events
events
Definition: DataFormatRates.py:105
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
AsgPhotonEfficiencyCorrectionTool::m_accessors
std::unique_ptr< Accessors > m_accessors
Definition: AsgPhotonEfficiencyCorrectionTool.h:180
PATCore::ParticleDataType::DataType
DataType
Definition: PATCoreEnums.h:22
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
AsgPhotonEfficiencyCorrectionTool::m_file_prefix_ISO
std::string m_file_prefix_ISO
Definition: AsgPhotonEfficiencyCorrectionTool.h:114
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
CP::CorrectionCode::ErrorCode
ErrorCode
Possible values for the correction code.
Definition: CorrectionCode.h:35
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
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
asg::AsgTool::AsgTool
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition: AsgTool.cxx:58
CP::CorrectionCode::Error
@ Error
Some error happened during the object correction.
Definition: CorrectionCode.h:36
histSizes.code
code
Definition: histSizes.py:129
AsgPhotonEfficiencyCorrectionTool::m_isoWP
std::string m_isoWP
Isolation working point.
Definition: AsgPhotonEfficiencyCorrectionTool.h:134
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
AthCommonDataStore
Definition: AthCommonDataStore.h:52
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
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:59
AsgPhotonEfficiencyCorrectionTool::m_resultName
std::string m_resultName
The string for the result.
Definition: AsgPhotonEfficiencyCorrectionTool.h:128
AsgPhotonEfficiencyCorrectionTool::m_resultPrefix
std::string m_resultPrefix
The prefix string for the result.
Definition: AsgPhotonEfficiencyCorrectionTool.h:125
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:296
lumiFormat.i
int i
Definition: lumiFormat.py:85
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition: AthCommonDataStore.h:145
AsgPhotonEfficiencyCorrectionTool::m_allowMissingLinks
Gaudi::Property< bool > m_allowMissingLinks
Definition: AsgPhotonEfficiencyCorrectionTool.h:152
CalibDbCompareRT.dummy
dummy
Definition: CalibDbCompareRT.py:59
asg::AsgMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AsgMessaging.cxx:49
AthenaPoolTestRead.acc
acc
Definition: AthenaPoolTestRead.py:16
MSG::name
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition: MsgLevel.cxx:19
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
AsgPhotonEfficiencyCorrectionTool::m_systFilter
std::unordered_map< CP::SystematicSet, CP::SystematicSet > m_systFilter
Systematics filter map.
Definition: AsgPhotonEfficiencyCorrectionTool.h:101
AsgPhotonEfficiencyCorrectionTool::m_file_prefix_Trig
std::string m_file_prefix_Trig
Definition: AsgPhotonEfficiencyCorrectionTool.h:115
Root::TElectronEfficiencyCorrectionTool
Definition: TElectronEfficiencyCorrectionTool.h:36
AsgPhotonEfficiencyCorrectionTool::callSingleEvent
void callSingleEvent(columnar::EgammaRange photons, columnar::EventInfoId event) const
Definition: AsgPhotonEfficiencyCorrectionTool.cxx:479
DeMoScan.runnumber
runnumber
Definition: DeMoScan.py:264
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
Root::TElectronEfficiencyCorrectionTool::initialize
int initialize()
Initialize this class.
Definition: TElectronEfficiencyCorrectionTool.cxx:87
columnar::ObjectId
a class representing a single object (electron, muons, etc.)
Definition: ContainerId.h:176
AsgPhotonEfficiencyCorrectionTool::m_mapFile
std::string m_mapFile
map filename
Definition: AsgPhotonEfficiencyCorrectionTool.h:140
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
AsgPhotonEfficiencyCorrectionTool::registerSystematics
StatusCode registerSystematics()
Register the systematics with the registry and add them to the recommended list.
Definition: AsgPhotonEfficiencyCorrectionTool.cxx:389
CP::SystematicSet::insert
void insert(const SystematicVariation &systematic)
description: insert a systematic into the set
Definition: SystematicSet.cxx:88
Result
Definition: fbtTestBasics.cxx:50
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
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:283
AsgPhotonEfficiencyCorrectionTool::m_corrFileNameUnconv
std::string m_corrFileNameUnconv
Definition: AsgPhotonEfficiencyCorrectionTool.h:122
AsgPhotonEfficiencyCorrectionTool::m_rootTool_con
Root::TElectronEfficiencyCorrectionTool * m_rootTool_con
Definition: AsgPhotonEfficiencyCorrectionTool.h:98
AsgPhotonEfficiencyCorrectionTool::appliedSystematics
const CP::SystematicSet & appliedSystematics() const
returns: the currently applied systematics
Definition: AsgPhotonEfficiencyCorrectionTool.h:80
CP::CorrectionCode::Ok
@ Ok
The correction was done successfully.
Definition: CorrectionCode.h:38
xAOD::photon
@ photon
Definition: TrackingPrimitives.h:200
a
TList * a
Definition: liststreamerinfos.cxx:10
AsgPhotonEfficiencyCorrectionTool::m_appliedSystematics
CP::SystematicSet * m_appliedSystematics
Currently applied systematics.
Definition: AsgPhotonEfficiencyCorrectionTool.h:104
h
mapkey::sf
@ sf
Definition: TElectronEfficiencyCorrectionTool.cxx:38
AsgPhotonEfficiencyCorrectionTool::m_trigger
std::string m_trigger
Trigger name for trigger SF.
Definition: AsgPhotonEfficiencyCorrectionTool.h:137
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:546
DeMoScan.first
bool first
Definition: DeMoScan.py:534
AsgPhotonEfficiencyCorrectionTool::calculate
CP::CorrectionCode calculate(columnar::EgammaId egam, columnar::EventInfoId eventInfo, Result &result) const
I think these calculate methods are only used internally.
Definition: AsgPhotonEfficiencyCorrectionTool.cxx:181
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
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:23
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:629
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:801
merge.status
status
Definition: merge.py:16
AsgPhotonEfficiencyCorrectionTool::m_sysSubstring
std::string m_sysSubstring
Definition: AsgPhotonEfficiencyCorrectionTool.h:107
AsgPhotonEfficiencyCorrectionTool::m_corrFileNameConv
std::string m_corrFileNameConv
The list of input file names.
Definition: AsgPhotonEfficiencyCorrectionTool.h:121
AsgPhotonEfficiencyCorrectionTool::m_removeTRTConversion
bool m_removeTRTConversion
Definition: AsgPhotonEfficiencyCorrectionTool.h:150
SG::DataProxy
Definition: DataProxy.h:45
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:160
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
fitman.k
k
Definition: fitman.py:528
CP::SystematicRegistry::getInstance
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.
Definition: SystematicRegistry.cxx:25