ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
ITrigGlobalEfficiencyCorrectionTool Class Referenceabstract

#include <ITrigGlobalEfficiencyCorrectionTool.h>

Inheritance diagram for ITrigGlobalEfficiencyCorrectionTool:
Collaboration diagram for ITrigGlobalEfficiencyCorrectionTool:

Public Member Functions

virtual CP::CorrectionCode getEfficiencyScaleFactor (const std::vector< const xAOD::IParticle * > &particles, double &efficiencyScaleFactor)=0
 
virtual CP::CorrectionCode getEfficiency (const std::vector< const xAOD::IParticle * > &particles, double &efficiencyData, double &efficiencyMc)=0
 
virtual CP::CorrectionCode checkTriggerMatching (bool &matched, const std::vector< const xAOD::IParticle * > &particles)=0
 
template<typename... Args>
auto getEfficiencyScaleFactor (Args &... args) -> std::enable_if_t< validArgs< Args... >(1), CP::CorrectionCode >
 Alternatively, the list of particles can be supplied via one or several vectors of xAOD::Electron*‍/Muon*‍/Photon* The generic signature is getEfficiencyScaleFactor((const) vector<(const)Type1*>&, ..., (const) vector<(const)TypeN*>&, double& efficiencyScaleFactor) e.g. More...
 
template<typename... Args>
auto getEfficiency (Args &... args) -> std::enable_if_t< validArgs< Args... >(2), CP::CorrectionCode >
 
template<typename... Args>
auto checkTriggerMatching (bool &matched, Args &... args) -> std::enable_if_t< validArgs< Args... >(0), CP::CorrectionCode >
 
virtual CP::CorrectionCode getRelevantTriggers (std::vector< std::string > &triggers)=0
 This will fill the 'triggers' argument with the names of the triggers relevant for the current run number, among those specified in the tool configuration. More...
 
virtual CP::CorrectionCode countTriggerLegs (const std::string &trigger, std::size_t &numberOfLegs)=0
 This utility function provides the number of legs for the specified trigger. More...
 
virtual CP::CorrectionCode getEfficiencyScaleFactor (unsigned runNumber, const std::vector< const xAOD::IParticle * > &particles, double &efficiencyScaleFactor)=0
 These should in principle not be used (except by unit tests), as the CP tools require the EventInfo decoration "RandomRunNumber" to be present. More...
 
virtual CP::CorrectionCode getEfficiency (unsigned runNumber, const std::vector< const xAOD::IParticle * > &particles, double &efficiencyData, double &efficiencyMc)=0
 
virtual bool isAffectedBySystematic (const SystematicVariation &systematic) const =0
 Declare the interface that this class provides. More...
 
virtual StatusCode applySystematicVariation (const SystematicSet &systConfig)=0
 effects: configure this tool for the given list of systematic variations. More...
 
virtual SystematicSet affectingSystematics () const =0
 the list of all systematics this tool can be affected by More...
 
virtual SystematicSet recommendedSystematics () const =0
 the list of all systematics this tool recommends to use More...
 
virtual void print () const =0
 Print the state of the tool. More...
 

Static Public Member Functions

template<typename Arg >
static constexpr bool validArgs (unsigned nTrailingDoubles)
 
template<typename Arg1 , typename Arg2 , typename... OtherArgs>
static constexpr bool validArgs (unsigned nTrailingDoubles)
 
static std::string toolnameForDefaultScaleFactor ()
 To be used with the ListOfLegsPerTool property: More...
 

Protected Member Functions

double * handleArg (double &arg, std::vector< const xAOD::IParticle * > &)
 
template<typename P >
double * handleArg (const std::vector< P > &arg, std::vector< const xAOD::IParticle * > &particles)
 

Detailed Description

Definition at line 20 of file ITrigGlobalEfficiencyCorrectionTool.h.

Member Function Documentation

◆ affectingSystematics()

