ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Utils/interface/MVATools.h
(Generate patch)

Comparing UserCode/MitPhysics/Utils/interface/MVATools.h (file contents):
Revision 1.4 by mingyang, Mon Dec 5 00:48:08 2011 UTC vs.
Revision 1.15 by mingyang, Sat Nov 9 15:08:28 2013 UTC

# Line 25 | Line 25
25   #include "MitAna/DataTree/interface/SuperCluster.h"
26   #include "MitAna/DataTree/interface/SuperClusterCol.h"
27   #include "MitCommon/MathTools/interface/MathUtils.h"
28 <
28 > #include "MitAna/DataTree/interface/PFCandidateCol.h"
29  
30   class TRandom3;
31   namespace TMVA {//MVA
# Line 34 | Line 34 | namespace TMVA {//MVA
34  
35   namespace mithep {
36    class MVATools {
37 <    public:
37 >  public:
38      MVATools();
39 <      
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 <    Bool_t PassMVASelection(const Photon* p,const Vertex* vtx,const TrackCol* trackCol,const VertexCol* vtxCol,Double_t _tRho,const ElectronCol* els,Float_t bdtCutBarrel, Float_t bdtCutEndcap);
57 <    Int_t PassElectronVetoInt(const Photon* p, const ElectronCol* els);
58 <      Float_t GetMVAbdtValue(const Photon* p,const Vertex* vtx,const TrackCol* trackCol,const VertexCol* vtxCol,Double_t _tRho,const ElectronCol* els);
59 <      
60 <      TMVA::Reader *fReaderEndcap;
61 <      TMVA::Reader *fReaderBarrel;    
62 <      
63 <      //MVA Variables
64 <      float HoE;
65 <      float covIEtaIEta;
66 <      float tIso1abs;
67 <      float tIso3abs;
68 <      float tIso2abs;
69 <      float R9;
70 <    
71 <      float absIsoEcal;
72 <      float absIsoHcal;
73 <      float RelEMax;
74 <      float RelETop;
75 <      float RelEBottom;
76 <      float RelELeft;
77 <      float RelERight;
78 <      float RelE2x5Max;
79 <      float RelE2x5Top;
80 <      float RelE2x5Bottom;
81 <      float RelE2x5Left;
82 <      float RelE2x5Right;
83 <      float RelE5x5;
84 <
85 <      float EtaWidth;
86 <      float PhiWidth;
87 <      float CoviEtaiPhi;
88 <      float CoviPhiiPhi;
89 <
90 <      float NVertexes;
91 <      float RelPreshowerEnergy;
92 <
93 <      //variable for v2 and v1
94 <      float RelIsoEcal;
95 <      float RelIsoHcal;
96 <      float tIso1;
97 <      float tIso3;
98 <      float tIso2;
99 <      
100 <      //variables used to compute mva variables
101 <      
102 <      Bool_t PassElecVeto;  
103 <      
104 <      double ecalIso3;
105 <      double ecalIso4;
106 <      double hcalIso4;
107 <      
108 <      unsigned int wVtxInd;
109 <      
110 <      double trackIso1;
111 <      
112 <      // track iso only
113 <      double trackIso3;
114 <      
115 <      // track iso worst vtx
116 <      double trackIso2;
117 <      
118 <      double combIso1;
119 <      double combIso2;
120 <      
121 <      double RawEnergy;
122 <      
123 <      double dRTrack;
124 <      
125 <      //spectator variables
126 <      double Pt_MVA;
127 <      double ScEta_MVA;
128 <      
129 <      Bool_t isbarrel;
130 <      
131 <      // check which category it is ...
132 <      int _tCat;
133 <      
134 <      //MVA  
135 <      Bool_t PassMVA;
136 <      TMVA::Reader *reader;
137 <      Float_t bdt;
138 <      Int_t PassElecVetoInt;
139 <      
140 <      ClassDef(MVATools, 0)
141 <        };
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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines