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

#include <MuonEfficiencyScaleFactors.h>

Inheritance diagram for CP::MuonEfficiencyScaleFactors:
Collaboration diagram for CP::MuonEfficiencyScaleFactors:

Public Member Functions

 MuonEfficiencyScaleFactors (const std::string &name)
 
virtual ~MuonEfficiencyScaleFactors ()=default
 
virtual StatusCode initialize ()
 initialize the tool once all settings are in place! More...
 
virtual CorrectionCode getEfficiencyScaleFactor (const xAOD::Muon &mu, float &sf, const xAOD::EventInfo *info=0) const
 Retrieve the Scale factor and decorate the muon. More...
 
virtual CorrectionCode applyEfficiencyScaleFactor (const xAOD::Muon &mu, const xAOD::EventInfo *info=0) const
 decorate the muon with scale factor information More...
 
virtual CorrectionCode getEfficiencyScaleFactorReplicas (const xAOD::Muon &mu, std::vector< float > &sf_err, const xAOD::EventInfo *info=0) const
 replica generation More...
 
virtual CorrectionCode applyEfficiencyScaleFactorReplicas (const xAOD::Muon &mu, int nreplicas=50, const xAOD::EventInfo *info=0) const
 decorate the muon with a set of SF replica weights. More...
 
virtual bool isAffectedBySystematic (const SystematicVariation &systematic) const
 returns: whether this tool is affected by the given systematis More...
 
virtual SystematicSet affectingSystematics () const
 returns: the list of all systematics this tool can be affected by More...
 
virtual SystematicSet recommendedSystematics () const
 returns: the list of all systematics this tool recommends to use More...
 
virtual StatusCode applySystematicVariation (const SystematicSet &systConfig)
 effects: configure this tool for the given list of systematic variations. More...
 
virtual CorrectionCode getDataEfficiency (const xAOD::Muon &mu, float &eff, const xAOD::EventInfo *info=0) const
 Obtain the muon efficiency measured using the data. More...
 
virtual CorrectionCode applyDataEfficiency (const xAOD::Muon &mu, const xAOD::EventInfo *info=0) const
 decorate a muon with the efficiency information More...
 
virtual CorrectionCode getDataEfficiencyReplicas (const xAOD::Muon &mu, std::vector< float > &sf_err, const xAOD::EventInfo *info=0) const
 
virtual CorrectionCode applyDataEfficiencyReplicas (const xAOD::Muon &mu, int nreplicas=50, const xAOD::EventInfo *info=0) const
 
virtual CorrectionCode getMCEfficiency (const xAOD::Muon &mu, float &eff, const xAOD::EventInfo *info=0) const
 Obtain the muon efficiency measured using the MC. More...
 
virtual CorrectionCode applyMCEfficiency (const xAOD::Muon &mu, const xAOD::EventInfo *info=0) const
 
virtual CorrectionCode getMCEfficiencyReplicas (const xAOD::Muon &mu, std::vector< float > &sf_err, const xAOD::EventInfo *info=0) const
 
virtual CorrectionCode applyMCEfficiencyReplicas (const xAOD::Muon &mu, int nreplicas=50, const xAOD::EventInfo *info=0) const
 
virtual int getUnCorrelatedSystBin (const xAOD::Muon &mu) const
 
virtual std::string getUncorrelatedSysBinName (unsigned int Bin) const
 
virtual std::string getUncorrelatedSysBinName (const SystematicSet &systConfig) const
 
std::string filename_Central () const
 The following methods are meant to propagate information from the central tool to the subtool managing the individual scale-factor maps to keep their constructors small in number of arguments. More...
 
std::string filename_Calo () const
 Reconstruction scale-factors have a dedicated map for calo-tag muons around |\eta|<0.1. More...
 
std::string filename_HighEta () const
 High-eta reconstruction scale-factors are not obtained by the means of are not obtained by the means of tag & probe, but rather by building the double ratio. More...
 
std::string filename_LowPt () const
 Returns the scale-factor maps from a complementary scale-factor measurement using the J/Psi or Upsilon resonance. More...
 
std::string filename_LowPtCalo () const
 
std::string filename_LRTCentral () const
 LRT muons have their own efficiency maps. More...
 
std::string filename_LRTLowPt () const
 
float lowPtTransition () const
 If the pt of the muon is below that threshold the J/Psi or Upsilon map is used given that it's available. More...
 
CP::MuonEfficiencyType measurement () const
 Returns the type of the measurement to be carried out... E.g. Reco/TTVA/Iso. More...
 
std::string sf_decoration () const
 The apply<Blah> methods decorate their result directly to the muon. More...
 
std::string data_effi_decoration () const
 
std::string mc_effi_decoration () const
 
std::string sf_replica_decoration () const
 
std::string data_effi_replica_decoration () const
 
std::string mc_effi_replica_deocration () const
 
size_t getPosition (const EffiCollection *coll) const
 Returns the position of the collection in the syst set vector. More...
 
size_t getNCollections () const
 Returns the number of EffiCollections stored in this class. More...
 
bool uncorrelate_sys () const
 Returns a boolean whether the uncorrelation of systematics has been switched on. More...
 
const std::string & close_by_jet_decoration () const
 Returns the string telling the tool in which float AuxElement the information of the separation to the closest jet is stored. More...
 
bool use_2D_iso_corrections () const
 option to set if we want to use 1D or 2D isolation SFs More...
 
bool use_lrt () const
 option to set if we want to use LRT muons 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

unsigned int getRandomRunNumber (const xAOD::EventInfo *info) const
 
StatusCode LoadInputs ()
 load the SF histos More...
 
std::map< std::string, unsigned int > lookUpSystematics ()
 Scale-factor files since Moriond2019 contain the breakdown of systematics into their individual components. More...
 
std::string resolve_file_location (const std::string &filename) const
 utility method to 'dress' a filename using the path resolver 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

SG::ReadHandleKey< xAOD::EventInfom_eventInfo {this, "EventInfoContName", "EventInfo", "event info key"}
 
std::string m_wp
 the working point to operate on More...
 
std::vector< std::unique_ptr< EffiCollection > > m_sf_sets
 This vector stores all scale-factor maps. More...
 
EffiCollectionm_current_sf
 Pointer to the current active map in terms of systematics. More...
 
std::string m_custom_dir
 
std::string m_custom_file_Combined
 
std::string m_custom_file_Calo
 
std::string m_custom_file_HighEta
 
std::string m_custom_file_LowPt
 
std::string m_custom_file_LowPtCalo
 
std::string m_custom_file_LRTCombined
 
std::string m_custom_file_LRTLowPt
 
std::string m_efficiency_decoration_name_data
 
std::string m_efficiency_decoration_name_mc
 
std::string m_sf_decoration_name
 
std::string m_calibration_version
 subfolder to load from the calibration db More...
 
float m_lowpt_threshold
 threshold below which low-pt SF (i.e. from JPsi) should be used More...
 
std::string m_iso_jet_dR
 Name of the decoration to catch up the close by jets. More...
 
bool m_use2DIsoCorr
 
CP::SystematicSet m_affectingSys
 
std::unordered_map< CP::SystematicSet, EffiCollection * > m_filtered_sys_sets
 It turned out that the code spends a large time in the look up of the systematics. More...
 
bool m_init
 
bool m_seperateSystBins
 
bool m_breakDownSyst
 
bool m_applyKineDepSys
 
bool m_useLRT
 Turn on if using LRT objects. More...
 
CP::MuonEfficiencyType m_Type
 
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 23 of file MuonEfficiencyScaleFactors.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

◆ MuonEfficiencyScaleFactors()

CP::MuonEfficiencyScaleFactors::MuonEfficiencyScaleFactors ( const std::string &  name)

Name of the decorator carrying the information the distance to the next what ever jet (AntiKt4EMTopo,....)

Turn on if using LRT muons

Definition at line 20 of file MuonEfficiencyScaleFactors.cxx.