virtual SystematicSet CP::IReentrantSystematicsTool::affectingSystematics ( ) const
pure virtualinherited

the list of all systematics this tool can be affected by

Implemented in InDet::InDetTrackSystematicsTool, CP::ElectronChargeEfficiencyCorrectionTool, AsgElectronEfficiencyCorrectionTool, CP::IsolationCorrectionTool, CP::EgammaCalibrationAndSmearingTool, CP::FFJetSmearingTool, SimpleMuonTriggerScaleFactors, SimplePhotonEfficiencyCorrectionTool, PMGTools::PMGTruthWeightTool, AsgPhotonEfficiencyCorrectionTool, ParticleScaleFactorTool, InDet::InDetTrackTruthFilterTool, CP::JetJvtEfficiency, InDet::InDetTrackBiasingTool, InDet::JetTrackFilterTool, InDet::InDetTrackSmearingTool, CP::BaseFakeBkgTool, InDet::InclusiveTrackFilterTool, TrigGlobalEfficiencyCorrectionTool, SimpleElectronEfficiencyCorrectionTool, TauAnalysisTools::DiTauSmearingTool, CP::JetQGTagger, CP::MuonCalibTool, CP::MuonCalibIntScaleSmearTool, CP::MuonCalibIntHighpTSmearTool, CP::MuonCalibIntSagittaTool, BTaggingEfficiencyJsonTool, InDet::IInDetTrackSmearingTool, InDet::IInDetTrackTruthFilterTool, CP::IIsolationCorrectionTool, InDet::IInDetTrackBiasingTool, InDet::IJetTrackFilterTool, BTaggingEfficiencyTool, JetUncertaintiesTool, BTaggingTruthTaggingTool, CP::PileupReweightingTool, met::METSystematicsTool, BTaggingEigenVectorRecompositionTool, TauAnalysisTools::DiTauEfficiencyCorrectionsTool, CP::JetTileCorrectionTool, TauAnalysisTools::CommonSmearingTool, CP::SystematicsTool, TauAnalysisTools::CommonEfficiencyTool, TauAnalysisTools::TauEfficiencyCorrectionsTool, TauAnalysisTools::TauSmearingTool, CP::MuonTriggerScaleFactors, and CP::MuonEfficiencyScaleFactors.

◆ applySystematicVariation()

virtual StatusCode CP::ISystematicsTool::applySystematicVariation ( const SystematicSet systConfig)
pure virtualinherited

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

Implemented in CP::ElectronChargeEfficiencyCorrectionTool, CP::MuonCalibTool, CP::MuonCalibIntScaleSmearTool, CP::MuonCalibIntHighpTSmearTool, CP::MuonCalibIntSagittaTool, CP::SystematicsTool, CP::JetTileCorrectionTool, CP::MuonEfficiencyScaleFactors, CP::JetQGTagger, CP::FFJetSmearingTool, CP::IIsolationCorrectionTool, AsgElectronEfficiencyCorrectionTool, CP::IsolationCorrectionTool, CP::EgammaCalibrationAndSmearingTool, AsgPhotonEfficiencyCorrectionTool, ParticleScaleFactorTool, CP::BaseFakeBkgTool, TauAnalysisTools::DiTauSmearingTool, TrigGlobalEfficiencyCorrectionTool, JetUncertaintiesTool, BTaggingTruthTaggingTool, CP::PileupReweightingTool, BTaggingEigenVectorRecompositionTool, TauAnalysisTools::DiTauEfficiencyCorrectionsTool, TauAnalysisTools::TauEfficiencyCorrectionsTool, TauAnalysisTools::TauSmearingTool, CP::MuonTriggerScaleFactors, BTaggingEfficiencyJsonTool, TauAnalysisTools::CommonSmearingTool, TauAnalysisTools::CommonEfficiencyTool, TauAnalysisTools::TauEfficiencyTriggerTool, CP::JetJvtEfficiency, BTaggingEfficiencyTool, met::METSystematicsTool, InDet::IInDetTrackSmearingTool, InDet::IInDetTrackTruthFilterTool, InDet::IInDetTrackBiasingTool, InDet::IJetTrackFilterTool, SimpleMuonTriggerScaleFactors, SimplePhotonEfficiencyCorrectionTool, InDet::InDetTrackTruthFilterTool, InDet::InDetTrackBiasingTool, InDet::JetTrackFilterTool, InDet::InDetTrackSmearingTool, InDet::InclusiveTrackFilterTool, SimpleElectronEfficiencyCorrectionTool, and InDet::InDetTrackSystematicsTool.

