ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
CP::ElectronChargeEfficiencyCorrectionTool Class Referencefinalabstract

#include <ElectronChargeEfficiencyCorrectionTool.h>

Inheritance diagram for CP::ElectronChargeEfficiencyCorrectionTool:
Collaboration diagram for CP::ElectronChargeEfficiencyCorrectionTool:

Public Member Functions

virtual StatusCode initialize () override final
 Gaudi Service Interface method implementations. More...
 
virtual CP::CorrectionCode getEfficiencyScaleFactor (const xAOD::Electron &inputObject, double &sf) const override final
 Retrieve the Scale factor. More...
 
virtual CP::CorrectionCode applyEfficiencyScaleFactor (const xAOD::Electron &inputObject) const override final
 Decorate the electron. More...
 
virtual bool isAffectedBySystematic (const SystematicVariation &systematic) const override final
 Returns whether this tool is affected by the given systematics. More...
 
virtual SystematicSet affectingSystematics () const override final
 Returns the list of all systematics this tool can be affected by. More...
 
virtual CP::SystematicSet recommendedSystematics () const override final
 Returns the list of all systematics this tool recommends to use. More...
 
virtual StatusCode applySystematicVariation (const SystematicSet &systConfig) override final
 effects: configure this tool for the given list of systematic variations. More...
 
virtual const CP::SystematicSetappliedSystematics () const override final
 returns: the currently applied systematics More...
 
virtual int systUncorrVariationIndex (const xAOD::Electron &) const override final
 
virtual CP::CorrectionCode getEfficiencyScaleFactor (const double, const double, const unsigned int, double &) const override final
 
virtual int getNumberOfToys () const override final
 
virtual void printCorrelationModels () const override final
 print available/implemented correlation models More...
 
virtual void print () const =0
 Print the state of the tool. More...
 
virtual void print () const
 Print the state of the tool. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

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 ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

virtual ASG_TOOL_CLASS(ElectronChargeEfficiencyCorrectionTool, IAsgElectronEfficiencyCorrectionTool) public ~ElectronChargeEfficiencyCorrectionTool ()
 Standard destructor. More...
 
StatusCode registerSystematics ()
 
float getChargeFlipRate (double eta, double pt, TH2 *hrates, double &flipRate) const
 Get the charge flip rate rate given pt, eta, histogram. More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

int m_dataTypeOverwrite
 Force the data type to a given value. More...
 
std::string m_eventInfoCollectionName
 The Event info collection name. More...
 
std::map< std::string, std::vector< TH2 * > > m_SF_SS
 Histogram that holds the correction rates for Monte Carlo. More...
 
std::map< std::string, std::vector< TH2 * > > m_SF_OS
 
std::vector< unsigned int > m_RunNumbers
 
bool m_useRandomRunNumber
 
unsigned int m_defaultRandomRunNumber
 
std::string m_filename
 The name of the input file that contains the histograms. More...
 
std::string m_workingPoint
 The name of the folder defining the LH/iso working point. More...
 
double m_eta_lowlimit
 Lower limit of eta range where corrections are available; taken from histogram. More...
 
double m_eta_uplimit
 Upper limit of eta range where corrections are available; taken from histogram. More...
 
double m_pt_lowlimit
 Lower limit of pt range where corrections are available; taken from histogram. More...
 
double m_pt_uplimit
 Upper limit of pt range where corrections are available; taken from histogram. More...
 
float m_gevmev
 Factor for GeV <-> MeV switching. More...
 
std::vector< std::string > m_systematics
 
std::map< CP::SystematicSet, CP::SystematicSetm_filtered_sys_sets
 
CP::SystematicSet m_mySysConf
 
CP::SystematicSet m_affectingSys
 
CP::SystematicSetm_appliedSystematics
 Currently applied systematics. More...
 
std::string m_sf_decoration_name
 Decorator. More...
 
SG::AuxElement::Decorator< float > * m_sfDec
 
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 26 of file ElectronChargeEfficiencyCorrectionTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ ~ElectronChargeEfficiencyCorrectionTool()

ElectronChargeEfficiencyCorrectionTool::~ElectronChargeEfficiencyCorrectionTool ( )
privatevirtual

Standard destructor.

Definition at line 77 of file ElectronChargeEfficiencyCorrectionTool.cxx.

79 {
80  if (m_sfDec)
81  delete m_sfDec;
82 }

Member Function Documentation

◆ affectingSystematics()

CP::SystematicSet ElectronChargeEfficiencyCorrectionTool::affectingSystematics ( ) const
finaloverridevirtual

Returns the list of all systematics this tool can be affected by.

Implements CP::IReentrantSystematicsTool.

Definition at line 633 of file ElectronChargeEfficiencyCorrectionTool.cxx.

634 {
636  result.insert(SystematicVariation("EL_CHARGEID_STAT", 1));
637  result.insert(SystematicVariation("EL_CHARGEID_STAT", -1));
638 
639  for (unsigned int i = 0; i < m_systematics.size(); i++) {
640  result.insert(SystematicVariation(
641  Form("EL_CHARGEID_SYS%s", m_systematics.at(i).c_str()), 1));
642  result.insert(SystematicVariation(
643  Form("EL_CHARGEID_SYS%s", m_systematics.at(i).c_str()), -1));
644  }
645  return result;
646 }

◆ appliedSystematics()

virtual const CP::SystematicSet& CP::ElectronChargeEfficiencyCorrectionTool::appliedSystematics ( ) const
inlinefinaloverridevirtual

returns: the currently applied systematics

Implements IAsgElectronEfficiencyCorrectionTool.

Definition at line 68 of file ElectronChargeEfficiencyCorrectionTool.h.

69  {
70  return *m_appliedSystematics;
71  }

◆ applyEfficiencyScaleFactor()