20  :
22  m_wp("Medium"),
23  m_sf_sets(),
24  m_current_sf(),
25  m_custom_dir(),
36  m_calibration_version("230213_Preliminary_r22run2"),
37  m_lowpt_threshold(-1.),
38  m_iso_jet_dR("dRJet"),
39  m_use2DIsoCorr(false),
42  m_init(false),
43  m_seperateSystBins(false),
44  m_breakDownSyst(false),
45  m_applyKineDepSys(true),
46  m_useLRT(false),
48 
49  declareProperty("WorkingPoint", m_wp);
50 
51  // these are for debugging / testing, *not* for general use!
52  declareProperty("CustomInputFolder", m_custom_dir);
53  declareProperty("CustomFileCaloTag", m_custom_file_Calo);
54  declareProperty("CustomFileCombined", m_custom_file_Combined);
55  declareProperty("CustomFileHighEta", m_custom_file_HighEta);
56  declareProperty("CustomFileLowPt", m_custom_file_LowPt);
57  declareProperty("CustomFileLowPtCalo", m_custom_file_LowPtCalo);
58  declareProperty("CustomFileLRTCombined", m_custom_file_LRTCombined);
59  declareProperty("CustomFileLRTLowPt", m_custom_file_LRTLowPt);
60 
61  // Apply additional systematics to account for negelected pt dependency
62  // in the maps themselves or for non-closure
63  declareProperty("ApplyKinematicSystematic", m_applyKineDepSys);
64 
65  // Set specific names for the decorations of the scale-factors to the muon
66  declareProperty("DataEfficiencyDecorationName", m_efficiency_decoration_name_data);
67  declareProperty("MCEfficiencyDecorationName", m_efficiency_decoration_name_mc);
68  declareProperty("ScaleFactorDecorationName", m_sf_decoration_name);
69 
70  declareProperty("CalibrationRelease", m_calibration_version);
71  // Set this property to -1 if you do not want to use the JPsi
72  // reconstruction scale-factors
73  declareProperty("LowPtThreshold", m_lowpt_threshold);
74  declareProperty("UncorrelateSystematics", m_seperateSystBins);
75  declareProperty("BreakDownSystematics", m_breakDownSyst);
78  declareProperty("CloseJetDRDecorator", m_iso_jet_dR);
79  declareProperty("Use2DIsoCorrections", m_use2DIsoCorr);
81  declareProperty("UseLRT", m_useLRT);
82  }

◆ ~MuonEfficiencyScaleFactors()

virtual CP::MuonEfficiencyScaleFactors::~MuonEfficiencyScaleFactors ( )
virtualdefault

Member Function Documentation

◆ affectingSystematics()

SystematicSet CP::MuonEfficiencyScaleFactors::affectingSystematics ( ) const
virtual

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

Implements CP::IReentrantSystematicsTool.

Definition at line 549 of file MuonEfficiencyScaleFactors.cxx.

549  {
550  if (!m_affectingSys.empty()) return m_affectingSys;
551  SystematicSet result;
552  for (auto& collection : m_sf_sets){
553  if (!collection->getSystSet()){
554  ATH_MSG_FATAL("No systematic defined for scale-factor map. ");
555  return SystematicSet();
556  }
557  result.insert(*collection->getSystSet());
558  }
559  return result;
560  }

◆ applyDataEfficiency()

CorrectionCode CP::MuonEfficiencyScaleFactors::applyDataEfficiency ( const xAOD::Muon mu,
const xAOD::EventInfo info = 0 
) const
virtual

decorate a muon with the efficiency information

Implements CP::IMuonEfficiencyScaleFactors.

Definition at line 280 of file MuonEfficiencyScaleFactors.cxx.

280  {
281  if (!m_init) {
282  ATH_MSG_ERROR("The tool has not been initialized yet");
283  return CorrectionCode::Error;
284  }
285  unsigned int RunNumber = getRandomRunNumber(info);
287  }

◆ applyDataEfficiencyReplicas()

CorrectionCode CP::MuonEfficiencyScaleFactors::applyDataEfficiencyReplicas ( const xAOD::Muon mu,
int  nreplicas = 50,
const xAOD::EventInfo info = 0 
) const
virtual

Definition at line 296 of file MuonEfficiencyScaleFactors.cxx.

296  {
297  if (!m_init) {
298  ATH_MSG_ERROR("The tool has not been initialized yet");
299  return CorrectionCode::Error;
300  }
301  unsigned int RunNumber = getRandomRunNumber(info);
303  }

◆ applyEfficiencyScaleFactor()

CorrectionCode CP::MuonEfficiencyScaleFactors::applyEfficiencyScaleFactor ( const xAOD::Muon mu,
const xAOD::EventInfo info = 0 
) const
virtual

decorate the muon with scale factor information

Implements CP::IMuonEfficiencyScaleFactors.

Definition at line 247 of file MuonEfficiencyScaleFactors.cxx.

247  {
248  if (!m_init) {
249  ATH_MSG_ERROR("The tool has not been initialized yet");
250  return CorrectionCode::Error;
251  }
252  unsigned int RunNumber = getRandomRunNumber(info);
254  }

◆ applyEfficiencyScaleFactorReplicas()

CorrectionCode CP::MuonEfficiencyScaleFactors::applyEfficiencyScaleFactorReplicas ( const xAOD::Muon mu,
int  nreplicas = 50,
const xAOD::EventInfo info = 0 
) const
virtual

decorate the muon with a set of SF replica weights.

Implements CP::IMuonEfficiencyScaleFactors.

Definition at line 264 of file MuonEfficiencyScaleFactors.cxx.

264  {
265  if (!m_init) {
266  ATH_MSG_ERROR("The tool has not been initialized yet");
267  return CorrectionCode::Error;
268  }
269  unsigned int RunNumber = getRandomRunNumber(info);
271  }

◆ applyMCEfficiency()

CorrectionCode CP::MuonEfficiencyScaleFactors::applyMCEfficiency ( const xAOD::Muon mu,
const xAOD::EventInfo info = 0 
) const
virtual

Implements CP::IMuonEfficiencyScaleFactors.

Definition at line 312 of file MuonEfficiencyScaleFactors.cxx.

312  {
313  if (!m_init) {
314  ATH_MSG_ERROR("The tool has not been initialized yet");
315  return CorrectionCode::Error;
316  }
317  unsigned int RunNumber = getRandomRunNumber(info);
319  }

◆ applyMCEfficiencyReplicas()

CorrectionCode CP::MuonEfficiencyScaleFactors::applyMCEfficiencyReplicas ( const xAOD::Muon mu,
int  nreplicas = 50,
const xAOD::EventInfo info = 0 
) const
virtual

Definition at line 328 of file MuonEfficiencyScaleFactors.cxx.

328  {
329  if (!m_init) {
330  ATH_MSG_ERROR("The tool has not been initialized yet");
331  return CorrectionCode::Error;
332  }
333  unsigned int RunNumber = getRandomRunNumber(info);
335  }

◆ applySystematicVariation()

StatusCode CP::MuonEfficiencyScaleFactors::applySystematicVariation ( const SystematicSet systConfig)
virtual

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 570 of file MuonEfficiencyScaleFactors.cxx.

570  {
571  if (!m_init) {
572  ATH_MSG_ERROR("Initialize first the tool!");
573  return StatusCode::FAILURE;
574  }
575 
576  //check if systematics is cached
577  std::unordered_map<CP::SystematicSet, EffiCollection*>::const_iterator itr = m_filtered_sys_sets.find (systConfig);
578 
579  SystematicSet mySysConf(systConfig);
580 
581  if (itr == m_filtered_sys_sets.end()) {
582  if (!SystematicSet::filterForAffectingSystematics(systConfig, m_affectingSys, mySysConf)) {
583  ATH_MSG_ERROR("Unsupported combination of systematics passed to the tool! ");
584  return StatusCode::FAILURE;
585  }
586  itr = m_filtered_sys_sets.find(mySysConf);
587  }
588 
589  // No cache is available
590  if (itr == m_filtered_sys_sets.end()){
591  std::vector<std::unique_ptr<EffiCollection>>::const_iterator coll_itr = std::find_if(m_sf_sets.begin(), m_sf_sets.end(),[&mySysConf](const std::unique_ptr<EffiCollection>& a){return a->isAffectedBySystematic(mySysConf);});
592  if (coll_itr == m_sf_sets.end()){
593  ATH_MSG_WARNING("Invalid systematic given.");
594  return StatusCode::FAILURE;
595  }
596  m_filtered_sys_sets.insert(std::pair<SystematicSet, EffiCollection*>(systConfig, coll_itr->get()));
597  itr = m_filtered_sys_sets.find(systConfig);
598  }
599  m_current_sf = itr->second;
600 
601  if (m_seperateSystBins && !itr->first.name().empty()){
602  for (std::set<SystematicVariation>::const_iterator t = mySysConf.begin(); t != mySysConf.end(); ++t) {
603  if ((*t).isToyVariation()) {
604  // First entry corresponds to the bin number and
605  // the second entry to the position in which the map is ordered
606  // into the m_sf_sets container
607  std::pair<unsigned, float> pair = (*t).getToyVariation();
608  if (pair.first != 0 && !m_current_sf->SetSystematicBin(pair.first)){
609  ATH_MSG_WARNING("Could not apply systematic " << (*t).name() << " for bin " << pair.first);
610  return StatusCode::FAILURE;
611  }
612  return StatusCode::SUCCESS;
613  }
614  }
615  }
616  return StatusCode::SUCCESS;
617  }

◆ close_by_jet_decoration()