◆ checkTriggerMatching() [1/2]

template<typename... Args>
auto ITrigGlobalEfficiencyCorrectionTool::checkTriggerMatching ( bool &  matched,
Args &...  args 
) -> std::enable_if_t<validArgs<Args...>(0), CP::CorrectionCode>

Definition at line 110 of file ITrigGlobalEfficiencyCorrectionTool.h.

112 {
113  std::vector<const xAOD::IParticle*> particles;
114  double* eff[] __attribute__((unused)) = { nullptr, handleArg(args, particles)... };
116 }

◆ checkTriggerMatching() [2/2]

virtual CP::CorrectionCode ITrigGlobalEfficiencyCorrectionTool::checkTriggerMatching ( bool &  matched,
const std::vector< const xAOD::IParticle * > &  particles 
)
pure virtual

◆ countTriggerLegs()

virtual CP::CorrectionCode ITrigGlobalEfficiencyCorrectionTool::countTriggerLegs ( const std::string &  trigger,
std::size_t &  numberOfLegs 
)
pure virtual

This utility function provides the number of legs for the specified trigger.

Implemented in TrigGlobalEfficiencyCorrectionTool.

◆ getEfficiency() [1/3]

template<typename... Args>
auto ITrigGlobalEfficiencyCorrectionTool::getEfficiency ( Args &...  args) -> std::enable_if_t<validArgs<Args...>(2), CP::CorrectionCode>

Definition at line 101 of file ITrigGlobalEfficiencyCorrectionTool.h.

103 {
104  std::vector<const xAOD::IParticle*> particles;
105  double* eff[] = { nullptr, handleArg(args, particles)... };
106  return getEfficiency(particles, *eff[sizeof...(Args)-1], *eff[sizeof...(Args)]);
107 }

◆ getEfficiency() [2/3]

virtual CP::CorrectionCode ITrigGlobalEfficiencyCorrectionTool::getEfficiency ( const std::vector< const xAOD::IParticle * > &  particles,
double &  efficiencyData,
double &  efficiencyMc 
)
pure virtual

◆ getEfficiency() [3/3]

virtual CP::CorrectionCode ITrigGlobalEfficiencyCorrectionTool::getEfficiency ( unsigned  runNumber,
const std::vector< const xAOD::IParticle * > &  particles,
double &  efficiencyData,
double &  efficiencyMc 
)
pure virtual

◆ getEfficiencyScaleFactor() [1/3]

template<typename... Args>
auto ITrigGlobalEfficiencyCorrectionTool::getEfficiencyScaleFactor ( Args &...  args) -> std::enable_if_t<validArgs<Args...>(1), CP::CorrectionCode>

Alternatively, the list of particles can be supplied via one or several vectors of xAOD::Electron*‍/Muon*‍/Photon* The generic signature is getEfficiencyScaleFactor((const) vector<(const)Type1*>&, ..., (const) vector<(const)TypeN*>&, double& efficiencyScaleFactor) e.g.

getEfficiencyScaleFactor(electrons, muons, sf); getEfficiencyScaleFactor(photons, sf); getEfficiencyScaleFactor(muons, electrons, photons, sf); don't forget the last argument(s)! (scale factor for getEfficiencyScaleFactor(), data and MC efficiencies for getEfficiency())

