ATLAS Offline Software
Loading...
Searching...
No Matches
JetForwardJvtToolBDT.h
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
5*/
6
7// JetForwardJvtToolBDT.h
8// Header file for class JetForwardJvtToolBDT
9// Author: Louis Portales<louis.portales@cern.ch>
11#ifndef FORWARDJVTTOOLBDT_JVT_FORWARDJVTTOOLBDT_H
12#define FORWARDJVTTOOLBDT_JVT_FORWARDJVTTOOLBDT_H 1
13
14// STL includes
15#include <string>
16
17// Root includes
18#include "TMVA/Reader.h"
19#include <TH3.h>
20#include <TString.h>
21#include <TFile.h>
22
23// FrameWork includes
24#include "AsgTools/ToolHandle.h"
27
28// EDM includes
36#include "AsgTools/IAsgTool.h"
41
42
43namespace TMVA{ class Reader; }
44
46 : public asg::AsgTool,
47 virtual public IJetDecorator{
49
50
51 // Public methods:
53 public:
54
55
57 JetForwardJvtToolBDT(const std::string& name);
58
61
62 // Athena algtool's Hooks
63 virtual StatusCode initialize() override;
64
65 virtual StatusCode decorate(const xAOD::JetContainer& jetCont) const override;
66
67 // MVfJVT
68 StatusCode getInputs ( const xAOD::Jet *jet ) const;
69 float getMVfJVT ( const xAOD::Jet *jet, int pvind , const std::vector<TVector2>& pileupMomenta ) const;
70 float getFJVT ( const xAOD::Jet *jet, int pvind , const std::vector<TVector2>& pileupMomenta ) const;
71 bool forwardJet ( const xAOD::Jet *jet ) const;
72 bool centralJet ( const xAOD::Jet *jet ) const;
73 float getDrpt ( const xAOD::Jet *jet ) const;
74 int getJetVertex ( const xAOD::Jet *jet ) const;
75 bool passMVfJVT ( float mvfjvt , float pt, float eta ) const;
76
77 StatusCode tagTruth(const xAOD::JetContainer *jets,const xAOD::JetContainer *truthJets);
78 std::vector<TVector2> calculateVertexMomenta(const xAOD::JetContainer *jets, int pvind) const;
79 int getPV() const;
80
81private:
82
83 Gaudi::Property<std::string> m_configDir{this, "configDir", "JetPileupTag/MVfJVT/", "Configuration directory"};
84 Gaudi::Property<std::vector<std::string> > m_MVconfig{this, "ConfigFiles", {
85 "weights/MVfJVT_pt2030_etaHigh_muHigh.May2019.weights.xml",
86 "weights/MVfJVT_pt2030_etaLow_muHigh.May2019.weights.xml",
87 "weights/MVfJVT_pt3040_etaHigh_muHigh.May2019.weights.xml",
88 "weights/MVfJVT_pt3040_etaLow_muHigh.May2019.weights.xml",
89 "weights/MVfJVT_pt4050_etaHigh_muHigh.May2019.weights.xml",
90 "weights/MVfJVT_pt4050_etaLow_muHigh.May2019.weights.xml",
91 "weights/MVfJVT_pt50plus_etaHigh_muHigh.May2019.weights.xml",
92 "weights/MVfJVT_pt50plus_etaLow_muHigh.May2019.weights.xml",
93 "weights/MVfJVT_pt2030_etaHigh_muLow.May2019.weights.xml",
94 "weights/MVfJVT_pt2030_etaLow_muLow.May2019.weights.xml",
95 "weights/MVfJVT_pt3040_etaHigh_muLow.May2019.weights.xml",
96 "weights/MVfJVT_pt3040_etaLow_muLow.May2019.weights.xml",
97 "weights/MVfJVT_pt4050_etaHigh_muLow.May2019.weights.xml",
98 "weights/MVfJVT_pt4050_etaLow_muLow.May2019.weights.xml",
99 "weights/MVfJVT_pt50plus_etaHigh_muLow.May2019.weights.xml",
100 "weights/MVfJVT_pt50plus_etaLow_muLow.May2019.weights.xml"
101 }, "List of config file names"}; // pt [20,30,40,50,120] || |eta| [2.5,3.2,4.5] || mu [0,50,inf.];
102 Gaudi::Property<std::string> m_wpFile{this, "WPfile", "MVfJVT_WPs.Nov2019.root", "WP file"};
103
104 std::unique_ptr< TFile > m_wpFileIn;
105 std::unique_ptr< TMVA::Reader > m_MVreader;
106 std::unique_ptr< TH3D > m_mvfjvtThresh;
107
108 Gaudi::Property<double> m_etaThresh{this, "EtaThresh", 2.5, "Eta threshold"};
109 Gaudi::Property<double> m_forwardMinPt{this, "ForwardMinPt", 20e3, "Forward minimum pt"};
110 Gaudi::Property<double> m_forwardMaxPt{this, "ForwardMaxPt", 120e3, "Forward maximum pt"};
111 Gaudi::Property<double> m_centerMinPt{this, "CentralMinPt", 20e3, "Central minimum pt"};
112 Gaudi::Property<double> m_centerMaxPt{this, "CentralMaxPt", -1, "Central maximum pt (set to -1 for no limit)"};
113 Gaudi::Property<double> m_centerJvtThresh{this, "CentralJvtThresh", 0.11, "Central JVT threshold"};
114 Gaudi::Property<std::string> m_jvtMomentName{this, "JvtMomentName", "Jvt", "SG key for JVT moment"};
115 Gaudi::Property<double> m_centerDrptThresh{this, "CentralDrptThresh", 0.2, "Central drpt threshold"};
116 Gaudi::Property<double> m_maxStochPt{this, "CentralMaxStochPt", 35e3, "Central maximum stochpt"};
117 Gaudi::Property<double> m_jetScaleFactor{this, "JetScaleFactor", 0.4, "Jet scale factor"};
118 Gaudi::Property<std::string> m_OP{this, "OperatingPoint", "DEFAULT", "Selected operating point, can be 'LOOSE', 'TIGHT' or 'TIGHTER'"};
119 Gaudi::Property<bool> m_getTagger{this, "retrieveTagger", false, "Whether to retrieve the tagger"};
120 Gaudi::Property<bool> m_isAna{this, "AnaToolMode", false, "True if running in AnaTool mode"};
121 Gaudi::Property<int> m_pvind{this, "PVIndexHS", -1, ""};
122
123 Gaudi::Property<std::string> m_jetContainerName{this, "JetContainer", "", "SG key of input jet container"};
124
125 SG::WriteDecorHandleKey<xAOD::JetContainer> m_outMVKey{this, "OutputDecMV", "passMVFJVT", "SG key for the output MV decoration"};
126
127 SG::WriteDecorHandleKey<xAOD::JetContainer> m_mvfjvtKey{this, "MVFJVTName", "MVfJVT", "SG key for the output MVfJVT decoration"};
128 SG::WriteDecorHandleKey<xAOD::JetContainer> m_cllambda2Key{this, "cllambda2Name", "LeadclSecondLambda", "SG key for the LeadclSecondLambda decoration"};
129 SG::WriteDecorHandleKey<xAOD::JetContainer> m_clwidthKey{this, "cletawidthName", "LeadclWidth", "SG key for the cluster eta width decoration"};
130 SG::WriteDecorHandleKey<xAOD::JetContainer> m_clisoKey{this, "clisoName", "SumclIso", "SG key for the cluster isolation decoration"};
131 SG::WriteDecorHandleKey<xAOD::JetContainer> m_clemprobKey{this, "clemprobName", "SumclEMprob", "SG key for the cluster EMprob decoration"};
132 SG::WriteDecorHandleKey<xAOD::JetContainer> m_cleKey{this, "cleName", "Sumcle", "SG key for the cluster energy decoration"};
133
134 SG::ReadDecorHandleKey<xAOD::JetContainer> m_lcllambda2NTKey{this, "lcllambda2NTName", "LeadingClusterSecondLambda", "Leading cluster second lambda to use if getTagger is false"};
135 SG::ReadDecorHandleKey<xAOD::JetContainer> m_lcllambda2Key{this, "lcllambda2Name", "DFCommonJets_MVfJVT_LeadclSecondLambda", "Leading cluster second lambda to use if getTagger is true"};
136 SG::ReadDecorHandleKey<xAOD::JetContainer> m_lclwidthKey{this, "lclwidthName", "DFCommonJets_MVfJVT_LeadclWidth", "Leading cluster width to use if getTagger is true"};
137 SG::ReadDecorHandleKey<xAOD::JetContainer> m_lclisoKey{this, "lclisoName", "DFCommonJets_MVfJVT_SumclIso", "Leading cluster isolation to use if getTagger is true"};
138 SG::ReadDecorHandleKey<xAOD::JetContainer> m_lclemprobKey{this, "lclemprobName", "DFCommonJets_MVfJVT_SumclEMprob", "Leading cluster EMprob to use if getTagger is true"};
139 SG::ReadDecorHandleKey<xAOD::JetContainer> m_lcleKey{this, "lcleName", "DFCommonJets_MVfJVT_Sumcle", "Leading cluster energy to use if getTagger is true"};
140
141 SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{this, "EventInfoName", "EventInfo", "SG key for input EventInfo"};
142 SG::ReadHandleKey<xAOD::VertexContainer> m_vertexContainerKey{this, "VertexContainerName", "PrimaryVertices", "SG key for input vertex container"};
143 SG::ReadHandleKey<xAOD::CaloClusterContainer> m_caloClusterContainerKey{this, "CaloClusterContainerName" "CaloCalTopoClusters", "SG key for input calo cluster container"};
144 SG::ReadHandleKey<xAOD::MissingETContainer> m_trkMetKey{this, "TrackMetName", "MET_Track", "SG key for input track MET container"};
145
146 SG::WriteDecorHandleKey<xAOD::JetContainer> m_isHSKey{this, "isHSName", "isJvtHS", "SG key for output isHS decoration"};
147 SG::WriteDecorHandleKey<xAOD::JetContainer> m_isPUKey{this, "isPUName", "isJvtPU", "SG key for output isPU decoration"};
148
149};
150#endif //> !FORWARDJVTTOOLBDT_JVT_FORWARDJVTTOOLBDT_H
Scalar eta() const
pseudorapidity method
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Handle class for reading a decoration on an object.
Handle class for adding a decoration to an object.
Interface for adding a decoration to a jet container.
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_caloClusterContainerKey
Gaudi::Property< std::vector< std::string > > m_MVconfig
std::vector< TVector2 > calculateVertexMomenta(const xAOD::JetContainer *jets, int pvind) const
Gaudi::Property< std::string > m_jvtMomentName
SG::WriteDecorHandleKey< xAOD::JetContainer > m_cllambda2Key
std::unique_ptr< TH3D > m_mvfjvtThresh
SG::WriteDecorHandleKey< xAOD::JetContainer > m_clisoKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_lclwidthKey
Gaudi::Property< double > m_forwardMaxPt
SG::WriteDecorHandleKey< xAOD::JetContainer > m_clwidthKey
Gaudi::Property< double > m_centerMinPt
Gaudi::Property< std::string > m_OP
SG::WriteDecorHandleKey< xAOD::JetContainer > m_isPUKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_outMVKey
Gaudi::Property< std::string > m_jetContainerName
SG::ReadDecorHandleKey< xAOD::JetContainer > m_lcllambda2NTKey
Gaudi::Property< bool > m_getTagger
SG::WriteDecorHandleKey< xAOD::JetContainer > m_clemprobKey
Gaudi::Property< double > m_centerJvtThresh
SG::WriteDecorHandleKey< xAOD::JetContainer > m_isHSKey
float getDrpt(const xAOD::Jet *jet) const
Gaudi::Property< bool > m_isAna
SG::ReadDecorHandleKey< xAOD::JetContainer > m_lclisoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
float getMVfJVT(const xAOD::Jet *jet, int pvind, const std::vector< TVector2 > &pileupMomenta) const
StatusCode tagTruth(const xAOD::JetContainer *jets, const xAOD::JetContainer *truthJets)
virtual ~JetForwardJvtToolBDT()
Destructor:
SG::WriteDecorHandleKey< xAOD::JetContainer > m_cleKey
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContainerKey
Gaudi::Property< double > m_jetScaleFactor
Gaudi::Property< double > m_etaThresh
JetForwardJvtToolBDT(const std::string &name)
Constructor with parameters:
SG::ReadDecorHandleKey< xAOD::JetContainer > m_lcleKey
bool centralJet(const xAOD::Jet *jet) const
Gaudi::Property< double > m_centerMaxPt
Gaudi::Property< double > m_maxStochPt
Gaudi::Property< std::string > m_wpFile
Gaudi::Property< int > m_pvind
int getJetVertex(const xAOD::Jet *jet) const
std::unique_ptr< TMVA::Reader > m_MVreader
std::unique_ptr< TFile > m_wpFileIn
Gaudi::Property< std::string > m_configDir
SG::ReadHandleKey< xAOD::MissingETContainer > m_trkMetKey
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
StatusCode getInputs(const xAOD::Jet *jet) const
Gaudi::Property< double > m_centerDrptThresh
bool forwardJet(const xAOD::Jet *jet) const
virtual StatusCode decorate(const xAOD::JetContainer &jetCont) const override
Decorate a jet collection without otherwise modifying it.
SG::WriteDecorHandleKey< xAOD::JetContainer > m_mvfjvtKey
float getFJVT(const xAOD::Jet *jet, int pvind, const std::vector< TVector2 > &pileupMomenta) const
SG::ReadDecorHandleKey< xAOD::JetContainer > m_lcllambda2Key
Gaudi::Property< double > m_forwardMinPt
bool passMVfJVT(float mvfjvt, float pt, float eta) const
SG::ReadDecorHandleKey< xAOD::JetContainer > m_lclemprobKey
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
Pythia8::Reader Reader
Jet_v1 Jet
Definition of the current "jet version".
JetContainer_v1 JetContainer
Definition of the current "jet container version".