CP::CorrectionCode ElectronChargeEfficiencyCorrectionTool::applyEfficiencyScaleFactor ( const xAOD::Electron inputObject) const
finaloverridevirtual

Decorate the electron.

Implements IAsgElectronEfficiencyCorrectionTool.

Definition at line 581 of file ElectronChargeEfficiencyCorrectionTool.cxx.

583 {
585  "In "
586  "CP::ElectronChargeEfficiencyCorrectionTool::applyEfficiencyScaleFactor("
587  "const xAOD::IParticle& part) const");
588  double sf = 0.0;
590  // Decorate the electron
591  (*m_sfDec)(part) = static_cast<float>(sf);
592  return result;
593 }

◆ applySystematicVariation()

StatusCode ElectronChargeEfficiencyCorrectionTool::applySystematicVariation ( const SystematicSet systConfig)
finaloverridevirtual

effects: configure this tool for the given list of systematic variations.

any requested systematics that are not affecting this tool will be silently ignored (unless they cause other errors). failures: systematic unknown failures: requesting multiple variations on the same systematic (e.g. up & down) failures: requesting an unsupported variation on an otherwise supported systematic (e.g. a 2 sigma variation and the tool only supports 1 sigma variations) failures: unsupported combination of supported systematic failures: other tool specific errors

Implements CP::ISystematicsTool.

Definition at line 660 of file ElectronChargeEfficiencyCorrectionTool.cxx.

662 {
663 
665  systConfig, m_affectingSys, m_mySysConf)) {
667  "Unsupported combination of systematics passed to the tool! ");
668  return StatusCode::FAILURE;
669  }
670 
671  return StatusCode::SUCCESS;
672 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  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 > &  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 > &  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 > &  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 > &  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

◆ getChargeFlipRate()

float ElectronChargeEfficiencyCorrectionTool::getChargeFlipRate ( double  eta,
double  pt,
TH2 hrates,
double &  flipRate 
) const
private

Get the charge flip rate rate given pt, eta, histogram.

Definition at line 597 of file ElectronChargeEfficiencyCorrectionTool.cxx.

602 {
603  ATH_MSG_VERBOSE(" -> in: getChargeFlipRate(" << pt << ", " << eta
604  << " TH2, double&)");
605 
606  if (pt > m_pt_uplimit)
607  pt = m_pt_uplimit * 0.999;
608 
609  int bin2D = hrates->FindBin(pt, eta);
610  flipRate = hrates->GetBinContent(bin2D);
611 
612  ATH_MSG_VERBOSE(" -> flipRate is " << flipRate << ", for histogram "
613  << hrates->GetName());
614 
615  return 0;
616 }

◆ getEfficiencyScaleFactor() [1/2]

virtual CP::CorrectionCode CP::ElectronChargeEfficiencyCorrectionTool::getEfficiencyScaleFactor ( const double  ,
const double  ,
const unsigned int  ,
double &   
) const
inlinefinaloverridevirtual

Implements IAsgElectronEfficiencyCorrectionTool.

Definition at line 81 of file ElectronChargeEfficiencyCorrectionTool.h.

83  {
85  "No toysimplemented in "
86  "ElectronChargeEfficiencyCorrectionTool");
88  }

◆ getEfficiencyScaleFactor() [2/2]

CP::CorrectionCode ElectronChargeEfficiencyCorrectionTool::getEfficiencyScaleFactor ( const xAOD::Electron inputObject,
double &  sf 
) const
finaloverridevirtual

Retrieve the Scale factor.

STAT

STAT

Implements IAsgElectronEfficiencyCorrectionTool.

Definition at line 342 of file ElectronChargeEfficiencyCorrectionTool.cxx.