const std::string & CP::MuonEfficiencyScaleFactors::close_by_jet_decoration ( ) const

Returns the string telling the tool in which float AuxElement the information of the separation to the closest jet is stored.

Definition at line 83 of file MuonEfficiencyScaleFactors.cxx.

83  {
84  return m_iso_jet_dR;
85  }

◆ data_effi_decoration()

std::string CP::MuonEfficiencyScaleFactors::data_effi_decoration ( ) const

Definition at line 99 of file MuonEfficiencyScaleFactors.cxx.

99  {
100  return m_efficiency_decoration_name_data.empty() ? std::string("DataEffi") + m_wp : m_efficiency_decoration_name_data;
101  }

◆ data_effi_replica_decoration()

std::string CP::MuonEfficiencyScaleFactors::data_effi_replica_decoration ( ) const

Definition at line 108 of file MuonEfficiencyScaleFactors.cxx.

108  {
109  return std::string("Replica") + data_effi_decoration();
110  }

◆ 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

◆ filename_Calo()

std::string CP::MuonEfficiencyScaleFactors::filename_Calo ( ) const

Reconstruction scale-factors have a dedicated map for calo-tag muons around |\eta|<0.1.

If the scale-factor is isolation/TTVA then the central file name is returned

Definition at line 378 of file MuonEfficiencyScaleFactors.cxx.

378  {
379 
381  else if (m_Type != CP::MuonEfficiencyType::Reco) {
382  return filename_Central();
383  } else return resolve_file_location("Reco_CaloTag_Z.root"); //note that in rel22 we switched from CaloTag to CaloScore. Now, we're not updating the filename yet to ensure backward compatibility, but it must be clear that in rel22 calibration areas this file will actually contain the CaloScore SFs.
384  }

◆ filename_Central()

std::string CP::MuonEfficiencyScaleFactors::filename_Central ( ) const

The following methods are meant to propagate information from the central tool to the subtool managing the individual scale-factor maps to keep their constructors small in number of arguments.

The users do not have to call them. Construct the name of the input files from the configuration Make these methods public such that they can be used by the scale-factor managing EffiCollection class without piping All arguments to the constructor again

Definition at line 347 of file MuonEfficiencyScaleFactors.cxx.

347  {
349  else if (m_Type == CP::MuonEfficiencyType::Iso) {
350  return resolve_file_location(Form("Iso_%s_Z.root", m_wp.c_str()));
351  } else if (m_Type == CP::MuonEfficiencyType::TTVA) {
352  return resolve_file_location("TTVA_Z.root");
354  return resolve_file_location("BadMuonVeto_HighPt_Z.root");
355  } else if (m_Type == CP::MuonEfficiencyType::Reco) {
356  return resolve_file_location(Form("Reco_%s_Z.root", m_wp.c_str()));
357  }
358  ATH_MSG_ERROR("What?");
359  return "";
360  }

◆ filename_HighEta()

std::string CP::MuonEfficiencyScaleFactors::filename_HighEta ( ) const

High-eta reconstruction scale-factors are not obtained by the means of are not obtained by the means of tag & probe, but rather by building the double ratio.

The map is delivered in a dedicated file whose path is returned here

Definition at line 385 of file MuonEfficiencyScaleFactors.cxx.

385  {
386 
388  else if (m_Type != CP::MuonEfficiencyType::Reco) {
389  return filename_Central();
390  } else return resolve_file_location("Reco_HighEta_Z.root");
391  }

◆ filename_LowPt()

std::string CP::MuonEfficiencyScaleFactors::filename_LowPt ( ) const

Returns the scale-factor maps from a complementary scale-factor measurement using the J/Psi or Upsilon resonance.

Definition at line 392 of file MuonEfficiencyScaleFactors.cxx.

392  {
393 
395  // for the no reco WPs, we currently use the existing Z SF also for the low pt regime
397  return filename_Central();
398  } else return resolve_file_location(Form("Reco_%s_JPsi.root", m_wp.c_str()));
399  }

◆ filename_LowPtCalo()

std::string CP::MuonEfficiencyScaleFactors::filename_LowPtCalo ( ) const

Definition at line 406 of file MuonEfficiencyScaleFactors.cxx.

406  {
407 
409  // for the no reco WPs, we currently use the existing Z SF also for the low pt regime
411  return filename_Central();
412  } else return resolve_file_location("Reco_CaloTag_JPsi.root"); //note that in rel22 we switched from CaloTag to CaloScore. Now, we're not updating the filename yet to ensure backward compatibility, but it must be clear that in rel22 calibration areas this file will actually contain the CaloScore SFs.
413  }

◆ filename_LRTCentral()

std::string CP::MuonEfficiencyScaleFactors::filename_LRTCentral ( ) const

LRT muons have their own efficiency maps.

Definition at line 361 of file MuonEfficiencyScaleFactors.cxx.

361  {
363  else if (m_Type == CP::MuonEfficiencyType::Iso) {
364  ATH_MSG_WARNING("Using standard isolation SF for LRT muons");
365  return resolve_file_location(Form("Iso_%s_Z.root", m_wp.c_str()));
366  } else if (m_Type == CP::MuonEfficiencyType::TTVA) {
367  ATH_MSG_WARNING("Using standard TTVA SF for LRT muons");
368  return resolve_file_location("TTVA_Z.root");
370  ATH_MSG_WARNING("Using standard BadMuonVeto SF for LRT muons");
371  return resolve_file_location("BadMuonVeto_HighPt_Z.root");
372  } else if (m_Type == CP::MuonEfficiencyType::Reco) {
373  return resolve_file_location(Form("Reco_%sNoID_Z.root", m_wp.c_str()));
374  }
375  ATH_MSG_ERROR("What?");
376  return "";
377  }

◆ filename_LRTLowPt()

std::string CP::MuonEfficiencyScaleFactors::filename_LRTLowPt ( ) const

Definition at line 400 of file MuonEfficiencyScaleFactors.cxx.

400  {
401 
403  // for LRT muons, we currently use the existing Z SF also for the low pt regime
404  else return filename_LRTCentral();
405  }

◆ getDataEfficiency()

CorrectionCode CP::MuonEfficiencyScaleFactors::getDataEfficiency ( const xAOD::Muon mu,
float &  eff,
const xAOD::EventInfo info = 0 
) const
virtual

Obtain the muon efficiency measured using the data.

Implements CP::IMuonEfficiencyScaleFactors.

Definition at line 272 of file MuonEfficiencyScaleFactors.cxx.

272  {
273  if (!m_init) {
274  ATH_MSG_ERROR("The tool has not been initialized yet");
275  return CorrectionCode::Error;
276  }
277  unsigned int RunNumber = getRandomRunNumber(info);
279  }

◆ getDataEfficiencyReplicas()

CorrectionCode CP::MuonEfficiencyScaleFactors::getDataEfficiencyReplicas ( const xAOD::Muon mu,
std::vector< float > &  sf_err,
const xAOD::EventInfo info = 0 
) const
virtual

Definition at line 288 of file MuonEfficiencyScaleFactors.cxx.

288  {
289  if (!m_init) {
290  ATH_MSG_ERROR("The tool has not been initialized yet");
291  return CorrectionCode::Error;
292  }
293  unsigned int RunNumber = getRandomRunNumber(info);
295  }

◆ getEfficiencyScaleFactor()

CorrectionCode CP::MuonEfficiencyScaleFactors::getEfficiencyScaleFactor ( const xAOD::Muon mu,
float &  sf,
const xAOD::EventInfo info = 0 
) const
virtual

Retrieve the Scale factor and decorate the muon.

Implements CP::IMuonEfficiencyScaleFactors.

Definition at line 239 of file MuonEfficiencyScaleFactors.cxx.

239  {
240  if (!m_init) {
241  ATH_MSG_ERROR("The tool has not been initialized yet.");
242  return CorrectionCode::Error;
243  }
244  unsigned int RunNumber = getRandomRunNumber(info);
246  }

◆ getEfficiencyScaleFactorReplicas()

CorrectionCode CP::MuonEfficiencyScaleFactors::getEfficiencyScaleFactorReplicas ( const xAOD::Muon mu,
std::vector< float > &  sf_err,
const xAOD::EventInfo info = 0 
) const
virtual

replica generation

Implements CP::IMuonEfficiencyScaleFactors.

Definition at line 256 of file MuonEfficiencyScaleFactors.cxx.

256  {
257  if (!m_init) {
258  ATH_MSG_ERROR("The tool has not been initialized yet");
259  return CorrectionCode::Error;
260  }
261  unsigned int RunNumber = getRandomRunNumber(info);
263  }

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

◆ getMCEfficiency()

CorrectionCode CP::MuonEfficiencyScaleFactors::getMCEfficiency ( const xAOD::Muon mu,
float &  eff,
const xAOD::EventInfo info = 0 
) const
virtual