Definition at line 92 of file ITrigGlobalEfficiencyCorrectionTool.h.

94 {
95  std::vector<const xAOD::IParticle*> particles;
96  double* sf[] = { nullptr, handleArg(args, particles)... };
97  return getEfficiencyScaleFactor(particles, *sf[sizeof...(Args)]);
98 }

◆ getEfficiencyScaleFactor() [2/3]

virtual CP::CorrectionCode ITrigGlobalEfficiencyCorrectionTool::getEfficiencyScaleFactor ( const std::vector< const xAOD::IParticle * > &  particles,
double &  efficiencyScaleFactor 
)
pure virtual

◆ getEfficiencyScaleFactor() [3/3]

virtual CP::CorrectionCode ITrigGlobalEfficiencyCorrectionTool::getEfficiencyScaleFactor ( unsigned  runNumber,
const std::vector< const xAOD::IParticle * > &  particles,
double &  efficiencyScaleFactor 
)
pure virtual

These should in principle not be used (except by unit tests), as the CP tools require the EventInfo decoration "RandomRunNumber" to be present.

Implemented in TrigGlobalEfficiencyCorrectionTool.

◆ getRelevantTriggers()

virtual CP::CorrectionCode ITrigGlobalEfficiencyCorrectionTool::getRelevantTriggers ( std::vector< std::string > &  triggers)
pure virtual

This will fill the 'triggers' argument with the names of the triggers relevant for the current run number, among those specified in the tool configuration.

Implemented in TrigGlobalEfficiencyCorrectionTool.

◆ handleArg() [1/2]

template<typename P >
double* ITrigGlobalEfficiencyCorrectionTool::handleArg ( const std::vector< P > &  arg,
std::vector< const xAOD::IParticle * > &  particles 
)
inlineprotected

Definition at line 59 of file ITrigGlobalEfficiencyCorrectionTool.h.

60  {
61  for(auto ptr : arg) particles.push_back(static_cast<const xAOD::IParticle*>(ptr));
62  return nullptr;
63  }

◆ handleArg() [2/2]

double* ITrigGlobalEfficiencyCorrectionTool::handleArg ( double &  arg,
std::vector< const xAOD::IParticle * > &   
)
inlineprotected

Definition at line 58 of file ITrigGlobalEfficiencyCorrectionTool.h.

58 { return &arg; }

◆ isAffectedBySystematic()

virtual bool CP::ISystematicsTool::isAffectedBySystematic ( const SystematicVariation systematic) const
pure virtualinherited

Declare the interface that this class provides.

returns: whether this tool is affected by the given systematics

Implemented in CP::JetQGTagger, CP::ElectronChargeEfficiencyCorrectionTool, CP::MuonCalibTool, CP::MuonCalibIntScaleSmearTool, CP::MuonCalibIntHighpTSmearTool, CP::MuonCalibIntSagittaTool, CP::JetTileCorrectionTool, CP::SystematicsTool, CP::MuonEfficiencyScaleFactors, CP::JetJvtEfficiency, met::METSystematicsTool, AsgElectronEfficiencyCorrectionTool, CP::IsolationCorrectionTool, CP::EgammaCalibrationAndSmearingTool, CP::FFJetSmearingTool, ParticleScaleFactorTool, AsgPhotonEfficiencyCorrectionTool, CP::BaseFakeBkgTool, TrigGlobalEfficiencyCorrectionTool, TauAnalysisTools::DiTauSmearingTool, BTaggingEfficiencyJsonTool, CP::IIsolationCorrectionTool, BTaggingEfficiencyTool, JetUncertaintiesTool, BTaggingTruthTaggingTool, CP::PileupReweightingTool, BTaggingEigenVectorRecompositionTool, TauAnalysisTools::DiTauEfficiencyCorrectionsTool, TauAnalysisTools::CommonSmearingTool, TauAnalysisTools::CommonEfficiencyTool, TauAnalysisTools::TauEfficiencyCorrectionsTool, TauAnalysisTools::TauSmearingTool, CP::MuonTriggerScaleFactors, SimpleMuonTriggerScaleFactors, SimplePhotonEfficiencyCorrectionTool, InDet::InDetTrackTruthFilterTool, InDet::InDetTrackBiasingTool, InDet::JetTrackFilterTool, InDet::InDetTrackSmearingTool, InDet::InclusiveTrackFilterTool, SimpleElectronEfficiencyCorrectionTool, InDet::InDetTrackSystematicsTool, InDet::IInDetTrackSmearingTool, InDet::IInDetTrackTruthFilterTool, InDet::IInDetTrackBiasingTool, and InDet::IJetTrackFilterTool.

◆ print()

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

◆ recommendedSystematics()

virtual SystematicSet CP::IReentrantSystematicsTool::recommendedSystematics ( ) const
pure virtualinherited

the list of all systematics this tool recommends to use

Implemented in CP::ElectronChargeEfficiencyCorrectionTool, AsgElectronEfficiencyCorrectionTool, CP::IsolationCorrectionTool, CP::EgammaCalibrationAndSmearingTool, CP::FFJetSmearingTool, SimpleMuonTriggerScaleFactors, SimplePhotonEfficiencyCorrectionTool, PMGTools::PMGTruthWeightTool, AsgPhotonEfficiencyCorrectionTool, InDet::InDetTrackTruthFilterTool, ParticleScaleFactorTool, CP::JetJvtEfficiency, InDet::InDetTrackBiasingTool, InDet::JetTrackFilterTool, InDet::InDetTrackSmearingTool, CP::BaseFakeBkgTool, InDet::InclusiveTrackFilterTool, TauAnalysisTools::DiTauSmearingTool, TrigGlobalEfficiencyCorrectionTool, SimpleElectronEfficiencyCorrectionTool, CP::JetQGTagger, CP::MuonCalibTool, CP::MuonCalibIntScaleSmearTool, CP::MuonCalibIntHighpTSmearTool, CP::MuonCalibIntSagittaTool, InDet::InDetTrackSystematicsTool, BTaggingEfficiencyJsonTool, InDet::IInDetTrackSmearingTool, InDet::IInDetTrackTruthFilterTool, CP::IIsolationCorrectionTool, InDet::IInDetTrackBiasingTool, InDet::IJetTrackFilterTool, BTaggingEfficiencyTool, JetUncertaintiesTool, BTaggingTruthTaggingTool, CP::PileupReweightingTool, met::METSystematicsTool, BTaggingEigenVectorRecompositionTool, TauAnalysisTools::DiTauEfficiencyCorrectionsTool, CP::JetTileCorrectionTool, CP::SystematicsTool, TauAnalysisTools::CommonSmearingTool, TauAnalysisTools::CommonEfficiencyTool, TauAnalysisTools::TauEfficiencyCorrectionsTool, TauAnalysisTools::TauSmearingTool, CP::MuonTriggerScaleFactors, and CP::MuonEfficiencyScaleFactors.

◆ toolnameForDefaultScaleFactor()

static std::string ITrigGlobalEfficiencyCorrectionTool::toolnameForDefaultScaleFactor ( )
inlinestatic

To be used with the ListOfLegsPerTool property:

Definition at line 56 of file ITrigGlobalEfficiencyCorrectionTool.h.

56 { return "RETURN_DEFAULT_SCALE_FACTOR"; }

◆ validArgs() [1/2]

template<typename Arg >
constexpr bool ITrigGlobalEfficiencyCorrectionTool::validArgs ( unsigned  nTrailingDoubles)
staticconstexpr

Definition at line 67 of file ITrigGlobalEfficiencyCorrectionTool.h.