345 {
346 
347  // initialize the SF at 1
348  sf = 1.0;
349 
350  // checking on the truth electron: up to now if this is not a good ele it's
351  // returning
352  bool goodEle = false;
353  CP::CorrectionCode goodEle_result =
354  ElectronEfficiencyHelpers::isGoodEle( ele, goodEle);
355  if (goodEle_result != CP::CorrectionCode::Ok) {
356  sf = -999.0;
357  ATH_MSG_DEBUG("This is the check of goodeleCC in getscalefactor. Scale "
358  "factor set to -999");
359  return goodEle_result;
360  }
361 
362  if (!goodEle) {
363  // electron is background electron and should not be corrected
364  return CP::CorrectionCode::Ok;
365  ATH_MSG_DEBUG("Here goodele is false but CC ok");
366  }
367 
368  // taking reconstructed variables
369  int reco_ele_charge = ele.charge();
370  const double ele_pt = ele.pt() * m_gevmev;
371  const double ele_eta = std::abs(ele.caloCluster()->etaBE(2));
372 
373  // getting the truth charge
374  int truth_ele_charge = 9999;
375  CP::CorrectionCode charge_result =
376  ElectronEfficiencyHelpers::getEleTruthCharge( ele, truth_ele_charge);
377  if (charge_result != CP::CorrectionCode::Ok) {
378  sf = -9999.0;
379  ATH_MSG_VERBOSE("This is check of geteletruthchargeCC in getscalefactor. "
380  "Scale factor set to -9999");
381  return charge_result;
382  }
383 
384  if (truth_ele_charge == 0) {
385  ATH_MSG_DEBUG("Here truth charge is =0!!");
386  return CP::CorrectionCode::Ok;
387  }
388 
389  ATH_MSG_DEBUG("Reco charge = " << reco_ele_charge
390  << "; Truth charge = " << truth_ele_charge);
391 
392  // getting the rates from file....
393  float retVal(0.0);
394 
396  // here determine, WHICH of the [histid] to choose (after cuuts on runnumber
397  // etc....)
398  std::string cutRunNumber = "all";
399 
400  if (!m_RunNumbers.empty()) {
401  unsigned int runnumber = m_defaultRandomRunNumber;
402  ATH_MSG_DEBUG("RandomRunNumber: " << runnumber << " "
404  if (m_useRandomRunNumber) {
405  const xAOD::EventInfo* eventInfo =
407  if (!eventInfo) {
408  ATH_MSG_ERROR("Could not retrieve EventInfo object!");
409  sf = 1.0;
411  }
412  static const SG::AuxElement::Accessor<unsigned int> randomrunnumber(
413  "RandomRunNumber");
414  if (!randomrunnumber.isAvailable(*eventInfo)) {
415  sf = 1.0;
417  "Pileup tool not run before using ElectronEfficiencyTool! SFs do not "
418  "reflect PU distribution in data");
420  }
421  runnumber = randomrunnumber(*(eventInfo));
422  }
423  ATH_MSG_DEBUG("Number of RunNumbers in file: " << m_RunNumbers.size());
424  for (std::size_t r = 0; r < m_RunNumbers.size(); r++) {
425  ATH_MSG_DEBUG( " - " << m_RunNumbers.at(r));
426  }
427  ATH_MSG_VERBOSE("DONE");
428 
429  bool isInRunNumberRange = false;
430  for ( std::size_t r=0; r<m_RunNumbers.size()-1; r+=2 ){
431  // increment by two, run numbers always come in pairs (upper and lower bound specified in the histogram name)
432 
433  if ( runnumber >= (unsigned int)m_RunNumbers.at(r) &&
434  runnumber <= (unsigned int)m_RunNumbers.at(r+1) ) {
435  cutRunNumber.clear();
436  cutRunNumber =
437  Form("RunNumber%d_%d", m_RunNumbers.at(r), m_RunNumbers.at(r + 1));
438  ATH_MSG_DEBUG("Random run number lies in range " << m_RunNumbers.at(r) << " " << m_RunNumbers.at(r+1));
439  isInRunNumberRange = true;
440  }
441  }
442 
443  if (runnumber < m_RunNumbers.at(0) ||
444  (runnumber > m_RunNumbers.at(m_RunNumbers.size() - 1))) {
445  ATH_MSG_DEBUG("RunNumber " << runnumber << " is not in valid RunNumber Range ");
446  sf = 1.0;
448  }
449 
450  if ( !isInRunNumberRange ) {
452  }
453  }
454 
455  // check if electron is within recommendations in eta/Et
456  if ( ele_eta < m_eta_lowlimit || ele_eta > m_eta_uplimit ) {
457 
458  ATH_MSG_DEBUG("Got an electron outside of the range of eta validity " << ele_eta);
460  }
461 
462  if ( ele_pt < m_pt_lowlimit ) {
463 
464  ATH_MSG_DEBUG("Got an electron outside of the range of pt validity: pt lower than lower limit");
466  }
467 
468  // Determine WHICH histograms to use here
469  const std::vector<TH2*>& SShistograms = m_SF_SS.at(cutRunNumber.c_str());
470  const std::vector<TH2*>& OShistograms = m_SF_OS.at(cutRunNumber.c_str());
471 
472  // here check OS or SS
473  bool isOS = false;
474 
475  if (truth_ele_charge * reco_ele_charge > 0)
476  isOS = true;
477 
478  if (isOS) {
479  retVal = this->getChargeFlipRate(ele_eta, ele_pt, OShistograms.at(0), sf);
480  if (retVal != 0) {
481  sf = -9999.0;
483  }
484  } else {
485  ATH_MSG_DEBUG("Get SS his");
486  retVal = this->getChargeFlipRate(ele_eta, ele_pt, SShistograms.at(0), sf);
487  if (retVal != 0) {
488  sf = -9999.0;
490  }
491  }
492 
493  ATH_MSG_DEBUG("eta: " << ele_eta << " pt: " << ele_pt);
494  ATH_MSG_DEBUG("SF Rates---- . SF: " << sf);
495 
496  // Systematics
497  // ------------------------------------------------------------------------------------------------------
498  double val_stat;
499 
501  if (isOS) {
502  retVal =
503  this->getChargeFlipRate(ele_eta, ele_pt, OShistograms.at(1), val_stat);
504  if (retVal != 0) {
505  sf = -9999.0;
507  }
508  } else {
509  ATH_MSG_DEBUG("Get SS his");
510  retVal =
511  this->getChargeFlipRate(ele_eta, ele_pt, SShistograms.at(1), val_stat);
512  if (retVal != 0) {
513  sf = -9999.0;
515  }
516  }
517 
518  std::vector<float> systs;
519  double val_sys{ 0.0 };
521  for (unsigned int s = 2; s < OShistograms.size(); s++) {
522  if (isOS) {
523  retVal =
524  this->getChargeFlipRate(ele_eta, ele_pt, OShistograms.at(s), val_sys);
525  if (retVal != 0) {
526  val_sys = -9999.0;
528  }
529  } else {
530  ATH_MSG_DEBUG("Get SS his");
531  retVal =
532  this->getChargeFlipRate(ele_eta, ele_pt, SShistograms.at(s), val_sys);
533  if (retVal != 0) {
534  val_sys = -9999.0;
536  }
537  }
538  systs.push_back(static_cast<float>(val_sys));
539  }
540 
541  ATH_MSG_DEBUG(" ... nominal SF: " << sf);
542 
543  if (m_mySysConf.empty()) {
544  ATH_MSG_DEBUG(" ... nominal SF: " << sf);
545  } else if (*(m_mySysConf.begin()) ==
546  SystematicVariation("EL_CHARGEID_STAT", 1)) {
547  sf = (sf + (val_stat));
548  ATH_MSG_DEBUG("SF after STATup = " << sf);
549  } else if (*(m_mySysConf.begin()) ==
550  SystematicVariation("EL_CHARGEID_STAT", -1)) {
551  sf = (sf - (val_stat));
552  ATH_MSG_DEBUG("SF after STATdown = " << sf);
553  } else {
554 
555  for (unsigned int i = 0; i < m_systematics.size(); i++) {
556  if (*(m_mySysConf.begin()) ==
557  SystematicVariation(
558  Form("EL_CHARGEID_SYS%s", m_systematics.at(i).c_str()), 1)) {
559  sf = (sf + (val_sys));
560  ATH_MSG_DEBUG("SF after SYSup = " << sf);
561  }
562 
563  if (*(m_mySysConf.begin()) ==
564  SystematicVariation(
565  Form("EL_CHARGEID_SYS%s", m_systematics.at(i).c_str()), -1)) {
566  sf = (sf - (val_sys));
567  ATH_MSG_DEBUG("SF after SYSdown = " << sf);
568  }
569  }
570 
571  }
572 
573  return CP::CorrectionCode::Ok;
574 }

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

