1 |
//--------------------------------------------------------------------------------------------------
|
2 |
// $Id $
|
3 |
//
|
4 |
// JetIDMVA
|
5 |
//
|
6 |
// Helper Class for Jet Id MVA
|
7 |
//
|
8 |
// Authors: P. Harris
|
9 |
//--------------------------------------------------------------------------------------------------
|
10 |
|
11 |
#ifndef MITPHYSICS_UTILS_JetIDMVA_H
|
12 |
#define MITPHYSICS_UTILS_JetIDMVA_H
|
13 |
|
14 |
#include "CondFormats/JetMETObjects/interface/FactorizedJetCorrector.h"
|
15 |
#include "MitAna/DataTree/interface/PFJetFwd.h"
|
16 |
#include "MitAna/DataTree/interface/VertexFwd.h"
|
17 |
#include "MitAna/DataTree/interface/TrackFwd.h"
|
18 |
#include "MitAna/DataTree/interface/PFJet.h"
|
19 |
#include "MitAna/DataTree/interface/PFJetCol.h"
|
20 |
#include "MitAna/DataTree/interface/PFCandidateCol.h"
|
21 |
#include "MitAna/DataTree/interface/PileupEnergyDensityCol.h"
|
22 |
#include "MitCommon/MathTools/interface/MathUtils.h"
|
23 |
|
24 |
// for Rho definitons
|
25 |
#include "MitPhysics/Utils/interface/RhoUtilities.h"
|
26 |
|
27 |
class TRandom3;
|
28 |
namespace TMVA {
|
29 |
class Reader;
|
30 |
}
|
31 |
|
32 |
namespace mithep {
|
33 |
class JetIDMVA {
|
34 |
public:
|
35 |
JetIDMVA();
|
36 |
~JetIDMVA();
|
37 |
|
38 |
enum MVAType {
|
39 |
kBaseline = 0,
|
40 |
k42 = 1,
|
41 |
k52 = 2,
|
42 |
kCut = 3,
|
43 |
kQGP = 4,
|
44 |
k53 = 5,
|
45 |
k53MET = 6,
|
46 |
k53METFull = 7
|
47 |
};
|
48 |
|
49 |
enum CutType {
|
50 |
kTight = 0,
|
51 |
kMedium = 1,
|
52 |
kLoose = 2,
|
53 |
kMET = 3
|
54 |
};
|
55 |
|
56 |
void Initialize(JetIDMVA::CutType iCutType,
|
57 |
TString iLowPtWeights ="$CMSSW_BASE/src/MitPhysics/data/mva_JetID_lowpt.weights.xml",
|
58 |
TString iHighPtWeights="$CMSSW_BASE/src/MitPhysics/data/mva_JetID_highpt.weights.xml",
|
59 |
JetIDMVA::MVAType iType=kBaseline,
|
60 |
TString iCutFileName ="$CMSSW_BASE/src/MitPhysics/Utils/python/JetIdParams_cfi.py",bool i42=false);
|
61 |
|
62 |
Bool_t IsInitialized() const { return fIsInitialized; }
|
63 |
Double_t MVAValue(
|
64 |
Float_t iNPV ,
|
65 |
Float_t iJPt1 ,
|
66 |
Float_t iJEta1 ,
|
67 |
Float_t iJPhi1 ,
|
68 |
Float_t iJD01 ,
|
69 |
Float_t iJDZ1 ,
|
70 |
Float_t iBeta ,
|
71 |
Float_t iBetaStar,
|
72 |
Float_t iNCharged,
|
73 |
Float_t iNNeutrals,
|
74 |
Float_t iDRMean ,
|
75 |
Float_t iFrac01 ,
|
76 |
Float_t iFrac02 ,
|
77 |
Float_t iFrac03 ,
|
78 |
Float_t iFrac04 ,
|
79 |
Float_t iFrac05 ,
|
80 |
Float_t iDR2Mean ,
|
81 |
Float_t iPtD
|
82 |
);
|
83 |
//Cut Based
|
84 |
Bool_t passCut(const PFJet *iJet,const Vertex *iVertex,const VertexCol *iVertices);
|
85 |
|
86 |
Bool_t passPt(const PFJet *iJet, FactorizedJetCorrector *iJetCorrector=0,
|
87 |
const PileupEnergyDensityCol *iPileupEnergyDensity=0,
|
88 |
RhoUtilities::RhoType type=RhoUtilities::DEFAULT);
|
89 |
//UNcorrected Jets
|
90 |
Bool_t pass(const PFJet *iJet,const Vertex *iVertex,const VertexCol *iVertices,
|
91 |
FactorizedJetCorrector *iJetCorrector,
|
92 |
const PileupEnergyDensityCol *iPileupEnergyDensity,
|
93 |
RhoUtilities::RhoType type = RhoUtilities::DEFAULT);
|
94 |
|
95 |
//Corrected Jets
|
96 |
Bool_t pass(const PFJet *iJet,const Vertex *iVertex,const VertexCol *iVertices);
|
97 |
|
98 |
//Uncorrected Jets
|
99 |
Double_t MVAValue(const PFJet *iJet,const Vertex *iVertex,const VertexCol *iVertices,
|
100 |
FactorizedJetCorrector *iJetCorrector,
|
101 |
const PileupEnergyDensityCol *iPileupEnergyDensity,
|
102 |
Bool_t printDebug=false);
|
103 |
|
104 |
Double_t* QGValue(const PFJet *iJet,const Vertex *iVertex,const VertexCol *iVertices, //Vertex here is the PV
|
105 |
FactorizedJetCorrector *iJetCorrector,
|
106 |
const PileupEnergyDensityCol *iPileupEnergyDensity,
|
107 |
Bool_t printDebug);
|
108 |
|
109 |
//Corrected Jets
|
110 |
Double_t MVAValue(const PFJet *iJet,const Vertex *iVertex,const VertexCol *iVertices,
|
111 |
Bool_t printDebug=false);
|
112 |
|
113 |
|
114 |
double correctedPt(const PFJet *iJet, FactorizedJetCorrector *iJetCorrector,
|
115 |
const PileupEnergyDensityCol *iPUEnergyDensity,
|
116 |
RhoUtilities::RhoType type = RhoUtilities::DEFAULT,int iId=-1);
|
117 |
|
118 |
Float_t fJetPtMin;
|
119 |
Float_t fDZCut;
|
120 |
Bool_t f42;
|
121 |
|
122 |
protected:
|
123 |
TMVA::Reader *fReader;
|
124 |
TMVA::Reader *fLowPtReader;
|
125 |
TString fLowPtMethodName;
|
126 |
TString fHighPtMethodName;
|
127 |
MVAType fType;
|
128 |
CutType fCutType;
|
129 |
Bool_t fIsInitialized;
|
130 |
Float_t fMVACut[4][4]; //Fix the cut array
|
131 |
Float_t fRMSCut[4][4];
|
132 |
Float_t fBetaStarCut[4][4];
|
133 |
|
134 |
Float_t fNVtx ;
|
135 |
Float_t fJPt1 ;
|
136 |
Float_t fJEta1 ;
|
137 |
Float_t fJPhi1 ;
|
138 |
Float_t fJD01 ;
|
139 |
Float_t fJDZ1 ;
|
140 |
Float_t fBeta ;
|
141 |
Float_t fBetaStar ;
|
142 |
Float_t fNCharged ;
|
143 |
Float_t fNNeutrals;
|
144 |
Float_t fNParticles;
|
145 |
Float_t fDRMean ;
|
146 |
Float_t fPtD ;
|
147 |
Float_t fFrac01 ;
|
148 |
Float_t fFrac02 ;
|
149 |
Float_t fFrac03 ;
|
150 |
Float_t fFrac04 ;
|
151 |
Float_t fFrac05 ;
|
152 |
Float_t fDR2Mean ;
|
153 |
|
154 |
ClassDef(JetIDMVA,0)
|
155 |
};
|
156 |
}
|
157 |
|
158 |
|
159 |
#endif
|