ATLAS Offline Software
Loading...
Searching...
No Matches
JvtEfficiencyToolBase.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef JETJVTEFFICIENCY_JVTEFFICIENCYTOOLBASE_H
6#define JETJVTEFFICIENCY_JVTEFFICIENCYTOOLBASE_H
7
9#include "AsgTools/AsgTool.h"
13
14#include <TH2.h>
15#include <memory>
16
17namespace CP {
20 virtual public CP::IJvtEfficiencyTool {
21 public:
23 virtual ~JvtEfficiencyToolBase() override = default;
24
25 virtual StatusCode initialize() override;
26
27 virtual CorrectionCode
28 getEfficiencyScaleFactor(const xAOD::Jet &jet, float &sf) const override;
29
30 virtual CorrectionCode
31 getInefficiencyScaleFactor(const xAOD::Jet &jet, float &sf) const override;
32
33 protected:
34 Gaudi::Property<std::string> m_jetContainer{
35 this, "JetContainer", "",
36 "The name of the jet container, used to correctly initialize the read handles"};
37 Gaudi::Property<bool> m_doTruthRequirement{
38 this, "DoTruthReq", true,
39 "Use the truth-matching requirement. **Strongly** recommended"};
41 this, "TruthHSLabel", "isJvtHS", "Label for truth-matched jets"};
42 Gaudi::Property<float> m_minEta{
43 this, "MinEtaForJvt", -1, "All jets with |eta| below this are out of range"};
44 Gaudi::Property<float> m_maxEta{
45 this, "MaxEtaForJvt", 2.5, "All jets with |eta| above this are out of range"};
46 Gaudi::Property<float> m_minPtForJvt{
47 this, "MinPtForJvt", 20e3, "All jets with pT below this are out of range"};
48 Gaudi::Property<float> m_maxPtForJvt{
49 this, "MaxPtForJvt", 60e3, "All jets with pT above this are out of range"};
50 Gaudi::Property<float> m_dummySFError{
51 this, "DummySFError", 0.1, "The amount by which to vary the dummy SF"};
52 // NB: Use a string not a read handle key as this is not written with a write handle key
53 Gaudi::Property<std::string> m_jetEtaName{
54 this, "JetEtaName", "eta", "The name of the jet eta to use."};
55 std::unique_ptr<TH2> m_jvtHist;
56 std::unique_ptr<TH2> m_effHist;
57 bool m_useDummySFs{false};
58 // The accessor for the jet eta
60 // -1, 0 or +1 depending on the systematic
62 // TEMPORARY: Allow for using an accessor rather than the full decorhandle
63 std::optional<SG::AuxElement::ConstAccessor<char>> m_accIsHS;
64
66 StatusCode initHists(const std::string &file, const std::string &wp);
67 bool isInRange(const xAOD::Jet &jet) const;
68 CorrectionCode getEffImpl(float x, float y, float &sf) const;
69 CorrectionCode getIneffImpl(float x, float y, float &sf) const;
70 };
71} // namespace CP
72
73#endif //> !JETJVTEFFICIENCY_JVTEFFICIENCYTOOLBASE_H
Handle class for reading a decoration on an object.
#define y
#define x
Return value from object correction CP tools.
Gaudi::Property< float > m_minEta
StatusCode initHists(const std::string &file, const std::string &wp)
Read the input histograms. Passing an empty 'file' string uses dummy SFs.
Gaudi::Property< float > m_minPtForJvt
Gaudi::Property< float > m_maxEta
CorrectionCode getIneffImpl(float x, float y, float &sf) const
std::unique_ptr< TH2 > m_jvtHist
SG::ConstAccessor< float > m_etaAcc
std::unique_ptr< TH2 > m_effHist
SG::ReadDecorHandleKey< xAOD::JetContainer > m_truthHSLabel
Gaudi::Property< bool > m_doTruthRequirement
virtual ~JvtEfficiencyToolBase() override=default
virtual CorrectionCode getInefficiencyScaleFactor(const xAOD::Jet &jet, float &sf) const override
Calculate the inefficiency scale factor for the provided jet.
CorrectionCode getEffImpl(float x, float y, float &sf) const
virtual CorrectionCode getEfficiencyScaleFactor(const xAOD::Jet &jet, float &sf) const override
Calculate the efficiency scale factor for the provided jet.
Gaudi::Property< std::string > m_jetContainer
std::optional< SG::AuxElement::ConstAccessor< char > > m_accIsHS
Gaudi::Property< float > m_maxPtForJvt
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
bool isInRange(const xAOD::Jet &jet) const
Gaudi::Property< float > m_dummySFError
Gaudi::Property< std::string > m_jetEtaName
Base class for CP tools providing systematic variations.
Helper class to provide constant type-safe access to aux data.
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58
Select isolated Photons, Electrons and Muons.
Jet_v1 Jet
Definition of the current "jet version".
TFile * file