JetForwardJvtTool.h 4.84 KB
Newer Older
Mark Hodgkinson's avatar
Mark Hodgkinson committed
1
2
3
///////////////////////// -*- C++ -*- /////////////////////////////

/*
4
  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
Mark Hodgkinson's avatar
Mark Hodgkinson committed
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
*/

// JetForwardJvtTool.h
// Header file for class JetForwardJvtTool
// Author: Matt Klein<matthew.henry.klein@cern.ch>
///////////////////////////////////////////////////////////////////
#ifndef FORWARDJVTTOOL_JVT_FORWARDJVTTOOL_H
#define FORWARDJVTTOOL_JVT_FORWARDJVTTOOL_H 1

// STL includes
#include <string>


// FrameWork includes
#include "AsgTools/ToolHandle.h"
#include "AsgTools/AsgTool.h"
21
22
23
#include "AsgTools/PropertyWrapper.h"
#include "AsgDataHandles/ReadDecorHandleKey.h"
#include "AsgDataHandles/WriteDecorHandleKey.h"
Mark Hodgkinson's avatar
Mark Hodgkinson committed
24
25
26

// EDM includes
#include "xAODJet/JetContainer.h"
27
#include "xAODTracking/VertexContainer.h"
Mark Hodgkinson's avatar
Mark Hodgkinson committed
28
29
#include "xAODMissingET/MissingETContainer.h"
#include "xAODCaloEvent/CaloCluster.h"
30
#include "JetInterface/IJetDecorator.h"
Mark Hodgkinson's avatar
Mark Hodgkinson committed
31
32
33
34
35
36
#include "AsgTools/IAsgTool.h"

//ASG_TOOL_INTERFACE(IJetUpdateJvt)

  class JetForwardJvtTool
  : public asg::AsgTool,
37
38
    virtual public IJetDecorator{
    ASG_TOOL_CLASS(JetForwardJvtTool,IJetDecorator)
Mark Hodgkinson's avatar
Mark Hodgkinson committed
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56

    // This macro defines the constructor with the interface declaration
    //ASG_TOOL_CLASS(JetForwardJvtTool, IJetForwardJvtTool)

    ///////////////////////////////////////////////////////////////////
    // Public methods:
    ///////////////////////////////////////////////////////////////////
  public:

    // Copy constructor:

    /// Constructor with parameters:
    JetForwardJvtTool(const std::string& name);

    /// Destructor:
    virtual ~JetForwardJvtTool();

    // Athena algtool's Hooks
57
    virtual StatusCode initialize() override;
Mark Hodgkinson's avatar
Mark Hodgkinson committed
58

59
    virtual StatusCode decorate(const xAOD::JetContainer& jetCont) const override;
Mark Hodgkinson's avatar
Mark Hodgkinson committed
60
61
62
63
64
65
66

    float getFJVT(const xAOD::Jet *jet) const;
    bool forwardJet(const xAOD::Jet *jet) const;
    bool centralJet(const xAOD::Jet *jet) const;
    float getDrpt(const xAOD::Jet *jet) const;
    int getJetVertex(const xAOD::Jet *jet) const;

67
    StatusCode tagTruth(const xAOD::JetContainer *jets,const xAOD::JetContainer *truthJets);
Mark Hodgkinson's avatar
Mark Hodgkinson committed
68
69
70
71
72
    void calculateVertexMomenta(const xAOD::JetContainer *jets) const;
    float getCombinedWidth(const xAOD::Jet *jet) const;

  private:

73
74
75
76
77
78
79
80
81
82
83
    Gaudi::Property<double> m_etaThresh{this, "EtaThresh", 2.5, "Eta threshold"};
    Gaudi::Property<double> m_forwardMinPt{this, "ForwardMinPt", 20e3, "Forward minimum Pt"};
    Gaudi::Property<double> m_forwardMaxPt{this, "ForwardMaxPt", 50e3, "Forward maximum Pt"};
    Gaudi::Property<double> m_centerMinPt{this, "CentralMinPt", 20e3, "Central minimum Pt"};
    Gaudi::Property<double> m_centerMaxPt{this, "CentralMaxPt", -1, "Central maximum Pt"};
    Gaudi::Property<double> m_centerJvtThresh{this, "CentralJvtThresh", 0.14, "Central JVT threshold"};
    Gaudi::Property<double> m_centerDrptThresh{this, "CentralDrptThresh", 0.2, "Central drpt threshold"};
    Gaudi::Property<double> m_maxStochPt{this, "CentralMaxStochPt", 35e3, "Central maximum StochPt"};
    Gaudi::Property<double> m_jetScaleFactor{this, "JetScaleFactor", 0.4, "Jet scale factor"};
    Gaudi::Property<double> m_fjvtThresh{this, "FjvtThresh", 15e3, "FJVT threshold"}; //15GeV->92%,11GeV->85%
    Gaudi::Property<bool> m_tightOP{this, "UseTightOP", false, "Use tight (true) or loose (false)"};
84
    Gaudi::Property<bool> m_recalculateFjvt{this, "RecalculateFjvt", true, "Recalculate Fjvt or use stored value"}; 
Mark Hodgkinson's avatar
Mark Hodgkinson committed
85
    mutable std::vector<TVector2> m_pileupMomenta;
86
    mutable size_t m_pvind = 0UL;
Mark Hodgkinson's avatar
Mark Hodgkinson committed
87
88
89
90
91
    void getPV() const;

    /// Default constructor:
    JetForwardJvtTool();

92
93
94
95
96
97
98
99
    Gaudi::Property<std::string> m_jetContainerName{this, "JetContainer", "", "SG key for the input jet container"};
    SG::ReadDecorHandleKey<xAOD::JetContainer> m_orKey{this, "OverlapDec", "", "Overlap decoration key"};
    SG::WriteDecorHandleKey<xAOD::JetContainer> m_outKey{this, "OutputDec", "passFJVT", "Output decoration key"};
    SG::WriteDecorHandleKey<xAOD::JetContainer> m_isHSKey{this, "IsJvtHSName", "isJvtHS", "Decoration key for isJvtHS"};
    SG::WriteDecorHandleKey<xAOD::JetContainer> m_isPUKey{this, "IsJvtPUName", "isJvtPU", "Decoration key for isJvtPU"};
    SG::WriteDecorHandleKey<xAOD::JetContainer> m_fjvtDecKey{this, "FJVTName", "fJvt", "Decoration key for fJvt"};
    
    SG::ReadHandleKey<xAOD::VertexContainer> m_vertexContainerName{this, "VertexContainerName", "PrimaryVertices", "SG key for vertex container"};
100
    SG::ReadHandleKey<xAOD::MissingETContainer> m_trkMETName{this, "Met_TrackName", "MET_Track", "SG key for MET track container"};
101
102
103
104

    SG::ReadDecorHandleKey<xAOD::JetContainer> m_widthKey{this, "WidthName", "Width", "SG key for jet width"};
    SG::ReadDecorHandleKey<xAOD::JetContainer> m_jvtMomentKey{this, "JvtMomentName", "Jvt", "JVT moment name"};
    SG::ReadDecorHandleKey<xAOD::JetContainer> m_sumPtsKey{this, "SumPtsName", "SumPtTrkPt500", "SG key for SumPt vector"};
105

Mark Hodgkinson's avatar
Mark Hodgkinson committed
106
107
  };
#endif //> !FORWARDJVTTOOL_JVT_FORWARDJVTTOOL_H