ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Utils/interface/MVATools.h
Revision: 1.14
Committed: Tue Jul 30 21:09:10 2013 UTC (11 years, 9 months ago) by mingyang
Content type: text/plain
Branch: MAIN
Changes since 1.13: +1 -0 lines
Log Message:
*** empty log message ***

File Contents

# Content
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,
47 k2011IdMVA_HZg
48 };
49
50 //--------------------------
51 //MVA
52 //--------------------------
53
54 //void InitializeMVA(int VariableType, TString EndcapWeights,TString BarrelWeights);
55 void InitializeMVA(IdMVAType type);
56
57 // 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
58 //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);
59 // removed this (fab): no needed naywhere...
60 //Int_t PassElectronVetoInt(const Photon* p, const ElectronCol* els);
61
62 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);
63
64 // these we can remove at some point
65 /* 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); */
66 /* 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); */
67
68
69 private:
70
71 TMVA::Reader *fReaderEndcap;
72 TMVA::Reader *fReaderBarrel;
73
74 IdMVAType fMVAType;
75 std::vector<float> mvaVars;
76 std::vector<std::string> varNames;
77 std::map<std::string,unsigned int> mvaVarMapEB;
78 std::map<std::string,unsigned int> mvaVarMapEE;
79
80 // -------------------------------------------------
81 // fab: these guys should all go away...
82 //MVA Variables
83 /* float HoE; */
84 /* float covIEtaIEta; */
85 /* float tIso1abs; */
86 /* float tIso3abs; */
87 /* float tIso2abs; */
88 /* float R9; */
89
90 /* float absIsoEcal; */
91 /* float absIsoHcal; */
92 /* float RelEMax; */
93 /* float RelETop; */
94 /* float RelEBottom; */
95 /* float RelELeft; */
96 /* float RelERight; */
97 /* float RelE2x5Max; */
98 /* float RelE2x5Top; */
99 /* float RelE2x5Bottom; */
100 /* float RelE2x5Left; */
101 /* float RelE2x5Right; */
102 /* float RelE5x5; */
103
104 /* float EtaWidth; */
105 /* float PhiWidth; */
106 /* float CoviEtaiPhi; */
107 /* float CoviPhiiPhi; */
108
109 /* float NVertexes; */
110 /* float RelPreshowerEnergy; */
111
112 /* //variable for v2 and v1 */
113 /* float RelIsoEcal; */
114 /* float RelIsoHcal; */
115 /* float tIso1; */
116 /* float tIso3; */
117 /* float tIso2; */
118
119 /* float ScEta; */
120
121 /* //variables used to compute mva variables */
122
123 /* Bool_t PassElecVeto; */
124
125 /* double ecalIso3; */
126 /* double ecalIso4; */
127 /* double hcalIso4; */
128
129 /* unsigned int wVtxInd; */
130
131 /* double trackIso1; */
132
133 /* // track iso only */
134 /* double trackIso3; */
135
136 /* // track iso worst vtx */
137 /* double trackIso2; */
138
139 /* double combIso1; */
140 /* double combIso2; */
141
142 /* double RawEnergy; */
143
144 /* double dRTrack; */
145
146 /* //spectator variables */
147 /* double Pt_MVA; */
148 /* double ScEta_MVA; */
149
150 /* Bool_t isbarrel; */
151
152 /* // check which category it is ... */
153 /* int _tCat; */
154
155 /* //1201 variable */
156 /* float myphoton_pfchargedisogood03; */
157 /* float myphoton_pfchargedisobad03; */
158 /* float myphoton_pfphotoniso03; */
159 /* float myphoton_sieie; */
160 /* float myphoton_sieip; */
161 /* float myphoton_etawidth; */
162 /* float myphoton_phiwidth; */
163 /* float myphoton_r9; */
164 /* float myphoton_s4ratio; */
165 /* float myphoton_SCeta; */
166 /* float event_rho; */
167 /* float myphoton_ESEffSigmaRR; */
168
169 //MVA
170 /* Bool_t PassMVA; */
171 /* //Float_t bdt; -> removed this, we should not have this a memeber variable !!! (fab) */
172 /* Int_t PassElecVetoInt; */
173
174
175 TMVA::Reader *reader;
176 ClassDef(MVATools, 0)
177 };
178 }
179
180 #endif