Obtain the muon efficiency measured using the MC.

Implements CP::IMuonEfficiencyScaleFactors.

Definition at line 304 of file MuonEfficiencyScaleFactors.cxx.

304  {
305  if (!m_init) {
306  ATH_MSG_ERROR("The tool has not been initialized yet");
307  return CorrectionCode::Error;
308  }
309  unsigned int RunNumber = getRandomRunNumber(info);
311  }

◆ getMCEfficiencyReplicas()

CorrectionCode CP::MuonEfficiencyScaleFactors::getMCEfficiencyReplicas ( const xAOD::Muon mu,
std::vector< float > &  sf_err,
const xAOD::EventInfo info = 0 
) const
virtual

Definition at line 320 of file MuonEfficiencyScaleFactors.cxx.

320  {
321  if (!m_init) {
322  ATH_MSG_ERROR("The tool has not been initialized yet");
323  return CorrectionCode::Error;
324  }
325  unsigned int RunNumber = getRandomRunNumber(info);
327  }

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

◆ getNCollections()

size_t CP::MuonEfficiencyScaleFactors::getNCollections ( ) const

Returns the number of EffiCollections stored in this class.

Definition at line 122 of file MuonEfficiencyScaleFactors.cxx.

122  {
123  return m_sf_sets.size();
124  }

◆ getPosition()

size_t CP::MuonEfficiencyScaleFactors::getPosition ( const EffiCollection coll) const

Returns the position of the collection in the syst set vector.

If the collection is not part of this class -1 is returned

Definition at line 114 of file MuonEfficiencyScaleFactors.cxx.

114  {
115  size_t i = 0;
116  for (const auto& sf: m_sf_sets) {
117  if (sf.get() == coll) return i;
118  ++i;
119  }
120  return i;
121  }

◆ getProperty()

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

Get one of the tool's properties.

◆ getRandomRunNumber()

unsigned int CP::MuonEfficiencyScaleFactors::getRandomRunNumber ( const xAOD::EventInfo info) const
private

Definition at line 217 of file MuonEfficiencyScaleFactors.cxx.

217  {
218  if (!info) {
220  info = evtInfo.operator->();
221  if (!info) {
222  ATH_MSG_ERROR("Could not retrieve the xAOD::EventInfo. Return 999999");
223  return 999999;
224  }
225  }
226  if (!info->eventType(xAOD::EventInfo::IS_SIMULATION)) {
227  ATH_MSG_DEBUG("The current event is a data event. Return runNumber instead.");
228  return info->runNumber();
229  }
230  if (!acc_rnd.isAvailable(*info)) {
231  ATH_MSG_WARNING("Failed to find the RandomRunNumber decoration. Please call the apply() method from the PileupReweightingTool before hand in order to get period dependent SFs. You'll receive SFs from the most recent period.");
232  return 999999;
233  } else if (acc_rnd(*info) == 0) {
234  ATH_MSG_DEBUG("Pile up tool has given runNumber 0. Return SF from latest period.");
235  return 999999;
236  }
237  return acc_rnd(*info);
238  }

◆ getUncorrelatedSysBinName() [1/2]

std::string CP::MuonEfficiencyScaleFactors::getUncorrelatedSysBinName ( const SystematicSet systConfig) const
virtual

Implements CP::IMuonEfficiencyScaleFactors.

Definition at line 633 of file MuonEfficiencyScaleFactors.cxx.

633  {
634  for (std::set<SystematicVariation>::const_iterator t = systConfig.begin(); t != systConfig.end(); ++t) {
635  if ((*t).isToyVariation()) {
636  std::pair<unsigned, float> pair = (*t).getToyVariation();
637  return getUncorrelatedSysBinName(pair.first);
638  }
639  }
640  ATH_MSG_ERROR("The given systematic " << systConfig.name() << " is not an unfolded one. Return unknown bin ");
641  return "unknown bin";
642  }

◆ getUncorrelatedSysBinName() [2/2]

std::string CP::MuonEfficiencyScaleFactors::getUncorrelatedSysBinName ( unsigned int  Bin) const
virtual

Implements CP::IMuonEfficiencyScaleFactors.

Definition at line 618 of file MuonEfficiencyScaleFactors.cxx.

618  {
619  if (!m_current_sf){
620  throw std::runtime_error("No systematic has been loaded. Cannot return any syst-bin") ;
621  ATH_MSG_FATAL("No systematic has been loaded. Cannot return any syst-bin");
622 
623  }
624  return m_current_sf->GetBinName(Bin);
625  }

◆ getUnCorrelatedSystBin()

int CP::MuonEfficiencyScaleFactors::getUnCorrelatedSystBin ( const xAOD::Muon mu) const
virtual

Implements CP::IMuonEfficiencyScaleFactors.

Definition at line 626 of file MuonEfficiencyScaleFactors.cxx.

626  {
627  if (!m_current_sf){
628  ATH_MSG_WARNING("No systematic has been loaded. Cannot return any syst-bin");
629  return -1;
630  }
632  }

◆ initialize()

StatusCode CP::MuonEfficiencyScaleFactors::initialize ( )
virtual

initialize the tool once all settings are in place!

Overwrite the property in case of the bad muon veto

for isolation efficiencies, we don't use a low pt component for now - set the low pt threshold to -1 same holds for TTVA SF, and for the HighPt WP

Reimplemented from asg::AsgTool.

Definition at line 128 of file MuonEfficiencyScaleFactors.cxx.

128  {
129  if (m_init) {
130  ATH_MSG_INFO("The tool using working point " << m_wp << " is already initialized.");
131  return StatusCode::SUCCESS;
132  }
133  if (m_wp.find("Iso") != std::string::npos) {
135 
136  } else if (m_wp.find("BadMuon") != std::string::npos) {
139  m_applyKineDepSys = true;
140  } else if (m_wp.find("TTVA") != std::string::npos) {
142  } else {
144  if (m_useLRT && m_wp!="Medium") {
145  ATH_MSG_FATAL(Form("Only Medium identification WP is supported for LRT muons. You chose %s.", m_wp.c_str()));
146  return StatusCode::FAILURE;
147  }
148  }
149  ATH_MSG_INFO("Efficiency type is = " << EfficiencyTypeName(m_Type));
150 
151  // temporary workaround to avoid bad Jpsi scale factors
152  if (m_lowpt_threshold < 0) { // not set by the user, use default values
153  if (m_calibration_version.find("Preliminary_r22run3") != std::string::npos) {
155  } else {
156  m_lowpt_threshold = 15e3;
157  }
158  }
159 
163  ATH_MSG_DEBUG("We are running Isolation or TTVA or High Pt reco SF, so we use Zmumu based SF for the whole pt range!");
164  m_lowpt_threshold = -1;
165  } else if (m_lowpt_threshold <= 0) {
166  ATH_MSG_INFO("Low pt SF turned off as crossover threshold is negative! Using Zmumu based SF for all pt values.");
167  } else {
168  ATH_MSG_INFO("JPsi based low pt SF will start to rock below " << m_lowpt_threshold / 1000. << " GeV!");
169  }
170 
171  std::set<std::string> decorations{
172  sf_decoration() ,
178  };
179  if (decorations.size() != 6){
180  ATH_MSG_FATAL("At least one of the decoration names for scale-factor/ data-efficiency / mc-efficiency is not uniquely defined... Please check your properties");
181  return StatusCode::FAILURE;
182  }
183 
185 
186  if (!m_custom_dir.empty()) ATH_MSG_WARNING("Note: setting up with user specified input file location " << m_custom_dir << " - this is not encouraged!");
187  if (!m_custom_file_Calo.empty()) ATH_MSG_WARNING("Note: setting up with user specified CaloTag input file " << m_custom_file_Calo << " - this is not encouraged!");
188  if (!m_custom_file_Combined.empty()) ATH_MSG_WARNING("Note: setting up with user specified Central muon input file " << m_custom_file_Combined << " - this is not encouraged! ");
189  if (!m_custom_file_HighEta.empty()) ATH_MSG_WARNING("Note: setting up with user specified High Eta input file " << m_custom_file_HighEta << " - this is not encouraged! ");
190  if (!m_custom_file_LowPt.empty()) ATH_MSG_WARNING("Note: setting up with user specified Low Pt input file " << m_custom_file_LowPt << " - this is not encouraged! ");
191  if (!m_custom_file_LowPtCalo.empty()) ATH_MSG_WARNING("Note: setting up with user specified Low Pt CaloTag input file " << m_custom_file_LowPtCalo << " - this is not encouraged! ");
192  if (!m_custom_file_LRTCombined.empty()) ATH_MSG_WARNING("Note: setting up with user specified Central LRT muon input file " << m_custom_file_LRTCombined << " - this is not encouraged! ");
193  if (!m_custom_file_LRTLowPt.empty()) ATH_MSG_WARNING("Note: setting up with user specified Low Pt LRT muon input file " << m_custom_file_LowPt << " - this is not encouraged! ");
194  if (m_custom_dir.empty()) ATH_MSG_INFO("Trying to initialize, with working point " << m_wp << ", using calibration release " << m_calibration_version);
195 
197 
198  // m_init has to be true for affectingSystematics()
199  m_init = true;
201  // set up for default running without systematics
202  if (!applySystematicVariation(SystematicSet())) {
203  ATH_MSG_ERROR("loading the central value systematic set failed");
204  return StatusCode::FAILURE;
205  }
206 
207  // Add the affecting systematics to the global registry
208  SystematicRegistry& registry = SystematicRegistry::getInstance();
209  if (!registry.registerSystematics(*this)) {
210  ATH_MSG_ERROR("unable to register the systematics");
211  return StatusCode::FAILURE;
212  }
213  ATH_MSG_INFO("Successfully initialized! ");
214 
215  return StatusCode::SUCCESS;
216  }

