1 |
pharris |
1.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 |
ceballos |
1.5 |
// for Rho definitons
|
25 |
|
|
#include "MitPhysics/Utils/interface/RhoUtilities.h"
|
26 |
|
|
|
27 |
pharris |
1.1 |
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 |
pharris |
1.6 |
kBaseline = 0,
|
40 |
|
|
k42 = 1,
|
41 |
pharris |
1.7 |
k52 = 2,
|
42 |
|
|
kCut = 3
|
43 |
pharris |
1.1 |
};
|
44 |
|
|
|
45 |
pharris |
1.3 |
enum CutType {
|
46 |
|
|
kTight = 0,
|
47 |
|
|
kMedium = 1,
|
48 |
pharris |
1.4 |
kLoose = 2,
|
49 |
|
|
kMET = 3
|
50 |
pharris |
1.3 |
};
|
51 |
|
|
|
52 |
|
|
void Initialize(JetIDMVA::CutType iCutType,
|
53 |
|
|
TString iLowPtWeights ="$CMSSW_BASE/src/MitPhysics/data/mva_JetID_lowpt.weights.xml",
|
54 |
|
|
TString iHighPtWeights="$CMSSW_BASE/src/MitPhysics/data/mva_JetID_highpt.weights.xml",
|
55 |
|
|
JetIDMVA::MVAType iType=kBaseline,
|
56 |
|
|
TString iCutFileName ="$CMSSW_BASE/src/MitPhysics/Utils/python/JetIdParams_cfi.py");
|
57 |
pharris |
1.1 |
|
58 |
|
|
Bool_t IsInitialized() const { return fIsInitialized; }
|
59 |
|
|
Double_t MVAValue(
|
60 |
|
|
Float_t iNPV ,
|
61 |
|
|
Float_t iJPt1 ,
|
62 |
|
|
Float_t iJEta1 ,
|
63 |
|
|
Float_t iJPhi1 ,
|
64 |
|
|
Float_t iJD01 ,
|
65 |
|
|
Float_t iJDZ1 ,
|
66 |
pharris |
1.3 |
Float_t iBeta ,
|
67 |
|
|
Float_t iBetaStar,
|
68 |
|
|
Float_t iNCharged,
|
69 |
|
|
Float_t iNNeutrals,
|
70 |
|
|
Float_t iDRMean ,
|
71 |
|
|
Float_t iFrac01 ,
|
72 |
|
|
Float_t iFrac02 ,
|
73 |
|
|
Float_t iFrac03 ,
|
74 |
|
|
Float_t iFrac04 ,
|
75 |
pharris |
1.6 |
Float_t iFrac05 ,
|
76 |
|
|
Float_t iDR2Mean
|
77 |
pharris |
1.1 |
);
|
78 |
pharris |
1.7 |
//Cut Based
|
79 |
|
|
Bool_t passCut(const PFJet *iJet,const Vertex *iVertex,const VertexCol *iVertices);
|
80 |
pharris |
1.1 |
|
81 |
pharris |
1.8 |
Bool_t passPt(const PFJet *iJet, FactorizedJetCorrector *iJetCorrector=0,
|
82 |
|
|
const PileupEnergyDensityCol *iPileupEnergyDensity=0,
|
83 |
|
|
RhoUtilities::RhoType type=RhoUtilities::DEFAULT);
|
84 |
pharris |
1.2 |
//UNcorrected Jets
|
85 |
pharris |
1.3 |
Bool_t pass(const PFJet *iJet,const Vertex *iVertex,const VertexCol *iVertices,
|
86 |
pharris |
1.1 |
FactorizedJetCorrector *iJetCorrector,
|
87 |
ceballos |
1.5 |
const PileupEnergyDensityCol *iPileupEnergyDensity,
|
88 |
|
|
RhoUtilities::RhoType type = RhoUtilities::DEFAULT);
|
89 |
|
|
|
90 |
pharris |
1.2 |
//Corrected Jets
|
91 |
pharris |
1.3 |
Bool_t pass(const PFJet *iJet,const Vertex *iVertex,const VertexCol *iVertices);
|
92 |
pharris |
1.2 |
|
93 |
|
|
//Uncorrected Jets
|
94 |
pharris |
1.3 |
Double_t MVAValue(const PFJet *iJet,const Vertex *iVertex,const VertexCol *iVertices,
|
95 |
pharris |
1.1 |
FactorizedJetCorrector *iJetCorrector,
|
96 |
|
|
const PileupEnergyDensityCol *iPileupEnergyDensity,
|
97 |
|
|
Bool_t printDebug=false);
|
98 |
|
|
|
99 |
pharris |
1.2 |
//Corrected Jets
|
100 |
pharris |
1.3 |
Double_t MVAValue(const PFJet *iJet,const Vertex *iVertex,const VertexCol *iVertices,
|
101 |
pharris |
1.2 |
Bool_t printDebug=false);
|
102 |
|
|
|
103 |
pharris |
1.1 |
|
104 |
|
|
double correctedPt(const PFJet *iJet, FactorizedJetCorrector *iJetCorrector,
|
105 |
ceballos |
1.5 |
const PileupEnergyDensityCol *iPUEnergyDensity,
|
106 |
|
|
RhoUtilities::RhoType type = RhoUtilities::DEFAULT);
|
107 |
pharris |
1.1 |
|
108 |
|
|
Float_t fJetPtMin;
|
109 |
pharris |
1.3 |
Float_t fDZCut;
|
110 |
pharris |
1.1 |
|
111 |
|
|
protected:
|
112 |
|
|
TMVA::Reader *fReader;
|
113 |
pharris |
1.6 |
TMVA::Reader *fLowPtReader;
|
114 |
pharris |
1.3 |
TString fLowPtMethodName;
|
115 |
|
|
TString fHighPtMethodName;
|
116 |
pharris |
1.1 |
MVAType fType;
|
117 |
pharris |
1.3 |
CutType fCutType;
|
118 |
pharris |
1.1 |
Bool_t fIsInitialized;
|
119 |
pharris |
1.3 |
Float_t fMVACut[4][4]; //Fix the cut array
|
120 |
pharris |
1.7 |
Float_t fRMSCut[4][4];
|
121 |
|
|
Float_t fBetaStarCut[4][4];
|
122 |
|
|
|
123 |
pharris |
1.3 |
Float_t fNVtx ;
|
124 |
|
|
Float_t fJPt1 ;
|
125 |
|
|
Float_t fJEta1 ;
|
126 |
|
|
Float_t fJPhi1 ;
|
127 |
|
|
Float_t fJD01 ;
|
128 |
|
|
Float_t fJDZ1 ;
|
129 |
|
|
Float_t fBeta ;
|
130 |
|
|
Float_t fBetaStar ;
|
131 |
|
|
Float_t fNCharged ;
|
132 |
|
|
Float_t fNNeutrals;
|
133 |
|
|
Float_t fDRMean ;
|
134 |
|
|
Float_t fFrac01 ;
|
135 |
|
|
Float_t fFrac02 ;
|
136 |
|
|
Float_t fFrac03 ;
|
137 |
|
|
Float_t fFrac04 ;
|
138 |
|
|
Float_t fFrac05 ;
|
139 |
pharris |
1.6 |
Float_t fDR2Mean ;
|
140 |
pharris |
1.3 |
|
141 |
pharris |
1.1 |
ClassDef(JetIDMVA,0)
|
142 |
|
|
};
|
143 |
|
|
}
|
144 |
|
|
|
145 |
|
|
|
146 |
|
|
#endif
|