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

Comparing UserCode/MitPhysics/Utils/src/MVATools.cc (file contents):
Revision 1.15 by mingyang, Mon Jun 11 09:04:33 2012 UTC vs.
Revision 1.21 by mingyang, Tue Jul 30 21:08:50 2013 UTC

# Line 9 | Line 9
9   #include <TMath.h>
10   #include <TFile.h>
11   #include <TRandom3.h>
12 + #include <TSystem.h>
13   #include "TMVA/Tools.h"//MVA
14   #include "TMVA/Reader.h"//MVA
15  
# Line 23 | Line 24 | MVATools::MVATools():
24    fReaderEndcap(0),
25    fReaderBarrel(0),
26    
27 +  fMVAType (MVATools::kNone)
28 +
29 +  // ------------------------------------------------------------------------------
30 +  // fab: These guys should all go away....
31    //MVA Variables v4
32 <  HoE(0),
33 <  covIEtaIEta(0),
34 <  tIso1abs(0),
35 <  tIso3abs(0),
36 <  tIso2abs(0),
37 <  R9(0),
38 <  
39 <  absIsoEcal(0),
40 <  absIsoHcal(0),
41 <  RelEMax(0),
42 <  RelETop(0),
43 <  RelEBottom(0),
44 <  RelELeft(0),
45 <  RelERight(0),
46 <  RelE2x5Max(0),
47 <  RelE2x5Top(0),
48 <  RelE2x5Bottom(0),
49 <  RelE2x5Left(0),
50 <  RelE2x5Right(0),
51 <  RelE5x5(0),
52 <  
53 <  EtaWidth(0),
54 <  PhiWidth(0),
55 <  CoviEtaiPhi(0),
56 <  CoviPhiiPhi(0),
57 <  
58 <  NVertexes(0),
59 <  RelPreshowerEnergy(0),
60 <
61 <  //MVA v2 and v1
62 <  RelIsoEcal(0),
63 <  RelIsoHcal(0),
64 <  tIso1(0),
65 <  tIso3(0),
66 <  tIso2(0),
67 <  ScEta(0.)
32 > //   HoE(0),
33 > //   covIEtaIEta(0),
34 > //   tIso1abs(0),
35 > //   tIso3abs(0),
36 > //   tIso2abs(0),
37 > //   R9(0),
38 >  
39 > //   absIsoEcal(0),
40 > //   absIsoHcal(0),
41 > //   RelEMax(0),
42 > //   RelETop(0),
43 > //   RelEBottom(0),
44 > //   RelELeft(0),
45 > //   RelERight(0),
46 > //   RelE2x5Max(0),
47 > //   RelE2x5Top(0),
48 > //   RelE2x5Bottom(0),
49 > //   RelE2x5Left(0),
50 > //   RelE2x5Right(0),
51 > //   RelE5x5(0),
52 >  
53 > //   EtaWidth(0),
54 > //   PhiWidth(0),
55 > //   CoviEtaiPhi(0),
56 > //   CoviPhiiPhi(0),
57 >  
58 > //   NVertexes(0),
59 > //   RelPreshowerEnergy(0),
60 >
61 > //   //MVA v2 and v1
62 > //   RelIsoEcal(0),
63 > //   RelIsoHcal(0),
64 > //   tIso1(0),
65 > //   tIso3(0),
66 > //   tIso2(0),
67 > //   ScEta(0.)
68 >  
69   {
70    // Constructor.
71   }
72  
73   //--------------------------------------------------------------------------------------------------
74 < void MVATools::InitializeMVA(int VariableType, TString EndcapWeights,TString BarrelWeights) {
74 > void MVATools::InitializeMVA(MVATools::IdMVAType type) {
75    
76 +  fMVAType = type;
77 +
78    if (fReaderEndcap) delete fReaderEndcap;  
79    if (fReaderBarrel) delete fReaderBarrel;
80 +
81 +  // no MVA needed if none requested  
82 +  if( type == kNone ) {    
83 +    return;
84 +  }
85    
86    fReaderEndcap = new TMVA::Reader( "!Color:!Silent:Error" );      
87    fReaderBarrel = new TMVA::Reader( "!Color:!Silent:Error" );  
88 +
89 +  TString BarrelWeights;
90 +  TString EndcapWeights;
91 +
92 +  varNames.resize(0);
93    
94 <  TMVA::Reader *readers[2];
77 <  readers[0]  = fReaderEndcap;
78 <  readers[1]  = fReaderBarrel;  
79 <  
80 <  for (UInt_t i=0; i<2; ++i) {
81 <
82 <    if(VariableType==0||VariableType==1||VariableType==2){
83 <      readers[i]->AddVariable( "HoE", &HoE );
84 <      readers[i]->AddVariable( "covIEtaIEta", &covIEtaIEta );
85 <      readers[i]->AddVariable( "tIso1", &tIso1 );
86 <      readers[i]->AddVariable( "tIso3", &tIso3 );
87 <      readers[i]->AddVariable( "tIso2", &tIso2 );
88 <      readers[i]->AddVariable( "R9", &R9 );
89 <    }
94 >  switch (type) {
95      
96 <    if(VariableType==3||VariableType==4){
97 <      readers[i]->AddVariable( "HoE", &HoE );
98 <      readers[i]->AddVariable( "covIEtaIEta", &covIEtaIEta );
99 <      readers[i]->AddVariable( "tIso1abs", &tIso1abs );
100 <      readers[i]->AddVariable( "tIso3abs", &tIso3abs );
101 <      readers[i]->AddVariable( "tIso2abs", &tIso2abs );
102 <      readers[i]->AddVariable( "R9", &R9 );
96 >  case k2011IdMVA_HZg:
97 >
98 >    EndcapWeights =  (gSystem->Getenv("CMSSW_BASE")+
99 >                      TString("/src/MitPhysics/data/")+
100 >                      TString("PhotonId_lowPt_EE_BDTG.")+
101 >                      TString("weights.xml"));
102 >    BarrelWeights =  (gSystem->Getenv("CMSSW_BASE")+
103 >                      TString("/src/MitPhysics/data/")+
104 >                      TString("PhotonId_lowPt_EB_BDTG.")+
105 >                      TString("weights.xml"));
106 >
107 >
108 >    varNames.push_back("sigieie");
109 >    varNames.push_back("covieip");
110 >    varNames.push_back("s4r"    );
111 >    varNames.push_back("r9"     );
112 >    varNames.push_back("sigeta" );
113 >    varNames.push_back("sigphi" );
114 >    varNames.push_back("pfgios" );
115 >    varNames.push_back("pfciso" );
116 >    varNames.push_back("rho"    );
117 >    varNames.push_back("sceta"  );
118 >    varNames.push_back("rawe"   );
119 >
120 >    mvaVars.resize(varNames.size());
121 >
122 >    std::cout<<"  Adding stuff here.... "<<std::endl;
123 >
124 >    for( unsigned int iV = 0; iV < mvaVars.size(); ++iV) {      
125 >      mvaVarMapEB.insert(  std::pair<std::string,unsigned int>(varNames[iV], iV) );
126 >      mvaVarMapEE.insert(  std::pair<std::string,unsigned int>(varNames[iV], iV) );
127      }
128      
129 <    if(VariableType==1||VariableType==2){
130 <      readers[i]->AddVariable( "RelIsoEcal", &RelIsoEcal );
131 <      readers[i]->AddVariable( "RelIsoHcal", &RelIsoHcal );
132 <      readers[i]->AddVariable( "RelEMax", &RelEMax );
133 <      readers[i]->AddVariable( "RelETop", &RelETop );
134 <      readers[i]->AddVariable( "RelEBottom", &RelEBottom );
135 <      readers[i]->AddVariable( "RelELeft", &RelELeft );
136 <      readers[i]->AddVariable( "RelERight", &RelERight );
137 <      readers[i]->AddVariable( "RelE2x5Max", &RelE2x5Max );
138 <      readers[i]->AddVariable( "RelE2x5Top", &RelE2x5Top );
139 <      readers[i]->AddVariable( "RelE2x5Bottom", &RelE2x5Bottom );
140 <      readers[i]->AddVariable( "RelE2x5Left", &RelE2x5Left );
141 <      readers[i]->AddVariable( "RelE2x5Right", &RelE2x5Right );
142 <      readers[i]->AddVariable( "RelE5x5", &RelE5x5 );
129 >    std::cout<<"  ... done "<<std::endl;
130 >
131 >    break;
132 >
133 >  case k2011IdMVA:
134 >
135 >    EndcapWeights =  (gSystem->Getenv("CMSSW_BASE")+
136 >                      TString("/src/MitPhysics/data/TMVAClassificationPhotonID_")+
137 >                      TString("Endcap_PassPreSel_Variable_10_BDTnCuts2000_BDT.")+
138 >                      TString("weights.xml"));
139 >    BarrelWeights =  (gSystem->Getenv("CMSSW_BASE")+
140 >                      TString("/src/MitPhysics/data/TMVAClassificationPhotonID_")+
141 >                      TString("Barrel_PassPreSel_Variable_10_BDTnCuts2000_BDT.")+
142 >                      TString("weights.xml"));
143 >
144 >    // set up the variable names
145 >    mvaVars.resize(12);
146 >    varNames.push_back("HoE"        );
147 >    varNames.push_back("covIEtaIEta");
148 >    varNames.push_back("tIso1abs"   );
149 >    varNames.push_back("tIso3abs"   );
150 >    varNames.push_back("tIso2abs"   );
151 >    varNames.push_back("R9"         );
152 >    varNames.push_back("absIsoEcal" );
153 >    varNames.push_back("absIsoHcal" );
154 >    varNames.push_back("NVertexes"  );
155 >    varNames.push_back("ScEta"      );
156 >    varNames.push_back("EtaWidth"   );
157 >    varNames.push_back("PhiWidth"   );
158 >
159 >    for( unsigned int iV = 0; iV < mvaVars.size(); ++iV) {      
160 >      mvaVarMapEB.insert(  std::pair<std::string,unsigned int>(varNames[iV], iV) );
161 >      mvaVarMapEE.insert(  std::pair<std::string,unsigned int>(varNames[iV], iV) );
162      }
163      
164 <    if(VariableType==3||VariableType==4){
165 <      readers[i]->AddVariable( "absIsoEcal", &absIsoEcal );
166 <      readers[i]->AddVariable( "absIsoHcal", &absIsoHcal );
167 <      readers[i]->AddVariable( "RelEMax", &RelEMax );
120 <      readers[i]->AddVariable( "RelETop", &RelEBottom);
121 <      readers[i]->AddVariable( "RelEBottom", &RelEBottom );
122 <      readers[i]->AddVariable( "RelELeft", &RelELeft );
123 <      readers[i]->AddVariable( "RelERight", &RelERight );
124 <      readers[i]->AddVariable( "RelE2x5Max", &RelE2x5Max );
125 <      readers[i]->AddVariable( "RelE2x5Top", &RelE2x5Top );
126 <      readers[i]->AddVariable( "RelE2x5Bottom", &RelE2x5Bottom );
127 <      readers[i]->AddVariable( "RelE2x5Left", &RelE2x5Left );
128 <      readers[i]->AddVariable( "RelE2x5Right", &RelE2x5Right );
129 <      readers[i]->AddVariable( "RelE5x5", &RelE5x5 );
130 <    }
164 >    break;
165 >
166 >  case k2012IdMVA:
167 >  case k2012IdMVA_globe:
168      
169 <    if(VariableType==2||VariableType==3||VariableType==4){
170 <      readers[i]->AddVariable( "EtaWidth", &EtaWidth );
171 <      readers[i]->AddVariable( "PhiWidth", &PhiWidth );
172 <      readers[i]->AddVariable( "CoviEtaiPhi", &CoviEtaiPhi );
173 <      readers[i]->AddVariable( "CoviPhiiPhi", &CoviPhiiPhi );
174 <      if(VariableType==4){
175 <        readers[i]->AddVariable( "NVertexes", &NVertexes );
176 <      }
177 <      if(i==0){
178 <        readers[i]->AddVariable( "RelPreshowerEnergy", &RelPreshowerEnergy );
179 <      }
169 >    EndcapWeights =      (gSystem->Getenv("CMSSW_BASE")+
170 >                          TString("/src/MitPhysics/data/")+
171 >                          TString("2012ICHEP_PhotonID_Endcap_BDT.")+
172 >                          TString("weights_PSCorr.xml"));
173 >    BarrelWeights =      (gSystem->Getenv("CMSSW_BASE")+
174 >                          TString("/src/MitPhysics/data/")+
175 >                          TString("2012ICHEP_PhotonID_Barrel_BDT.")+
176 >                          TString("weights.xml"));
177 >
178 >    mvaVars.resize(12);
179 >    varNames.push_back("ph.r9"                        );
180 >    varNames.push_back("ph.sigietaieta"               );
181 >    varNames.push_back("ph.scetawidth"                );
182 >    varNames.push_back("ph.scphiwidth"                );
183 >    varNames.push_back("ph.idmva_CoviEtaiPhi"         );
184 >    varNames.push_back("ph.idmva_s4ratio"             );
185 >    varNames.push_back("ph.idmva_GammaIso"            );
186 >    varNames.push_back("ph.idmva_ChargedIso_selvtx"   );
187 >    varNames.push_back("ph.idmva_ChargedIso_worstvtx" );
188 >    varNames.push_back("ph.sceta"                     );
189 >    varNames.push_back("rho"                          );
190 >    varNames.push_back("ph.idmva_PsEffWidthSigmaRR"   );
191 >
192 >    for( unsigned int iV = 0; iV < mvaVars.size() - 1; ++iV) {
193 >      mvaVarMapEB.insert(  std::pair<std::string,unsigned int>(varNames[iV], iV) );
194 >      mvaVarMapEE.insert(  std::pair<std::string,unsigned int>(varNames[iV], iV) );
195      }
196 +    
197 +    // pre-shower only used for Endcaps
198 +    mvaVarMapEE.insert( std::pair<std::string,unsigned int> ( varNames[mvaVars.size() - 1], mvaVars.size() - 1) );
199  
200 <    if(VariableType==6){
201 <      readers[i]->AddVariable( "HoE", &HoE );
202 <      readers[i]->AddVariable( "covIEtaIEta", &covIEtaIEta );
148 <      readers[i]->AddVariable( "tIso1abs", &tIso1abs );
149 <      readers[i]->AddVariable( "tIso3abs", &tIso3abs );
150 <      readers[i]->AddVariable( "tIso2abs", &tIso2abs );
151 <      readers[i]->AddVariable( "R9", &R9 );
152 <      readers[i]->AddVariable( "absIsoEcal", &absIsoEcal );
153 <      readers[i]->AddVariable( "absIsoHcal", &absIsoHcal );
154 <      readers[i]->AddVariable( "RelE5x5", &RelE5x5 );
155 <      readers[i]->AddVariable( "EtaWidth", &EtaWidth );
156 <      readers[i]->AddVariable( "PhiWidth", &PhiWidth );
157 <      readers[i]->AddVariable( "CoviEtaiPhi", &CoviEtaiPhi );
158 <      readers[i]->AddVariable( "CoviPhiiPhi", &CoviPhiiPhi );
159 <      readers[i]->AddVariable( "NVertexes", &NVertexes );
160 <      if(i==0){
161 <      readers[i]->AddVariable( "RelPreshowerEnergy", &RelPreshowerEnergy );
162 <      }
163 <    }
200 >    break;
201 >
202 >  case k2013FinalIdMVA:
203      
204 <    if(VariableType==7){
205 <      readers[i]->AddVariable( "HoE", &HoE );
206 <      readers[i]->AddVariable( "covIEtaIEta", &covIEtaIEta );
207 <      readers[i]->AddVariable( "tIso1abs", &tIso1abs );
208 <      readers[i]->AddVariable( "tIso3abs", &tIso3abs );
209 <      readers[i]->AddVariable( "tIso2abs", &tIso2abs );
210 <      readers[i]->AddVariable( "R9", &R9 );
211 <      readers[i]->AddVariable( "absIsoEcal", &absIsoEcal );
212 <      readers[i]->AddVariable( "absIsoHcal", &absIsoHcal );
213 <      readers[i]->AddVariable( "NVertexes", &NVertexes );
214 <      readers[i]->AddVariable( "ScEta", &ScEta );
215 <    }    
216 <
217 <    if(VariableType==10){
218 <      readers[i]->AddVariable( "HoE", &HoE );
219 <      readers[i]->AddVariable( "covIEtaIEta", &covIEtaIEta );
220 <      readers[i]->AddVariable( "tIso1abs", &tIso1abs );
221 <      readers[i]->AddVariable( "tIso3abs", &tIso3abs );
222 <      readers[i]->AddVariable( "tIso2abs", &tIso2abs );
223 <      readers[i]->AddVariable( "R9", &R9 );
224 <      readers[i]->AddVariable( "absIsoEcal", &absIsoEcal );
225 <      readers[i]->AddVariable( "absIsoHcal", &absIsoHcal );
226 <      readers[i]->AddVariable( "NVertexes", &NVertexes );
227 <      readers[i]->AddVariable( "ScEta", &ScEta );
228 <      readers[i]->AddVariable( "EtaWidth", &EtaWidth );
229 <      readers[i]->AddVariable( "PhiWidth", &PhiWidth );      
230 <    }    
192 <
193 <    if(VariableType==1201){
194 <      /*readers[i]->AddVariable( "myphoton_pfchargedisogood03", &myphoton_pfchargedisogood03);
195 <      readers[i]->AddVariable( "myphoton_pfchargedisobad03", &myphoton_pfchargedisobad03);
196 <      readers[i]->AddVariable( "myphoton_pfphotoniso03", &myphoton_pfphotoniso03 );
197 <      readers[i]->AddVariable( "myphoton_sieie", &myphoton_sieie );
198 <      readers[i]->AddVariable( "myphoton_sieip", &myphoton_sieip );
199 <      readers[i]->AddVariable( "myphoton_etawidth", &myphoton_etawidth );
200 <      readers[i]->AddVariable( "myphoton_phiwidth", &myphoton_phiwidth );
201 <      readers[i]->AddVariable( "myphoton_r9", &myphoton_r9 );
202 <      readers[i]->AddVariable( "myphoton_s4ratio", &myphoton_s4ratio );
203 <      readers[i]->AddVariable( "myphoton_SCeta", &myphoton_SCeta );
204 <      readers[i]->AddVariable( "event_rho", &event_rho );
205 <      if(i==0){
206 <        readers[i]->AddVariable( "myphoton_ESEffSigmaRR", &myphoton_ESEffSigmaRR);
207 <        }*/
208 <      readers[i]->AddVariable( "ph.r9", &myphoton_r9 );
209 <      readers[i]->AddVariable( "ph.sigietaieta", &myphoton_sieie );
210 <      readers[i]->AddVariable( "ph.scetawidth", &myphoton_etawidth );
211 <      readers[i]->AddVariable( "ph.scphiwidth", &myphoton_phiwidth );
212 <      readers[i]->AddVariable( "ph.idmva_CoviEtaiPhi", &myphoton_sieip );
213 <      readers[i]->AddVariable( "ph.idmva_s4ratio", &myphoton_s4ratio );
214 <      readers[i]->AddVariable( "ph.idmva_GammaIso", &myphoton_pfphotoniso03 );
215 <      readers[i]->AddVariable( "ph.idmva_ChargedIso_selvtx", &myphoton_pfchargedisogood03);
216 <      readers[i]->AddVariable( "ph.idmva_ChargedIso_worstvtx", &myphoton_pfchargedisobad03);
217 <      readers[i]->AddVariable( "ph.sceta", &myphoton_SCeta );
218 <      readers[i]->AddVariable( "rho", &event_rho );
219 <      if(i==0){
220 <        readers[i]->AddVariable( "1.00023*ph.idmva_PsEffWidthSigmaRR + 0.0913", &myphoton_ESEffSigmaRR);
221 <      }
204 >    EndcapWeights =      (gSystem->Getenv("CMSSW_BASE")+
205 >                          TString("/src/MitPhysics/data/")+
206 >                          TString("2013FinalPaper_PhotonID_Endcap_BDT_TrainRangePT15.")+
207 >                          TString("weights.xml"));
208 >    BarrelWeights =      (gSystem->Getenv("CMSSW_BASE")+
209 >                          TString("/src/MitPhysics/data/")+
210 >                          TString("2013FinalPaper_PhotonID_Barrel_BDT_TrainRangePT15.")+
211 >                          TString("weights.xml"));
212 >
213 >    mvaVars.resize(13);
214 >    varNames.push_back("ph.scrawe"                    );
215 >    varNames.push_back("ph.r9"                        );
216 >    varNames.push_back("ph.sigietaieta"               );
217 >    varNames.push_back("ph.scetawidth"                );
218 >    varNames.push_back("ph.scphiwidth"                );
219 >    varNames.push_back("ph.idmva_CoviEtaiPhi"         );
220 >    varNames.push_back("ph.idmva_s4ratio"             );
221 >    varNames.push_back("ph.idmva_GammaIso"            );
222 >    varNames.push_back("ph.idmva_ChargedIso_selvtx"   );
223 >    varNames.push_back("ph.idmva_ChargedIso_worstvtx" );
224 >    varNames.push_back("ph.sceta"                     );
225 >    varNames.push_back("rho"                          );
226 >    varNames.push_back("ph.idmva_PsEffWidthSigmaRR"   );
227 >
228 >    for( unsigned int iV = 0; iV < mvaVars.size() - 1; ++iV) {
229 >      mvaVarMapEB.insert(  std::pair<std::string,unsigned int>(varNames[iV], iV) );
230 >      mvaVarMapEE.insert(  std::pair<std::string,unsigned int>(varNames[iV], iV) );
231      }
232      
233 +    // pre-shower only used for Endcaps
234 +    mvaVarMapEE.insert( std::pair<std::string,unsigned int> ( varNames[mvaVars.size() - 1], mvaVars.size() - 1) );
235 +
236 +    break;
237 +    
238 +  default:
239 +    // no variables... better never called..
240 +    std::cerr<<" MVATools: Trying to initialize with unknown type."<<std::endl;
241 +    break;
242    }
243 <  
243 >
244 >
245 >  // looping over both maps and adding Vars to BDT readers
246 >  for( unsigned int iV = 0; iV < varNames.size(); ++iV ){
247 >    std::map<std::string,unsigned int>::const_iterator it = mvaVarMapEB.find(varNames[iV]);
248 >    if ( it != mvaVarMapEB.end() )
249 >      fReaderBarrel -> AddVariable( (it->first).c_str(), &(mvaVars[it->second]));
250 >    it = mvaVarMapEE.find(varNames[iV]);
251 >    if ( it != mvaVarMapEE.end() )
252 >      fReaderEndcap -> AddVariable( (it->first).c_str(), &(mvaVars[it->second]));
253 >  }
254 >
255    fReaderEndcap->BookMVA("BDT method",EndcapWeights);
256    fReaderBarrel->BookMVA("BDT method",BarrelWeights);
257    
# Line 231 | Line 260 | void MVATools::InitializeMVA(int Variabl
260    
261   }
262  
263 < Bool_t MVATools::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, Bool_t applyElectronVeto) {
263 > // //--------------------------------------------------------------------------------------------------
264 > // void MVATools::InitializeMVA(int VariableType, TString EndcapWeights,TString BarrelWeights) {
265    
266 <  //initilize the bool value
267 <  PassMVA=kFALSE;
266 > //   if (fReaderEndcap) delete fReaderEndcap;  
267 > //   if (fReaderBarrel) delete fReaderBarrel;
268    
269 <  Float_t photon_bdt =  MVATools::GetMVAbdtValue_2011(p,vtx,trackCol,vtxCol, _tRho, els, applyElectronVeto);
269 > //   fReaderEndcap = new TMVA::Reader( "!Color:!Silent:Error" );      
270 > //   fReaderBarrel = new TMVA::Reader( "!Color:!Silent:Error" );  
271    
272 <  if (isbarrel) {
273 <    if(bdt>bdtCutBarrel){
274 <      PassMVA=kTRUE;    
275 <    }
276 <  }
277 <  else {
278 <    if(bdt>bdtCutEndcap){
279 <      PassMVA=kTRUE;    
280 <    }
281 <  }
282 <  return PassMVA;
283 < }
284 <
285 < //---------------------------------------------------------------------------------
286 < Int_t MVATools::PassElectronVetoInt(const Photon* p, const ElectronCol* els) {
272 > //   TMVA::Reader *readers[2];
273 > //   readers[0]  = fReaderEndcap;
274 > //   readers[1]  = fReaderBarrel;  
275 >  
276 > //   for (UInt_t i=0; i<2; ++i) {
277 >
278 > //     if(VariableType==0||VariableType==1||VariableType==2){
279 > //       readers[i]->AddVariable( "HoE", &HoE );
280 > //       readers[i]->AddVariable( "covIEtaIEta", &covIEtaIEta );
281 > //       readers[i]->AddVariable( "tIso1", &tIso1 );
282 > //       readers[i]->AddVariable( "tIso3", &tIso3 );
283 > //       readers[i]->AddVariable( "tIso2", &tIso2 );
284 > //       readers[i]->AddVariable( "R9", &R9 );
285 > //     }
286 >    
287 > //     if(VariableType==3||VariableType==4){
288 > //       readers[i]->AddVariable( "HoE", &HoE );
289 > //       readers[i]->AddVariable( "covIEtaIEta", &covIEtaIEta );
290 > //       readers[i]->AddVariable( "tIso1abs", &tIso1abs );
291 > //       readers[i]->AddVariable( "tIso3abs", &tIso3abs );
292 > //       readers[i]->AddVariable( "tIso2abs", &tIso2abs );
293 > //       readers[i]->AddVariable( "R9", &R9 );
294 > //     }
295 >    
296 > //     if(VariableType==1||VariableType==2){
297 > //       readers[i]->AddVariable( "RelIsoEcal", &RelIsoEcal );
298 > //       readers[i]->AddVariable( "RelIsoHcal", &RelIsoHcal );
299 > //       readers[i]->AddVariable( "RelEMax", &RelEMax );
300 > //       readers[i]->AddVariable( "RelETop", &RelETop );
301 > //       readers[i]->AddVariable( "RelEBottom", &RelEBottom );
302 > //       readers[i]->AddVariable( "RelELeft", &RelELeft );
303 > //       readers[i]->AddVariable( "RelERight", &RelERight );
304 > //       readers[i]->AddVariable( "RelE2x5Max", &RelE2x5Max );
305 > //       readers[i]->AddVariable( "RelE2x5Top", &RelE2x5Top );
306 > //       readers[i]->AddVariable( "RelE2x5Bottom", &RelE2x5Bottom );
307 > //       readers[i]->AddVariable( "RelE2x5Left", &RelE2x5Left );
308 > //       readers[i]->AddVariable( "RelE2x5Right", &RelE2x5Right );
309 > //       readers[i]->AddVariable( "RelE5x5", &RelE5x5 );
310 > //     }
311 >    
312 > //     if(VariableType==3||VariableType==4){
313 > //       readers[i]->AddVariable( "absIsoEcal", &absIsoEcal );
314 > //       readers[i]->AddVariable( "absIsoHcal", &absIsoHcal );
315 > //       readers[i]->AddVariable( "RelEMax", &RelEMax );
316 > //       readers[i]->AddVariable( "RelETop", &RelEBottom);
317 > //       readers[i]->AddVariable( "RelEBottom", &RelEBottom );
318 > //       readers[i]->AddVariable( "RelELeft", &RelELeft );
319 > //       readers[i]->AddVariable( "RelERight", &RelERight );
320 > //       readers[i]->AddVariable( "RelE2x5Max", &RelE2x5Max );
321 > //       readers[i]->AddVariable( "RelE2x5Top", &RelE2x5Top );
322 > //       readers[i]->AddVariable( "RelE2x5Bottom", &RelE2x5Bottom );
323 > //       readers[i]->AddVariable( "RelE2x5Left", &RelE2x5Left );
324 > //       readers[i]->AddVariable( "RelE2x5Right", &RelE2x5Right );
325 > //       readers[i]->AddVariable( "RelE5x5", &RelE5x5 );
326 > //     }
327 >    
328 > //     if(VariableType==2||VariableType==3||VariableType==4){
329 > //       readers[i]->AddVariable( "EtaWidth", &EtaWidth );
330 > //       readers[i]->AddVariable( "PhiWidth", &PhiWidth );
331 > //       readers[i]->AddVariable( "CoviEtaiPhi", &CoviEtaiPhi );
332 > //       readers[i]->AddVariable( "CoviPhiiPhi", &CoviPhiiPhi );
333 > //       if(VariableType==4){
334 > //      readers[i]->AddVariable( "NVertexes", &NVertexes );
335 > //       }
336 > //       if(i==0){
337 > //      readers[i]->AddVariable( "RelPreshowerEnergy", &RelPreshowerEnergy );
338 > //       }
339 > //     }
340 >
341 > //     if(VariableType==6){
342 > //       readers[i]->AddVariable( "HoE", &HoE );
343 > //       readers[i]->AddVariable( "covIEtaIEta", &covIEtaIEta );
344 > //       readers[i]->AddVariable( "tIso1abs", &tIso1abs );
345 > //       readers[i]->AddVariable( "tIso3abs", &tIso3abs );
346 > //       readers[i]->AddVariable( "tIso2abs", &tIso2abs );
347 > //       readers[i]->AddVariable( "R9", &R9 );
348 > //       readers[i]->AddVariable( "absIsoEcal", &absIsoEcal );
349 > //       readers[i]->AddVariable( "absIsoHcal", &absIsoHcal );
350 > //       readers[i]->AddVariable( "RelE5x5", &RelE5x5 );
351 > //       readers[i]->AddVariable( "EtaWidth", &EtaWidth );
352 > //       readers[i]->AddVariable( "PhiWidth", &PhiWidth );
353 > //       readers[i]->AddVariable( "CoviEtaiPhi", &CoviEtaiPhi );
354 > //       readers[i]->AddVariable( "CoviPhiiPhi", &CoviPhiiPhi );
355 > //       readers[i]->AddVariable( "NVertexes", &NVertexes );
356 > //       if(i==0){
357 > //       readers[i]->AddVariable( "RelPreshowerEnergy", &RelPreshowerEnergy );
358 > //       }
359 > //     }
360 >    
361 > //     if(VariableType==7){
362 > //       readers[i]->AddVariable( "HoE", &HoE );
363 > //       readers[i]->AddVariable( "covIEtaIEta", &covIEtaIEta );
364 > //       readers[i]->AddVariable( "tIso1abs", &tIso1abs );
365 > //       readers[i]->AddVariable( "tIso3abs", &tIso3abs );
366 > //       readers[i]->AddVariable( "tIso2abs", &tIso2abs );
367 > //       readers[i]->AddVariable( "R9", &R9 );
368 > //       readers[i]->AddVariable( "absIsoEcal", &absIsoEcal );
369 > //       readers[i]->AddVariable( "absIsoHcal", &absIsoHcal );
370 > //       readers[i]->AddVariable( "NVertexes", &NVertexes );
371 > //       readers[i]->AddVariable( "ScEta", &ScEta );
372 > //     }    
373 >
374 > //     if(VariableType==10){
375 > //       readers[i]->AddVariable( "HoE", &HoE );
376 > //       readers[i]->AddVariable( "covIEtaIEta", &covIEtaIEta );
377 > //       readers[i]->AddVariable( "tIso1abs", &tIso1abs );
378 > //       readers[i]->AddVariable( "tIso3abs", &tIso3abs );
379 > //       readers[i]->AddVariable( "tIso2abs", &tIso2abs );
380 > //       readers[i]->AddVariable( "R9", &R9 );
381 > //       readers[i]->AddVariable( "absIsoEcal", &absIsoEcal );
382 > //       readers[i]->AddVariable( "absIsoHcal", &absIsoHcal );
383 > //       readers[i]->AddVariable( "NVertexes", &NVertexes );
384 > //       readers[i]->AddVariable( "ScEta", &ScEta );
385 > //       readers[i]->AddVariable( "EtaWidth", &EtaWidth );
386 > //       readers[i]->AddVariable( "PhiWidth", &PhiWidth );      
387 > //     }    
388 >
389 > //     if(VariableType==1201){
390 > //       /*readers[i]->AddVariable( "myphoton_pfchargedisogood03", &myphoton_pfchargedisogood03);
391 > //       readers[i]->AddVariable( "myphoton_pfchargedisobad03", &myphoton_pfchargedisobad03);
392 > //       readers[i]->AddVariable( "myphoton_pfphotoniso03", &myphoton_pfphotoniso03 );
393 > //       readers[i]->AddVariable( "myphoton_sieie", &myphoton_sieie );
394 > //       readers[i]->AddVariable( "myphoton_sieip", &myphoton_sieip );
395 > //       readers[i]->AddVariable( "myphoton_etawidth", &myphoton_etawidth );
396 > //       readers[i]->AddVariable( "myphoton_phiwidth", &myphoton_phiwidth );
397 > //       readers[i]->AddVariable( "myphoton_r9", &myphoton_r9 );
398 > //       readers[i]->AddVariable( "myphoton_s4ratio", &myphoton_s4ratio );
399 > //       readers[i]->AddVariable( "myphoton_SCeta", &myphoton_SCeta );
400 > //       readers[i]->AddVariable( "event_rho", &event_rho );
401 > //       if(i==0){
402 > //      readers[i]->AddVariable( "myphoton_ESEffSigmaRR", &myphoton_ESEffSigmaRR);
403 > //      }*/
404 > //       readers[i]->AddVariable( "ph.r9", &myphoton_r9 );
405 > //       readers[i]->AddVariable( "ph.sigietaieta", &myphoton_sieie );
406 > //       readers[i]->AddVariable( "ph.scetawidth", &myphoton_etawidth );
407 > //       readers[i]->AddVariable( "ph.scphiwidth", &myphoton_phiwidth );
408 > //       readers[i]->AddVariable( "ph.idmva_CoviEtaiPhi", &myphoton_sieip );
409 > //       readers[i]->AddVariable( "ph.idmva_s4ratio", &myphoton_s4ratio );
410 > //       readers[i]->AddVariable( "ph.idmva_GammaIso", &myphoton_pfphotoniso03 );
411 > //       readers[i]->AddVariable( "ph.idmva_ChargedIso_selvtx", &myphoton_pfchargedisogood03);
412 > //       readers[i]->AddVariable( "ph.idmva_ChargedIso_worstvtx", &myphoton_pfchargedisobad03);
413 > //       readers[i]->AddVariable( "ph.sceta", &myphoton_SCeta );
414 > //       readers[i]->AddVariable( "rho", &event_rho );
415 > //       if(i==0){
416 > //      //readers[i]->AddVariable( "1.00023*ph.idmva_PsEffWidthSigmaRR + 0.0913", &myphoton_ESEffSigmaRR);
417 > //         readers[i]->AddVariable( "ph.idmva_PsEffWidthSigmaRR", &myphoton_ESEffSigmaRR);
418 > //       }
419 > //     }
420 >    
421 > //   }
422    
423 <  // these values are taken from the H2GGlobe code... (actually from Marco/s mail)
424 <  float cic4_allcuts_temp_sublead[] = {
259 <    3.8,         2.2,         1.77,        1.29,
260 <    11.7,        3.4,         3.9,         1.84,
261 <    3.5,         2.2,         2.3,         1.45,
262 <    0.0106,      0.0097,      0.028,       0.027,
263 <    0.082,       0.062,       0.065,       0.048,
264 <    0.94,        0.36,        0.94,        0.32,
265 <    1.,          0.062,       0.97,        0.97,
266 <    1.5,         1.5,         1.5,         1.5 };  // the last line is PixelmatchVeto and un-used
267 <  
268 <  //initilize the bool value
269 <  PassElecVetoInt=0;
270 <  
271 <  dRTrack = PhotonTools::ElectronVetoCiC(p, els);
272 <  
273 <  ScEta_MVA=p->SCluster()->Eta();
274 <  
275 <  isbarrel = (fabs(ScEta_MVA)<1.4442);
276 <
277 <  R9 = p->R9();
278 <  //R9 = p->E33()/p->SCluster()->RawEnergy();
279 <  
280 <  // check which category it is ...
281 <  _tCat = 1;
282 <  if ( !isbarrel ) _tCat = 3;
283 <  if ( R9 < 0.94 ) _tCat++;
284 <  
285 <  //Electron Veto
286 <  if(dRTrack > cic4_allcuts_temp_sublead[_tCat-1+6*4]){
287 <    PassElecVetoInt=1;
288 <  }
423 > //   fReaderEndcap->BookMVA("BDT method",EndcapWeights);
424 > //   fReaderBarrel->BookMVA("BDT method",BarrelWeights);
425    
426 <  return  PassElecVetoInt;
426 > //   assert(fReaderEndcap);
427 > //   assert(fReaderBarrel);
428    
429 < }
429 > // }
430  
431 < //--------------------------------------------------------------------------------------------------
431 > // *** REMOVED THIS COMPLETELY. If a module wants to cut on BDT, it should 1,) compute the BDT value (using GetMVAbdtValue(...) ) and then make the cut itself...
432  
433 < Float_t MVATools::GetMVAbdtValue_2012_globe(const Photon* p,const Vertex* vtx,const TrackCol* trackCol,const VertexCol* vtxCol,Double_t _tRho, const PFCandidateCol *fPFCands,const ElectronCol* els,Bool_t applyElectronVeto) {
433 > // Bool_t MVATools::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, Bool_t applyElectronVeto) {
434 >  
435 > //   //initilize the bool value
436 > //   PassMVA=kFALSE;
437 >  
438 > //   Float_t photon_bdt =  MVATools::GetMVAbdtValue_2011(p,vtx,trackCol,vtxCol, _tRho, els, applyElectronVeto);
439    
440 <  //get the variables used to compute MVA variables
441 <  ecalIso3 = p->EcalRecHitIsoDr03();
442 <  ecalIso4 = p->EcalRecHitIsoDr04();
443 <  hcalIso4 = p->HcalTowerSumEtDr04();
444 <  
445 <  wVtxInd = 0;
446 <  
447 <  trackIso1 = IsolationTools::CiCTrackIsolation(p,vtx, 0.3, 0.02, 0.0, 0.0, 0.1, 1.0, trackCol, NULL, NULL, (!applyElectronVeto ? els : NULL) );//Question Ming:whyfPV->At(0) instead of selected vertex using ranking method?
448 <    
449 <  // track iso worst vtx
450 <  trackIso2 = IsolationTools::CiCTrackIsolation(p,vtx, 0.4, 0.02, 0.0, 0.0, 0.1, 1.0, trackCol, &wVtxInd,vtxCol, (!applyElectronVeto ? els : NULL) );
451 <  
310 <  combIso1 = ecalIso3+hcalIso4+trackIso1 - 0.17*_tRho;
311 <  combIso2 = ecalIso4+hcalIso4+trackIso2 - 0.52*_tRho;
312 <  
313 <  RawEnergy = p->SCluster()->RawEnergy();
314 <  
315 <  ScEta = p->SCluster()->Eta();
316 <  
317 <  //mva varialbes v1 and v2
318 <  tIso1 = (combIso1) *50./p->Et();
319 <  tIso3 = (trackIso1)*50./p->Et();
320 <  tIso2 = (combIso2) *50./(p->MomVtx(vtxCol->At(wVtxInd)->Position()).Pt());
321 <  RelIsoEcal=(ecalIso3-0.17*_tRho)/p->Et();
322 <  RelIsoHcal=(hcalIso4-0.17*_tRho)/p->Et();
323 <
324 <  //compute mva variables for v3
325 <  HoE = p->HadOverEm();
326 <  covIEtaIEta = p->CoviEtaiEta();
327 <  tIso1abs = combIso1;
328 <  tIso3abs = trackIso1;
329 <  tIso2abs = combIso2;
330 <  R9 = p->R9();
331 <
332 <  absIsoEcal=(ecalIso3-0.17*_tRho);
333 <  absIsoHcal=(hcalIso4-0.17*_tRho);
334 <  RelEMax=p->SCluster()->Seed()->EMax()/RawEnergy;
335 <  RelETop=p->SCluster()->Seed()->ETop()/RawEnergy;
336 <  RelEBottom=p->SCluster()->Seed()->EBottom()/RawEnergy;
337 <  RelELeft=p->SCluster()->Seed()->ELeft()/RawEnergy;
338 <  RelERight=p->SCluster()->Seed()->ERight()/RawEnergy;
339 <  RelE2x5Max=p->SCluster()->Seed()->E2x5Max()/RawEnergy;
340 <  RelE2x5Top=p->SCluster()->Seed()->E2x5Top()/RawEnergy;
341 <  RelE2x5Bottom=p->SCluster()->Seed()->E2x5Bottom()/RawEnergy;
342 <  RelE2x5Left=p->SCluster()->Seed()->E2x5Left()/RawEnergy;
343 <  RelE2x5Right=p->SCluster()->Seed()->E2x5Right()/RawEnergy;
344 <  RelE5x5=p->SCluster()->Seed()->E5x5()/RawEnergy;
345 <  
346 <  EtaWidth=p->EtaWidth();
347 <  PhiWidth=p->PhiWidth();
348 <  CoviEtaiPhi=p->SCluster()->Seed()->CoviEtaiPhi();
349 <  CoviPhiiPhi=p->SCluster()->Seed()->CoviPhiiPhi();
350 <
351 <  RelPreshowerEnergy=p->SCluster()->PreshowerEnergy()/RawEnergy;
352 <  NVertexes=vtxCol->GetEntries();
353 <  
354 <  //spectator variables
355 <  Pt_MVA=p->Pt();
356 <  ScEta_MVA=p->SCluster()->Eta();
357 <
358 <  //
359 <
360 <  isbarrel = (fabs(ScEta_MVA)<1.4442);
361 <  
362 <  //variable 1201
363 <  myphoton_pfchargedisogood03=IsolationTools::PFChargedIsolation(p,vtx,0.3,0,fPFCands);
364 <  myphoton_pfchargedisobad03=IsolationTools::PFChargedIsolation(p,vtx,0.3,0,fPFCands,&wVtxInd,vtxCol);
365 <  myphoton_pfphotoniso03=IsolationTools::PFGammaIsolation(p,0.3,0,fPFCands);
366 <  myphoton_sieie=covIEtaIEta;
367 <  myphoton_sieip=CoviEtaiPhi;
368 <  myphoton_etawidth=EtaWidth;
369 <  myphoton_phiwidth=PhiWidth;
370 <  myphoton_r9=R9;
371 <  myphoton_s4ratio=p->S4Ratio();
372 <  myphoton_SCeta=ScEta_MVA;
373 <  event_rho= _tRho;
440 > //   if (isbarrel) {
441 > //     if(photon_bdt>bdtCutBarrel){
442 > //       PassMVA=kTRUE;
443 > //     }
444 > //   }
445 > //   else {
446 > //     if(photon_bdt>bdtCutEndcap){
447 > //       PassMVA=kTRUE;
448 > //     }
449 > //   }
450 > //   return PassMVA;
451 > // }
452  
453 <  myphoton_ESEffSigmaRR=-99;
453 > // //---------------------------------------------------------------------------------
454 > // Int_t MVATools::PassElectronVetoInt(const Photon* p, const ElectronCol* els) {
455 >  
456 > //   // these values are taken from the H2GGlobe code... (actually from Marco/s mail)
457 > //   float cic4_allcuts_temp_sublead[] = {
458 > //     3.8,         2.2,         1.77,        1.29,
459 > //     11.7,        3.4,         3.9,         1.84,
460 > //     3.5,         2.2,         2.3,         1.45,
461 > //     0.0106,      0.0097,      0.028,       0.027,
462 > //     0.082,       0.062,       0.065,       0.048,
463 > //     0.94,        0.36,        0.94,        0.32,
464 > //     1.,          0.062,       0.97,        0.97,
465 > //     1.5,         1.5,         1.5,         1.5 };  // the last line is PixelmatchVeto and un-used
466 >  
467 > //   //initilize the bool value
468 > //   PassElecVetoInt=0;
469 >  
470 > //   dRTrack = PhotonTools::ElectronVetoCiC(p, els);
471 >  
472 > //   ScEta_MVA=p->SCluster()->Eta();
473 >  
474 > //   isbarrel = (fabs(ScEta_MVA)<1.4442);
475  
476 <  if(!isbarrel){
477 <    myphoton_ESEffSigmaRR=p->EffSigmaRR();
379 <  }
476 > //   R9 = p->R9();
477 > //   //R9 = p->E33()/p->SCluster()->RawEnergy();
478    
479 <  if (isbarrel) {
480 <    reader = fReaderBarrel;
481 <  }
482 <  else {
385 <    reader = fReaderEndcap;
386 <  }
479 > //   // check which category it is ...
480 > //   _tCat = 1;
481 > //   if ( !isbarrel ) _tCat = 3;
482 > //   if ( R9 < 0.94 ) _tCat++;
483    
484 <  assert(reader);
484 > //   //Electron Veto
485 > //   if(dRTrack > cic4_allcuts_temp_sublead[_tCat-1+6*4]){
486 > //     PassElecVetoInt=1;
487 > //   }
488 >  
489 > //   return  PassElecVetoInt;
490 >  
491 > // }
492  
493 <  bdt = reader->EvaluateMVA("BDT method");
493 > //--------------------------------------------------------------------------------------------------
494  
392  /* printf("HoE: %f\n",HoE);
393  printf("covIEtaIEta: %f\n",covIEtaIEta);
394  printf("tIso1abs: %f\n",tIso1abs);
395  printf("tIso3abs: %f\n",tIso3abs);
396  printf("tIso2abs: %f\n",tIso2abs);
397  
398  printf("absIsoEcal: %f\n",absIsoEcal);
399  printf("absIsoHcal: %f\n",absIsoHcal);
400  printf("RelEMax: %f\n",RelEMax);
401  printf("RelETop: %f\n",RelETop);
402  printf("RelEBottom: %f\n",RelEBottom);
403  printf("RelELeft: %f\n",RelELeft);
404  printf("RelERight: %f\n",RelERight);
405  printf("RelE2x5Max: %f\n",RelE2x5Max);
406  printf("RelE2x5Top: %f\n",RelE2x5Top);
407  printf("RelE2x5Bottom: %f\n",RelE2x5Bottom);
408  printf("RelE2x5Left: %f\n",RelE2x5Left);
409  printf("RelE2x5Right;: %f\n",RelE2x5Right);
410  printf("RelE5x5: %f\n",RelE5x5);
411  
412  printf("EtaWidth: %f\n",EtaWidth);
413  printf("PhiWidth: %f\n",PhiWidth);
414  printf("CoviEtaiPhi: %f\n",CoviEtaiPhi);
415  printf("CoviPhiiPhi: %f\n",CoviPhiiPhi);
416  
417  if (!isbarrel) {
418    printf("RelPreshowerEnergy: %f\n",RelPreshowerEnergy);
419    }*/
420  
421  return bdt;
422 }
495  
496 < Float_t MVATools::GetMVAbdtValue_2011(const Photon* p,const Vertex* vtx,const TrackCol* trackCol,const VertexCol* vtxCol,Double_t _tRho,const ElectronCol* els,Bool_t applyElectronVeto) {
425 <  
426 <  //get the variables used to compute MVA variables
427 <  ecalIso3 = p->EcalRecHitIsoDr03();
428 <  ecalIso4 = p->EcalRecHitIsoDr04();
429 <  hcalIso4 = p->HcalTowerSumEtDr04();
430 <  
431 <  wVtxInd = 0;
432 <  
433 <  trackIso1 = IsolationTools::CiCTrackIsolation(p,vtx, 0.3, 0.02, 0.0, 0.0, 0.1, 1.0, trackCol, NULL, NULL, (!applyElectronVeto ? els : NULL) );//Question Ming:whyfPV->At(0) instead of selected vertex using ranking method?
434 <    
435 <  // track iso worst vtx
436 <  trackIso2 = IsolationTools::CiCTrackIsolation(p,vtx, 0.4, 0.02, 0.0, 0.0, 0.1, 1.0, trackCol, &wVtxInd,vtxCol, (!applyElectronVeto ? els : NULL) );
437 <  
438 <  combIso1 = ecalIso3+hcalIso4+trackIso1 - 0.17*_tRho;
439 <  combIso2 = ecalIso4+hcalIso4+trackIso2 - 0.52*_tRho;
440 <  
441 <  RawEnergy = p->SCluster()->RawEnergy();
442 <  
443 <  ScEta = p->SCluster()->Eta();
444 <  
445 <  //mva varialbes v1 and v2
446 <  tIso1 = (combIso1) *50./p->Et();
447 <  tIso3 = (trackIso1)*50./p->Et();
448 <  tIso2 = (combIso2) *50./(p->MomVtx(vtxCol->At(wVtxInd)->Position()).Pt());
449 <  RelIsoEcal=(ecalIso3-0.17*_tRho)/p->Et();
450 <  RelIsoHcal=(hcalIso4-0.17*_tRho)/p->Et();
451 <
452 <  //compute mva variables for v3
453 <  HoE = p->HadOverEm();
454 <  covIEtaIEta = p->CoviEtaiEta();
455 <  tIso1abs = combIso1;
456 <  tIso3abs = trackIso1;
457 <  tIso2abs = combIso2;
458 <  R9 = p->R9();
459 <
460 <  absIsoEcal=(ecalIso3-0.17*_tRho);
461 <  absIsoHcal=(hcalIso4-0.17*_tRho);
462 <  RelEMax=p->SCluster()->Seed()->EMax()/RawEnergy;
463 <  RelETop=p->SCluster()->Seed()->ETop()/RawEnergy;
464 <  RelEBottom=p->SCluster()->Seed()->EBottom()/RawEnergy;
465 <  RelELeft=p->SCluster()->Seed()->ELeft()/RawEnergy;
466 <  RelERight=p->SCluster()->Seed()->ERight()/RawEnergy;
467 <  RelE2x5Max=p->SCluster()->Seed()->E2x5Max()/RawEnergy;
468 <  RelE2x5Top=p->SCluster()->Seed()->E2x5Top()/RawEnergy;
469 <  RelE2x5Bottom=p->SCluster()->Seed()->E2x5Bottom()/RawEnergy;
470 <  RelE2x5Left=p->SCluster()->Seed()->E2x5Left()/RawEnergy;
471 <  RelE2x5Right=p->SCluster()->Seed()->E2x5Right()/RawEnergy;
472 <  RelE5x5=p->SCluster()->Seed()->E5x5()/RawEnergy;
473 <  
474 <  EtaWidth=p->EtaWidth();
475 <  PhiWidth=p->PhiWidth();
476 <  CoviEtaiPhi=p->SCluster()->Seed()->CoviEtaiPhi();
477 <  CoviPhiiPhi=p->SCluster()->Seed()->CoviPhiiPhi();
478 <
479 <  RelPreshowerEnergy=p->SCluster()->PreshowerEnergy()/RawEnergy;
480 <  NVertexes=vtxCol->GetEntries();
481 <  
482 <  //spectator variables
483 <  Pt_MVA=p->Pt();
484 <  ScEta_MVA=p->SCluster()->Eta();
496 > Double_t MVATools::GetMVAbdtValue(const Photon* p, const Vertex* vtx, const TrackCol* trackCol, const VertexCol* vtxCol, Double_t _tRho, const PFCandidateCol *fPFCands, const ElectronCol* els, Bool_t applyElectronVeto) {
497  
498 <  //
498 >  // if there's no reader, or the type is kNone, return the default values of -99.
499 >  if( ( !fReaderBarrel || !fReaderEndcap ) || fMVAType == kNone ) return -99.;
500  
501 <  isbarrel = (fabs(ScEta_MVA)<1.4442);
501 >  // we compute the variable names... make sure no confilcts when adding new variables...
502    
503 <  if (isbarrel) {
504 <    reader = fReaderBarrel;
503 >  // check if it's a Barrel or EE photon
504 >  bool isBarrel = ( p->SCluster()->AbsEta() < 1.5 );
505 >
506 >  std::map<std::string,unsigned int>* theVars = ( isBarrel ? &mvaVarMapEB : &mvaVarMapEE );  
507 >  
508 >  // loop over all the variables in the map... and keep count (to make sure we have filled all variables)
509 >  unsigned int varCounter = 0;
510 >  for( std::map<std::string,unsigned int>::const_iterator iV = theVars->begin(); iV != theVars->end(); ++iV ) {
511 >    
512 >    TString theVarName  = TString(iV->first);  
513 >    float* theVarValue  = &(mvaVars[iV->second]);           // pointer to the variable...
514 >    
515 >    if(
516 >       !theVarName.CompareTo("HoE")
517 >       ) {
518 >      (*theVarValue) = p->HadOverEm();
519 >      varCounter++;
520 >    } else if (
521 >               !theVarName.CompareTo("covIEtaIEta") || !theVarName.CompareTo("ph.sigietaieta") || !theVarName.CompareTo("sigieie")
522 >               ) {
523 >      (*theVarValue) = p->CoviEtaiEta();
524 >      varCounter++;
525 >    } else if (
526 >               !theVarName.CompareTo("R9") || !theVarName.CompareTo("ph.r9") || !theVarName.CompareTo("r9")
527 >               ) {
528 >      (*theVarValue) = p->R9();
529 >      varCounter++;
530 >    } else if (
531 >               !theVarName.CompareTo("ScEta") || !theVarName.CompareTo("ph.sceta") || !theVarName.CompareTo("sceta")
532 >               ) {
533 >      (*theVarValue) = p->SCluster()->Eta();
534 >      varCounter++;
535 >    } else if (
536 >               !theVarName.CompareTo("rho")
537 >               ) {
538 >      (*theVarValue) = _tRho;
539 >       varCounter++;
540 >    } else if (
541 >               !theVarName.CompareTo("tIso1abs")
542 >               ) {      
543 >      double _ecalIso3 = p->EcalRecHitIsoDr03();
544 >      double _hcalIso4 = p->HcalTowerSumEtDr04();  
545 >      double _trackIso1 = IsolationTools::CiCTrackIsolation(p,vtx, 0.3, 0.02, 0.0, 0.0, 0.1, 1.0, trackCol, NULL, NULL, (!applyElectronVeto ? els : NULL) );//Question Ming:whyfPV->At(0) instead of selected vertex using ranking method?
546 >      (*theVarValue) = _ecalIso3+_hcalIso4+_trackIso1 - 0.17*_tRho;
547 >      varCounter++;
548 >    } else if (
549 >               !theVarName.CompareTo("tIso2abs")
550 >               ) {
551 >      double _ecalIso4 = p->EcalRecHitIsoDr04();
552 >      double _hcalIso4 = p->HcalTowerSumEtDr04();
553 >      unsigned int wVtxInd = 0;
554 >      double _trackIso2 = IsolationTools::CiCTrackIsolation(p,vtx, 0.4, 0.02, 0.0, 0.0, 0.1, 1.0, trackCol, &wVtxInd,vtxCol, (!applyElectronVeto ? els : NULL) );
555 >      (*theVarValue) = _ecalIso4+_hcalIso4+_trackIso2 - 0.52*_tRho;
556 >      varCounter++;
557 >    } else if (
558 >               !theVarName.CompareTo("tIso3abs")
559 >               ) {
560 >      (*theVarValue) = IsolationTools::CiCTrackIsolation(p,vtx, 0.3, 0.02, 0.0, 0.0, 0.1, 1.0, trackCol, NULL, NULL, (!applyElectronVeto ? els : NULL) );
561 >      varCounter++;
562 >    } else if (
563 >               !theVarName.CompareTo("absIsoEcal")
564 >               ) {
565 >      double _ecalIso3 = p->EcalRecHitIsoDr03();
566 >      (*theVarValue) =  (_ecalIso3-0.17*_tRho);
567 >      varCounter++;
568 >    } else if (
569 >               !theVarName.CompareTo("absIsoHcal")
570 >               ) {
571 >      double _hcalIso4 = p->HcalTowerSumEtDr04();
572 >      (*theVarValue) = (_hcalIso4-0.17*_tRho);
573 >      varCounter++;
574 >    } else if (
575 >               !theVarName.CompareTo("NVertexes")
576 >               ) {
577 >
578 >      (*theVarValue) = vtxCol->GetEntries();
579 >      varCounter++;
580 >    } else if (
581 >               !theVarName.CompareTo("EtaWidth") || !theVarName.CompareTo("ph.scetawidth") || !theVarName.CompareTo("sigeta")
582 >               ) {
583 >      (*theVarValue) = p->EtaWidth();
584 >      varCounter++;
585 >    } else if (
586 >               !theVarName.CompareTo("PhiWidth") || !theVarName.CompareTo("ph.scphiwidth") || !theVarName.CompareTo("sigphi")
587 >               ) {
588 >      (*theVarValue) = p->PhiWidth();
589 >      varCounter++;
590 >
591 >    } else if (
592 >               !theVarName.CompareTo("ph.idmva_CoviEtaiPhi") || !theVarName.CompareTo("covieip")
593 >               ) {
594 >      (*theVarValue) = p->SCluster()->Seed()->CoviEtaiPhi();
595 >      varCounter++;
596 >    } else if (
597 >               !theVarName.CompareTo("ph.idmva_s4ratio") || !theVarName.CompareTo("s4r")
598 >               ) {
599 >      (*theVarValue) = p->S4Ratio();
600 >      //(*theVarValue) = p->SCluster()->Seed()->E2x2()/p->E55();
601 >      varCounter++;
602 >    } else if (
603 >               !theVarName.CompareTo("ph.idmva_GammaIso") || !theVarName.CompareTo("pfgiso")
604 >               ) {
605 >      (*theVarValue) = IsolationTools::PFGammaIsolation(p,0.3,0,fPFCands);
606 >      varCounter++;
607 >    } else if (
608 >               !theVarName.CompareTo("ph.idmva_ChargedIso_selvtx") || !theVarName.CompareTo("pfciso")
609 >               ) {
610 >      (*theVarValue) = IsolationTools::PFChargedIsolation(p,vtx,0.3,0,fPFCands);
611 >      varCounter++;
612 >    } else if (
613 >               !theVarName.CompareTo("ph.idmva_ChargedIso_worstvtx")
614 >               ) {
615 >      unsigned int wVtxInd = 0;
616 >      (*theVarValue) = IsolationTools::PFChargedIsolation(p,vtx,0.3,0,fPFCands,&wVtxInd,vtxCol);
617 >      varCounter++;
618 >    } else if (
619 >               !theVarName.CompareTo("ph.idmva_PsEffWidthSigmaRR")
620 >               ) {
621 >      (*theVarValue) = p->EffSigmaRR();
622 >      varCounter++;
623 >    } else if (
624 >               !theVarName.CompareTo("rawe")|| !theVarName.CompareTo("ph.scrawe")
625 >               ) {
626 >      (*theVarValue) = p->SCluster()->RawEnergy();
627 >      varCounter++;
628 >    } else {
629 >      // a variable is not know... copmplain!
630 >      std::cerr<<" ERROR: MVA Evaluation called with unknown variable name >"<<theVarName<<">."<<std::endl;
631 >    }
632    }
633 <  else {
633 >  
634 >  // now all the variables should be filled... check!
635 >  if( varCounter != theVars->size() )
636 >    std::cerr<<" ERROR: MVA Evaludation called and not all variables are filled."<<std::endl;
637 >
638 >  // we're ready to compute the MVA value
639 >  TMVA::Reader* reader = NULL;
640 >  if (isBarrel)
641 >    reader = fReaderBarrel;
642 >  else
643      reader = fReaderEndcap;
495  }
644    
645    assert(reader);
498
499  bdt = reader->EvaluateMVA("BDT method");
500
501  /* printf("HoE: %f\n",HoE);
502  printf("covIEtaIEta: %f\n",covIEtaIEta);
503  printf("tIso1abs: %f\n",tIso1abs);
504  printf("tIso3abs: %f\n",tIso3abs);
505  printf("tIso2abs: %f\n",tIso2abs);
506  
507  printf("absIsoEcal: %f\n",absIsoEcal);
508  printf("absIsoHcal: %f\n",absIsoHcal);
509  printf("RelEMax: %f\n",RelEMax);
510  printf("RelETop: %f\n",RelETop);
511  printf("RelEBottom: %f\n",RelEBottom);
512  printf("RelELeft: %f\n",RelELeft);
513  printf("RelERight: %f\n",RelERight);
514  printf("RelE2x5Max: %f\n",RelE2x5Max);
515  printf("RelE2x5Top: %f\n",RelE2x5Top);
516  printf("RelE2x5Bottom: %f\n",RelE2x5Bottom);
517  printf("RelE2x5Left: %f\n",RelE2x5Left);
518  printf("RelE2x5Right;: %f\n",RelE2x5Right);
519  printf("RelE5x5: %f\n",RelE5x5);
520  
521  printf("EtaWidth: %f\n",EtaWidth);
522  printf("PhiWidth: %f\n",PhiWidth);
523  printf("CoviEtaiPhi: %f\n",CoviEtaiPhi);
524  printf("CoviPhiiPhi: %f\n",CoviPhiiPhi);
525  
526  if (!isbarrel) {
527    printf("RelPreshowerEnergy: %f\n",RelPreshowerEnergy);
528    }*/
646    
647 <  return bdt;
647 >  return (reader->EvaluateMVA("BDT method"));
648   }
649 +
650 + // Float_t MVATools::GetMVAbdtValue_2012_globe(const Photon* p,const Vertex* vtx,const TrackCol* trackCol,const VertexCol* vtxCol,Double_t _tRho, const PFCandidateCol *fPFCands,const ElectronCol* els,Bool_t applyElectronVeto) {
651 +  
652 + //   //get the variables used to compute MVA variables
653 + //   ecalIso3 = p->EcalRecHitIsoDr03();
654 + //   ecalIso4 = p->EcalRecHitIsoDr04();
655 + //   hcalIso4 = p->HcalTowerSumEtDr04();
656 +  
657 + //   wVtxInd = 0;
658 +  
659 + //   trackIso1 = IsolationTools::CiCTrackIsolation(p,vtx, 0.3, 0.02, 0.0, 0.0, 0.1, 1.0, trackCol, NULL, NULL, (!applyElectronVeto ? els : NULL) );//Question Ming:whyfPV->At(0) instead of selected vertex using ranking method?
660 +    
661 + //   // track iso worst vtx
662 + //   trackIso2 = IsolationTools::CiCTrackIsolation(p,vtx, 0.4, 0.02, 0.0, 0.0, 0.1, 1.0, trackCol, &wVtxInd,vtxCol, (!applyElectronVeto ? els : NULL) );
663 +  
664 + //   combIso1 = ecalIso3+hcalIso4+trackIso1 - 0.17*_tRho;
665 + //   combIso2 = ecalIso4+hcalIso4+trackIso2 - 0.52*_tRho;
666 +  
667 + //   RawEnergy = p->SCluster()->RawEnergy();
668 +  
669 + //   ScEta = p->SCluster()->Eta();
670 +  
671 + //   //mva varialbes v1 and v2
672 + //   tIso1 = (combIso1) *50./p->Et();
673 + //   tIso3 = (trackIso1)*50./p->Et();
674 + //   tIso2 = (combIso2) *50./(p->MomVtx(vtxCol->At(wVtxInd)->Position()).Pt());
675 + //   RelIsoEcal=(ecalIso3-0.17*_tRho)/p->Et();
676 + //   RelIsoHcal=(hcalIso4-0.17*_tRho)/p->Et();
677 +
678 + //   //compute mva variables for v3
679 + //   HoE = p->HadOverEm();
680 + //   covIEtaIEta = p->CoviEtaiEta();
681 + //   tIso1abs = combIso1;
682 + //   tIso3abs = trackIso1;
683 + //   tIso2abs = combIso2;
684 + //   R9 = p->R9();
685 +
686 + //   absIsoEcal=(ecalIso3-0.17*_tRho);
687 + //   absIsoHcal=(hcalIso4-0.17*_tRho);
688 + //   RelEMax=p->SCluster()->Seed()->EMax()/RawEnergy;
689 + //   RelETop=p->SCluster()->Seed()->ETop()/RawEnergy;
690 + //   RelEBottom=p->SCluster()->Seed()->EBottom()/RawEnergy;
691 + //   RelELeft=p->SCluster()->Seed()->ELeft()/RawEnergy;
692 + //   RelERight=p->SCluster()->Seed()->ERight()/RawEnergy;
693 + //   RelE2x5Max=p->SCluster()->Seed()->E2x5Max()/RawEnergy;
694 + //   RelE2x5Top=p->SCluster()->Seed()->E2x5Top()/RawEnergy;
695 + //   RelE2x5Bottom=p->SCluster()->Seed()->E2x5Bottom()/RawEnergy;
696 + //   RelE2x5Left=p->SCluster()->Seed()->E2x5Left()/RawEnergy;
697 + //   RelE2x5Right=p->SCluster()->Seed()->E2x5Right()/RawEnergy;
698 + //   RelE5x5=p->SCluster()->Seed()->E5x5()/RawEnergy;
699 +  
700 + //   EtaWidth=p->EtaWidth();
701 + //   PhiWidth=p->PhiWidth();
702 + //   CoviEtaiPhi=p->SCluster()->Seed()->CoviEtaiPhi();
703 + //   CoviPhiiPhi=p->SCluster()->Seed()->CoviPhiiPhi();
704 +
705 + //   RelPreshowerEnergy=p->SCluster()->PreshowerEnergy()/RawEnergy;
706 + //   NVertexes=vtxCol->GetEntries();
707 +  
708 + //   //spectator variables
709 + //   Pt_MVA=p->Pt();
710 + //   ScEta_MVA=p->SCluster()->Eta();
711 +
712 + //   //
713 +
714 + //   isbarrel = (fabs(ScEta_MVA)<1.4442);
715 +  
716 + //   //variable 1201
717 + //   myphoton_pfchargedisogood03=IsolationTools::PFChargedIsolation(p,vtx,0.3,0,fPFCands);
718 + //   myphoton_pfchargedisobad03=IsolationTools::PFChargedIsolation(p,vtx,0.3,0,fPFCands,&wVtxInd,vtxCol);
719 + //   myphoton_pfphotoniso03=IsolationTools::PFGammaIsolation(p,0.3,0,fPFCands);
720 + //   myphoton_sieie=covIEtaIEta;
721 + //   myphoton_sieip=CoviEtaiPhi;
722 + //   myphoton_etawidth=EtaWidth;
723 + //   myphoton_phiwidth=PhiWidth;
724 + //   myphoton_r9=R9;
725 + //   myphoton_s4ratio=p->S4Ratio();
726 + //   myphoton_SCeta=ScEta_MVA;
727 + //   event_rho= _tRho;
728 +
729 + //   myphoton_ESEffSigmaRR=-99;
730 +
731 + //   if(!isbarrel){
732 + //     myphoton_ESEffSigmaRR=p->EffSigmaRR();
733 + //   }
734 +  
735 + //   if (isbarrel) {
736 + //     reader = fReaderBarrel;
737 + //   }
738 + //   else {
739 + //     reader = fReaderEndcap;
740 + //   }
741 +  
742 + //   assert(reader);
743 +
744 + //   double bdt = reader->EvaluateMVA("BDT method");
745 +
746 + //   /* printf("HoE: %f\n",HoE);
747 + //   printf("covIEtaIEta: %f\n",covIEtaIEta);
748 + //   printf("tIso1abs: %f\n",tIso1abs);
749 + //   printf("tIso3abs: %f\n",tIso3abs);
750 + //   printf("tIso2abs: %f\n",tIso2abs);
751 +  
752 + //   printf("absIsoEcal: %f\n",absIsoEcal);
753 + //   printf("absIsoHcal: %f\n",absIsoHcal);
754 + //   printf("RelEMax: %f\n",RelEMax);
755 + //   printf("RelETop: %f\n",RelETop);
756 + //   printf("RelEBottom: %f\n",RelEBottom);
757 + //   printf("RelELeft: %f\n",RelELeft);
758 + //   printf("RelERight: %f\n",RelERight);
759 + //   printf("RelE2x5Max: %f\n",RelE2x5Max);
760 + //   printf("RelE2x5Top: %f\n",RelE2x5Top);
761 + //   printf("RelE2x5Bottom: %f\n",RelE2x5Bottom);
762 + //   printf("RelE2x5Left: %f\n",RelE2x5Left);
763 + //   printf("RelE2x5Right;: %f\n",RelE2x5Right);
764 + //   printf("RelE5x5: %f\n",RelE5x5);
765 +  
766 + //   printf("EtaWidth: %f\n",EtaWidth);
767 + //   printf("PhiWidth: %f\n",PhiWidth);
768 + //   printf("CoviEtaiPhi: %f\n",CoviEtaiPhi);
769 + //   printf("CoviPhiiPhi: %f\n",CoviPhiiPhi);
770 +  
771 + //   if (!isbarrel) {
772 + //     printf("RelPreshowerEnergy: %f\n",RelPreshowerEnergy);
773 + //     }*/
774 +  
775 + //   return bdt;
776 + // }
777 +
778 + // Float_t MVATools::GetMVAbdtValue_2011(const Photon* p,const Vertex* vtx,const TrackCol* trackCol,const VertexCol* vtxCol,Double_t _tRho,const ElectronCol* els,Bool_t applyElectronVeto) {
779 +  
780 + //   //get the variables used to compute MVA variables
781 + //   ecalIso3 = p->EcalRecHitIsoDr03();
782 + //   ecalIso4 = p->EcalRecHitIsoDr04();
783 + //   hcalIso4 = p->HcalTowerSumEtDr04();
784 +  
785 + //   wVtxInd = 0;
786 +  
787 + //   trackIso1 = IsolationTools::CiCTrackIsolation(p,vtx, 0.3, 0.02, 0.0, 0.0, 0.1, 1.0, trackCol, NULL, NULL, (!applyElectronVeto ? els : NULL) );//Question Ming:whyfPV->At(0) instead of selected vertex using ranking method?
788 +    
789 + //   // track iso worst vtx
790 + //   trackIso2 = IsolationTools::CiCTrackIsolation(p,vtx, 0.4, 0.02, 0.0, 0.0, 0.1, 1.0, trackCol, &wVtxInd,vtxCol, (!applyElectronVeto ? els : NULL) );
791 +  
792 + //   combIso1 = ecalIso3+hcalIso4+trackIso1 - 0.17*_tRho;
793 + //   combIso2 = ecalIso4+hcalIso4+trackIso2 - 0.52*_tRho;
794 +  
795 + //   RawEnergy = p->SCluster()->RawEnergy();
796 +  
797 + //   ScEta = p->SCluster()->Eta();
798 +  
799 + //   //mva varialbes v1 and v2
800 + //   tIso1 = (combIso1) *50./p->Et();
801 + //   tIso3 = (trackIso1)*50./p->Et();
802 + //   tIso2 = (combIso2) *50./(p->MomVtx(vtxCol->At(wVtxInd)->Position()).Pt());
803 + //   RelIsoEcal=(ecalIso3-0.17*_tRho)/p->Et();
804 + //   RelIsoHcal=(hcalIso4-0.17*_tRho)/p->Et();
805 +
806 + //   //compute mva variables for v3
807 + //   HoE = p->HadOverEm();
808 + //   covIEtaIEta = p->CoviEtaiEta();
809 + //   tIso1abs = combIso1;
810 + //   tIso3abs = trackIso1;
811 + //   tIso2abs = combIso2;
812 + //   R9 = p->R9();
813 +
814 + //   absIsoEcal=(ecalIso3-0.17*_tRho);
815 + //   absIsoHcal=(hcalIso4-0.17*_tRho);
816 + //   RelEMax=p->SCluster()->Seed()->EMax()/RawEnergy;
817 + //   RelETop=p->SCluster()->Seed()->ETop()/RawEnergy;
818 + //   RelEBottom=p->SCluster()->Seed()->EBottom()/RawEnergy;
819 + //   RelELeft=p->SCluster()->Seed()->ELeft()/RawEnergy;
820 + //   RelERight=p->SCluster()->Seed()->ERight()/RawEnergy;
821 + //   RelE2x5Max=p->SCluster()->Seed()->E2x5Max()/RawEnergy;
822 + //   RelE2x5Top=p->SCluster()->Seed()->E2x5Top()/RawEnergy;
823 + //   RelE2x5Bottom=p->SCluster()->Seed()->E2x5Bottom()/RawEnergy;
824 + //   RelE2x5Left=p->SCluster()->Seed()->E2x5Left()/RawEnergy;
825 + //   RelE2x5Right=p->SCluster()->Seed()->E2x5Right()/RawEnergy;
826 + //   RelE5x5=p->SCluster()->Seed()->E5x5()/RawEnergy;
827 +  
828 + //   EtaWidth=p->EtaWidth();
829 + //   PhiWidth=p->PhiWidth();
830 + //   CoviEtaiPhi=p->SCluster()->Seed()->CoviEtaiPhi();
831 + //   CoviPhiiPhi=p->SCluster()->Seed()->CoviPhiiPhi();
832 +
833 + //   RelPreshowerEnergy=p->SCluster()->PreshowerEnergy()/RawEnergy;
834 + //   NVertexes=vtxCol->GetEntries();
835 +  
836 + //   //spectator variables
837 + //   Pt_MVA=p->Pt();
838 + //   ScEta_MVA=p->SCluster()->Eta();
839 +
840 + //   //
841 +
842 + //   isbarrel = (fabs(ScEta_MVA)<1.4442);
843 +  
844 + //   if (isbarrel) {
845 + //     reader = fReaderBarrel;
846 + //   }
847 + //   else {
848 + //     reader = fReaderEndcap;
849 + //   }
850 +  
851 + //   assert(reader);
852 +
853 + //   double bdt = reader->EvaluateMVA("BDT method");
854 +
855 + //   /* printf("HoE: %f\n",HoE);
856 + //   printf("covIEtaIEta: %f\n",covIEtaIEta);
857 + //   printf("tIso1abs: %f\n",tIso1abs);
858 + //   printf("tIso3abs: %f\n",tIso3abs);
859 + //   printf("tIso2abs: %f\n",tIso2abs);
860 +  
861 + //   printf("absIsoEcal: %f\n",absIsoEcal);
862 + //   printf("absIsoHcal: %f\n",absIsoHcal);
863 + //   printf("RelEMax: %f\n",RelEMax);
864 + //   printf("RelETop: %f\n",RelETop);
865 + //   printf("RelEBottom: %f\n",RelEBottom);
866 + //   printf("RelELeft: %f\n",RelELeft);
867 + //   printf("RelERight: %f\n",RelERight);
868 + //   printf("RelE2x5Max: %f\n",RelE2x5Max);
869 + //   printf("RelE2x5Top: %f\n",RelE2x5Top);
870 + //   printf("RelE2x5Bottom: %f\n",RelE2x5Bottom);
871 + //   printf("RelE2x5Left: %f\n",RelE2x5Left);
872 + //   printf("RelE2x5Right;: %f\n",RelE2x5Right);
873 + //   printf("RelE5x5: %f\n",RelE5x5);
874 +  
875 + //   printf("EtaWidth: %f\n",EtaWidth);
876 + //   printf("PhiWidth: %f\n",PhiWidth);
877 + //   printf("CoviEtaiPhi: %f\n",CoviEtaiPhi);
878 + //   printf("CoviPhiiPhi: %f\n",CoviPhiiPhi);
879 +  
880 + //   if (!isbarrel) {
881 + //     printf("RelPreshowerEnergy: %f\n",RelPreshowerEnergy);
882 + //     }*/
883 +  
884 + //   return bdt;
885 + // }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines