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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines