ATLAS Offline Software
JetJvtEfficiency.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef JETJVTEFFICIENCYSCALEFACTORS_H_
6 #define JETJVTEFFICIENCYSCALEFACTORS_H_
7 
13 #include "AsgTools/AsgTool.h"
14 #include "AsgTools/AnaToolHandle.h"
18 
20 
21 #include <TH2.h>
22 #include <string>
23 #include <memory>
24 
25 namespace CP {
26 
33 };
34 
36  public CP::SystematicsTool,
37  virtual public CP::IJetJvtEfficiency,
38  virtual public IJetDecorator {
40 
41 public:
42  JetJvtEfficiency( const std::string& name);
43 
44  virtual StatusCode initialize() override;
45 
47 
48  virtual CorrectionCode getEfficiencyScaleFactor(const xAOD::Jet& jet,float& sf) override;
49  virtual CorrectionCode getInefficiencyScaleFactor(const xAOD::Jet& jet,float& sf) override;
50  virtual CorrectionCode applyEfficiencyScaleFactor(const xAOD::Jet& jet) override;
53  virtual bool passesJvtCut(const xAOD::Jet& jet) const override;
54  virtual bool isInRange(const xAOD::Jet& jet) const override;
55 
56  // Decorate jets with flag for passJVT decision
57  virtual StatusCode decorate(const xAOD::JetContainer& jets) const override;
58 
59  virtual StatusCode recalculateScores(const xAOD::JetContainer& jets) const override;
60 
66 
67  float getJvtThresh() const override {return m_jvtCut;}
68  float getUserPtMax() const override {return m_maxPtForJvt;}
70 
71 private:
72 
74 
76 
77  ToolHandle<JetPileupTag::JetVertexNNTagger> m_NNJvtTool_handle;
78  ToolHandle<IAsgSelectionTool> m_jvtSelTool;
79  ToolHandle<IJvtEfficiencyTool> m_jvtEffTool;
80 
81  int m_tagger;
82  std::string m_wp;
83  std::string m_file;
85  std::unique_ptr<TH2> m_h_JvtHist;
86  std::unique_ptr<TH2> m_h_EffHist;
87  std::string m_passJvtDecName;
88  std::string m_sf_decoration_name;
90  std::string m_truthJetContName;
91  std::string m_jetEtaName;
94  std::string m_ORdec;
97  std::string m_jetContainerName;
98  std::string m_NNJvtParamFile;
99  std::string m_NNJvtCutFile;
100 
101  // kept for backwards compatibility with legacy Jvt
102  std::string m_jetJvtMomentName;
103  float m_jvtCut;
105 
106  // configurable accessors/decorators
107  std::unique_ptr<SG::AuxElement::ConstAccessor< float > > m_jetEtaAcc;
108  std::unique_ptr<SG::AuxElement::ConstAccessor< char > > m_passORAcc;
109  std::unique_ptr<SG::AuxElement::Decorator< float > > m_sfDec;
110  std::unique_ptr<SG::AuxElement::Decorator< char > > m_isHSDec;
111  std::unique_ptr<SG::AuxElement::ConstAccessor< char > > m_isHSAcc;
112 
114  "SG key for passJvt decoration (including jet container name)"};
116 };
117 
118 } /* namespace CP */
119 
120 #endif /* JETJVTEFFICIENCYSCALEFACTORS_H_ */
CP::JetJvtEfficiency::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: JetJvtEfficiency.cxx:62
SG::WriteDecorHandleKey
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Definition: StoreGate/StoreGate/WriteDecorHandleKey.h:89
CP::JetJvtEfficiency::m_jvtCutBorder
float m_jvtCutBorder
Definition: JetJvtEfficiency.h:104
beamspotnt.var
var
Definition: bin/beamspotnt.py:1394
CP::JetJvtEfficiency::m_doTruthRequirement
bool m_doTruthRequirement
Definition: JetJvtEfficiency.h:93
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
CP::JetJvtEfficiency::m_sfDec
std::unique_ptr< SG::AuxElement::Decorator< float > > m_sfDec
Definition: JetJvtEfficiency.h:109
CP::JetJvtEfficiency::m_passJvtKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_passJvtKey
Definition: JetJvtEfficiency.h:113
CP::JetJvtEfficiency::m_tagger
int m_tagger
Definition: JetJvtEfficiency.h:81
CP::JetJvtEfficiency::applyInefficiencyScaleFactor
virtual CorrectionCode applyInefficiencyScaleFactor(const xAOD::Jet &jet) override
Definition: JetJvtEfficiency.cxx:232
ASG_TOOL_CLASS2
#define ASG_TOOL_CLASS2(CLASSNAME, INT1, INT2)
Definition: AsgToolMacros.h:77
CP::JetJvtEfficiency::m_passJvtDecName
std::string m_passJvtDecName
Definition: JetJvtEfficiency.h:87
CP::JetJvtEfficiency::applySystematicVariation
StatusCode applySystematicVariation(const CP::SystematicSet &set) override
effects: configure this tool for the given list of systematic variations.
Definition: JetJvtEfficiency.h:64
CP::JetJvtEfficiency::m_jvtEffTool
ToolHandle< IJvtEfficiencyTool > m_jvtEffTool
Definition: JetJvtEfficiency.h:79
JetVertexNNTagger.h
CP::JetJvtEfficiency::m_appliedSystEnum
SystApplied m_appliedSystEnum
Definition: JetJvtEfficiency.h:75
CP::JetJvtEfficiency::m_file
std::string m_file
Definition: JetJvtEfficiency.h:83
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition: SystematicSet.h:31
CP::JetJvtEfficiency::m_NNJvtTool_handle
ToolHandle< JetPileupTag::JetVertexNNTagger > m_NNJvtTool_handle
Definition: JetJvtEfficiency.h:77
CP::SystematicsTool::affectingSystematics
virtual SystematicSet affectingSystematics() const
returns: the list of all systematics this tool can be affected by guarantee: strong failures: out of ...
Definition: SystematicsTool.cxx:40
CP::NNJVT_EFFICIENCY_UP
@ NNJVT_EFFICIENCY_UP
Definition: JetJvtEfficiency.h:30
IJetDecorator
Interface for adding a decoration to a jet container.
Definition: IJetDecorator.h:21
CP::JetJvtEfficiency::m_wp
std::string m_wp
Definition: JetJvtEfficiency.h:82
CP::JetJvtEfficiency
Definition: JetJvtEfficiency.h:38
CP::SystematicsTool::applySystematicVariation
virtual StatusCode applySystematicVariation(const SystematicSet &systConfig)
effects: configure this tool for the given list of systematic variations.
Definition: SystematicsTool.cxx:74
CP::SystematicVariation
Definition: SystematicVariation.h:47
CP::JetJvtEfficiency::getEfficiencyScaleFactor
virtual CorrectionCode getEfficiencyScaleFactor(const xAOD::Jet &jet, float &sf) override
Definition: JetJvtEfficiency.cxx:217
CP::JetJvtEfficiency::JetJvtEfficiency
JetJvtEfficiency()
IAsgSelectionTool.h
CP::JetJvtEfficiency::m_taggingAlg
JvtTagger m_taggingAlg
Definition: JetJvtEfficiency.h:84
CP::JetJvtEfficiency::m_useDummySFs
bool m_useDummySFs
Definition: JetJvtEfficiency.h:96
CP::JetJvtEfficiency::m_jvtSelTool
ToolHandle< IAsgSelectionTool > m_jvtSelTool
Definition: JetJvtEfficiency.h:78
IJetDecorator.h
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
CP::JetJvtEfficiency::isInRange
virtual bool isInRange(const xAOD::Jet &jet) const override
Definition: JetJvtEfficiency.cxx:305
CP::JetJvtEfficiency::applyEfficiencyScaleFactor
virtual CorrectionCode applyEfficiencyScaleFactor(const xAOD::Jet &jet) override
Definition: JetJvtEfficiency.cxx:225
CP::JetJvtEfficiency::getUserPtMax
float getUserPtMax() const override
Definition: JetJvtEfficiency.h:68
CP::JetJvtEfficiency::decorate
virtual StatusCode decorate(const xAOD::JetContainer &jets) const override
Decorate a jet collection without otherwise modifying it.
Definition: JetJvtEfficiency.cxx:281
CP::JetJvtEfficiency::m_jetEtaName
std::string m_jetEtaName
Definition: JetJvtEfficiency.h:91
CP::JetJvtEfficiency::m_NNJvtParamFile
std::string m_NNJvtParamFile
Definition: JetJvtEfficiency.h:98
CP::FJVT_EFFICIENCY_DOWN
@ FJVT_EFFICIENCY_DOWN
Definition: JetJvtEfficiency.h:31
CP::JetJvtEfficiency::m_NNJvtCutFile
std::string m_NNJvtCutFile
Definition: JetJvtEfficiency.h:99
CP::JetJvtEfficiency::tagTruth
StatusCode tagTruth(const xAOD::IParticleContainer *jets, const xAOD::IParticleContainer *truthJets) override
Definition: JetJvtEfficiency.cxx:338
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
CP::SystematicsTool::recommendedSystematics
virtual SystematicSet recommendedSystematics() const
returns: the list of all systematics this tool can be affected by guarantee: strong failures: out of ...
Definition: SystematicsTool.cxx:47
CP::SystematicsTool::isAffectedBySystematic
virtual bool isAffectedBySystematic(const SystematicVariation &systematic) const
returns: whether this tool is affected by the given systematic guarantee: no-fail
Definition: SystematicsTool.cxx:32
CP::JetJvtEfficiency::m_isHS_decoration_name
std::string m_isHS_decoration_name
Definition: JetJvtEfficiency.h:89
IJvtEfficiencyTool.h
CP::JetJvtEfficiency::applyAllEfficiencyScaleFactor
virtual CorrectionCode applyAllEfficiencyScaleFactor(const xAOD::IParticleContainer *jets, float &sf) override
Definition: JetJvtEfficiency.cxx:239
CP::JetJvtEfficiency::passesJvtCut
virtual bool passesJvtCut(const xAOD::Jet &jet) const override
Definition: JetJvtEfficiency.cxx:300
CP::JetJvtEfficiency::recommendedSystematics
CP::SystematicSet recommendedSystematics() const override
returns: the list of all systematics this tool can be affected by guarantee: strong failures: out of ...
Definition: JetJvtEfficiency.h:63
CP::JetJvtEfficiency::m_passORAcc
std::unique_ptr< SG::AuxElement::ConstAccessor< char > > m_passORAcc
Definition: JetJvtEfficiency.h:108
CP::JetJvtEfficiency::recalculateScores
virtual StatusCode recalculateScores(const xAOD::JetContainer &jets) const override
Definition: JetJvtEfficiency.cxx:288
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CP::JetJvtEfficiency::m_jetContainerName
std::string m_jetContainerName
Definition: JetJvtEfficiency.h:97
CP::JvtTagger
JvtTagger
Definition: IJetJvtEfficiency.h:22
CP::JetJvtEfficiency::m_suppressOutputDependence
bool m_suppressOutputDependence
Definition: JetJvtEfficiency.h:115
CP::JetJvtEfficiency::sysApplySystematicVariation
StatusCode sysApplySystematicVariation(const CP::SystematicSet &) override
effects: configure this tool for the given list of systematic variations.
Definition: JetJvtEfficiency.cxx:334
CP::JetJvtEfficiency::m_ORdec
std::string m_ORdec
Definition: JetJvtEfficiency.h:94
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
CP::JetJvtEfficiency::m_isHSAcc
std::unique_ptr< SG::AuxElement::ConstAccessor< char > > m_isHSAcc
Definition: JetJvtEfficiency.h:111
SystematicsTool.h
AnaToolHandle.h
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
CP::JetJvtEfficiency::getJvtThresh
float getJvtThresh() const override
Definition: JetJvtEfficiency.h:67
CP::JetJvtEfficiency::isAffectedBySystematic
bool isAffectedBySystematic(const CP::SystematicVariation &var) const override
returns: whether this tool is affected by the given systematic guarantee: no-fail
Definition: JetJvtEfficiency.h:61
CP::NONE
@ NONE
Definition: JetJvtEfficiency.h:28
CP::JetJvtEfficiency::m_jetEtaAcc
std::unique_ptr< SG::AuxElement::ConstAccessor< float > > m_jetEtaAcc
Definition: JetJvtEfficiency.h:107
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
CP::JetJvtEfficiency::m_h_EffHist
std::unique_ptr< TH2 > m_h_EffHist
Definition: JetJvtEfficiency.h:86
CP::JetJvtEfficiency::m_isHSDec
std::unique_ptr< SG::AuxElement::Decorator< char > > m_isHSDec
Definition: JetJvtEfficiency.h:110
CP::JetJvtEfficiency::m_jvtCut
float m_jvtCut
Definition: JetJvtEfficiency.h:103
CP::NNJVT_EFFICIENCY_DOWN
@ NNJVT_EFFICIENCY_DOWN
Definition: JetJvtEfficiency.h:29
EventInfo.h
CP::JetJvtEfficiency::affectingSystematics
CP::SystematicSet affectingSystematics() const override
returns: the list of all systematics this tool can be affected by guarantee: strong failures: out of ...
Definition: JetJvtEfficiency.h:62
WriteDecorHandleKey.h
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
CP::SystApplied
SystApplied
Definition: JetJvtEfficiency.h:27
CP::JetJvtEfficiency::m_truthJetContName
std::string m_truthJetContName
Definition: JetJvtEfficiency.h:90
CP::JetJvtEfficiency::histInitialize
StatusCode histInitialize()
CP::JetJvtEfficiency::m_jetJvtMomentName
std::string m_jetJvtMomentName
Definition: JetJvtEfficiency.h:102
mapkey::sf
@ sf
Definition: TElectronEfficiencyCorrectionTool.cxx:38
CP::SystematicsTool
Base class for CP tools providing systematic variations.
Definition: SystematicsTool.h:48
CP::IJetJvtEfficiency
Definition: IJetJvtEfficiency.h:37
CP::JetJvtEfficiency::m_maxPtForJvt
float m_maxPtForJvt
Definition: JetJvtEfficiency.h:92
CP::CorrectionCode
Return value from object correction CP tools.
Definition: CorrectionCode.h:31
ReadDecorHandle.h
Handle class for reading a decoration on an object.
CP::JetJvtEfficiency::m_h_JvtHist
std::unique_ptr< TH2 > m_h_JvtHist
Definition: JetJvtEfficiency.h:85
CP::FJVT_EFFICIENCY_UP
@ FJVT_EFFICIENCY_UP
Definition: JetJvtEfficiency.h:32
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
CP::JetJvtEfficiency::m_useMuBinsSF
bool m_useMuBinsSF
Definition: JetJvtEfficiency.h:95
AsgTool.h
IJetJvtEfficiency.h
CP::JetJvtEfficiency::m_sf_decoration_name
std::string m_sf_decoration_name
Definition: JetJvtEfficiency.h:88
CP::JetJvtEfficiency::getInefficiencyScaleFactor
virtual CorrectionCode getInefficiencyScaleFactor(const xAOD::Jet &jet, float &sf) override
Definition: JetJvtEfficiency.cxx:221