◆ getNumberOfToys()

virtual int CP::ElectronChargeEfficiencyCorrectionTool::getNumberOfToys ( ) const
inlinefinaloverridevirtual

Implements IAsgElectronEfficiencyCorrectionTool.

Definition at line 90 of file ElectronChargeEfficiencyCorrectionTool.h.

91  {
93  "No toysimplemented in "
94  "ElectronChargeEfficiencyCorrectionTool");
95  return -1;
96  };

◆ getProperty()

template<class T >
const T* asg::AsgTool::getProperty ( const std::string &  name) const
inherited

Get one of the tool's properties.

◆ initialize()

StatusCode ElectronChargeEfficiencyCorrectionTool::initialize ( )
finaloverridevirtual

Gaudi Service Interface method implementations.

STAT ERROR

STAT ERROR

end // if ( name.find(Form("SYST") ) != std::string::npos)

here: need to use iterator over map!!!

Reimplemented from asg::AsgTool.

Definition at line 88 of file ElectronChargeEfficiencyCorrectionTool.cxx.

89 {
90  ATH_MSG_DEBUG("initializing");
91 
92  // initialize the random number generator (used in case of charge flip
93  // approach)
94  // m_Rndm = new TRandom3(1);
95 
96  if (m_sfDec)
97  delete m_sfDec;
99 
100  // Resolve the path to the input file for the charge flip rates
101  const std::string rootfilename = PathResolverFindCalibFile(m_filename);
102  if (m_filename.empty()) {
103  ATH_MSG_ERROR(" PathResolver was not able to find the file ... aborting");
104  return StatusCode::FAILURE;
105  }
106 
107  // Getting the root file and histograms
108  TFile* rootFile = TFile::Open(rootfilename.c_str());
109 
110  // protection against bad file
111  if (rootFile == nullptr) {
112  ATH_MSG_ERROR(" Was not able to open file: " << rootfilename
113  << " ...... aborting");
114  return StatusCode::FAILURE;
115  }
116 
118  //
119  // explanation: attempt to loop generally over a file
120  // -- if certain SINGALWORD is present -- then this is taken as a signal,
121  // that this is another dimension... can be dynamically added.
122  // e.g.
123  // SFSyst<number>_RunNumber<minRN>-<maxRN>_Nvtx<minNvtx>-<maxNvtx>
124  // SFStat_RunNumber<minRN>-<maxRN>_Nvtx<minNvtx>-<maxNvtx>
125  // SFCentral_RunNumber<minRN>-<maxRN>_Nvtx<minNvtx>-<maxNvtx>
126 
127  // Then can create a key that will dynamically give us access to a map:
128  // std::map<std::string key, std::vector<TH2 *>> m_SF_SS; // keys (e.g.
129  // RunNumber223333_319200_Nvtx0_10_Phi1.5_1.6) mapping to vector of SF
130  // histograms --> vector m_SF: 0=nominal, 1=stat, 2,3,4...n=syst
131  // std::map<std::string key, std::vector<TH2 *>> m_SF_OS; // keys
132  // (e.g. RunNumber223333_319200_Nvtx0_10_Phi1.5_1.6) mapping to vector of
133  // SF histograms --> vector m_SF: 0=nominal, 1=stat, 2,3,4...n=syst
134  // TFile* data/ChMisIDSF_TightLL_FixedCutTight.root
135  // KEY: TH2F SFCentral_RunNumber296939_311481_SS;1
136  // SFCentral_RunNumber296939_311481_SS KEY: TH2F
137  // SFCentral_RunNumber296939_311481_OS;1 SFCentral_RunNumber296939_311481_OS
138  // KEY: TH2F STAT_RunNumber296939_311481_SS;1
139  // STAT_RunNumber296939_311481_SS KEY: TH2F STAT_RunNumber296939_311481_OS;1
140  // STAT_RunNumber296939_311481_OS KEY: TH2F
141  // SYST_RunNumber296939_311481_total_SS;1 SYST_RunNumber296939_311481_SS:
142  // total KEY: TH2F SYST_RunNumber296939_311481_total_OS;1
143  // SYST_RunNumber296939_311481_OS: total
144 
145  m_SF_SS.clear();
146  m_SF_OS.clear();
147  TList* keyListfolder = rootFile->GetListOfKeys();
148  std::vector<std::string> names;
149  std::set<std::string> set_systematics;
150 
151  names.reserve(keyListfolder->GetEntries());
152  for (int j = 0; j < keyListfolder->GetEntries(); j++) {
153  names.emplace_back((keyListfolder->At(j)->GetName()));
154  }
155  std::sort(names.begin(), names.end());
156 
157  for (unsigned int j = 0; j < names.size(); j++) {
158 
159  std::string name = names.at(j);
160  ATH_MSG_DEBUG("Got ROOT object with name: " << name);
161  if (name.find(Form("SFCentral_")) != std::string::npos) {
162  ATH_MSG_VERBOSE("Found name 'SFCentral_' in ROOT object name");
163  // Check for opposite-sign (=opposite-charge)
164  bool isOS = false;
165  if (name.find(Form("_OS")) != std::string::npos) {
166  isOS = true;
167  ATH_MSG_VERBOSE("Found name '_OS' in ROOT object name");
168  }
169  if (isOS) {
170  std::string histid = (names.at(j));
171  histid.erase(0, 10);
172  histid.erase(histid.size() - 3, 3); // remove _SS, _OS
173  ATH_MSG_VERBOSE("Using histid: " << histid);
174 
175  if (histid.find("RunNumber") != std::string::npos) {
176  ATH_MSG_VERBOSE("Found name 'RunNumber' in histid");
177  std::string runlow = histid;
178  runlow.erase(histid.find(Form("RunNumber")), 9);
179  runlow.erase(runlow.find('_'), runlow.size());
180  m_RunNumbers.push_back(
181  static_cast<unsigned int>(atoi(runlow.c_str())));
182  std::string runhigh = histid;
183  runhigh.erase(histid.find(Form("RunNumber")), 9);
184  runhigh.erase(0, runhigh.find('_') + 1);
185  m_RunNumbers.push_back(
186  static_cast<unsigned int>(atoi(runhigh.c_str())));
187  }
188  ATH_MSG_VERBOSE("Using histid (OS hid): " << histid);
189  m_SF_OS[histid].push_back((TH2*)rootFile->Get(names.at(j).c_str()));
190  } else {
191  std::string histid = (names.at(j));
192  histid.erase(0, 10);
193  histid.erase(histid.size() - 3, 3); // remove _SS, _OS
194  ATH_MSG_VERBOSE("Using histid (do we this in ? SS): " << histid);
195  m_SF_SS[histid].push_back((TH2*)rootFile->Get(names.at(j).c_str()));
196  }
197  }
198 
200  if (name.find(Form("STAT_")) != std::string::npos) {
201  ATH_MSG_VERBOSE("Found name 'STAT_' in ROOT object name");
202  bool isOS = false;
203  if (name.find(Form("_OS")) != std::string::npos) {
204  isOS = true;
205  ATH_MSG_VERBOSE("Found name '_OS' in ROOT object name");
206  }
207  if (isOS) {
208  std::string histid = (names.at(j));
209  histid.erase(0, 5);
210  histid.erase(histid.size() - 3, 3); // remove _SS, _OS
211  ATH_MSG_VERBOSE("Using histid: " << histid);
212 
213  if (histid.find("RunNumber") != std::string::npos) {
214  ATH_MSG_VERBOSE("Found name 'RunNumber' in histid");
215  std::string runlow = histid;
216  runlow.erase(histid.find(Form("RunNumber")), 9);
217  runlow.erase(runlow.find('_'), runlow.size());
218  // m_RunNumbers.push_back( static_cast<unsigned
219  // int>(atoi(runlow.c_str())) );
220  std::string runhigh = histid;
221  runhigh.erase(histid.find(Form("RunNumber")), 9);
222  runhigh.erase(0, runhigh.find('_') + 1);
223  // m_RunNumbers.push_back( static_cast<unsigned
224  // int>(atoi(runhigh.c_str())) );
225  }
226  ATH_MSG_VERBOSE("Using histid (OS hid): " << histid);
227  m_SF_OS[histid].push_back((TH2*)rootFile->Get(names.at(j).c_str()));
228  } else {
229  std::string histid = (names.at(j));
230  ATH_MSG_VERBOSE("Found histid: " << histid);
231  histid.erase(0, 5);
232  histid.erase(histid.size() - 3, 3); // remove _SS, _OS
233  ATH_MSG_VERBOSE("Using histid (do we this in ? SS): " << histid);
234  m_SF_SS[histid].push_back((TH2*)rootFile->Get(names.at(j).c_str()));
235  }
236 
237  }
238 
240  if (name.find(Form("SYST")) != std::string::npos) {
241  ATH_MSG_VERBOSE("Found name 'SYST' in ROOT object name");
242  bool isOS = false;
243  if (name.find(Form("_OS")) != std::string::npos) {
244  isOS = true;
245  ATH_MSG_VERBOSE("Found name '_OS' in ROOT object name");
246  }
247  if (isOS) {
248  std::string histid = (names.at(j));
249  histid.erase(0, 4);
250  histid.erase(histid.size() - 3, 3); // remove _SS, _OS
251 
252  std::string sysname = histid;
253  sysname.erase(sysname.find('_'), sysname.size());
254  set_systematics.insert(sysname);
255 
256  histid.erase(0, histid.find('_') + 1); // remove _SS, _OS
257  ATH_MSG_VERBOSE("Using syst histid: " << histid);
258 
259  if (histid.find("RunNumber") != std::string::npos) {
260  std::string runlow = histid;
261  runlow.erase(histid.find(Form("RunNumber")), 9);
262  runlow.erase(runlow.find('_'), runlow.size());
263  // m_RunNumbers.push_back( static_cast<unsigned
264  // int>(atoi(runlow.c_str())) );
265  std::string runhigh = histid;
266  runhigh.erase(histid.find(Form("RunNumber")), 9);
267  runhigh.erase(0, runhigh.find('_') + 1);
268  // m_RunNumbers.push_back( static_cast<unsigned
269  // int>(atoi(runhigh.c_str())) );
270  }
271  ATH_MSG_VERBOSE("Using histid (OS hid): " << histid);
272  m_SF_OS[histid].push_back((TH2*)rootFile->Get(names.at(j).c_str()));
273  } else {
274  std::string histid = (names.at(j));
275  histid.erase(0, 4);
276  histid.erase(histid.size() - 3, 3); // remove _SS, _OS
277  histid.erase(0, histid.find('_') + 1); // remove _SS, _OS
278  ATH_MSG_VERBOSE("Using histid (sys ? SS): " << histid);
279  m_SF_SS[histid].push_back((TH2*)rootFile->Get(names.at(j).c_str()));
280  }
281 
282  }
283  }
284 
286 
287  if (m_SF_OS.empty() || m_SF_SS.empty() || m_SF_SS.size() != m_SF_OS.size()) {
289  "OS/SS SF vectors not filled or of different size. -- Problem with "
290  "files. -- Report to <hn-atlas-EGammaWG@cern.ch>");
291  return StatusCode::FAILURE;
292  }
293 
294  m_systematics.insert(m_systematics.end(), set_systematics.begin(), set_systematics.end());
295 
296  std::sort(m_RunNumbers.begin(), m_RunNumbers.end());
298  // Determine the limits of validity
299 
301  ATH_MSG_DEBUG("Having m_SF_OS.size() = " << m_SF_OS.size());
302  std::map<std::string, std::vector<TH2*>>::iterator it = m_SF_OS.begin();
303 
304  // Get the kinematic limits
305  m_eta_lowlimit = (*it).second.at(0)->GetYaxis()->GetXmin();
306  m_eta_uplimit = (*it).second.at(0)->GetYaxis()->GetXmax();
307  ATH_MSG_VERBOSE("|eta| limits " << m_eta_lowlimit << ", " << m_eta_uplimit);
308 
309  m_pt_lowlimit = (*it).second.at(0)->GetXaxis()->GetXmin();
310  m_pt_uplimit = (*it).second.at(0)->GetXaxis()->GetXmax();
311  ATH_MSG_VERBOSE("pt limits " << m_pt_lowlimit << ", " << m_pt_uplimit);
312 
313  // Check if the input file is in GeV or MeV
314  if (m_pt_uplimit > 1500) {
315  ATH_MSG_VERBOSE("Rates in input file are in MeV");
316  m_gevmev = 1.;
317  } else {
318  ATH_MSG_VERBOSE("Rates in input file are in GeV");
319  m_gevmev = 0.001;
320  }
321 
322  // Systematics // dynamic too?
324 
325  // Add the recommended systematics to the registry
326  if (registerSystematics() != StatusCode::SUCCESS) {
327  ATH_MSG_ERROR("(registerSystematics() != CP::SystematicCode::Ok)");
328  return StatusCode::FAILURE;
329  }
330 
331  return StatusCode::SUCCESS;
332 }

