Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
JetForwardPFlowJvtTool.h
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // JetForwardPFlowJvtTool.h
8 // Header file for class JetForwardPFlowJvtTool
9 // Author: Anastasia Kotsokechagia <anastasia.kotsokechagia@cern.ch>
10 
11 // Tool for calculating fjvt values for pflow jets.
12 // Short describtion of the tool;
13 // First central PU jets are built per vertex.
14 // Reconstructed calibrated jets are then used to calculate the per vertex missing momentum (miss-mom).
15 // The per vertex missing momentum is defined as: The vector some of the calibrated jet momenta (for jets with pt>20GeV && Rpt>0.1 wrt to the vertex) + tracks assosiated to the vertex (otherwise).
16 // PU Jets closeby (dR<0.3) to a HS jet are not considered.
17 // The fJVT value for every forward jet (fj) of the event is then calculated choosing the vertex with the largest negative miss-mom projection on the fj.
18 // User action: After initializing the tool the user has to call the modify(xAOD::JetContainer& jetCont) function. Argument in this fuction is the PFlow jet container of the event.
19 // The fjvt value for every forward jet of the container is then calculated and can be retrieved.
21  //Parameters
22  // m_orLabel: ""
23  // m_jetsName : "Container name for the output reconstructed PU jets "
24  // m_tightOP: "If true a tight fjvt threshold value is applied"
25  // m_outLabelFjvt: "Decorator for passing fJVT threshold (tight or loose)"
26  // m_jetchargedp4: "Name of the jet charged momentum 4-vector"
27  // m_etaThresh: "Maximum eta value for considering a jet as central"
28  // m_forwardMinPt: "Minimum forward jet pt"
29  // m_forwardMaxPt: "Maximum forward jet pt. If -1 no threshold is applied"
30  // m_centerMinPt: "Minimum central jet pt"
31  // m_centerMaxPt: "Maximum central jet pt. If -1 no threshold is applied"
32  // m_pvind: "Hard-Scatter primary vertex index of the event. If -1 it's automatically retrieved from the event"
33  // m_rptCut: "Rpt cut value for central PU jets contributing in the missing momentum calculation"
34  // m_jvtCut: "JVT threshold value for considering a central PU jet as HS"
35  // m_dzCut: "Dz=z-z0 cut value for pfo objects participating in the HS vertex jet reco"
36  // m_vertices: "Number of vertices for which the missing momentum is calculated"
37  // m_maxRap: "Maximum rapidity value in fastjet::AreaDefinition"
38  // m_neutMaxRap: "Maximum rapidity value for neutral pfos participating in jet reco"
39  // m_weight: "PFO weight value"
40  // m_pfoToolName: "Name of PFO retriever tool"
41  // m_wpfoToolName: "Name of PFO weighting tool"
42  // m_pfoJESName: "Name of jet calibration tool"
43  // m_jetAlgo: "Jet calibration collection name"
44  // m_calibconfig: "Calibration config for PFlow jets, need to be updated with latest one"
45  // m_calibSeq: "Calibration sequence to be applied"
46  // m_calibArea: "Calibration area"
47  // m_isdata: "True if data"
48 
49 
50 #ifndef FORWARDPFLOWJVTTOOL_JVT_FORWARDPFLOWJVTTOOL_H
51 #define FORWARDPFLOWJVTTOOL_JVT_FORWARDPFLOWJVTTOOL_H 1
52 
53 // STL includes
54 #include <string>
55 
56 // FrameWork includes
57 #include "AsgTools/ToolHandle.h"
58 #include "AsgTools/AsgTool.h"
62 #include "xAODJet/JetContainer.h"
66 
67 
72 
73 // Pflow / FE tools
74 #include "PFlowUtils/FEHelpers.h"
78 
79 #include "AsgTools/ToolHandle.h"
81 
82 namespace pflow {
83  struct puJets {
84  std::shared_ptr<xAOD::JetContainer> jetCont;
85  std::shared_ptr<xAOD::JetAuxContainer> jetAuxCont;
86  };
87 }
88 
90  : public asg::AsgTool,
91  virtual public IJetDecorator{
93 
94 
95  // Public methods:
97  public:
98 
100  JetForwardPFlowJvtTool(const std::string& name);
101 
104 
105  virtual StatusCode initialize() override;
106 
107 
108  virtual StatusCode decorate(const xAOD::JetContainer& jetCont) const override;
109 
110  float getFJVT(const xAOD::Jet *jet,const std::vector<TVector2>& pileupMomenta) const;
111  bool isForwardJet(const xAOD::Jet *jet) const;
112  bool isCentralJet(const xAOD::Jet *jet) const;
113 
115  virtual std::vector<TVector2> calculateVertexMomenta(const xAOD::JetContainer *jets,int pvind, int vertices) const;
117  bool hasCloseByHSjet(const xAOD::Jet *jet, const xAOD::JetContainer *pjets ) const;
118  double getRpt(const xAOD::Jet *jet) const;
119  fastjet::PseudoJet pfoToPseudoJet(const xAOD::PFO* pfo, const CP::PFO_JetMETConfig_charge& theCharge, const xAOD::Vertex *vx) const;
120  fastjet::PseudoJet feToPseudoJet(const xAOD::FlowElement* fe, const CP::PFO_JetMETConfig_charge& theCharge, const xAOD::Vertex *vx) const;
121  std::size_t getPV() const;
122 
123  protected:
124 
125  SG::ReadHandleKey<jet::TrackVertexAssociation> m_tvaKey{this, "TrackVertexAssociation", "", "Input track-vertex association"};
126  Gaudi::Property<std::string> m_jetContainerName{this, "JetContainer", "", "SG key for the input jet container"};
127  Gaudi::Property<std::string> m_jetsName{this, "jetsName", "AntiKt4PUPFlowJets", "Container name for the output reconstructed PU jets"};
128  Gaudi::Property<std::string> m_jetchargedp4{this, "jetchargedp4", "JetChargedScaleMomentum", "Name of the jet charged momentum 4-vector"};
129 
130  Gaudi::Property<bool> m_isdata{this, "isdata", false, "True if data"};
131  Gaudi::Property<int> m_pvind{this, "pvind", -1, "Hard-Scatter primary vertex index of the event. If -1 it will be automatically retrieved from the event"};
132  Gaudi::Property<int> m_vertices{this, "vertices", 10, "Number of vertices for which the missing momentum is calculated"};
133  Gaudi::Property<bool> m_includePV{this, "includePV", false, "Flag to include jets and tracks associated to PV in the calculation"};
134  Gaudi::Property<double> m_etaThresh{this, "etaThresh", 2.5, "Maximum eta value for considering a jet as central"};
135  Gaudi::Property<double> m_forwardMinPt{this, "forwardMinPt", 18e3, "Minimum forward jet pt"};
136  Gaudi::Property<double> m_forwardMaxPt{this, "forwardMaxPt", -1, "Maximum forward jet pt. If -1 no threshold is applied"};
137  Gaudi::Property<double> m_centerMinPt{this, "centralMinPt", 20e3, "Minimum central jet pt"};
138  Gaudi::Property<double> m_centerMaxPt{this, "centralMaxPt", -1, "Maximum central jet pt. If -1 no threshold is applied"};
139  Gaudi::Property<double> m_fjvtThresh{this, "fjvtThresh", 15e3, "fjvt threshold value"};
140  Gaudi::Property<double> m_rptCut{this, "rptCut", 0.1, "Rpt cut value for central PU jets contributing in the missing momentum calculation"};
141  Gaudi::Property<double> m_jvtCut{this, "jvtCut", 0.2, "JVT threshold value for considering a central PU jet as HS"};
142  Gaudi::Property<double> m_dzCut{this, "dzCut", 2.0, "Dz=z=-z0 cut for pfo objects participating in the HS vertex jet reco"};
143  Gaudi::Property<double> m_maxRap{this, "maxRap", 2.5, "Maximum rapidity value in fastjet::AreaDefinition"};
144  Gaudi::Property<double> m_neutMaxRap{this, "neutMaxRap", 2.5, "Maximum rapidity value for neutral pfos participating in jet reco"};
145  Gaudi::Property<float> m_weight{this, "weight", 0, "PFO weight value"};
146  Gaudi::Property<bool> m_tightOP{this, "tightOP", false, "If true a tight fjvt threshold value is applied"};
147 
148  // not used?
149  //Gaudi::Property<std::string> m_jvtMomentName{"jvtMomentName", "", ""};
150  //Gaudi::Property<double> m_centerJvtThresh{"", 0, ""};
151 
152  SG::ReadHandleKey<xAOD::VertexContainer> m_vxContKey{this, "verticesName", "PrimaryVertices", "Container name of vertices to be retrieved"};
153  SG::ReadHandleKey<xAOD::PFOContainer> m_PFOKey{this, "PFOName", "CHSParticleFlowObjects", "SG Key for CHS PFO Container"};
154  SG::ReadHandleKey<xAOD::FlowElementContainer> m_FEKey{this, "FEName", "", "SG Key for CHS FlowElement Container (overrides PFO if not empty)"};
156 
157  SG::ReadDecorHandleKey<xAOD::JetContainer> m_passJvtKey{this, "passJvtName", "NNJvtPass", "SG key for output pass-JVT decoration"};
158  SG::ReadDecorHandleKey<xAOD::PFO> m_orKey{this, "ORName", "", "OR label"};
159  SG::ReadDecorHandleKey<xAOD::FlowElement> m_orFEKey{this, "ORNameFE", "", "OR label"};
160 
161  SG::WriteDecorHandleKey<xAOD::JetContainer> m_fjvtKey{this, "FjvtName", "passOnlyFJVT", "Decorator for passing fJVT threshold (tight or loose)"};
162  SG::WriteDecorHandleKey<xAOD::JetContainer> m_fjvtRawKey{this, "FjvtRawName", "fJvt", "Decorator for raw fJVT variable"};
163  SG::WriteDecorHandleKey<xAOD::JetContainer> m_isHSKey{this, "isHSName", "isJVTHS", "SG key for output isJVTHS decoration"};
164  SG::WriteDecorHandleKey<xAOD::JetContainer> m_isPUKey{this, "isPUName", "isJvtPU", "SG key for output isJVTPU decoration"};
165 
166  ToolHandle<CP::WeightPFOTool> m_wpfotool{this,"WeightPFOTool", "", "Weight PFO tool name"};
167  ToolHandle<IJetCalibrationTool> m_pfoJES{this,"JetCalibrationTool", "", "Jet calibration tool name"};
168 
169  };
170 #endif //> !FORWARDJVTTOOL_JVT_FORWARDJVTTOOL_H
JetForwardPFlowJvtTool::calculateVertexMomenta
virtual std::vector< TVector2 > calculateVertexMomenta(const xAOD::JetContainer *jets, int pvind, int vertices) const
Definition: JetForwardPFlowJvtTool.cxx:133
SG::WriteDecorHandleKey< xAOD::JetContainer >
pflow::puJets::jetAuxCont
std::shared_ptr< xAOD::JetAuxContainer > jetAuxCont
Definition: JetForwardPFlowJvtTool.h:85
FEHelpers.h
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
PropertyWrapper.h
FlowElementContainer.h
JetForwardPFlowJvtTool::isForwardJet
bool isForwardJet(const xAOD::Jet *jet) const
Definition: JetForwardPFlowJvtTool.cxx:359
JetForwardPFlowJvtTool::decorate
virtual StatusCode decorate(const xAOD::JetContainer &jetCont) const override
Decorate a jet collection without otherwise modifying it.
Definition: JetForwardPFlowJvtTool.cxx:93
JetForwardPFlowJvtTool::m_centerMinPt
Gaudi::Property< double > m_centerMinPt
Definition: JetForwardPFlowJvtTool.h:137
JetForwardPFlowJvtTool::pfoToPseudoJet
fastjet::PseudoJet pfoToPseudoJet(const xAOD::PFO *pfo, const CP::PFO_JetMETConfig_charge &theCharge, const xAOD::Vertex *vx) const
Definition: JetForwardPFlowJvtTool.cxx:315
JetForwardPFlowJvtTool::hasCloseByHSjet
bool hasCloseByHSjet(const xAOD::Jet *jet, const xAOD::JetContainer *pjets) const
Definition: JetForwardPFlowJvtTool.cxx:178
JetForwardPFlowJvtTool::m_jetContainerName
Gaudi::Property< std::string > m_jetContainerName
Definition: JetForwardPFlowJvtTool.h:126
JetForwardPFlowJvtTool::m_pvind
Gaudi::Property< int > m_pvind
Definition: JetForwardPFlowJvtTool.h:131
JetForwardPFlowJvtTool::tagTruth
StatusCode tagTruth(const xAOD::JetContainer *jets, const xAOD::JetContainer *truthJets)
Definition: JetForwardPFlowJvtTool.cxx:397
IJetDecorator
Interface for adding a decoration to a jet container.
Definition: IJetDecorator.h:21
defineDB.jets
jets
Definition: JetTagCalibration/share/defineDB.py:24
JetForwardPFlowJvtTool::m_tvaKey
SG::ReadHandleKey< jet::TrackVertexAssociation > m_tvaKey
Definition: JetForwardPFlowJvtTool.h:125
JetForwardPFlowJvtTool::m_weight
Gaudi::Property< float > m_weight
Definition: JetForwardPFlowJvtTool.h:145
JetForwardPFlowJvtTool::m_isdata
Gaudi::Property< bool > m_isdata
Definition: JetForwardPFlowJvtTool.h:130
IWeightPFOTool.h
SG::ReadHandleKey< jet::TrackVertexAssociation >
JetForwardPFlowJvtTool::m_includePV
Gaudi::Property< bool > m_includePV
Definition: JetForwardPFlowJvtTool.h:133
IJetDecorator.h
JetForwardPFlowJvtTool::m_wpfotool
ToolHandle< CP::WeightPFOTool > m_wpfotool
Definition: JetForwardPFlowJvtTool.h:166
JetForwardPFlowJvtTool::m_pfoJES
ToolHandle< IJetCalibrationTool > m_pfoJES
Definition: JetForwardPFlowJvtTool.h:167
JetForwardPFlowJvtTool
Definition: JetForwardPFlowJvtTool.h:91
IJetCalibrationTool.h
JetForwardPFlowJvtTool::~JetForwardPFlowJvtTool
virtual ~JetForwardPFlowJvtTool()
Destructor:
JetForwardPFlowJvtTool::m_vertices
Gaudi::Property< int > m_vertices
Definition: JetForwardPFlowJvtTool.h:132
ReadDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
JetForwardPFlowJvtTool::m_isPUKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_isPUKey
Definition: JetForwardPFlowJvtTool.h:164
JetForwardPFlowJvtTool::m_jetchargedp4
Gaudi::Property< std::string > m_jetchargedp4
Definition: JetForwardPFlowJvtTool.h:128
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
pflow::puJets::jetCont
std::shared_ptr< xAOD::JetContainer > jetCont
Definition: JetForwardPFlowJvtTool.h:84
CheckAppliedSFs.e3
e3
Definition: CheckAppliedSFs.py:264
JetForwardPFlowJvtTool::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: JetForwardPFlowJvtTool.h:155
JetForwardPFlowJvtTool::getPV
std::size_t getPV() const
Definition: JetForwardPFlowJvtTool.cxx:377
JetForwardPFlowJvtTool::m_passJvtKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_passJvtKey
Definition: JetForwardPFlowJvtTool.h:157
JetForwardPFlowJvtTool::m_jetsName
Gaudi::Property< std::string > m_jetsName
Definition: JetForwardPFlowJvtTool.h:127
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
JetForwardPFlowJvtTool::m_fjvtRawKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_fjvtRawKey
Definition: JetForwardPFlowJvtTool.h:162
JetForwardPFlowJvtTool::m_fjvtKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_fjvtKey
Definition: JetForwardPFlowJvtTool.h:161
JetForwardPFlowJvtTool::feToPseudoJet
fastjet::PseudoJet feToPseudoJet(const xAOD::FlowElement *fe, const CP::PFO_JetMETConfig_charge &theCharge, const xAOD::Vertex *vx) const
Definition: JetForwardPFlowJvtTool.cxx:337
JetForwardPFlowJvtTool::m_vxContKey
SG::ReadHandleKey< xAOD::VertexContainer > m_vxContKey
Definition: JetForwardPFlowJvtTool.h:152
TrackVertexAssociation.h
JetForwardPFlowJvtTool::m_dzCut
Gaudi::Property< double > m_dzCut
Definition: JetForwardPFlowJvtTool.h:142
JetForwardPFlowJvtTool::m_rptCut
Gaudi::Property< double > m_rptCut
Definition: JetForwardPFlowJvtTool.h:140
JetForwardPFlowJvtTool::JetForwardPFlowJvtTool
JetForwardPFlowJvtTool(const std::string &name)
Constructor with parameters:
Definition: JetForwardPFlowJvtTool.cxx:33
WeightPFOTool.h
JetForwardPFlowJvtTool::isCentralJet
bool isCentralJet(const xAOD::Jet *jet) const
Definition: JetForwardPFlowJvtTool.cxx:365
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
pflow
Definition: JetForwardPFlowJvtTool.h:82
WriteDecorHandle.h
Handle class for adding a decoration to an object.
JetForwardPFlowJvtTool::m_FEKey
SG::ReadHandleKey< xAOD::FlowElementContainer > m_FEKey
Definition: JetForwardPFlowJvtTool.h:154
JetForwardPFlowJvtTool::m_jvtCut
Gaudi::Property< double > m_jvtCut
Definition: JetForwardPFlowJvtTool.h:141
JetForwardPFlowJvtTool::m_forwardMaxPt
Gaudi::Property< double > m_forwardMaxPt
Definition: JetForwardPFlowJvtTool.h:136
xAOD::PFO_v1
Class describing a particle flow object.
Definition: PFO_v1.h:35
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
JetForwardPFlowJvtTool::m_tightOP
Gaudi::Property< bool > m_tightOP
Definition: JetForwardPFlowJvtTool.h:146
JetForwardPFlowJvtTool::m_forwardMinPt
Gaudi::Property< double > m_forwardMinPt
Definition: JetForwardPFlowJvtTool.h:135
EventInfo.h
JetForwardPFlowJvtTool::m_orFEKey
SG::ReadDecorHandleKey< xAOD::FlowElement > m_orFEKey
Definition: JetForwardPFlowJvtTool.h:159
WriteDecorHandleKey.h
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
JetForwardPFlowJvtTool::m_fjvtThresh
Gaudi::Property< double > m_fjvtThresh
Definition: JetForwardPFlowJvtTool.h:139
pflow::puJets
Definition: JetForwardPFlowJvtTool.h:83
JetForwardPFlowJvtTool::m_neutMaxRap
Gaudi::Property< double > m_neutMaxRap
Definition: JetForwardPFlowJvtTool.h:144
JetForwardPFlowJvtTool::getRpt
double getRpt(const xAOD::Jet *jet) const
Definition: JetForwardPFlowJvtTool.cxx:371
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
JetContainer.h
JetForwardPFlowJvtTool::m_centerMaxPt
Gaudi::Property< double > m_centerMaxPt
Definition: JetForwardPFlowJvtTool.h:138
JetForwardPFlowJvtTool::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: JetForwardPFlowJvtTool.cxx:44
JetForwardPFlowJvtTool::m_maxRap
Gaudi::Property< double > m_maxRap
Definition: JetForwardPFlowJvtTool.h:143
JetForwardPFlowJvtTool::m_isHSKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_isHSKey
Definition: JetForwardPFlowJvtTool.h:163
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
CP::PFO_JetMETConfig_charge
PFO_JetMETConfig_charge
Definition: Reconstruction/PFlow/PFlowUtils/PFlowUtils/PFODefs.h:11
JetForwardPFlowJvtTool::m_PFOKey
SG::ReadHandleKey< xAOD::PFOContainer > m_PFOKey
Definition: JetForwardPFlowJvtTool.h:153
ReadDecorHandle.h
Handle class for reading a decoration on an object.
JetForwardPFlowJvtTool::m_etaThresh
Gaudi::Property< double > m_etaThresh
Definition: JetForwardPFlowJvtTool.h:134
JetAuxContainer.h
JetForwardPFlowJvtTool::buildPFlowPUjets
pflow::puJets buildPFlowPUjets(const xAOD::Vertex &vx) const
Definition: JetForwardPFlowJvtTool.cxx:188
ToolHandle.h
SG::ReadDecorHandleKey
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Definition: StoreGate/StoreGate/ReadDecorHandleKey.h:85
AsgTool.h
JetForwardPFlowJvtTool::getFJVT
float getFJVT(const xAOD::Jet *jet, const std::vector< TVector2 > &pileupMomenta) const
Definition: JetForwardPFlowJvtTool.cxx:123
JetForwardPFlowJvtTool::m_orKey
SG::ReadDecorHandleKey< xAOD::PFO > m_orKey
Definition: JetForwardPFlowJvtTool.h:158
xAOD::FlowElement_v1
A detector object made of other lower level object(s)
Definition: FlowElement_v1.h:25