1 |
|
2 |
//--------------------------------------------------------------------------------------------------
|
3 |
// $Id $
|
4 |
//
|
5 |
// Met Regression
|
6 |
//
|
7 |
// Authors: P. Harris
|
8 |
//--------------------------------------------------------------------------------------------------
|
9 |
|
10 |
#ifndef MITPHYSICS_UTILS_MVAMet_H
|
11 |
#define MITPHYSICS_UTILS_MVAMet_H
|
12 |
#include <TMatrixD.h>
|
13 |
#include "MitAna/DataTree/interface/PFJetFwd.h"
|
14 |
#include "MitAna/DataTree/interface/VertexFwd.h"
|
15 |
#include "MitAna/DataTree/interface/TrackFwd.h"
|
16 |
#include "MitAna/DataTree/interface/MuonCol.h"
|
17 |
#include "MitAna/DataTree/interface/PFTauCol.h"
|
18 |
#include "MitAna/DataTree/interface/ElectronCol.h"
|
19 |
#include "MitAna/DataTree/interface/PhotonCol.h"
|
20 |
#include "MitAna/DataTree/interface/Met.h"
|
21 |
#include "MitAna/DataTree/interface/PFMet.h"
|
22 |
#include "MitAna/DataTree/interface/PFMetCol.h"
|
23 |
#include "MitAna/DataTree/interface/PFJet.h"
|
24 |
#include "MitAna/DataTree/interface/PFJetCol.h"
|
25 |
#include "MitAna/DataTree/interface/PFCandidateCol.h"
|
26 |
#include "MitAna/DataTree/interface/PileupEnergyDensityCol.h"
|
27 |
#include "MitCommon/MathTools/interface/MathUtils.h"
|
28 |
|
29 |
#include "MitPhysics/Utils/interface/RecoilTools.h"
|
30 |
#include "MitPhysics/Utils/interface/MetLeptonTools.h"
|
31 |
#include "CondFormats/EgammaObjects/interface/GBRForest.h"
|
32 |
|
33 |
class TRandom3;
|
34 |
class GBRForest;
|
35 |
|
36 |
namespace mithep {
|
37 |
class MVAMet {
|
38 |
public:
|
39 |
MVAMet();
|
40 |
~MVAMet();
|
41 |
enum MVAType {
|
42 |
kBaseline = 0
|
43 |
};
|
44 |
|
45 |
//void setVariables(TMVA::Reader *iReader,bool iScale);
|
46 |
//void Initialize( TString iU1MethodName="U1MVA",
|
47 |
// TString iPhiMethodName="PhiMVA",
|
48 |
// TString iJetMVAFile="$CMSSW_BASE/src/MitPhysics/data/mva_RecoilPhiRegress_baseline.weights.xml",
|
49 |
// TString iU1Weights="$CMSSW_BASE/src/MitPhysics/data/mva_RecoilRegress_baseline.weights.xml",
|
50 |
// TString iPhiWeights="$CMSSW_BASE/src/MitPhysics/data/mva_JetID.weights.xml",
|
51 |
// MVAType iType=kBaseline);
|
52 |
void Initialize(
|
53 |
TString iJetLowPtFile ="$CMSSW_BASE/src/MitPhysics/data/mva_RecoilPhiRegress_baseline.weights.xml",
|
54 |
TString iJetHighPtFile="$CMSSW_BASE/src/MitPhysics/data/mva_RecoilPhiRegress_baseline.weights.xml",
|
55 |
TString iJetCutFile ="$CMSSW_BASE/src/MitPhysics/data/mva_RecoilPhiRegress_baseline.weights.xml",
|
56 |
TString iU1Weights ="$CMSSW_BASE/src/MitPhysics/data/gbrmet.root",
|
57 |
TString iPhiWeights ="$CMSSW_BASE/src/MitPhysics/data/gbrmetphi.root",
|
58 |
TString iCovU1Weights ="$CMSSW_BASE/src/MitPhysics/data/gbrcovu1_52.root",
|
59 |
TString iCovU2Weights ="$CMSSW_BASE/src/MitPhysics/data/gbrcovu2_52.root",
|
60 |
JetIDMVA::MVAType iType=JetIDMVA::kBaseline);
|
61 |
|
62 |
Bool_t IsInitialized() const { return fIsInitialized; }
|
63 |
Float_t* getVals();
|
64 |
Double_t evaluatePhi();
|
65 |
Double_t evaluateU1();
|
66 |
Double_t evaluateCovU1();
|
67 |
Double_t evaluateCovU2();
|
68 |
Double_t MVAValue( bool iPhi,
|
69 |
Float_t iPFSumEt,
|
70 |
Float_t iU ,
|
71 |
Float_t iUPhi ,
|
72 |
Float_t iTKSumEt,
|
73 |
Float_t iTKU ,
|
74 |
Float_t iTKUPhi ,
|
75 |
Float_t iNPSumEt,
|
76 |
Float_t iNPU ,
|
77 |
Float_t iNPUPhi ,
|
78 |
Float_t iPUSumEt,
|
79 |
Float_t iPUMet ,
|
80 |
Float_t iPUMetPhi,
|
81 |
Float_t iPCSumEt,
|
82 |
Float_t iPCU ,
|
83 |
Float_t iPCUPhi ,
|
84 |
Float_t iJSPt1 ,
|
85 |
Float_t iJSEta1 ,
|
86 |
Float_t iJSPhi1 ,
|
87 |
Float_t iJSPt2 ,
|
88 |
Float_t iJSEta2 ,
|
89 |
Float_t iJSPhi2 ,
|
90 |
Float_t iNJet ,
|
91 |
Float_t iNAllJet,
|
92 |
Float_t iNPV );
|
93 |
|
94 |
Met GetMet( Bool_t iPhi,
|
95 |
Float_t iPtVis,Float_t iPhiVis,Float_t iSumEtVis,
|
96 |
Float_t iPtQ ,Float_t iPhiQ ,Float_t iSumEtQ,
|
97 |
const PFMet *iMet ,
|
98 |
const PFCandidateCol *iCands,
|
99 |
const Vertex *iVertex,const VertexCol *iVertices,
|
100 |
const PFJetCol *iJets ,
|
101 |
FactorizedJetCorrector *iJetCorrector,
|
102 |
const PileupEnergyDensityCol *iPileupEnergyDensity,
|
103 |
int iNPV,
|
104 |
Bool_t printDebug=false);
|
105 |
|
106 |
Met GetMet( Bool_t iPhi,
|
107 |
Float_t iPtVis,Float_t iPhiVis,Float_t iSumEtVis,
|
108 |
Float_t iPtQ ,Float_t iPhiQ ,Float_t iSumEtQ,
|
109 |
const PFMet *iMet ,
|
110 |
const PFCandidateCol *iCands,
|
111 |
const Vertex *iVertex,const VertexCol *iVertices,Double_t iRho,
|
112 |
const PFJetCol *iJets ,
|
113 |
int iNPV,
|
114 |
Bool_t printDebug=false);
|
115 |
|
116 |
Met GetMet( Bool_t iPhi,
|
117 |
Float_t iPt1,Float_t iPhi1,Float_t iEta1,Float_t iChargedFrac1,
|
118 |
Float_t iPt2,Float_t iPhi2,Float_t iEta2,Float_t iChargedFrac2,
|
119 |
const PFMet *iMet ,
|
120 |
const PFCandidateCol *iCands,
|
121 |
const Vertex *iVertex,const VertexCol *iVertices,
|
122 |
const PFJetCol *iJets ,
|
123 |
FactorizedJetCorrector *iJetCorrector,
|
124 |
const PileupEnergyDensityCol *iPUEnergyDensity,
|
125 |
int iNPV,
|
126 |
Bool_t printDebug=false);
|
127 |
|
128 |
Met GetMet( Bool_t iPhi,
|
129 |
Float_t iPt1,Float_t iPhi1,Float_t iEta1,Float_t iChargedFrac1,
|
130 |
Float_t iPt2,Float_t iPhi2,Float_t iEta2,Float_t iChargedFrac2,
|
131 |
const PFMet *iMet ,
|
132 |
const PFCandidateCol *iCands,
|
133 |
const Vertex *iVertex,const VertexCol *iVertices,Double_t iRho,
|
134 |
const PFJetCol *iJets ,
|
135 |
int iNPV,
|
136 |
Bool_t printDebug=false);
|
137 |
|
138 |
Met GetMet( const MuonCol *iMuons,const ElectronCol *iElectrons,const PFTauCol *iTaus,
|
139 |
const PFCandidateCol *iCands,const PFJetCol *iJets,const Vertex *iPV,const VertexCol *iVertices,const PFMetCol *iPFMet,
|
140 |
FactorizedJetCorrector *iJetCorrector,const PileupEnergyDensityCol* iPUEnergyDensity);
|
141 |
|
142 |
Met GetMet(const PhotonCol *iPhotons,
|
143 |
const PFCandidateCol *iCands,const PFJetCol *iJets,const Vertex *iPV,const VertexCol *iVertices,const PFMetCol *iPFMet,
|
144 |
FactorizedJetCorrector *iJetCorrector,const PileupEnergyDensityCol* iPUEnergyDensity);
|
145 |
|
146 |
TMatrixD* GetMetCovariance() { return fCov; }
|
147 |
Float_t GetSignificance () { return fSignificance;}
|
148 |
Float_t GetUncertainty () { return fUncertainty;}
|
149 |
RecoilTools *fRecoilTools;
|
150 |
|
151 |
Int_t fNPhotons;
|
152 |
|
153 |
protected:
|
154 |
TString fPhiMethodName;
|
155 |
TString fU1MethodName;
|
156 |
TString fCovU1MethodName;
|
157 |
TString fCovU2MethodName;
|
158 |
Bool_t fIsInitialized;
|
159 |
JetIDMVA::MVAType fType;
|
160 |
Bool_t f42;
|
161 |
|
162 |
Float_t fSumEt ;
|
163 |
Float_t fU ;
|
164 |
Float_t fUPhi ;
|
165 |
Float_t fTKSumEt;
|
166 |
Float_t fTKU ;
|
167 |
Float_t fTKUPhi ;
|
168 |
Float_t fNPSumEt;
|
169 |
Float_t fNPU ;
|
170 |
Float_t fNPUPhi ;
|
171 |
Float_t fPUSumEt;
|
172 |
Float_t fPUMet ;
|
173 |
Float_t fPUMetPhi ;
|
174 |
Float_t fPCSumEt;
|
175 |
Float_t fPCU ;
|
176 |
Float_t fPCUPhi ;
|
177 |
Float_t fJSPt1 ;
|
178 |
Float_t fJSEta1 ;
|
179 |
Float_t fJSPhi1 ;
|
180 |
Float_t fJSPt2 ;
|
181 |
Float_t fJSEta2 ;
|
182 |
Float_t fJSPhi2 ;
|
183 |
Float_t fNJet ;
|
184 |
Float_t fNAllJet;
|
185 |
Float_t fNPV ;
|
186 |
Float_t fUPhiMVA;
|
187 |
Float_t fUMVA;
|
188 |
|
189 |
Float_t* fPhiVals;
|
190 |
Float_t* fU1Vals;
|
191 |
Float_t* fCovVals;
|
192 |
|
193 |
GBRForest *fPhiReader;
|
194 |
GBRForest *fU1Reader;
|
195 |
GBRForest *fCovU1Reader;
|
196 |
GBRForest *fCovU2Reader;
|
197 |
|
198 |
Float_t fSignificance;
|
199 |
Float_t fUncertainty;
|
200 |
TMatrixD *fCov;
|
201 |
|
202 |
Int_t fNMuons;
|
203 |
Int_t fNElectrons;
|
204 |
Int_t fNTaus;
|
205 |
|
206 |
MetLeptonTools *fMetLeptonTools;
|
207 |
//TMVA::Reader* fPhiReader;
|
208 |
//TMVA::Reader* fU1Reader;
|
209 |
ClassDef(MVAMet,0)
|
210 |
};
|
211 |
}
|
212 |
#endif
|