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