CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EGammaMvaEleEstimatorCSA14.cc
Go to the documentation of this file.
1 #include <TFile.h>
3 #include <cmath>
4 #include <vector>
5 #include <cstdio>
6 #include <zlib.h>
7 #include "TMVA/MethodBase.h"
8 
9 
10 //--------------------------------------------------------------------------------------------------
12 fMethodname("BDTG method"),
13 fisInitialized(kFALSE),
14 fMVAType(kTrig),
15 fUseBinnedVersion(kTRUE),
16 fNMVABins(0)
17 {
18  // Constructor.
19 }
20 
21 //--------------------------------------------------------------------------------------------------
23 {
24  for (unsigned int i=0;i<fTMVAReader.size(); ++i) {
25  if (fTMVAMethod[i]) delete fTMVAMethod[i];
26  if (fTMVAReader[i]) delete fTMVAReader[i];
27  }
28 }
29 
30 //--------------------------------------------------------------------------------------------------
32  std::string weightsfile,
34 {
35 
36  std::vector<std::string> tempWeightFileVector;
37  tempWeightFileVector.push_back(weightsfile);
38  initialize(methodName,type,kFALSE,tempWeightFileVector);
39 }
40 
41 
42 //--------------------------------------------------------------------------------------------------
45  Bool_t useBinnedVersion,
46  std::vector<std::string> weightsfiles
47  ) {
48 
49  //clean up first
50  for (unsigned int i=0;i<fTMVAReader.size(); ++i) {
51  if (fTMVAReader[i]) delete fTMVAReader[i];
52  if (fTMVAMethod[i]) delete fTMVAMethod[i];
53  }
54  fTMVAReader.clear();
55  fTMVAMethod.clear();
56  //initialize
57  fisInitialized = kTRUE;
58  fMVAType = type;
59  fMethodname = methodName;
60  fUseBinnedVersion = useBinnedVersion;
61 
62  //Define expected number of bins
63  UInt_t ExpectedNBins = 0;
64  if (type == kTrig) {
65  ExpectedNBins = 2;
66  }
67  else if (type == kNonTrig) {
68  ExpectedNBins = 4;
69  }
70  else if (type ==kNonTrigPhys14) {
71  ExpectedNBins = 6;
72  }
73 
74  fNMVABins = ExpectedNBins;
75 
76  //Check number of weight files given
77  if (fNMVABins != weightsfiles.size() ) {
78  std::cout << "Error: Expected Number of bins = " << fNMVABins << " does not equal to weightsfiles.size() = "
79  << weightsfiles.size() << std::endl;
80 
81  #ifndef STANDALONE
82  assert(fNMVABins == weightsfiles.size());
83  #endif
84  }
85 
86  //Loop over all bins
87  for (unsigned int i=0;i<fNMVABins; ++i) {
88 
89  TMVA::Reader *tmpTMVAReader = new TMVA::Reader( "!Color:!Silent:Error" );
90  tmpTMVAReader->SetVerbose(kTRUE);
91 
92  if (type == kTrig) {
93  // Pure tracking variables
94  // Pure tracking variables
95  tmpTMVAReader->AddVariable("fBrem", &fMVAVar_fbrem);
96  tmpTMVAReader->AddVariable("kfchi2", &fMVAVar_kfchi2);
97  tmpTMVAReader->AddVariable("kfhits", &fMVAVar_kfhits);
98  tmpTMVAReader->AddVariable("gsfChi2", &fMVAVar_gsfchi2);
99 
100  // Geometrical matchings
101  tmpTMVAReader->AddVariable("eledeta", &fMVAVar_deta);
102  tmpTMVAReader->AddVariable("eledphi", &fMVAVar_dphi);
103  tmpTMVAReader->AddVariable("detacalo", &fMVAVar_detacalo);
104 
105  // Pure ECAL -> shower shapes
106  tmpTMVAReader->AddVariable("noZSsee", &fMVAVar_see);
107  tmpTMVAReader->AddVariable("noZSspp", &fMVAVar_spp);
108  tmpTMVAReader->AddVariable("etawidth", &fMVAVar_etawidth);
109  tmpTMVAReader->AddVariable("phiwidth", &fMVAVar_phiwidth);
110  tmpTMVAReader->AddVariable("noZSe1x5e5x5", &fMVAVar_OneMinusE1x5E5x5);
111  tmpTMVAReader->AddVariable("noZSr9", &fMVAVar_R9);
112 
113  // Energy matching
114  tmpTMVAReader->AddVariable("HtoE", &fMVAVar_HoE);
115  tmpTMVAReader->AddVariable("EoP", &fMVAVar_EoP);
116  tmpTMVAReader->AddVariable("IoEmIoP", &fMVAVar_IoEmIoP);
117  tmpTMVAReader->AddVariable("EEleoPout", &fMVAVar_eleEoPout);
118  if(i == 1 ) tmpTMVAReader->AddVariable("PreShowerOverRaw",&fMVAVar_PreShowerOverRaw);
119 
120  tmpTMVAReader->AddSpectator("pt", &fMVAVar_pt);
121  tmpTMVAReader->AddSpectator("absEta", &fMVAVar_abseta);
122  }
123 
124 
125  if ((type == kNonTrig)||(type == kNonTrigPhys14)) {
126 
127  tmpTMVAReader->AddVariable("ele_kfhits", &fMVAVar_kfhits);
128  // Pure ECAL -> shower shapes
129  tmpTMVAReader->AddVariable("ele_oldsigmaietaieta", &fMVAVar_see);
130  tmpTMVAReader->AddVariable("ele_oldsigmaiphiiphi", &fMVAVar_spp);
131  tmpTMVAReader->AddVariable("ele_oldcircularity", &fMVAVar_OneMinusE1x5E5x5);
132  tmpTMVAReader->AddVariable("ele_oldr9", &fMVAVar_R9);
133  tmpTMVAReader->AddVariable("ele_scletawidth", &fMVAVar_etawidth);
134  tmpTMVAReader->AddVariable("ele_sclphiwidth", &fMVAVar_phiwidth);
135  tmpTMVAReader->AddVariable("ele_he", &fMVAVar_HoE);
136  if ((type == kNonTrig)&&(i == 1 || i == 3)) tmpTMVAReader->AddVariable("ele_psEoverEraw",&fMVAVar_PreShowerOverRaw);
137  if ((type == kNonTrigPhys14)&&(i == 2 || i == 5)) tmpTMVAReader->AddVariable("ele_psEoverEraw",&fMVAVar_PreShowerOverRaw);
138 
139 
140  //Pure tracking variables
141  tmpTMVAReader->AddVariable("ele_kfchi2", &fMVAVar_kfchi2);
142  tmpTMVAReader->AddVariable("ele_chi2_hits", &fMVAVar_gsfchi2);
143  // Energy matching
144  tmpTMVAReader->AddVariable("ele_fbrem", &fMVAVar_fbrem);
145  tmpTMVAReader->AddVariable("ele_ep", &fMVAVar_EoP);
146  tmpTMVAReader->AddVariable("ele_eelepout", &fMVAVar_eleEoPout);
147  tmpTMVAReader->AddVariable("ele_IoEmIop", &fMVAVar_IoEmIoP);
148 
149  // Geometrical matchings
150  tmpTMVAReader->AddVariable("ele_deltaetain", &fMVAVar_deta);
151  tmpTMVAReader->AddVariable("ele_deltaphiin", &fMVAVar_dphi);
152  tmpTMVAReader->AddVariable("ele_deltaetaseed", &fMVAVar_detacalo);
153 
154 
155 
156  tmpTMVAReader->AddSpectator("ele_pT", &fMVAVar_pt);
157  tmpTMVAReader->AddSpectator("ele_isbarrel", &fMVAVar_isBarrel);
158  tmpTMVAReader->AddSpectator("ele_isendcap", &fMVAVar_isEndcap);
159  if (type == kNonTrigPhys14) tmpTMVAReader->AddSpectator("scl_eta", &fMVAVar_SCeta);
160 
161  }
162 
163 
164 
165 
166 #ifndef STANDALONE
167  if ((fMethodname.find("BDT") == 0) && (weightsfiles[i].rfind(".xml.gz") == weightsfiles[i].length()-strlen(".xml.gz"))) {
168  gzFile file = gzopen(weightsfiles[i].c_str(), "rb");
169  if (file == nullptr) { std::cout << "Error opening gzip file associated to " << weightsfiles[i] << std::endl; throw cms::Exception("Configuration","Error reading zipped XML file"); }
170  std::vector<char> data;
171  data.reserve(1024*1024*10);
172  unsigned int bufflen = 32*1024;
173  char *buff = reinterpret_cast<char *>(malloc(bufflen));
174  if (buff == nullptr) { std::cout << "Error creating buffer for " << weightsfiles[i] << std::endl; gzclose(file); throw cms::Exception("Configuration","Error reading zipped XML file"); }
175  int read;
176  while ((read = gzread(file, buff, bufflen)) != 0) {
177  if (read == -1) { std::cout << "Error reading gzip file associated to " << weightsfiles[i] << ": " << gzerror(file,&read) << std::endl; gzclose(file); free(buff); throw cms::Exception("Configuration","Error reading zipped XML file"); }
178  data.insert(data.end(), buff, buff+read);
179  }
180  if (gzclose(file) != Z_OK) { std::cout << "Error closing gzip file associated to " << weightsfiles[i] << std::endl; }
181  free(buff);
182  data.push_back('\0'); // IMPORTANT
183  fTMVAMethod.push_back(dynamic_cast<TMVA::MethodBase*>(tmpTMVAReader->BookMVA(TMVA::Types::kBDT, &data[0])));
184  } else {
185  if (weightsfiles[i].rfind(".xml.gz") == weightsfiles[i].length()-strlen(".xml.gz")) {
186  std::cout << "Error: xml.gz unsupported for method " << fMethodname << ", weight file " << weightsfiles[i] << std::endl; throw cms::Exception("Configuration","Error reading zipped XML file");
187  }
188  fTMVAMethod.push_back(dynamic_cast<TMVA::MethodBase*>(tmpTMVAReader->BookMVA(fMethodname , weightsfiles[i])));
189  }
190 #else
191  if (weightsfiles[i].rfind(".xml.gz") == weightsfiles[i].length()-strlen(".xml.gz")) {
192  std::cout << "Error: xml.gz unsupported for method " << fMethodname << ", weight file " << weightsfiles[i] << std::endl; abort();
193  }
194  fTMVAMethod.push_back(dynamic_cast<TMVA::MethodBase*>(tmpTMVAReader->BookMVA(fMethodname , weightsfiles[i])));
195 #endif
196  std::cout << "MVABin " << i << " : MethodName = " << fMethodname
197  << " , type == " << type << " , "
198  << "Load weights file : " << weightsfiles[i]
199  << std::endl;
200  fTMVAReader.push_back(tmpTMVAReader);
201  }
202  std::cout << "Electron ID MVA Completed\n";
203 
204 }
205 
206 
207 //--------------------------------------------------------------------------------------------------
208 UInt_t EGammaMvaEleEstimatorCSA14::GetMVABin( double eta, double pt) const {
209 
210  //Default is to return the first bin
211  unsigned int bin = 0;
212 
213 
215  bin = 0;
216  if (pt < 10 && fabs(eta) < 1.479) bin = 0;
217  if (pt < 10 && fabs(eta) >= 1.479) bin = 1;
218  if (pt >= 10 && fabs(eta) < 1.479) bin = 2;
219  if (pt >= 10 && fabs(eta) >= 1.479) bin = 3;
220  }
221 
222 
224  ) {
225  bin = 0;
226  if (pt >= 10 && fabs(eta) < 1.479) bin = 0;
227  if (pt >= 10 && fabs(eta) >= 1.479) bin = 1;
228  }
229 
231  bin = 0;
232  if (pt < 10 && fabs(eta) < 0.8) bin = 0;
233  if (pt < 10 && fabs(eta) >= 0.8 && fabs(eta) < 1.479) bin = 1;
234  if (pt < 10 && fabs(eta) >= 1.479) bin = 2;
235  if (pt >= 10 && fabs(eta) < 0.8) bin = 3;
236  if (pt >= 10 && fabs(eta) >= 0.8 && fabs(eta) < 1.479) bin = 4;
237  if (pt >= 10 && fabs(eta) >= 1.479) bin = 5;
238  }
239 
240  return bin;
241 }
242 
243 
244 
245 
246 
247 //--------------------------------------------------------------------------------------------------
248 
249 // for kTrig and kNonTrig algorithm
251  const reco::Vertex& vertex,
252  const TransientTrackBuilder& transientTrackBuilder,
253  noZS::EcalClusterLazyTools myEcalCluster,
254  bool printDebug) {
255 
256  if (!fisInitialized) {
257  std::cout << "Error: EGammaMvaEleEstimatorCSA14 not properly initialized.\n";
258  return -9999;
259  }
260 
262  std::cout << "Error: This method should be called for kTrig or kNonTrig or kNonTrigPhys14 MVA only" << std::endl;
263  return -9999;
264  }
265 
266  bool validKF= false;
267  reco::TrackRef myTrackRef = ele.closestCtfTrackRef();
268  validKF = (myTrackRef.isAvailable());
269  validKF = (myTrackRef.isNonnull());
270 
271  // Pure tracking variables
272  fMVAVar_fbrem = ele.fbrem();
273  fMVAVar_kfchi2 = (validKF) ? myTrackRef->normalizedChi2() : 0 ;
274  fMVAVar_kfhits = (validKF) ? myTrackRef->hitPattern().trackerLayersWithMeasurement() : -1. ;
275  fMVAVar_kfhitsall = (validKF) ? myTrackRef->numberOfValidHits() : -1. ; // save also this in your ntuple as possible alternative
276  fMVAVar_gsfchi2 = ele.gsfTrack()->normalizedChi2();
277 
278 
279  // Geometrical matchings
283 
284 
285  // Pure ECAL -> shower shapes
286  std::vector<float> vCov = myEcalCluster.localCovariances(*(ele.superCluster()->seed())) ;
287  if (!isnan(vCov[0])) fMVAVar_see = sqrt (vCov[0]); //EleSigmaIEtaIEta
288  else fMVAVar_see = 0.;
289  if (!isnan(vCov[2])) fMVAVar_spp = sqrt (vCov[2]); //EleSigmaIPhiIPhi
290  else fMVAVar_spp = 0.;
291 
292  fMVAVar_etawidth = ele.superCluster()->etaWidth();
293  fMVAVar_phiwidth = ele.superCluster()->phiWidth();
294  fMVAVar_OneMinusE1x5E5x5 = (ele.e5x5()) !=0. ? 1.-(myEcalCluster.e1x5(*(ele.superCluster()->seed()))/myEcalCluster.e5x5(*(ele.superCluster()->seed()))) : -1. ;
295  fMVAVar_R9 = myEcalCluster.e3x3(*(ele.superCluster()->seed())) / ele.superCluster()->rawEnergy();
296 
297  // Energy matching
298  fMVAVar_HoE = ele.hadronicOverEm();
300  fMVAVar_IoEmIoP = (1.0/ele.ecalEnergy()) - (1.0 / ele.p()); // in the future to be changed with ele.gsfTrack()->p()
302  fMVAVar_PreShowerOverRaw= ele.superCluster()->preshowerEnergy() / ele.superCluster()->rawEnergy();
303 
304 
305  // Spectators
306  fMVAVar_eta = ele.superCluster()->eta();
307  fMVAVar_abseta = fabs(ele.superCluster()->eta());
308  fMVAVar_pt = ele.pt();
309  fMVAVar_isBarrel = (ele.superCluster()->eta()<1.479);
310  fMVAVar_isEndcap = (ele.superCluster()->eta()>1.479);
311  fMVAVar_SCeta = ele.superCluster()->eta();
312 
313 
314  // for triggering electrons get the impact parameteres
315  if(fMVAType == kTrig) {
316  //d0
317  if (ele.gsfTrack().isNonnull()) {
318  fMVAVar_d0 = (-1.0)*ele.gsfTrack()->dxy(vertex.position());
319  } else if (ele.closestCtfTrackRef().isNonnull()) {
320  fMVAVar_d0 = (-1.0)*ele.closestCtfTrackRef()->dxy(vertex.position());
321  } else {
322  fMVAVar_d0 = -9999.0;
323  }
324 
325  //default values for IP3D
326  fMVAVar_ip3d = -999.0;
327  fMVAVar_ip3dSig = 0.0;
328  if (ele.gsfTrack().isNonnull()) {
329  const double gsfsign = ( (-ele.gsfTrack()->dxy(vertex.position())) >=0 ) ? 1. : -1.;
330 
331  const reco::TransientTrack &tt = transientTrackBuilder.build(ele.gsfTrack());
332  const std::pair<bool,Measurement1D> &ip3dpv = IPTools::absoluteImpactParameter3D(tt,vertex);
333  if (ip3dpv.first) {
334  double ip3d = gsfsign*ip3dpv.second.value();
335  double ip3derr = ip3dpv.second.error();
336  fMVAVar_ip3d = ip3d;
337  fMVAVar_ip3dSig = ip3d/ip3derr;
338  }
339  }
340  }
341 
342  // evaluate
343  bindVariables();
344  Double_t mva = -9999;
345  if (fUseBinnedVersion) {
346  int bin = GetMVABin(fMVAVar_eta,fMVAVar_pt);
347  mva = fTMVAReader[bin]->EvaluateMVA(fTMVAMethod[bin]);
348  } else {
349  mva = fTMVAReader[0]->EvaluateMVA(fTMVAMethod[0]);
350  }
351 
352 
353 
354  if(printDebug) {
355  std::cout << " *** Inside the class fMethodname " << fMethodname << " fMVAType " << fMVAType << std::endl;
356  std::cout << " fbrem " << fMVAVar_fbrem
357  << " kfchi2 " << fMVAVar_kfchi2
358  << " mykfhits " << fMVAVar_kfhits
359  << " gsfchi2 " << fMVAVar_gsfchi2
360  << " deta " << fMVAVar_deta
361  << " dphi " << fMVAVar_dphi
362  << " detacalo " << fMVAVar_detacalo
363  << " see " << fMVAVar_see
364  << " spp " << fMVAVar_spp
365  << " etawidth " << fMVAVar_etawidth
366  << " phiwidth " << fMVAVar_phiwidth
367  << " OneMinusE1x5E5x5 " << fMVAVar_OneMinusE1x5E5x5
368  << " R9 " << fMVAVar_R9
369  << " HoE " << fMVAVar_HoE
370  << " EoP " << fMVAVar_EoP
371  << " IoEmIoP " << fMVAVar_IoEmIoP
372  << " eleEoPout " << fMVAVar_eleEoPout
373  << " d0 " << fMVAVar_d0
374  << " ip3d " << fMVAVar_ip3d
375  << " eta " << fMVAVar_eta
376  << " pt " << fMVAVar_pt << std::endl;
377  std::cout << " ### MVA " << mva << std::endl;
378  }
379 
380 
381 
382  return mva;
383 }
384 
385 
386 
388  bool printDebug) {
389 
390  if (!fisInitialized) {
391  std::cout << "Error: EGammaMvaEleEstimatorCSA14 not properly initialized.\n";
392  return -9999;
393  }
394 
396  std::cout << "Error: This method should be called for kTrig or kNonTrig or kNonTrigPhys14 MVA only" << std::endl;
397  return -9999;
398  }
399 
400  bool validKF= false;
401  reco::TrackRef myTrackRef = ele.closestCtfTrackRef();
402  validKF = (myTrackRef.isAvailable());
403  validKF = (myTrackRef.isNonnull());
404 
405  // Pure tracking variables
406  fMVAVar_fbrem = ele.fbrem();
407  fMVAVar_kfchi2 = (validKF) ? myTrackRef->normalizedChi2() : 0 ;
408  fMVAVar_kfhits = (validKF) ? myTrackRef->hitPattern().trackerLayersWithMeasurement() : -1. ;
409  fMVAVar_kfhitsall = (validKF) ? myTrackRef->numberOfValidHits() : -1. ; // save also this in your ntuple as possible alternative
410  fMVAVar_gsfchi2 = ele.gsfTrack()->normalizedChi2();
411 
412 
413  // Geometrical matchings
417 
418 
419  // Pure ECAL -> shower shapes
420  fMVAVar_see = ele.full5x5_sigmaIetaIeta(); //EleSigmaIEtaIEta
421  fMVAVar_spp = ele.full5x5_sigmaIphiIphi(); //EleSigmaIPhiIPhi
422 
423  fMVAVar_etawidth = ele.superCluster()->etaWidth();
424  fMVAVar_phiwidth = ele.superCluster()->phiWidth();
425  fMVAVar_OneMinusE1x5E5x5 = (ele.full5x5_e5x5()) !=0. ? 1.-(ele.full5x5_e1x5()/ele.full5x5_e5x5()) : -1. ;
426  fMVAVar_R9 = ele.full5x5_r9();
427 
428  // Energy matching
429  fMVAVar_HoE = ele.hadronicOverEm();
431  fMVAVar_IoEmIoP = (1.0/ele.ecalEnergy()) - (1.0 / ele.p()); // in the future to be changed with ele.gsfTrack()->p()
433  fMVAVar_PreShowerOverRaw= ele.superCluster()->preshowerEnergy() / ele.superCluster()->rawEnergy();
434 
435 
436  // Spectators
437  fMVAVar_eta = ele.superCluster()->eta();
438  fMVAVar_abseta = fabs(ele.superCluster()->eta());
439  fMVAVar_pt = ele.pt();
440  fMVAVar_isBarrel = (ele.superCluster()->eta()<1.479);
441  fMVAVar_isEndcap = (ele.superCluster()->eta()>1.479);
442  fMVAVar_SCeta = ele.superCluster()->eta();
443 
444 
445 
446  // evaluate
447  bindVariables();
448  Double_t mva = -9999;
449  if (fUseBinnedVersion) {
450  int bin = GetMVABin(fMVAVar_eta,fMVAVar_pt);
451  mva = fTMVAReader[bin]->EvaluateMVA(fTMVAMethod[bin]);
452  } else {
453  mva = fTMVAReader[0]->EvaluateMVA(fTMVAMethod[0]);
454  }
455 
456 
457 
458  if(printDebug) {
459  std::cout << " *** Inside the class fMethodname " << fMethodname << " fMVAType " << fMVAType << std::endl;
460  std::cout << " fbrem " << fMVAVar_fbrem
461  << " kfchi2 " << fMVAVar_kfchi2
462  << " mykfhits " << fMVAVar_kfhits
463  << " gsfchi2 " << fMVAVar_gsfchi2
464  << " deta " << fMVAVar_deta
465  << " dphi " << fMVAVar_dphi
466  << " detacalo " << fMVAVar_detacalo
467  << " see " << fMVAVar_see
468  << " spp " << fMVAVar_spp
469  << " etawidth " << fMVAVar_etawidth
470  << " phiwidth " << fMVAVar_phiwidth
471  << " OneMinusE1x5E5x5 " << fMVAVar_OneMinusE1x5E5x5
472  << " R9 " << fMVAVar_R9
473  << " HoE " << fMVAVar_HoE
474  << " EoP " << fMVAVar_EoP
475  << " IoEmIoP " << fMVAVar_IoEmIoP
476  << " eleEoPout " << fMVAVar_eleEoPout
477  << " eta " << fMVAVar_eta
478  << " pt " << fMVAVar_pt << std::endl;
479  std::cout << " ### MVA " << mva << std::endl;
480  }
481 
482 
483 
484  return mva;
485 }
486 
487 
488 
490 
491  // this binding is needed for variables that sometime diverge.
492 
493 
494  if(fMVAVar_fbrem < -1.)
495  fMVAVar_fbrem = -1.;
496 
497  fMVAVar_deta = fabs(fMVAVar_deta);
498  if(fMVAVar_deta > 0.06)
499  fMVAVar_deta = 0.06;
500 
501 
502  fMVAVar_dphi = fabs(fMVAVar_dphi);
503  if(fMVAVar_dphi > 0.6)
504  fMVAVar_dphi = 0.6;
505 
506 
507  if(fMVAVar_EoP > 20.)
508  fMVAVar_EoP = 20.;
509 
510  if(fMVAVar_eleEoPout > 20.)
511  fMVAVar_eleEoPout = 20.;
512 
513 
515  if(fMVAVar_detacalo > 0.2)
516  fMVAVar_detacalo = 0.2;
517 
518  if(fMVAVar_OneMinusE1x5E5x5 < -1.)
520 
521  if(fMVAVar_OneMinusE1x5E5x5 > 2.)
523 
524 
525 
526  if(fMVAVar_R9 > 5)
527  fMVAVar_R9 = 5;
528 
529  if(fMVAVar_gsfchi2 > 200.)
530  fMVAVar_gsfchi2 = 200;
531 
532 
533  if(fMVAVar_kfchi2 > 10.)
534  fMVAVar_kfchi2 = 10.;
535 
536 
537  // Needed for a bug in CMSSW_420, fixed in more recent CMSSW versions
539  fMVAVar_spp = 0.;
540 
541 
542  return;
543 }
544 
545 
546 
547 
548 
549 
550 
551 
bool isAvailable() const
Definition: Ref.h:576
type
Definition: HCALResponse.h:21
void initialize(std::string methodName, std::string weightsfile, EGammaMvaEleEstimatorCSA14::MVAType type)
int i
Definition: DBlmapReader.cc:9
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:252
float e5x5(const reco::BasicCluster &cluster)
std::vector< TMVA::MethodBase * > fTMVAMethod
float eSuperClusterOverP() const
Definition: GsfElectron.h:243
float full5x5_e5x5() const
Definition: GsfElectron.h:437
float full5x5_e1x5() const
Definition: GsfElectron.h:435
assert(m_qm.get())
reco::TransientTrack build(const reco::Track *p) const
std::pair< bool, Measurement1D > absoluteImpactParameter3D(const reco::TransientTrack &transientTrack, const reco::Vertex &vertex)
Definition: IPTools.cc:37
float full5x5_sigmaIphiIphi() const
Definition: GsfElectron.h:434
float fbrem() const
Definition: GsfElectron.h:698
float e3x3(const reco::BasicCluster &cluster)
Double_t mvaValue(const reco::GsfElectron &ele, const reco::Vertex &vertex, const TransientTrackBuilder &transientTrackBuilder, noZS::EcalClusterLazyTools myEcalCluster, bool printDebug=kFALSE)
const Point & position() const
position
Definition: Vertex.h:99
std::vector< TMVA::Reader * > fTMVAReader
TrackRef closestCtfTrackRef() const
Definition: GsfElectron.h:199
float full5x5_sigmaIetaIeta() const
Definition: GsfElectron.h:433
reco::SuperClusterRef superCluster() const
override the reco::GsfElectron::superCluster method, to access the internal storage of the superclust...
float deltaEtaSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:247
float hadronicOverEm() const
Definition: GsfElectron.h:457
reco::GsfTrackRef gsfTrack() const
override the reco::GsfElectron::gsfTrack method, to access the internal storage of the supercluster ...
reco::TrackRef closestCtfTrackRef() const
override the reco::GsfElectron::closestCtfTrackRef method, to access the internal storage of the trac...
bool isnan(float x)
Definition: math.h:13
T sqrt(T t)
Definition: SSEVec.h:18
virtual SuperClusterRef superCluster() const
reference to a SuperCluster
Definition: GsfElectron.h:182
float deltaPhiSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:250
float eEleClusterOverPout() const
Definition: GsfElectron.h:246
std::vector< float > localCovariances(const reco::BasicCluster &cluster, float w0=4.7)
Analysis-level electron class.
Definition: Electron.h:52
float ecalEnergy() const
Definition: GsfElectron.h:785
virtual double p() const final
magnitude of momentum vector
float e5x5() const
Definition: GsfElectron.h:420
float full5x5_r9() const
Definition: GsfElectron.h:438
UInt_t GetMVABin(double eta, double pt) const
float deltaEtaSeedClusterTrackAtCalo() const
Definition: GsfElectron.h:248
float e1x5(const reco::BasicCluster &cluster)
tuple cout
Definition: gather_cfg.py:145
virtual GsfTrackRef gsfTrack() const
reference to a GsfTrack
Definition: GsfElectron.h:183
virtual double pt() const final
transverse momentum