ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Utils/interface/JetIDMVA.h
Revision: 1.10
Committed: Sat Jan 12 11:49:46 2013 UTC (12 years, 3 months ago) by pharris
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_029c, Mit_029b, Mit_029a
Changes since 1.9: +10 -6 lines
Log Message:
Updated MVA Met and Jet ID

File Contents

# User Rev Content
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.10 kBaseline = 0,
40     k42 = 1,
41     k52 = 2,
42     kCut = 3,
43     kQGP = 4,
44     k53 = 5,
45     k53MET = 6,
46     k53METFull = 7
47 pharris 1.1 };
48    
49 pharris 1.3 enum CutType {
50     kTight = 0,
51     kMedium = 1,
52 pharris 1.4 kLoose = 2,
53     kMET = 3
54 pharris 1.3 };
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");
61 pharris 1.9
62 pharris 1.1 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 pharris 1.3 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 pharris 1.6 Float_t iFrac05 ,
80 pharris 1.10 Float_t iDR2Mean ,
81     Float_t iPtD
82 pharris 1.1 );
83 pharris 1.7 //Cut Based
84     Bool_t passCut(const PFJet *iJet,const Vertex *iVertex,const VertexCol *iVertices);
85 pharris 1.1
86 pharris 1.8 Bool_t passPt(const PFJet *iJet, FactorizedJetCorrector *iJetCorrector=0,
87     const PileupEnergyDensityCol *iPileupEnergyDensity=0,
88     RhoUtilities::RhoType type=RhoUtilities::DEFAULT);
89 pharris 1.2 //UNcorrected Jets
90 pharris 1.3 Bool_t pass(const PFJet *iJet,const Vertex *iVertex,const VertexCol *iVertices,
91 pharris 1.1 FactorizedJetCorrector *iJetCorrector,
92 ceballos 1.5 const PileupEnergyDensityCol *iPileupEnergyDensity,
93     RhoUtilities::RhoType type = RhoUtilities::DEFAULT);
94    
95 pharris 1.2 //Corrected Jets
96 pharris 1.3 Bool_t pass(const PFJet *iJet,const Vertex *iVertex,const VertexCol *iVertices);
97 pharris 1.2
98     //Uncorrected Jets
99 pharris 1.3 Double_t MVAValue(const PFJet *iJet,const Vertex *iVertex,const VertexCol *iVertices,
100 pharris 1.1 FactorizedJetCorrector *iJetCorrector,
101     const PileupEnergyDensityCol *iPileupEnergyDensity,
102     Bool_t printDebug=false);
103    
104 pharris 1.9 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 pharris 1.2 //Corrected Jets
110 pharris 1.3 Double_t MVAValue(const PFJet *iJet,const Vertex *iVertex,const VertexCol *iVertices,
111 pharris 1.2 Bool_t printDebug=false);
112    
113 pharris 1.1
114     double correctedPt(const PFJet *iJet, FactorizedJetCorrector *iJetCorrector,
115 ceballos 1.5 const PileupEnergyDensityCol *iPUEnergyDensity,
116 pharris 1.9 RhoUtilities::RhoType type = RhoUtilities::DEFAULT,int iId=-1);
117 pharris 1.1
118     Float_t fJetPtMin;
119 pharris 1.3 Float_t fDZCut;
120 pharris 1.1
121     protected:
122     TMVA::Reader *fReader;
123 pharris 1.6 TMVA::Reader *fLowPtReader;
124 pharris 1.3 TString fLowPtMethodName;
125     TString fHighPtMethodName;
126 pharris 1.1 MVAType fType;
127 pharris 1.3 CutType fCutType;
128 pharris 1.1 Bool_t fIsInitialized;
129 pharris 1.3 Float_t fMVACut[4][4]; //Fix the cut array
130 pharris 1.7 Float_t fRMSCut[4][4];
131     Float_t fBetaStarCut[4][4];
132    
133 pharris 1.3 Float_t fNVtx ;
134     Float_t fJPt1 ;
135     Float_t fJEta1 ;
136     Float_t fJPhi1 ;
137     Float_t fJD01 ;
138     Float_t fJDZ1 ;
139     Float_t fBeta ;
140     Float_t fBetaStar ;
141     Float_t fNCharged ;
142     Float_t fNNeutrals;
143 pharris 1.9 Float_t fNParticles;
144 pharris 1.3 Float_t fDRMean ;
145 pharris 1.9 Float_t fPtD ;
146 pharris 1.3 Float_t fFrac01 ;
147     Float_t fFrac02 ;
148     Float_t fFrac03 ;
149     Float_t fFrac04 ;
150     Float_t fFrac05 ;
151 pharris 1.6 Float_t fDR2Mean ;
152 pharris 1.3
153 pharris 1.1 ClassDef(JetIDMVA,0)
154     };
155     }
156    
157    
158     #endif