1 |
//--------------------------------------------------------------------------------------------------
|
2 |
// $Id $
|
3 |
//
|
4 |
// MVATools
|
5 |
//
|
6 |
// Helper Class for photon Identification decisions.
|
7 |
//
|
8 |
// Authors: M.Yang 2011/10/12
|
9 |
//--------------------------------------------------------------------------------------------------
|
10 |
|
11 |
#ifndef MITPHYSICS_UTILS_MVATOOLS_H
|
12 |
#define MITPHYSICS_UTILS_MVATOOLS_H
|
13 |
|
14 |
#include "MitAna/DataTree/interface/Photon.h"
|
15 |
#include "MitAna/DataTree/interface/PhotonCol.h"
|
16 |
#include "MitAna/DataTree/interface/TrackCol.h"
|
17 |
#include "MitAna/DataTree/interface/Electron.h"
|
18 |
#include "MitAna/DataTree/interface/ElectronCol.h"
|
19 |
#include "MitAna/DataTree/interface/BaseVertex.h"
|
20 |
#include "MitAna/DataTree/interface/DecayParticleCol.h"
|
21 |
#include "MitAna/DataTree/interface/VertexCol.h"
|
22 |
#include "MitAna/DataTree/interface/BeamSpotCol.h"
|
23 |
#include "MitAna/DataTree/interface/TriggerObjectCol.h"
|
24 |
#include "MitAna/DataTree/interface/MCParticleCol.h"
|
25 |
#include "MitAna/DataTree/interface/SuperCluster.h"
|
26 |
#include "MitAna/DataTree/interface/SuperClusterCol.h"
|
27 |
#include "MitCommon/MathTools/interface/MathUtils.h"
|
28 |
#include "MitAna/DataTree/interface/PFCandidateCol.h"
|
29 |
|
30 |
class TRandom3;
|
31 |
namespace TMVA {//MVA
|
32 |
class Reader;
|
33 |
}
|
34 |
|
35 |
namespace mithep {
|
36 |
class MVATools {
|
37 |
public:
|
38 |
MVATools();
|
39 |
|
40 |
// MVA Typles
|
41 |
enum IdMVAType {
|
42 |
kNone = 0,
|
43 |
k2011IdMVA,
|
44 |
k2012IdMVA_globe,
|
45 |
k2012IdMVA, // same as above, but more logical name...
|
46 |
k2013FinalIdMVA_8TeV,
|
47 |
k2013FinalIdMVA_7TeV,
|
48 |
k2011IdMVA_HZg
|
49 |
};
|
50 |
|
51 |
//--------------------------
|
52 |
//MVA
|
53 |
//--------------------------
|
54 |
|
55 |
//void InitializeMVA(int VariableType, TString EndcapWeights,TString BarrelWeights);
|
56 |
void InitializeMVA(IdMVAType type);
|
57 |
|
58 |
// removed this (fab): if a mod want to cuty on BDT values, compute them in the mod using GetMVAbdtValue(..) and make the cut in the mod
|
59 |
//Bool_t PassMVASelection (const Photon* p,const Vertex* vtx,const TrackCol* trackCol,const VertexCol* vtxCol,Double_t _tRho,Float_t bdtCutBarrel, Float_t bdtCutEndcap, const ElectronCol* els=0, Bool_t applyElectronVeto=kTRUE);
|
60 |
// removed this (fab): no needed naywhere...
|
61 |
//Int_t PassElectronVetoInt(const Photon* p, const ElectronCol* els);
|
62 |
|
63 |
Double_t GetMVAbdtValue (const Photon* p,const Vertex* vtx,const TrackCol* trackCol,const VertexCol* vtxCol,Double_t _tRho, const PFCandidateCol *fPFCands=NULL ,const ElectronCol* els=0, Bool_t applyElectronVeto=kTRUE);
|
64 |
|
65 |
// these we can remove at some point
|
66 |
/* Float_t GetMVAbdtValue_2011 (const Photon* p,const Vertex* vtx,const TrackCol* trackCol,const VertexCol* vtxCol,Double_t _tRho, const ElectronCol* els=0, Bool_t applyElectronVeto=kTRUE); */
|
67 |
/* Float_t GetMVAbdtValue_2012_globe(const Photon* p,const Vertex* vtx,const TrackCol* trackCol,const VertexCol* vtxCol,Double_t _tRho, const PFCandidateCol *fPFCands=NULL ,const ElectronCol* els=0, Bool_t applyElectronVeto=kTRUE); */
|
68 |
|
69 |
|
70 |
private:
|
71 |
|
72 |
TMVA::Reader *fReaderEndcap;
|
73 |
TMVA::Reader *fReaderBarrel;
|
74 |
|
75 |
IdMVAType fMVAType;
|
76 |
std::vector<float> mvaVars;
|
77 |
std::vector<std::string> varNames;
|
78 |
std::map<std::string,unsigned int> mvaVarMapEB;
|
79 |
std::map<std::string,unsigned int> mvaVarMapEE;
|
80 |
|
81 |
// -------------------------------------------------
|
82 |
// fab: these guys should all go away...
|
83 |
//MVA Variables
|
84 |
/* float HoE; */
|
85 |
/* float covIEtaIEta; */
|
86 |
/* float tIso1abs; */
|
87 |
/* float tIso3abs; */
|
88 |
/* float tIso2abs; */
|
89 |
/* float R9; */
|
90 |
|
91 |
/* float absIsoEcal; */
|
92 |
/* float absIsoHcal; */
|
93 |
/* float RelEMax; */
|
94 |
/* float RelETop; */
|
95 |
/* float RelEBottom; */
|
96 |
/* float RelELeft; */
|
97 |
/* float RelERight; */
|
98 |
/* float RelE2x5Max; */
|
99 |
/* float RelE2x5Top; */
|
100 |
/* float RelE2x5Bottom; */
|
101 |
/* float RelE2x5Left; */
|
102 |
/* float RelE2x5Right; */
|
103 |
/* float RelE5x5; */
|
104 |
|
105 |
/* float EtaWidth; */
|
106 |
/* float PhiWidth; */
|
107 |
/* float CoviEtaiPhi; */
|
108 |
/* float CoviPhiiPhi; */
|
109 |
|
110 |
/* float NVertexes; */
|
111 |
/* float RelPreshowerEnergy; */
|
112 |
|
113 |
/* //variable for v2 and v1 */
|
114 |
/* float RelIsoEcal; */
|
115 |
/* float RelIsoHcal; */
|
116 |
/* float tIso1; */
|
117 |
/* float tIso3; */
|
118 |
/* float tIso2; */
|
119 |
|
120 |
/* float ScEta; */
|
121 |
|
122 |
/* //variables used to compute mva variables */
|
123 |
|
124 |
/* Bool_t PassElecVeto; */
|
125 |
|
126 |
/* double ecalIso3; */
|
127 |
/* double ecalIso4; */
|
128 |
/* double hcalIso4; */
|
129 |
|
130 |
/* unsigned int wVtxInd; */
|
131 |
|
132 |
/* double trackIso1; */
|
133 |
|
134 |
/* // track iso only */
|
135 |
/* double trackIso3; */
|
136 |
|
137 |
/* // track iso worst vtx */
|
138 |
/* double trackIso2; */
|
139 |
|
140 |
/* double combIso1; */
|
141 |
/* double combIso2; */
|
142 |
|
143 |
/* double RawEnergy; */
|
144 |
|
145 |
/* double dRTrack; */
|
146 |
|
147 |
/* //spectator variables */
|
148 |
/* double Pt_MVA; */
|
149 |
/* double ScEta_MVA; */
|
150 |
|
151 |
/* Bool_t isbarrel; */
|
152 |
|
153 |
/* // check which category it is ... */
|
154 |
/* int _tCat; */
|
155 |
|
156 |
/* //1201 variable */
|
157 |
/* float myphoton_pfchargedisogood03; */
|
158 |
/* float myphoton_pfchargedisobad03; */
|
159 |
/* float myphoton_pfphotoniso03; */
|
160 |
/* float myphoton_sieie; */
|
161 |
/* float myphoton_sieip; */
|
162 |
/* float myphoton_etawidth; */
|
163 |
/* float myphoton_phiwidth; */
|
164 |
/* float myphoton_r9; */
|
165 |
/* float myphoton_s4ratio; */
|
166 |
/* float myphoton_SCeta; */
|
167 |
/* float event_rho; */
|
168 |
/* float myphoton_ESEffSigmaRR; */
|
169 |
|
170 |
//MVA
|
171 |
/* Bool_t PassMVA; */
|
172 |
/* //Float_t bdt; -> removed this, we should not have this a memeber variable !!! (fab) */
|
173 |
/* Int_t PassElecVetoInt; */
|
174 |
|
175 |
|
176 |
TMVA::Reader *reader;
|
177 |
ClassDef(MVATools, 0)
|
178 |
};
|
179 |
}
|
180 |
|
181 |
#endif
|