◆ 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 ElectronChargeEfficiencyCorrectionTool::isAffectedBySystematic ( const SystematicVariation systematic) const
finaloverridevirtual

Returns whether this tool is affected by the given systematics.

Implements CP::ISystematicsTool.

Definition at line 621 of file ElectronChargeEfficiencyCorrectionTool.cxx.

623 {
624 
626  return sys.find(systematic) != sys.end();
627 }

◆ 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

◆ printCorrelationModels()

virtual void CP::ElectronChargeEfficiencyCorrectionTool::printCorrelationModels ( ) const
inlinefinaloverridevirtual

print available/implemented correlation models

Implements IAsgElectronEfficiencyCorrectionTool.

Definition at line 98 of file ElectronChargeEfficiencyCorrectionTool.h.

99  {
100  ATH_MSG_INFO(
101  "ONLY A DEFAULT Correlation model available for now");
102  };

◆ recommendedSystematics()

CP::SystematicSet ElectronChargeEfficiencyCorrectionTool::recommendedSystematics ( ) const
finaloverridevirtual

Returns the list of all systematics this tool recommends to use.

Implements CP::IReentrantSystematicsTool.

Definition at line 651 of file ElectronChargeEfficiencyCorrectionTool.cxx.

652 {
653 
654  return affectingSystematics();
655 }