◆ 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 CP::MuonEfficiencyScaleFactors::isAffectedBySystematic ( const SystematicVariation systematic) const
virtual

returns: whether this tool is affected by the given systematis

Implements CP::ISystematicsTool.

Definition at line 545 of file MuonEfficiencyScaleFactors.cxx.

545  {
546  return m_affectingSys.find(systematic) != m_affectingSys.end();
547  }

◆ LoadInputs()

StatusCode CP::MuonEfficiencyScaleFactors::LoadInputs ( )
private

load the SF histos

We've at least the stat and sys errors and nothing went wrong during loading the files

Push back the nominal options

Now we can fill the map with the individual sets

Filter the bits which are not assigning the files

J-psi stream... Kick all bits from the Z

...and the Z stream. Kick all bits from the JPsi

Definition at line 416 of file MuonEfficiencyScaleFactors.cxx.

416  {
417  if (!m_sf_sets.empty()){
418  ATH_MSG_DEBUG("Input already loaded will not do it again");
419  return StatusCode::SUCCESS;
420  }
421  std::map<std::string, unsigned int> systematics = lookUpSystematics();
424  if (systematics.empty()){
425  ATH_MSG_FATAL("No valid systematic could be loaded. Not even the statistical uncertainties");
426  return StatusCode::FAILURE;
427  }
428 
430  m_sf_sets.push_back( std::make_unique<EffiCollection>(*this));
431  EffiCollection* nominal = m_sf_sets.back().get();
432 
433  std::function<unsigned int(unsigned int, unsigned int)> not_inB = [](unsigned int a , unsigned int b){
434  unsigned int b_flipped = ~b;
435  return a & b_flipped;
436  };
438  for (const auto& syst: systematics){
440  if ((syst.second & EffiCollection::ZAnalysis) && (syst.second & EffiCollection::JPsiAnalysis)) {
442  m_sf_sets.push_back(std::make_unique < EffiCollection > (nominal, *this, syst.first, not_inB(syst.second, EffiCollection::ZAnalysis), false));
443  m_sf_sets.push_back(std::make_unique < EffiCollection > (nominal, *this, syst.first, not_inB(syst.second, EffiCollection::ZAnalysis), true));
445  m_sf_sets.push_back(std::make_unique < EffiCollection > (nominal, *this, syst.first, not_inB(syst.second, EffiCollection::JPsiAnalysis), true));
446  m_sf_sets.push_back(std::make_unique < EffiCollection > (nominal, *this, syst.first, not_inB(syst.second, EffiCollection::JPsiAnalysis), false));
447  } else {
448  m_sf_sets.push_back(std::make_unique < EffiCollection > (nominal, *this, syst.first, syst.second, false));
449  m_sf_sets.push_back(std::make_unique < EffiCollection > (nominal, *this, syst.first, syst.second, true));
450  }
451  }
452  for(auto& sf: m_sf_sets){
453  if (!sf->CheckConsistency()) {
454  ATH_MSG_FATAL("Inconsistent scalefactor maps have been found for "<<(sf->getSystSet() ?sf->getSystSet()->name() : "UNKOWN"));
455  return StatusCode::FAILURE;
456  }
457  }
458  return StatusCode::SUCCESS;
459  }

◆ lookUpSystematics()

std::map< std::string, unsigned int > CP::MuonEfficiencyScaleFactors::lookUpSystematics ( )
private

Scale-factor files since Moriond2019 contain the breakdown of systematics into their individual components.

This method loads all systematics and looks their systematics up and returns them in a map together with a bitmask which files are affected by the systematic

All file_name methods return the central filename if there is no proper map for that component use a set to sort out all non-defined maps

The bad muon veto measurement only provides a combined systematic uncertainty of the bad-muon veto. No stat error needed in this case

If the systematics shall be split into bins

At the moment the systematic break down is not part of all files ignore if there is no break down

Activate the pt-dependent systematic for the old calibration files by hand

Read out the systematic tree from the scale-factor files

Definition at line 460 of file MuonEfficiencyScaleFactors.cxx.

460  {
461  std::map<std::string, unsigned int> syst_map;
464  std::set<std::string> files_to_look_up{
466  filename_Calo(),
468  filename_LowPt(),
470  };
471  if (m_useLRT) {
472  files_to_look_up.insert(filename_LRTCentral());
473  files_to_look_up.insert(filename_LRTLowPt());
474  }
475  std::function<int(const std::string&)> get_bit = [this](const std::string& file_name){
480  if (this->use_lrt()) {
483  }
484  // last file which remains is forward
486  };
487 
488  std::function<void(const std::string&,int)> insert_bit =[&syst_map](const std::string& key, unsigned int bit){
489  if (syst_map.find(key) == syst_map.end()) syst_map.insert(std::pair<std::string, unsigned int>(key,bit));
490  else syst_map[key] = syst_map[key] | bit;
491  };
492  for (const auto& look_up : files_to_look_up){
493  std::unique_ptr<TFile> root_file(TFile::Open(look_up.c_str(), "READ"));
494  if (!root_file || !root_file->IsOpen()){
495  ATH_MSG_FATAL("Could not open file "<<look_up);
496  syst_map.clear();
497  break;
498  }
502  insert_bit("STAT", get_bit(look_up));
503  }
505  if (m_seperateSystBins) insert_bit("STAT", EffiCollection::UnCorrelated);
506 
507  TTree* syst_tree = nullptr;
508  root_file->GetObject("Systematics", syst_tree);
509 
512  if (!m_breakDownSyst || syst_tree == nullptr){
513  ATH_MSG_DEBUG("The file "<<look_up<<" does not contain any systematic tree. No break down for that one will be considered");
514  insert_bit("SYS",get_bit(look_up));
517  insert_bit("SYS", EffiCollection::PtDependent);
518  }
519  continue;
520  }
522  std::string* syst_name = nullptr;
523  bool is_symmetric(0), has_pt_sys(0), uncorrelated(0);
524  if (syst_tree->SetBranchAddress("Name", &syst_name) != 0 ||
525  syst_tree->SetBranchAddress("IsSymmetric", &is_symmetric) != 0 ||
526  syst_tree->SetBranchAddress("HasPtDependentSys", &has_pt_sys) !=0 ||
527  syst_tree->SetBranchAddress("CanBeUncorrelated", &uncorrelated) !=0){
528 
529 
530  ATH_MSG_FATAL("Although "<<look_up<<" has a systematic tree. There is no proper connection to the branches");
531  syst_map.clear();
532  break;
533  }
534  for (int i =0; syst_tree->GetEntry(i); ++i){
535  insert_bit( *syst_name, get_bit(look_up));
536  if (is_symmetric) insert_bit(*syst_name, EffiCollection::Symmetric);
537 
538  if (m_applyKineDepSys && has_pt_sys) {
539  insert_bit(*syst_name, EffiCollection::PtDependent);
540  }if (m_seperateSystBins && uncorrelated) insert_bit(*syst_name, EffiCollection::UnCorrelated);
541  }
542  }
543  return syst_map;
544  }

◆ lowPtTransition()

float CP::MuonEfficiencyScaleFactors::lowPtTransition ( ) const

If the pt of the muon is below that threshold the J/Psi or Upsilon map is used given that it's available.

Definition at line 89 of file MuonEfficiencyScaleFactors.cxx.

89  {
90  return m_lowpt_threshold;
91  }

◆ mc_effi_decoration()

std::string CP::MuonEfficiencyScaleFactors::mc_effi_decoration ( ) const

Definition at line 102 of file MuonEfficiencyScaleFactors.cxx.

102  {
103  return m_efficiency_decoration_name_mc.empty() ? std::string("MCEffi") + m_wp : m_efficiency_decoration_name_mc;
104  }

