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.11 by mingyang, Sun Jun 10 16:29:09 2012 UTC vs.
Revision 1.15 by mingyang, Sat Nov 9 15:08:28 2013 UTC

# 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,Float_t bdtCutBarrel, Float_t bdtCutEndcap, const ElectronCol* els=0, Bool_t applyElectronVeto=kTRUE);
47 <    Int_t PassElectronVetoInt(const Photon* p, const ElectronCol* els);
48 <    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);
49 <    Float_t GetMVAbdtValue_2012_globe(const Photon* p,const Vertex* vtx,const TrackCol* trackCol,const VertexCol* vtxCol,Double_t _tRho, const PFCandidateCol *fPFCands,const ElectronCol* els=0, Bool_t applyElectronVeto=kTRUE);
50 <      
51 <      TMVA::Reader *fReaderEndcap;
52 <      TMVA::Reader *fReaderBarrel;    
53 <      
54 <      //MVA Variables
55 <      float HoE;
56 <      float covIEtaIEta;
57 <      float tIso1abs;
58 <      float tIso3abs;
59 <      float tIso2abs;
60 <      float R9;
61 <    
62 <      float absIsoEcal;
63 <      float absIsoHcal;
64 <      float RelEMax;
65 <      float RelETop;
66 <      float RelEBottom;
67 <      float RelELeft;
68 <      float RelERight;
69 <      float RelE2x5Max;
70 <      float RelE2x5Top;
71 <      float RelE2x5Bottom;
72 <      float RelE2x5Left;
73 <      float RelE2x5Right;
74 <      float RelE5x5;
75 <
76 <      float EtaWidth;
77 <      float PhiWidth;
78 <      float CoviEtaiPhi;
79 <      float CoviPhiiPhi;
55 >    //void InitializeMVA(int VariableType, TString EndcapWeights,TString BarrelWeights);
56 >    void InitializeMVA(IdMVAType type);
57  
58 <      float NVertexes;
59 <      float RelPreshowerEnergy;
60 <
61 <      //variable for v2 and v1
62 <      float RelIsoEcal;
63 <      float RelIsoHcal;
64 <      float tIso1;
65 <      float tIso3;
66 <      float tIso2;
67 <      
68 <      float ScEta;
69 <      
70 <      //variables used to compute mva variables
71 <      
72 <      Bool_t PassElecVeto;  
73 <      
74 <      double ecalIso3;
75 <      double ecalIso4;
76 <      double hcalIso4;
77 <      
78 <      unsigned int wVtxInd;
79 <      
80 <      double trackIso1;
81 <      
82 <      // track iso only
83 <      double trackIso3;
84 <      
85 <      // track iso worst vtx
86 <      double trackIso2;
87 <      
88 <      double combIso1;
89 <      double combIso2;
90 <      
91 <      double RawEnergy;
92 <      
93 <      double dRTrack;
94 <      
95 <      //spectator variables
96 <      double Pt_MVA;
97 <      double ScEta_MVA;
98 <      
99 <      Bool_t isbarrel;
100 <      
101 <      // check which category it is ...
102 <      int _tCat;
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  
127      //1201 variable
128      float myphoton_pfchargedisogood03;
129      float myphoton_pfchargedisobad03;
130      float myphoton_pfphotoniso03;
131      float myphoton_sieie;
132      float myphoton_sieip;
133      float myphoton_etawidth;
134      float myphoton_phiwidth;
135      float myphoton_r9;
136      float myphoton_s4ratio;
137      float myphoton_SCeta;
138      float event_rho;
139      float myphoton_ESEffSigmaRR;
175  
176 <      //MVA  
177 <      Bool_t PassMVA;
178 <      TMVA::Reader *reader;
144 <      Float_t bdt;
145 <      Int_t PassElecVetoInt;
146 <      
147 <      ClassDef(MVATools, 0)
148 <        };
176 >    TMVA::Reader *reader;    
177 >    ClassDef(MVATools, 0)
178 >      };
179   }
180  
181   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines