ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Utils/interface/JetIDMVA.h
Revision: 1.7
Committed: Fri May 25 20:01:40 2012 UTC (12 years, 11 months ago) by pharris
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_028a
Changes since 1.6: +7 -2 lines
Log Message:
added cut based 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.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.2 //UNcorrected Jets
82 pharris 1.3 Bool_t pass(const PFJet *iJet,const Vertex *iVertex,const VertexCol *iVertices,
83 pharris 1.1 FactorizedJetCorrector *iJetCorrector,
84 ceballos 1.5 const PileupEnergyDensityCol *iPileupEnergyDensity,
85     RhoUtilities::RhoType type = RhoUtilities::DEFAULT);
86    
87 pharris 1.2 //Corrected Jets
88 pharris 1.3 Bool_t pass(const PFJet *iJet,const Vertex *iVertex,const VertexCol *iVertices);
89 pharris 1.2
90     //Uncorrected Jets
91 pharris 1.3 Double_t MVAValue(const PFJet *iJet,const Vertex *iVertex,const VertexCol *iVertices,
92 pharris 1.1 FactorizedJetCorrector *iJetCorrector,
93     const PileupEnergyDensityCol *iPileupEnergyDensity,
94     Bool_t printDebug=false);
95    
96 pharris 1.2 //Corrected Jets
97 pharris 1.3 Double_t MVAValue(const PFJet *iJet,const Vertex *iVertex,const VertexCol *iVertices,
98 pharris 1.2 Bool_t printDebug=false);
99    
100 pharris 1.1
101     double correctedPt(const PFJet *iJet, FactorizedJetCorrector *iJetCorrector,
102 ceballos 1.5 const PileupEnergyDensityCol *iPUEnergyDensity,
103     RhoUtilities::RhoType type = RhoUtilities::DEFAULT);
104 pharris 1.1
105     Float_t fJetPtMin;
106 pharris 1.3 Float_t fDZCut;
107 pharris 1.1
108     protected:
109     TMVA::Reader *fReader;
110 pharris 1.6 TMVA::Reader *fLowPtReader;
111 pharris 1.3 TString fLowPtMethodName;
112     TString fHighPtMethodName;
113 pharris 1.1 MVAType fType;
114 pharris 1.3 CutType fCutType;
115 pharris 1.1 Bool_t fIsInitialized;
116 pharris 1.3 Float_t fMVACut[4][4]; //Fix the cut array
117 pharris 1.7 Float_t fRMSCut[4][4];
118     Float_t fBetaStarCut[4][4];
119    
120 pharris 1.3 Float_t fNVtx ;
121     Float_t fJPt1 ;
122     Float_t fJEta1 ;
123     Float_t fJPhi1 ;
124     Float_t fJD01 ;
125     Float_t fJDZ1 ;
126     Float_t fBeta ;
127     Float_t fBetaStar ;
128     Float_t fNCharged ;
129     Float_t fNNeutrals;
130     Float_t fDRMean ;
131     Float_t fFrac01 ;
132     Float_t fFrac02 ;
133     Float_t fFrac03 ;
134     Float_t fFrac04 ;
135     Float_t fFrac05 ;
136 pharris 1.6 Float_t fDR2Mean ;
137 pharris 1.3
138 pharris 1.1 ClassDef(JetIDMVA,0)
139     };
140     }
141    
142    
143     #endif