◆ mc_effi_replica_deocration()

std::string CP::MuonEfficiencyScaleFactors::mc_effi_replica_deocration ( ) const

Definition at line 111 of file MuonEfficiencyScaleFactors.cxx.

111  {
112  return std::string("Replica") + mc_effi_decoration();
113  }

◆ measurement()

CP::MuonEfficiencyType CP::MuonEfficiencyScaleFactors::measurement ( ) const

Returns the type of the measurement to be carried out... E.g. Reco/TTVA/Iso.

Definition at line 93 of file MuonEfficiencyScaleFactors.cxx.

93  {
94  return m_Type;
95  }

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

SystematicSet CP::MuonEfficiencyScaleFactors::recommendedSystematics ( ) const
virtual

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

Implements CP::IReentrantSystematicsTool.

Definition at line 563 of file MuonEfficiencyScaleFactors.cxx.

563  {
564  if (!m_init) {
565  ATH_MSG_ERROR("The tool has not been initialized yet");
566  return CP::SystematicSet();
567  }
568  return affectingSystematics();
569  }

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

◆ resolve_file_location()

std::string CP::MuonEfficiencyScaleFactors::resolve_file_location ( const std::string &  filename) const
private

utility method to 'dress' a filename using the path resolver

Definition at line 337 of file MuonEfficiencyScaleFactors.cxx.

337  {
338  if (!m_custom_dir.empty()) {
339  return m_custom_dir + "/" + filename;
340  }
341  std::string fullPathToFile = PathResolverFindCalibFile(Form("MuonEfficiencyCorrections/%s/%s", m_calibration_version.c_str(), filename.c_str()));
342  if (fullPathToFile.empty()) {
343  ATH_MSG_ERROR("Unable to resolve the input file " << m_calibration_version << "/" << filename << " via the PathResolver!");
344  }
345  return fullPathToFile;
346  }

◆ sf_decoration()

std::string CP::MuonEfficiencyScaleFactors::sf_decoration ( ) const

The apply<Blah> methods decorate their result directly to the muon.

The name of the decorators can be set by the users themselves using several properties. To avoid that systmatics overwrite each other and the nominal the final maps are decorating the muon following the logic <decoration>__<syst_name> The following methods propagate the basic decoration names to the maps

Definition at line 96 of file MuonEfficiencyScaleFactors.cxx.

96  {
97  return m_sf_decoration_name.empty() ? std::string("SF") + m_wp : m_sf_decoration_name;
98  }

◆ sf_replica_decoration()

std::string CP::MuonEfficiencyScaleFactors::sf_replica_decoration ( ) const

Definition at line 105 of file MuonEfficiencyScaleFactors.cxx.

105  {
106  return std::string("Replica") + sf_decoration();
107  }

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

◆ uncorrelate_sys()

bool CP::MuonEfficiencyScaleFactors::uncorrelate_sys ( ) const

Returns a boolean whether the uncorrelation of systematics has been switched on.

Definition at line 92 of file MuonEfficiencyScaleFactors.cxx.

92 { return m_seperateSystBins; }

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

◆ use_2D_iso_corrections()

bool CP::MuonEfficiencyScaleFactors::use_2D_iso_corrections ( ) const

option to set if we want to use 1D or 2D isolation SFs

Definition at line 86 of file MuonEfficiencyScaleFactors.cxx.

86  {
87  return m_use2DIsoCorr;
88  }

◆ use_lrt()

bool CP::MuonEfficiencyScaleFactors::use_lrt ( ) const

option to set if we want to use LRT muons

Definition at line 125 of file MuonEfficiencyScaleFactors.cxx.

125  {
126  return m_useLRT;
127  }

Member Data Documentation

◆ m_affectingSys

CP::SystematicSet CP::MuonEfficiencyScaleFactors::m_affectingSys
private

Definition at line 192 of file MuonEfficiencyScaleFactors.h.

◆ m_applyKineDepSys

bool CP::MuonEfficiencyScaleFactors::m_applyKineDepSys
private

Definition at line 200 of file MuonEfficiencyScaleFactors.h.

◆ m_breakDownSyst

bool CP::MuonEfficiencyScaleFactors::m_breakDownSyst
private

Definition at line 199 of file MuonEfficiencyScaleFactors.h.

◆ m_calibration_version

std::string CP::MuonEfficiencyScaleFactors::m_calibration_version
private

subfolder to load from the calibration db

Definition at line 184 of file MuonEfficiencyScaleFactors.h.

◆ m_current_sf

EffiCollection* CP::MuonEfficiencyScaleFactors::m_current_sf
private

Pointer to the current active map in terms of systematics.

Definition at line 166 of file MuonEfficiencyScaleFactors.h.

◆ m_custom_dir

std::string CP::MuonEfficiencyScaleFactors::m_custom_dir
private

Definition at line 168 of file MuonEfficiencyScaleFactors.h.

◆ m_custom_file_Calo

std::string CP::MuonEfficiencyScaleFactors::m_custom_file_Calo
private

Definition at line 170 of file MuonEfficiencyScaleFactors.h.

◆ m_custom_file_Combined

std::string CP::MuonEfficiencyScaleFactors::m_custom_file_Combined
private

Definition at line 169 of file MuonEfficiencyScaleFactors.h.

◆ m_custom_file_HighEta

std::string CP::MuonEfficiencyScaleFactors::m_custom_file_HighEta
private

Definition at line 171 of file MuonEfficiencyScaleFactors.h.

◆ m_custom_file_LowPt

std::string CP::MuonEfficiencyScaleFactors::m_custom_file_LowPt
private

Definition at line 172 of file MuonEfficiencyScaleFactors.h.

◆ m_custom_file_LowPtCalo

std::string CP::MuonEfficiencyScaleFactors::m_custom_file_LowPtCalo
private

Definition at line 173 of file MuonEfficiencyScaleFactors.h.

◆ m_custom_file_LRTCombined

std::string CP::MuonEfficiencyScaleFactors::m_custom_file_LRTCombined
private

Definition at line 174 of file MuonEfficiencyScaleFactors.h.

◆ m_custom_file_LRTLowPt

std::string CP::MuonEfficiencyScaleFactors::m_custom_file_LRTLowPt
private

Definition at line 175 of file MuonEfficiencyScaleFactors.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_efficiency_decoration_name_data

std::string CP::MuonEfficiencyScaleFactors::m_efficiency_decoration_name_data
private

Definition at line 179 of file MuonEfficiencyScaleFactors.h.

◆ m_efficiency_decoration_name_mc

std::string CP::MuonEfficiencyScaleFactors::m_efficiency_decoration_name_mc
private

Definition at line 180 of file MuonEfficiencyScaleFactors.h.

◆ m_eventInfo

SG::ReadHandleKey<xAOD::EventInfo> CP::MuonEfficiencyScaleFactors::m_eventInfo {this, "EventInfoContName", "EventInfo", "event info key"}
private

Definition at line 77 of file MuonEfficiencyScaleFactors.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_filtered_sys_sets

std::unordered_map<CP::SystematicSet, EffiCollection*> CP::MuonEfficiencyScaleFactors::m_filtered_sys_sets
private

It turned out that the code spends a large time in the look up of the systematics.

This map tries to mitigate this issue.

Definition at line 195 of file MuonEfficiencyScaleFactors.h.

◆ m_init

bool CP::MuonEfficiencyScaleFactors::m_init
private

Definition at line 197 of file MuonEfficiencyScaleFactors.h.

◆ m_iso_jet_dR

std::string CP::MuonEfficiencyScaleFactors::m_iso_jet_dR
private

Name of the decoration to catch up the close by jets.

Definition at line 190 of file MuonEfficiencyScaleFactors.h.

◆ m_lowpt_threshold

float CP::MuonEfficiencyScaleFactors::m_lowpt_threshold
private

threshold below which low-pt SF (i.e. from JPsi) should be used

Definition at line 188 of file MuonEfficiencyScaleFactors.h.

◆ m_seperateSystBins

bool CP::MuonEfficiencyScaleFactors::m_seperateSystBins
private

Definition at line 198 of file MuonEfficiencyScaleFactors.h.

◆ m_sf_decoration_name

std::string CP::MuonEfficiencyScaleFactors::m_sf_decoration_name
private

Definition at line 181 of file MuonEfficiencyScaleFactors.h.

◆ m_sf_sets

std::vector<std::unique_ptr<EffiCollection> > CP::MuonEfficiencyScaleFactors::m_sf_sets
private

This vector stores all scale-factor maps.

Definition at line 163 of file MuonEfficiencyScaleFactors.h.

◆ m_Type

CP::MuonEfficiencyType CP::MuonEfficiencyScaleFactors::m_Type
private

Definition at line 204 of file MuonEfficiencyScaleFactors.h.

