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