◆ registerSystematics()

StatusCode ElectronChargeEfficiencyCorrectionTool::registerSystematics ( )
private

Definition at line 675 of file ElectronChargeEfficiencyCorrectionTool.cxx.

675  {
677 
678  if (registry.registerSystematics(*this) != StatusCode::SUCCESS) {
679  ATH_MSG_ERROR("Failed to add systematic to list of recommended systematics.");
680  return StatusCode::FAILURE;
681  }
682 
683  return StatusCode::SUCCESS;
684 }

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

◆ systUncorrVariationIndex()

virtual int CP::ElectronChargeEfficiencyCorrectionTool::systUncorrVariationIndex ( const xAOD::Electron ) const
inlinefinaloverridevirtual

Implements IAsgElectronEfficiencyCorrectionTool.

Definition at line 73 of file ElectronChargeEfficiencyCorrectionTool.h.

74  {
76  "systUncorrVariationIndex is not implemented in "
77  "ElectronChargeEfficiencyCorrectionTool");
78  return -999;
79  }

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

CP::SystematicSet CP::ElectronChargeEfficiencyCorrectionTool::m_affectingSys
private

Definition at line 166 of file ElectronChargeEfficiencyCorrectionTool.h.

◆ m_appliedSystematics

CP::SystematicSet* CP::ElectronChargeEfficiencyCorrectionTool::m_appliedSystematics
private

Currently applied systematics.

Definition at line 169 of file ElectronChargeEfficiencyCorrectionTool.h.

◆ m_dataTypeOverwrite

int CP::ElectronChargeEfficiencyCorrectionTool::m_dataTypeOverwrite
private

Force the data type to a given value.

Definition at line 114 of file ElectronChargeEfficiencyCorrectionTool.h.

◆ m_defaultRandomRunNumber

unsigned int CP::ElectronChargeEfficiencyCorrectionTool::m_defaultRandomRunNumber
private

Definition at line 133 of file ElectronChargeEfficiencyCorrectionTool.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_eta_lowlimit

double CP::ElectronChargeEfficiencyCorrectionTool::m_eta_lowlimit
private

Lower limit of eta range where corrections are available; taken from histogram.