◆ m_use2DIsoCorr

bool CP::MuonEfficiencyScaleFactors::m_use2DIsoCorr
private

Definition at line 191 of file MuonEfficiencyScaleFactors.h.

◆ m_useLRT

bool CP::MuonEfficiencyScaleFactors::m_useLRT
private

Turn on if using LRT objects.

Definition at line 202 of file MuonEfficiencyScaleFactors.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_wp

std::string CP::MuonEfficiencyScaleFactors::m_wp
private

the working point to operate on

Definition at line 160 of file MuonEfficiencyScaleFactors.h.


The documentation for this class was generated from the following files:
grepfile.info
info
Definition: grepfile.py:38
CP::MuonEfficiencyScaleFactors::filename_Calo
std::string filename_Calo() const
Reconstruction scale-factors have a dedicated map for calo-tag muons around |\eta|<0....
Definition: MuonEfficiencyScaleFactors.cxx:378
CP::MuonEfficiencyScaleFactors::m_custom_file_LowPtCalo
std::string m_custom_file_LowPtCalo
Definition: MuonEfficiencyScaleFactors.h:173
python.Dso.registry
registry
Definition: Control/AthenaServices/python/Dso.py:159
CP::MuonEfficiencyScaleFactors::filename_Central
std::string filename_Central() const
The following methods are meant to propagate information from the central tool to the subtool managin...
Definition: MuonEfficiencyScaleFactors.cxx:347
CP::MuonEfficiencyScaleFactors::filename_LRTLowPt
std::string filename_LRTLowPt() const
Definition: MuonEfficiencyScaleFactors.cxx:400
CP::EfficiencyScaleFactor::DataEfficiency
CorrectionCode DataEfficiency(const xAOD::Muon &mu, float &Eff) const
... and absolute efficiencies
Definition: EfficiencyScaleFactor.cxx:308
CP::EfficiencyScaleFactor::ScaleFactorReplicas
CorrectionCode ScaleFactorReplicas(const xAOD::Muon &mu, std::vector< float > &SF)
Definition: EfficiencyScaleFactor.cxx:403
CP::MuonEfficiencyScaleFactors::m_filtered_sys_sets
std::unordered_map< CP::SystematicSet, EffiCollection * > m_filtered_sys_sets
It turned out that the code spends a large time in the look up of the systematics.
Definition: MuonEfficiencyScaleFactors.h:195
CP::MuonEfficiencyScaleFactors::m_custom_file_LRTLowPt
std::string m_custom_file_LRTLowPt
Definition: MuonEfficiencyScaleFactors.h:175
CP::MuonEfficiencyScaleFactors::data_effi_replica_decoration
std::string data_effi_replica_decoration() const
Definition: MuonEfficiencyScaleFactors.cxx:108
CP::EffiCollection::CentralLowPt
@ CentralLowPt
Definition: EffiCollection.h:42
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
CP::MuonEfficiencyScaleFactors::m_custom_dir
std::string m_custom_dir
Definition: MuonEfficiencyScaleFactors.h:168
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
CP::MuonEfficiencyScaleFactors::LoadInputs
StatusCode LoadInputs()
load the SF histos
Definition: MuonEfficiencyScaleFactors.cxx:416
CP::EfficiencyScaleFactor::MCEfficiencyReplicas
CorrectionCode MCEfficiencyReplicas(const xAOD::Muon &mu, std::vector< float > &eff)
Definition: EfficiencyScaleFactor.cxx:409
Undefined
@ Undefined
Definition: MaterialTypes.h:8
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::MuonEfficiencyScaleFactors::m_useLRT
bool m_useLRT
Turn on if using LRT objects.
Definition: MuonEfficiencyScaleFactors.h:202
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CP::MuonEfficiencyScaleFactors::sf_replica_decoration
std::string sf_replica_decoration() const
Definition: MuonEfficiencyScaleFactors.cxx:105
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
CP::MuonEfficiencyScaleFactors::m_iso_jet_dR
std::string m_iso_jet_dR
Name of the decoration to catch up the close by jets.
Definition: MuonEfficiencyScaleFactors.h:190
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
CP::BadMuonVeto
@ BadMuonVeto
Definition: MuonEfficiencyType.h:17
CP::MuonEfficiencyScaleFactors::sf_decoration
std::string sf_decoration() const
The apply<Blah> methods decorate their result directly to the muon.
Definition: MuonEfficiencyScaleFactors.cxx:96
CP::MuonEfficiencyScaleFactors::m_eventInfo
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo
Definition: MuonEfficiencyScaleFactors.h:77
CP::EffiCollection::UnCorrelated
@ UnCorrelated
Definition: EffiCollection.h:55
CP::SystematicSet::empty
bool empty() const
returns: whether the set is empty
Definition: SystematicSet.h:67
CP::EffiCollection::Central
@ Central
The five different scale-factor maps.
Definition: EffiCollection.h:39
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::MuonEfficiencyScaleFactors::m_custom_file_LRTCombined
std::string m_custom_file_LRTCombined
Definition: MuonEfficiencyScaleFactors.h:174
CP::EffiCollection::Calo
@ Calo
Definition: EffiCollection.h:40
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
CP::MuonEfficiencyScaleFactors::m_sf_sets
std::vector< std::unique_ptr< EffiCollection > > m_sf_sets
This vector stores all scale-factor maps.
Definition: MuonEfficiencyScaleFactors.h:163
CP::MuonEfficiencyScaleFactors::m_custom_file_Combined
std::string m_custom_file_Combined
Definition: MuonEfficiencyScaleFactors.h:169
xAOD::EventInfo_v1::IS_SIMULATION
@ IS_SIMULATION
true: simulation, false: data
Definition: EventInfo_v1.h:151
CP::MuonEfficiencyScaleFactors::m_use2DIsoCorr
bool m_use2DIsoCorr
Definition: MuonEfficiencyScaleFactors.h:191
CP::EfficiencyScaleFactor::ApplyScaleFactor
CorrectionCode ApplyScaleFactor(const xAOD::Muon &mu) const
or you can just decorate the scale-factor to the muon
Definition: EfficiencyScaleFactor.cxx:366
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
CP::EffiCollection::Forward
@ Forward
Definition: EffiCollection.h:41
CP::MuonEfficiencyScaleFactors::filename_LRTCentral
std::string filename_LRTCentral() const
LRT muons have their own efficiency maps.
Definition: MuonEfficiencyScaleFactors.cxx:361
CP::EfficiencyScaleFactor::DataEfficiencyReplicas
CorrectionCode DataEfficiencyReplicas(const xAOD::Muon &mu, std::vector< float > &eff)
Definition: EfficiencyScaleFactor.cxx:406
CP::MuonEfficiencyScaleFactors::m_sf_decoration_name
std::string m_sf_decoration_name
Definition: MuonEfficiencyScaleFactors.h:181
physics_parameters.file_name
string file_name
Definition: physics_parameters.py:32
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::MuonEfficiencyScaleFactors::filename_LowPt
std::string filename_LowPt() const
Returns the scale-factor maps from a complementary scale-factor measurement using the J/Psi or Upsilo...
Definition: MuonEfficiencyScaleFactors.cxx:392
CP::CorrectionCode::Error
@ Error
Some error happened during the object correction.
Definition: CorrectionCode.h:36
CP::MuonEfficiencyScaleFactors::m_init
bool m_init
Definition: MuonEfficiencyScaleFactors.h:197
CP::MuonEfficiencyScaleFactors::m_efficiency_decoration_name_mc
std::string m_efficiency_decoration_name_mc
Definition: MuonEfficiencyScaleFactors.h:180
CP::Iso
@ Iso
Definition: MuonEfficiencyType.h:16
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CheckAppliedSFs.e3
e3
Definition: CheckAppliedSFs.py:264
lumiFormat.i
int i
Definition: lumiFormat.py:92
PixelAthClusterMonAlgCfg.e4
e4
Definition: PixelAthClusterMonAlgCfg.py:317
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
CP::MuonEfficiencyScaleFactors::m_efficiency_decoration_name_data
std::string m_efficiency_decoration_name_data
Definition: MuonEfficiencyScaleFactors.h:179
CP::MuonEfficiencyScaleFactors::resolve_file_location
std::string resolve_file_location(const std::string &filename) const
utility method to 'dress' a filename using the path resolver
Definition: MuonEfficiencyScaleFactors.cxx:337
top::nominal
@ nominal
Definition: ScaleFactorRetriever.h:29
CP::Reco
@ Reco
Definition: MuonEfficiencyType.h:14
CP::MuonEfficiencyScaleFactors::applySystematicVariation
virtual StatusCode applySystematicVariation(const SystematicSet &systConfig)
effects: configure this tool for the given list of systematic variations.
Definition: MuonEfficiencyScaleFactors.cxx:570
CP::EffiCollection::PtDependent
@ PtDependent
Definition: EffiCollection.h:54
CP::EfficiencyScaleFactor::MCEfficiency
CorrectionCode MCEfficiency(const xAOD::Muon &mu, float &Eff) const
... mc efficiency
Definition: EfficiencyScaleFactor.cxx:323
CP::SystematicSet::end
const_iterator end() const
description: const iterator to the end of the set
Definition: SystematicSet.h:59
CP::EffiCollection::GetBinName
std::string GetBinName(unsigned int bin) const
Returns the global bin name conststucted from the axis titles and the bin borders.
Definition: EffiCollection.cxx:300
python.xAODType.dummy
dummy
Definition: xAODType.py:4
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MSG::name
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition: MsgLevel.cxx:19
CP::EfficiencyScaleFactor::ApplyDataEfficiency
CorrectionCode ApplyDataEfficiency(const xAOD::Muon &mu) const
You can decorate the data efficiecny as well.
Definition: EfficiencyScaleFactor.cxx:379
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
CP::MuonEfficiencyScaleFactors::m_current_sf
EffiCollection * m_current_sf
Pointer to the current active map in terms of systematics.
Definition: MuonEfficiencyScaleFactors.h:166
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
CP::MuonEfficiencyScaleFactors::m_affectingSys
CP::SystematicSet m_affectingSys
Definition: MuonEfficiencyScaleFactors.h:192
CP::EfficiencyScaleFactor::ApplyDataEfficiencyReplicas
CorrectionCode ApplyDataEfficiencyReplicas(const xAOD::Muon &mu, int n_replicas)
Definition: EfficiencyScaleFactor.cxx:385
CP::MuonEfficiencyScaleFactors::filename_HighEta
std::string filename_HighEta() const
High-eta reconstruction scale-factors are not obtained by the means of are not obtained by the means ...
Definition: MuonEfficiencyScaleFactors.cxx:385
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
CP::EffiCollection::retrieveSF
EfficiencyScaleFactor * retrieveSF(const xAOD::Muon &mu, unsigned int RunNumber) const
return the correct SF type to provide, depending on eta and the author
Definition: EffiCollection.cxx:245
EventInfoWrite.RunNumber
RunNumber
Definition: EventInfoWrite.py:50
CheckAppliedSFs.systematics
def systematics
Definition: CheckAppliedSFs.py:231
CP::MuonEfficiencyScaleFactors::m_breakDownSyst
bool m_breakDownSyst
Definition: MuonEfficiencyScaleFactors.h:199
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
CP::MuonEfficiencyScaleFactors::m_applyKineDepSys
bool m_applyKineDepSys
Definition: MuonEfficiencyScaleFactors.h:200
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
CP::MuonEfficiencyScaleFactors::m_wp
std::string m_wp
the working point to operate on
Definition: MuonEfficiencyScaleFactors.h:160
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
CP::MuonEfficiencyScaleFactors::m_custom_file_Calo
std::string m_custom_file_Calo
Definition: MuonEfficiencyScaleFactors.h:170
CP::TTVA
@ TTVA
Definition: MuonEfficiencyType.h:15
CP::MuonEfficiencyScaleFactors::m_custom_file_HighEta
std::string m_custom_file_HighEta
Definition: MuonEfficiencyScaleFactors.h:171
CP::EffiCollection::ZAnalysis
@ ZAnalysis
Definition: EffiCollection.h:45
CP::EffiCollection::Symmetric
@ Symmetric
Definition: EffiCollection.h:53
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:431
CP::EffiCollection::CaloLowPt
@ CaloLowPt
Definition: EffiCollection.h:43
CP::SystematicSet::find
iterator find(const SystematicVariation &sys) const
description: find an element in the set
Definition: SystematicSet.h:63
a
TList * a
Definition: liststreamerinfos.cxx:10
h
CP::EfficiencyScaleFactor::ApplyMCEfficiency
CorrectionCode ApplyMCEfficiency(const xAOD::Muon &mu) const
... or decorate them directly
Definition: EfficiencyScaleFactor.cxx:391
CP::EffiCollection::JPsiAnalysis
@ JPsiAnalysis
Distinguish these two because the systematics are named with an extra LOWPT.
Definition: EffiCollection.h:48
CP::MuonEfficiencyScaleFactors::getRandomRunNumber
unsigned int getRandomRunNumber(const xAOD::EventInfo *info) const
Definition: MuonEfficiencyScaleFactors.cxx:217
mapkey::sf
@ sf
Definition: TElectronEfficiencyCorrectionTool.cxx:38
CP::MuonEfficiencyScaleFactors::mc_effi_decoration
std::string mc_effi_decoration() const
Definition: MuonEfficiencyScaleFactors.cxx:102
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
CP::EfficiencyScaleFactor::ApplyScaleFactorReplicas
CorrectionCode ApplyScaleFactorReplicas(const xAOD::Muon &mu, int n_replicas)
Definition: EfficiencyScaleFactor.cxx:372
CP::MuonEfficiencyScaleFactors::use_lrt
bool use_lrt() const
option to set if we want to use LRT muons
Definition: MuonEfficiencyScaleFactors.cxx:125
CP::MuonEfficiencyScaleFactors::m_custom_file_LowPt
std::string m_custom_file_LowPt
Definition: MuonEfficiencyScaleFactors.h:172
CP::MuonEfficiencyScaleFactors::lookUpSystematics
std::map< std::string, unsigned int > lookUpSystematics()
Scale-factor files since Moriond2019 contain the breakdown of systematics into their individual compo...
Definition: MuonEfficiencyScaleFactors.cxx:460
CP::MuonEfficiencyScaleFactors::mc_effi_replica_deocration
std::string mc_effi_replica_deocration() const
Definition: MuonEfficiencyScaleFactors.cxx:111
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
CP::EfficiencyScaleFactor::ScaleFactor
CorrectionCode ScaleFactor(const xAOD::Muon &mu, float &SF) const
the important bits - extract SF info
Definition: EfficiencyScaleFactor.cxx:292
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
dqt_zlumi_alleff_HIST.eff
int eff
Definition: dqt_zlumi_alleff_HIST.py:113
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
CP::EfficiencyScaleFactor::ApplyMCEfficiencyReplicas
CorrectionCode ApplyMCEfficiencyReplicas(const xAOD::Muon &mu, int n_replicas)
Definition: EfficiencyScaleFactor.cxx:397
CP::MuonEfficiencyScaleFactors::filename_LowPtCalo
std::string filename_LowPtCalo() const
Definition: MuonEfficiencyScaleFactors.cxx:406
CP::MuonEfficiencyScaleFactors::m_lowpt_threshold
float m_lowpt_threshold
threshold below which low-pt SF (i.e. from JPsi) should be used
Definition: MuonEfficiencyScaleFactors.h:188
CP::MuonEfficiencyScaleFactors::m_seperateSystBins
bool m_seperateSystBins
Definition: MuonEfficiencyScaleFactors.h:198
CP::EffiCollection::getUnCorrelatedSystBin
int getUnCorrelatedSystBin(const xAOD::Muon &mu) const
Returns the bin number from which the scale-factor of the muon is going to be retrieved....
Definition: EffiCollection.cxx:316
SG::DataProxy
Definition: DataProxy.h:44
CP::EffiCollection::SetSystematicBin
bool SetSystematicBin(unsigned int Bin)
If systematic decorrelation is activated then the user needs to loop manually over the syst bins.
Definition: EffiCollection.cxx:278
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
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::MuonEfficiencyScaleFactors::getUncorrelatedSysBinName
virtual std::string getUncorrelatedSysBinName(unsigned int Bin) const
Definition: MuonEfficiencyScaleFactors.cxx:618
CP::MuonEfficiencyScaleFactors::measurement
CP::MuonEfficiencyType measurement() const
Returns the type of the measurement to be carried out... E.g. Reco/TTVA/Iso.
Definition: MuonEfficiencyScaleFactors.cxx:93
CP::MuonEfficiencyScaleFactors::m_Type
CP::MuonEfficiencyType m_Type
Definition: MuonEfficiencyScaleFactors.h:204
CP::MuonEfficiencyScaleFactors::data_effi_decoration
std::string data_effi_decoration() const
Definition: MuonEfficiencyScaleFactors.cxx:99
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
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
CP::MuonEfficiencyScaleFactors::m_calibration_version
std::string m_calibration_version
subfolder to load from the calibration db
Definition: MuonEfficiencyScaleFactors.h:184
CP::MuonEfficiencyScaleFactors::affectingSystematics
virtual SystematicSet affectingSystematics() const
returns: the list of all systematics this tool can be affected by
Definition: MuonEfficiencyScaleFactors.cxx:549