68 {
69  if(std::is_same<double, Arg>::value) return (nTrailingDoubles==1);
70  using P = std::remove_cv_t<Arg>;
71  return std::is_same<P, std::vector<xAOD::Electron*>>::value
72  || std::is_same<P, std::vector<const xAOD::Electron*>>::value
73  || std::is_same<P, std::vector<xAOD::Muon*>>::value
74  || std::is_same<P, std::vector<const xAOD::Muon*>>::value
75  || std::is_same<P, std::vector<xAOD::Photon*>>::value
76  || std::is_same<P, std::vector<const xAOD::Photon*>>::value;
77 }

◆ validArgs() [2/2]

template<typename Arg1 , typename Arg2 , typename... OtherArgs>
constexpr bool ITrigGlobalEfficiencyCorrectionTool::validArgs ( unsigned  nTrailingDoubles)
staticconstexpr

Definition at line 80 of file ITrigGlobalEfficiencyCorrectionTool.h.

81 {
82  bool xs [] = { std::is_same<OtherArgs, double>::value..., true };
83  for(bool x : xs) if(!x) return validArgs<Arg1>(0) && validArgs<Arg2, OtherArgs...>(nTrailingDoubles);
84  unsigned nTD = sizeof...(OtherArgs);
85  if(nTD == nTrailingDoubles) return validArgs<Arg1>(0) && validArgs<Arg2>(0);
86  if(nTD == nTrailingDoubles-1) return validArgs<Arg1>(0) && std::is_same<Arg2, double>::value;
87  if(nTD == nTrailingDoubles-2) return std::is_same<Arg1, double>::value && std::is_same<Arg2, double>::value;
88  return false;
89 }

The documentation for this class was generated from the following file:
DMTest::P
P_v1 P
Definition: P.h:23
ITrigGlobalEfficiencyCorrectionTool::handleArg
double * handleArg(double &arg, std::vector< const xAOD::IParticle * > &)
Definition: ITrigGlobalEfficiencyCorrectionTool.h:58
athena.value
value
Definition: athena.py:124
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
Args
Definition: test_lwtnn_fastgraph.cxx:12
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
x
#define x
ITrigGlobalEfficiencyCorrectionTool::validArgs
static constexpr bool validArgs(unsigned nTrailingDoubles)
Definition: ITrigGlobalEfficiencyCorrectionTool.h:67
create_dcsc_inputs_sqlite.arg
list arg
Definition: create_dcsc_inputs_sqlite.py:48
python.ElectronD3PDObject.matched
matched
Definition: ElectronD3PDObject.py:138
unused
void unused(Args &&...)
Definition: VP1ExpertSettings.cxx:39
ITrigGlobalEfficiencyCorrectionTool::getEfficiencyScaleFactor
virtual CP::CorrectionCode getEfficiencyScaleFactor(const std::vector< const xAOD::IParticle * > &particles, double &efficiencyScaleFactor)=0
__attribute__
__attribute__((always_inline)) inline uint16_t TileCalibDrawerBase
Definition: TileCalibDrawerBase.h:190
ITrigGlobalEfficiencyCorrectionTool::checkTriggerMatching
virtual CP::CorrectionCode checkTriggerMatching(bool &matched, const std::vector< const xAOD::IParticle * > &particles)=0
mapkey::sf
@ sf
Definition: TElectronEfficiencyCorrectionTool.cxx:38
ITrigGlobalEfficiencyCorrectionTool::getEfficiency
virtual CP::CorrectionCode getEfficiency(const std::vector< const xAOD::IParticle * > &particles, double &efficiencyData, double &efficiencyMc)=0
LArG4FSStartPointFilter.particles
list particles
Definition: LArG4FSStartPointFilter.py:84
dqt_zlumi_alleff_HIST.eff
int eff
Definition: dqt_zlumi_alleff_HIST.py:113
python.CaloScaleNoiseConfig.args
args
Definition: CaloScaleNoiseConfig.py:80