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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines