CMS 3D CMS Logo

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