Definition at line 143 of file ElectronChargeEfficiencyCorrectionTool.h.

◆ m_eta_uplimit

double CP::ElectronChargeEfficiencyCorrectionTool::m_eta_uplimit
private

Upper limit of eta range where corrections are available; taken from histogram.

Definition at line 147 of file ElectronChargeEfficiencyCorrectionTool.h.

◆ m_eventInfoCollectionName

std::string CP::ElectronChargeEfficiencyCorrectionTool::m_eventInfoCollectionName
private

The Event info collection name.

Definition at line 118 of file ElectronChargeEfficiencyCorrectionTool.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_filename

std::string CP::ElectronChargeEfficiencyCorrectionTool::m_filename
private

The name of the input file that contains the histograms.

Definition at line 136 of file ElectronChargeEfficiencyCorrectionTool.h.

◆ m_filtered_sys_sets

std::map<CP::SystematicSet, CP::SystematicSet> CP::ElectronChargeEfficiencyCorrectionTool::m_filtered_sys_sets
private

Definition at line 163 of file ElectronChargeEfficiencyCorrectionTool.h.

◆ m_gevmev

float CP::ElectronChargeEfficiencyCorrectionTool::m_gevmev
private

Factor for GeV <-> MeV switching.

Definition at line 158 of file ElectronChargeEfficiencyCorrectionTool.h.

◆ m_mySysConf

CP::SystematicSet CP::ElectronChargeEfficiencyCorrectionTool::m_mySysConf
private

Definition at line 165 of file ElectronChargeEfficiencyCorrectionTool.h.

◆ m_pt_lowlimit

double CP::ElectronChargeEfficiencyCorrectionTool::m_pt_lowlimit
private

Lower limit of pt range where corrections are available; taken from histogram.

Definition at line 151 of file ElectronChargeEfficiencyCorrectionTool.h.

◆ m_pt_uplimit

double CP::ElectronChargeEfficiencyCorrectionTool::m_pt_uplimit
private

Upper limit of pt range where corrections are available; taken from histogram.

Definition at line 155 of file ElectronChargeEfficiencyCorrectionTool.h.

◆ m_RunNumbers

std::vector<unsigned int> CP::ElectronChargeEfficiencyCorrectionTool::m_RunNumbers
private

Definition at line 131 of file ElectronChargeEfficiencyCorrectionTool.h.

◆ m_sf_decoration_name

std::string CP::ElectronChargeEfficiencyCorrectionTool::m_sf_decoration_name
private

Decorator.

Definition at line 172 of file ElectronChargeEfficiencyCorrectionTool.h.

◆ m_SF_OS

std::map<std::string, std::vector<TH2*> > CP::ElectronChargeEfficiencyCorrectionTool::m_SF_OS
private

Definition at line 126 of file ElectronChargeEfficiencyCorrectionTool.h.

◆ m_SF_SS

std::map<std::string, std::vector<TH2*> > CP::ElectronChargeEfficiencyCorrectionTool::m_SF_SS
private

Histogram that holds the correction rates for Monte Carlo.

Definition at line 122 of file ElectronChargeEfficiencyCorrectionTool.h.

◆ m_sfDec

SG::AuxElement::Decorator<float>* CP::ElectronChargeEfficiencyCorrectionTool::m_sfDec
private

Definition at line 173 of file ElectronChargeEfficiencyCorrectionTool.h.

◆ m_systematics

std::vector<std::string> CP::ElectronChargeEfficiencyCorrectionTool::m_systematics
private

Definition at line 161 of file ElectronChargeEfficiencyCorrectionTool.h.

◆ m_useRandomRunNumber

bool CP::ElectronChargeEfficiencyCorrectionTool::m_useRandomRunNumber
private

Definition at line 132 of file ElectronChargeEfficiencyCorrectionTool.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.

◆ m_workingPoint

std::string CP::ElectronChargeEfficiencyCorrectionTool::m_workingPoint
private

The name of the folder defining the LH/iso working point.

Definition at line 139 of file ElectronChargeEfficiencyCorrectionTool.h.


The documentation for this class was generated from the following files:
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
python.Dso.registry
registry
Definition: Control/AthenaServices/python/Dso.py:159
beamspotman.r
def r
Definition: beamspotman.py:676
CP::ElectronChargeEfficiencyCorrectionTool::m_eventInfoCollectionName
std::string m_eventInfoCollectionName
The Event info collection name.
Definition: ElectronChargeEfficiencyCorrectionTool.h:118
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
get_generator_info.result
result
Definition: get_generator_info.py:21
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
CP::ElectronChargeEfficiencyCorrectionTool::affectingSystematics
virtual SystematicSet affectingSystematics() const override final
Returns the list of all systematics this tool can be affected by.
Definition: ElectronChargeEfficiencyCorrectionTool.cxx:633
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:66
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
CP::ElectronChargeEfficiencyCorrectionTool::m_eta_lowlimit
double m_eta_lowlimit
Lower limit of eta range where corrections are available; taken from histogram.
Definition: ElectronChargeEfficiencyCorrectionTool.h:143
CP::SystematicSet::empty
bool empty() const
returns: whether the set is empty
Definition: SystematicSet.h:67
skel.it
it
Definition: skel.GENtoEVGEN.py:423
test_pyathena.pt
pt
Definition: test_pyathena.py:11
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
CP::ElectronChargeEfficiencyCorrectionTool::m_mySysConf
CP::SystematicSet m_mySysConf
Definition: ElectronChargeEfficiencyCorrectionTool.h:165
CP::ElectronChargeEfficiencyCorrectionTool::m_pt_lowlimit
double m_pt_lowlimit
Lower limit of pt range where corrections are available; taken from histogram.
Definition: ElectronChargeEfficiencyCorrectionTool.h:151
CP::ElectronChargeEfficiencyCorrectionTool::m_affectingSys
CP::SystematicSet m_affectingSys
Definition: ElectronChargeEfficiencyCorrectionTool.h:166
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
CP::ElectronChargeEfficiencyCorrectionTool::registerSystematics
StatusCode registerSystematics()
Definition: ElectronChargeEfficiencyCorrectionTool.cxx:675
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
CP::ElectronChargeEfficiencyCorrectionTool::getEfficiencyScaleFactor
virtual CP::CorrectionCode getEfficiencyScaleFactor(const xAOD::Electron &inputObject, double &sf) const override final
Retrieve the Scale factor.
Definition: ElectronChargeEfficiencyCorrectionTool.cxx:342
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
CP::ElectronChargeEfficiencyCorrectionTool::m_eta_uplimit
double m_eta_uplimit
Upper limit of eta range where corrections are available; taken from histogram.
Definition: ElectronChargeEfficiencyCorrectionTool.h:147
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
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
CP::ElectronChargeEfficiencyCorrectionTool::m_gevmev
float m_gevmev
Factor for GeV <-> MeV switching.
Definition: ElectronChargeEfficiencyCorrectionTool.h:158
CP::CorrectionCode::Error
@ Error
Some error happened during the object correction.
Definition: CorrectionCode.h:36
CP::ElectronChargeEfficiencyCorrectionTool::m_SF_OS
std::map< std::string, std::vector< TH2 * > > m_SF_OS
Definition: ElectronChargeEfficiencyCorrectionTool.h:126
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CP::ElectronChargeEfficiencyCorrectionTool::m_RunNumbers
std::vector< unsigned int > m_RunNumbers
Definition: ElectronChargeEfficiencyCorrectionTool.h:131
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:58
lumiFormat.i
int i
Definition: lumiFormat.py:92
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
python.subdetectors.mmg.names
names
Definition: mmg.py:8
CP::ElectronChargeEfficiencyCorrectionTool::m_pt_uplimit
double m_pt_uplimit
Upper limit of pt range where corrections are available; taken from histogram.
Definition: ElectronChargeEfficiencyCorrectionTool.h:155
CP::ElectronChargeEfficiencyCorrectionTool::m_sf_decoration_name
std::string m_sf_decoration_name
Decorator.
Definition: ElectronChargeEfficiencyCorrectionTool.h:172
python.xAODType.dummy
dummy
Definition: xAODType.py:4
makeComparison.rootFile
rootFile
Definition: makeComparison.py:27
MSG::name
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition: MsgLevel.cxx:19
CP::ElectronChargeEfficiencyCorrectionTool::m_useRandomRunNumber
bool m_useRandomRunNumber
Definition: ElectronChargeEfficiencyCorrectionTool.h:132
CP::ElectronChargeEfficiencyCorrectionTool::m_sfDec
SG::AuxElement::Decorator< float > * m_sfDec
Definition: ElectronChargeEfficiencyCorrectionTool.h:173
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
TH2
Definition: rootspy.cxx:373
DeMoScan.runnumber
runnumber
Definition: DeMoScan.py:266
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
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
CP::ElectronChargeEfficiencyCorrectionTool::m_systematics
std::vector< std::string > m_systematics
Definition: ElectronChargeEfficiencyCorrectionTool.h:161
ElectronEfficiencyHelpers::isGoodEle
CP::CorrectionCode isGoodEle(const xAOD::Electron &ele, bool &goodEle)
Return true if it's good ele for charge flip measurements.
Definition: ElectronEfficiencyHelpers.cxx:36
ElectronEfficiencyHelpers::getEleTruthCharge
CP::CorrectionCode getEleTruthCharge(const xAOD::Electron &ele, int &truthcharge)
Get the charge of the original electron.
Definition: ElectronEfficiencyHelpers.cxx:14
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
CP::CorrectionCode::Ok
@ Ok
The correction was done successfully.
Definition: CorrectionCode.h:38
a
TList * a
Definition: liststreamerinfos.cxx:10
h
mapkey::sf
@ sf
Definition: TElectronEfficiencyCorrectionTool.cxx:38
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
CP::SystematicRegistry
This module implements the central registry for handling systematic uncertainties with CP tools.
Definition: SystematicRegistry.h:25
CP::SystematicSet::begin
const_iterator begin() const
description: const iterator to the beginning of the set
Definition: SystematicSet.h:55
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
CP::CorrectionCode
Return value from object correction CP tools.
Definition: CorrectionCode.h:31
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
CxxUtils::atoi
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
Definition: Control/CxxUtils/Root/StringUtils.cxx:85
CP::ElectronChargeEfficiencyCorrectionTool::m_SF_SS
std::map< std::string, std::vector< TH2 * > > m_SF_SS
Histogram that holds the correction rates for Monte Carlo.
Definition: ElectronChargeEfficiencyCorrectionTool.h:122
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
CP::ElectronChargeEfficiencyCorrectionTool::getChargeFlipRate
float getChargeFlipRate(double eta, double pt, TH2 *hrates, double &flipRate) const
Get the charge flip rate rate given pt, eta, histogram.
Definition: ElectronChargeEfficiencyCorrectionTool.cxx:597
CP::ElectronChargeEfficiencyCorrectionTool::m_filename
std::string m_filename
The name of the input file that contains the histograms.
Definition: ElectronChargeEfficiencyCorrectionTool.h:136
CP::ElectronChargeEfficiencyCorrectionTool::m_appliedSystematics
CP::SystematicSet * m_appliedSystematics
Currently applied systematics.
Definition: ElectronChargeEfficiencyCorrectionTool.h:169
SG::DataProxy
Definition: DataProxy.h:44
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
CP::ElectronChargeEfficiencyCorrectionTool::m_defaultRandomRunNumber
unsigned int m_defaultRandomRunNumber
Definition: ElectronChargeEfficiencyCorrectionTool.h:133
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