CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
WenuPlots.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: WenuPlots
4 // Class: WenuPlots
5 //
6 /*
7 
8  Description:
9  this is an analyzer that reads pat::CompositeCandidate WenuCandidates
10  and creates some plots
11  Implementation:
12  The code takes the output of the WenuCandidateFilter and
13  * implements on them a user defined selection
14  * implements the selection with one cut (configurable which cut) inverted
15  * creates a set of basic plots with the Wenu Candidate distribution
16  vs MET, MT etc. These plots are stored in a root file
17  If you have several root files from different runs you have to run a macro
18  to combine the output and have the final plots
19 
20  This analyser is PAT based in the sense that it reads CompositeCandidates,
21  which are composed of a pat::MET plus a pat::Electron. You normally
22  don't have to change this file when the CMSSW version changes because it
23  contains only methods from the stable core of pat Objects. Most
24  version dependent changes should be in WenuCandidateFilter.cc
25  TO DO LIST:
26  * more plots to be added
27  * there should be an base Plots class from which WenuPlots and ZeePlots
28  inherit. this makes sense since they have so many common methods
29 
30  Changes Log:
31  12Feb09 First Release of the code for CMSSW_2_2_X
32  16Sep09 tested that it works with 3_1_2 as well
33  09Sep09 added one extra iso with the name userIso_XX_
34  23Feb09 added option to include extra IDs that are in CMSSW, such as
35  categorized, likehood etc
36  added extra variables TIP and E/P
37  27May10 changes to apply the Spring10 selections, relative isolations
38  the 3 default ones, pat user isolations added in the end
39  change to framework independent variable definitions
40  double->Double_t etc and math.h functions from TMath
41  01Jul10 second electron information added
42  Contact:
43  Nikolaos Rompotis - Nikolaos.Rompotis@Cern.ch
44  Imperial College London
45 
46 
47 */
48 //
49 // Original Author: Nikolaos Rompotis
50 
51 
59 //#include "RecoEcal/EgammaCoreTools/plugins/EcalClusterCrackCorrectionFunctor.h"
60 
62 
63 {
65 // I N P U T P A R A M E T E R S
67 //
69 // WENU COLLECTION //////////////////////////////////////////////////////
70 //
71 
73  ("wenuCollectionTag");
74  //
75  // code parameters
76  //
77  std::string outputFile_D = "histos.root";
78  outputFile_ = iConfig.getUntrackedParameter<std::string>("outputFile", outputFile_D);
79  WENU_VBTFselectionFileName_ = iConfig.getUntrackedParameter<std::string>("WENU_VBTFselectionFileName");
80  WENU_VBTFpreseleFileName_ = iConfig.getUntrackedParameter<std::string>("WENU_VBTFpreseleFileName");
81  DatasetTag_ = iConfig.getUntrackedParameter<Int_t>("DatasetTag");
82  //
83  // use of precalculatedID
84  // if you use it, then no other cuts are applied
85  usePrecalcID_ = iConfig.getUntrackedParameter<Bool_t>("usePrecalcID",false);
86  if (usePrecalcID_) {
87  usePrecalcIDType_ = iConfig.getUntrackedParameter<std::string>("usePrecalcIDType");
88  usePrecalcIDSign_ = iConfig.getUntrackedParameter<std::string>("usePrecalcIDSign","=");
89  usePrecalcIDValue_= iConfig.getUntrackedParameter<Double_t>("usePrecalcIDValue");
90  }
91  useValidFirstPXBHit_ = iConfig.getUntrackedParameter<Bool_t>("useValidFirstPXBHit",false);
92  useConversionRejection_ = iConfig.getUntrackedParameter<Bool_t>("useConversionRejection",false);
93  useExpectedMissingHits_ = iConfig.getUntrackedParameter<Bool_t>("useExpectedMissingHits",false);
94 
95  maxNumberOfExpectedMissingHits_ = iConfig.getUntrackedParameter<Int_t>("maxNumberOfExpectedMissingHits",1);
96  if (not usePrecalcID_) {
97  if (useValidFirstPXBHit_) std::cout << "WenuPlots: Warning: you have demanded a valid 1st layer PXB hit" << std::endl;
98  if (useConversionRejection_) std::cout << "WenuPlots: Warning: you have demanded egamma conversion rejection criteria to be applied" << std::endl;
99  if (useExpectedMissingHits_) std::cout << "WenuPlots: Warning: you have demanded at most "
100  <<maxNumberOfExpectedMissingHits_ << " missing inner hits "<< std::endl;
101  }
102  else {
103  std::cout << "WenuPlots: Using Precalculated ID with type " << usePrecalcIDType_
104  << usePrecalcIDSign_ << usePrecalcIDValue_ << std::endl;
105  }
106  if ((useValidFirstPXBHit_ || useExpectedMissingHits_ || useConversionRejection_) && (not usePrecalcID_)) {
107  usePreselection_ = true;
108  } else { usePreselection_ = false; }
109  includeJetInformationInNtuples_ = iConfig.getUntrackedParameter<Bool_t>("includeJetInformationInNtuples", false);
111  caloJetCollectionTag_ = iConfig.getUntrackedParameter<edm::InputTag>("caloJetCollectionTag");
112  pfJetCollectionTag_ = iConfig.getUntrackedParameter<edm::InputTag>("pfJetCollectionTag");
113  DRJetFromElectron_ = iConfig.getUntrackedParameter<Double_t>("DRJetFromElectron");
114  }
115  storeExtraInformation_ = iConfig.getUntrackedParameter<Bool_t>("storeExtraInformation");
116  storeAllSecondElectronVariables_ = iConfig.getUntrackedParameter<Bool_t>("storeAllSecondElectronVariables", false);
117  // primary vtx collections
119  ("PrimaryVerticesCollection", edm::InputTag("offlinePrimaryVertices"));
121  ("PrimaryVerticesCollectionBS",edm::InputTag("offlinePrimaryVerticesWithBS"));
122  //
123  // the selection cuts:
124  trackIso_EB_ = iConfig.getUntrackedParameter<Double_t>("trackIso_EB", 1000.);
125  ecalIso_EB_ = iConfig.getUntrackedParameter<Double_t>("ecalIso_EB", 1000.);
126  hcalIso_EB_ = iConfig.getUntrackedParameter<Double_t>("hcalIso_EB", 1000.);
127  //
128  trackIso_EE_ = iConfig.getUntrackedParameter<Double_t>("trackIso_EE", 1000.);
129  ecalIso_EE_ = iConfig.getUntrackedParameter<Double_t>("ecalIso_EE", 1000.);
130  hcalIso_EE_ = iConfig.getUntrackedParameter<Double_t>("hcalIso_EE", 1000.);
131  //
132  sihih_EB_ = iConfig.getUntrackedParameter<Double_t>("sihih_EB");
133  dphi_EB_ = iConfig.getUntrackedParameter<Double_t>("dphi_EB");
134  deta_EB_ = iConfig.getUntrackedParameter<Double_t>("deta_EB");
135  hoe_EB_ = iConfig.getUntrackedParameter<Double_t>("hoe_EB");
136  cIso_EB_ = iConfig.getUntrackedParameter<Double_t>("cIso_EB", 1000.);
137  tip_bspot_EB_=iConfig.getUntrackedParameter<Double_t>("tip_bspot_EB", 1000.);
138  eop_EB_=iConfig.getUntrackedParameter<Double_t>("eop_EB", 1000.);
139  //
140  sihih_EE_ = iConfig.getUntrackedParameter<Double_t>("sihih_EE");
141  dphi_EE_ = iConfig.getUntrackedParameter<Double_t>("dphi_EE");
142  deta_EE_ = iConfig.getUntrackedParameter<Double_t>("deta_EE");
143  hoe_EE_ = iConfig.getUntrackedParameter<Double_t>("hoe_EE");
144  cIso_EE_ = iConfig.getUntrackedParameter<Double_t>("cIso_EE", 1000.);
145  tip_bspot_EE_=iConfig.getUntrackedParameter<Double_t>("tip_bspot_EE", 1000.);
146  eop_EE_=iConfig.getUntrackedParameter<Double_t>("eop_EE", 1000.);
147  //
148  trackIsoUser_EB_ = iConfig.getUntrackedParameter<Double_t>("trackIsoUser_EB", 1000.);
149  ecalIsoUser_EB_ = iConfig.getUntrackedParameter<Double_t>("ecalIsoUser_EB", 1000.);
150  hcalIsoUser_EB_ = iConfig.getUntrackedParameter<Double_t>("hcalIsoUser_EB", 1000.);
151  trackIsoUser_EE_ = iConfig.getUntrackedParameter<Double_t>("trackIsoUser_EE", 1000.);
152  ecalIsoUser_EE_ = iConfig.getUntrackedParameter<Double_t>("ecalIsoUser_EE", 1000.);
153  hcalIsoUser_EE_ = iConfig.getUntrackedParameter<Double_t>("hcalIsoUser_EE", 1000.);
154  //
155  trackIso_EB_inv = iConfig.getUntrackedParameter<Bool_t>("trackIso_EB_inv", false);
156  ecalIso_EB_inv = iConfig.getUntrackedParameter<Bool_t>("ecalIso_EB_inv", false);
157  hcalIso_EB_inv = iConfig.getUntrackedParameter<Bool_t>("hcalIso_EB_inv", false);
158  //
159  trackIso_EE_inv = iConfig.getUntrackedParameter<Bool_t>("trackIso_EE_inv", false);
160  ecalIso_EE_inv = iConfig.getUntrackedParameter<Bool_t>("ecalIso_EE_inv", false);
161  hcalIso_EE_inv = iConfig.getUntrackedParameter<Bool_t>("hcalIso_EE_inv", false);
162  //
163  sihih_EB_inv = iConfig.getUntrackedParameter<Bool_t>("sihih_EB_inv", false);
164  dphi_EB_inv = iConfig.getUntrackedParameter<Bool_t>("dphi_EB_inv", false);
165  deta_EB_inv = iConfig.getUntrackedParameter<Bool_t>("deta_EB_inv", false);
166  hoe_EB_inv = iConfig.getUntrackedParameter<Bool_t>("hoe_EB_inv", false);
167  cIso_EB_inv = iConfig.getUntrackedParameter<Bool_t>("cIso_EB_inv", false);
168  tip_bspot_EB_inv=iConfig.getUntrackedParameter<Bool_t>("tip_bspot_EB_inv", false);
169  eop_EB_inv=iConfig.getUntrackedParameter<Bool_t>("eop_EB_inv", false);
170  //
171  sihih_EE_inv = iConfig.getUntrackedParameter<Bool_t>("sihih_EE_inv", false);
172  dphi_EE_inv = iConfig.getUntrackedParameter<Bool_t>("dphi_EE_inv", false);
173  deta_EE_inv = iConfig.getUntrackedParameter<Bool_t>("deta_EE_inv", false);
174  hoe_EE_inv = iConfig.getUntrackedParameter<Bool_t>("hoe_EE_inv", false);
175  cIso_EE_inv = iConfig.getUntrackedParameter<Bool_t>("cIso_EE_inv", false);
176  tip_bspot_EE_inv=iConfig.getUntrackedParameter<Bool_t>("tip_bspot_EE_inv", false);
177  eop_EE_inv=iConfig.getUntrackedParameter<Bool_t>("eop_EE_inv", false);
178  //
179  trackIsoUser_EB_inv = iConfig.getUntrackedParameter<Bool_t>("trackIsoUser_EB_inv", false);
180  ecalIsoUser_EB_inv = iConfig.getUntrackedParameter<Bool_t>("ecalIsoUser_EB_inv", false);
181  hcalIsoUser_EB_inv = iConfig.getUntrackedParameter<Bool_t>("hcalIsoUser_EB_inv", false);
182  trackIsoUser_EE_inv = iConfig.getUntrackedParameter<Bool_t>("trackIsoUser_EE_inv", false);
183  ecalIsoUser_EE_inv = iConfig.getUntrackedParameter<Bool_t>("ecalIsoUser_EE_inv", false);
184  hcalIsoUser_EE_inv = iConfig.getUntrackedParameter<Bool_t>("hcalIsoUser_EE_inv", false);
185 
186 }
187 
188 
189 
191 {
192 
193  // do anything here that needs to be done at desctruction time
194  // (e.g. close files, deallocate resources etc.)
195 
196 }
197 
198 
199 //
200 // member functions
201 //
202 
203 // ------------ method called to for each event ------------
204 void
206 {
207  using namespace std;
208  //
209  // Get the collections here
210  //
212  iEvent.getByLabel(wenuCollectionTag_, WenuCands);
213 
214  if (not WenuCands.isValid()) {
215  cout << "Warning: no wenu candidates in this event..." << endl;
216  return;
217  }
218  const pat::CompositeCandidateCollection *wcands = WenuCands.product();
219  const pat::CompositeCandidateCollection::const_iterator
220  wenuIter = wcands->begin();
221  const pat::CompositeCandidate wenu = *wenuIter;
222  //
223  // get the parts of the composite candidate:
224  const pat::Electron * myElec=
225  dynamic_cast<const pat::Electron*> (wenu.daughter("electron"));
226  const pat::MET * myMet=
227  dynamic_cast<const pat::MET*> (wenu.daughter("met"));
228  const pat::MET * myPfMet=
229  dynamic_cast<const pat::MET*> (wenu.daughter("pfmet"));
230  const pat::MET * myTcMet=
231  dynamic_cast<const pat::MET*> (wenu.daughter("tcmet"));
232  // _______________________________________________________________________
233  //
234  // VBTF Root tuple production --------------------------------------------
235  // _______________________________________________________________________
236  //
237  // .......................................................................
238  // vbtf produces 2 root tuples: one that contains the highest pT electron
239  // that passes a user defined selection and one other with only the
240  // preselection criteria applied
241  // .......................................................................
242  //
243  // fill the tree variables
244  runNumber = iEvent.run();
245  eventNumber = Long64_t( iEvent.eventAuxiliary().event() );
246  lumiSection = (Int_t) iEvent.luminosityBlock();
247  //
248  ele_sc_eta = (Float_t) myElec->superCluster()->eta();
249  ele_sc_phi = (Float_t) myElec->superCluster()->phi();
250  double scx = myElec->superCluster()->x();
251  double scy = myElec->superCluster()->y();
252  double scz = myElec->superCluster()->z();
253  ele_sc_rho = (Float_t) sqrt( scx*scx + scy*scy + scz*scz );
254  ele_sc_energy = (Float_t) myElec->superCluster()->energy();
255  ele_sc_gsf_et = (Float_t) myElec->superCluster()->energy()/TMath::CosH(myElec->gsfTrack()->eta());
256  ele_cand_eta = (Float_t) myElec->eta();
257  ele_cand_phi = (Float_t) myElec->phi();
258  ele_cand_et = (Float_t) myElec->et();
259  //
260  ele_iso_track = (Float_t) myElec->dr03IsolationVariables().tkSumPt / ele_cand_et;
261  ele_iso_ecal = (Float_t) myElec->dr03IsolationVariables().ecalRecHitSumEt/ele_cand_et;
262  ele_iso_hcal = (Float_t) ( myElec->dr03IsolationVariables().hcalDepth1TowerSumEt +
263  myElec->dr03IsolationVariables().hcalDepth2TowerSumEt) / ele_cand_et;
264  //
265  ele_id_sihih = (Float_t) myElec->sigmaIetaIeta();
266  ele_id_deta = (Float_t) myElec->deltaEtaSuperClusterTrackAtVtx();
267  ele_id_dphi = (Float_t) myElec->deltaPhiSuperClusterTrackAtVtx();
268  ele_id_hoe = (Float_t) myElec->hadronicOverEm();
269  //
270  ele_cr_mhitsinner= myElec->gsfTrack()->trackerExpectedHitsInner().numberOfHits();
271  ele_cr_dcot = myElec->convDcot();
272  ele_cr_dist = myElec->convDist();
273  //
274  ele_vx = (Float_t) myElec->vx();
275  ele_vy = (Float_t) myElec->vy();
276  ele_vz = (Float_t) myElec->vz();
277  // get the primary vtx information
278  // no BS
281  const std::vector<reco::Vertex> Vtx = *(pVtx.product());
282  // with BS
285  const std::vector<reco::Vertex> VtxBS = *(pVtxBS.product());
286  if (Vtx.size() > 0) {
287  pv_x = Float_t(Vtx[0].position().x());
288  pv_y = Float_t(Vtx[0].position().y());
289  pv_z = Float_t(Vtx[0].position().z());
290  ele_tip_pv = myElec->gsfTrack()->dxy(Vtx[0].position());
291  } else {
292  pv_x = -999999.;
293  pv_y = -999999.;
294  pv_z = -999999.;
295  ele_tip_pv = -999999.;
296  }
297  if (VtxBS.size() > 0) {
298  pvbs_x = Float_t(VtxBS[0].position().x());
299  pvbs_y = Float_t(VtxBS[0].position().y());
300  pvbs_z = Float_t(VtxBS[0].position().z());
301  ele_tip_pvbs = myElec->gsfTrack()->dxy(VtxBS[0].position());
302  } else {
303  pvbs_x = -999999.;
304  pvbs_y = -999999.;
305  pvbs_z = -999999.;
306  ele_tip_pvbs = -999999.;
307  }
308 
309  //
310  ele_gsfCharge = (Int_t) myElec->gsfTrack()->charge();
311  // must keep the ctf track collection, i.e. general track collection
312  ele_ctfCharge = (Int_t) myElec->closestCtfTrackRef().isNonnull() ? myElec->closestCtfTrackRef()->charge():-9999;
313  ele_scPixCharge = (Int_t) myElec->chargeInfo().scPixCharge;
314  ele_eop = (Float_t) myElec->eSuperClusterOverP();
315  ele_tip_bs = (Float_t) -myElec->dB();
316  //ele_tip_pv = myElec->userFloat("ele_tip_pv");
317  ele_pin = (Float_t) myElec->trackMomentumAtVtx().R();
318  ele_pout = (Float_t) myElec->trackMomentumOut().R();
319  //
320  event_caloMET = (Float_t) myMet->et();
321  event_pfMET = (Float_t) myPfMet->et();
322  event_tcMET = (Float_t) myTcMet->et();
323  event_caloMET_phi= (Float_t) myMet->phi();
324  event_pfMET_phi = (Float_t) myPfMet->phi();
325  event_tcMET_phi = (Float_t) myTcMet->phi();
326  event_caloSumEt = (Float_t) myMet->sumEt();
327  event_pfSumEt = (Float_t) myPfMet->sumEt();
328  event_tcSumEt = (Float_t) myTcMet->sumEt();
329  // transverse mass for the user's convenience
330  event_caloMT = (Float_t) TMath::Sqrt(2.*(ele_sc_gsf_et*event_caloMET -
332  + ele_sc_gsf_et*TMath::Sin(ele_sc_phi)*event_caloMET*TMath::Sin(event_caloMET_phi)
333  ) ) );
334  event_pfMT = (Float_t) TMath::Sqrt(2.*(ele_sc_gsf_et*event_pfMET -
335  (ele_sc_gsf_et*TMath::Cos(ele_sc_phi)*event_pfMET*TMath::Cos(event_pfMET_phi)
336  + ele_sc_gsf_et*TMath::Sin(ele_sc_phi)*event_pfMET*TMath::Sin(event_pfMET_phi)
337  ) ) );
338  event_tcMT = (Float_t) TMath::Sqrt(2.*(ele_sc_gsf_et*event_tcMET -
339  (ele_sc_gsf_et*TMath::Cos(ele_sc_phi)*event_tcMET*TMath::Cos(event_tcMET_phi)
340  + ele_sc_gsf_et*TMath::Sin(ele_sc_phi)*event_tcMET*TMath::Sin(event_tcMET_phi)
341  ) ) );
343  // jet information - only if the user asks for it
344  // keep the 5 highest et jets of the event that are further than DR> DRJetFromElectron_
346  // initialize the array of the jet information
347  for (int i=0; i<5; ++i) {
348  calojet_et[i] = -999999; calojet_eta[i] = -999999; calojet_phi[i] = -999999;
349  pfjet_et[i] = -999999; pfjet_eta[i] = -999999; pfjet_phi[i] = -999999;
350  }
351  // get hold of the jet collections
354  iEvent.getByLabel(caloJetCollectionTag_, pCaloJets);
355  iEvent.getByLabel(pfJetCollectionTag_, pPfJets);
356  //
357  // calo jets now:
358  if (pCaloJets.isValid()) {
359  const reco::CaloJetCollection *caloJets = pCaloJets.product();
360  int nCaloJets = (int) caloJets->size();
361  if (nCaloJets>0) {
362  float *nCaloET = new float[nCaloJets];
363  float *nCaloEta = new float[nCaloJets];
364  float *nCaloPhi = new float[nCaloJets];
365  reco::CaloJetCollection::const_iterator cjet = caloJets->begin();
366  int counter = 0;
367  for (; cjet != caloJets->end(); ++cjet) {
368  // store them only if they are far enough from the electron
369  Double_t DR = reco::deltaR(cjet->eta(), cjet->phi(), myElec->gsfTrack()->eta(), ele_sc_phi);
370  if (DR > DRJetFromElectron_) {
371  nCaloET[counter] = cjet->et();
372  nCaloEta[counter] = cjet->eta();
373  nCaloPhi[counter] = cjet->phi();
374  ++counter;
375  }
376  }
377  int *caloJetSorted = new int[nCaloJets];
378  TMath::Sort(nCaloJets, nCaloET, caloJetSorted, true);
379  for (int i=0; i<nCaloJets; ++i) {
380  if (i>=5) break;
381  calojet_et[i] = nCaloET[ caloJetSorted[i] ];
382  calojet_eta[i] = nCaloEta[ caloJetSorted[i] ];
383  calojet_phi[i] = nCaloPhi[ caloJetSorted[i] ];
384  }
385  delete [] caloJetSorted;
386  delete [] nCaloET;
387  delete [] nCaloEta;
388  delete [] nCaloPhi;
389  }
390  } else {
391  std::cout << "WenuPlots: Could not get caloJet collection with name "
392  << caloJetCollectionTag_ << std::endl;
393  }
394  //
395  // pf jets now:
396  if (pPfJets.isValid()) {
397  const reco::PFJetCollection *pfJets = pPfJets.product();
398  int nPfJets = (int) pfJets->size();
399  if (nPfJets>0) {
400  float *nPfET = new float[nPfJets];
401  float *nPfEta = new float[nPfJets];
402  float *nPfPhi = new float[nPfJets];
403  reco::PFJetCollection::const_iterator pjet = pfJets->begin();
404  int counter = 0;
405  for (; pjet != pfJets->end(); ++pjet) {
406  // store them only if they are far enough from the electron
407  Double_t DR = reco::deltaR(pjet->eta(), pjet->phi(), myElec->gsfTrack()->eta(), ele_sc_phi);
408  if (DR > DRJetFromElectron_) {
409  nPfET[counter] = pjet->et();
410  nPfEta[counter] = pjet->eta();
411  nPfPhi[counter] = pjet->phi();
412  ++counter;
413  }
414  }
415  int *pfJetSorted = new int[nPfJets];
416  TMath::Sort(nPfJets, nPfET, pfJetSorted, true);
417  for (int i=0; i<nPfJets; ++i) {
418  if (i>=5) break;
419  pfjet_et[i] = nPfET[ pfJetSorted[i] ];
420  pfjet_eta[i] = nPfEta[ pfJetSorted[i] ];
421  pfjet_phi[i] = nPfPhi[ pfJetSorted[i] ];
422  }
423  delete [] pfJetSorted;
424  delete [] nPfET;
425  delete [] nPfEta;
426  delete [] nPfPhi;
427  }
428  } else {
429  std::cout << "WenuPlots: Could not get pfJet collection with name "
430  << pfJetCollectionTag_ << std::endl;
431  }
432 
433  }
434  // second electron information - in preselected ntuple only
435  ele2nd_sc_gsf_et = -1; // also in sele tree
436  ele2nd_sc_eta = -1;
437  ele2nd_sc_phi = -1;
438  ele2nd_sc_rho = 0;
439  ele2nd_cand_eta = 0;
440  ele2nd_cand_phi = 0;
441  ele2nd_cand_et = 0;
442  ele2nd_pin = 0;
443  ele2nd_pout = 0;
444  ele2nd_passes_selection = -1; // also in sele tree
445  ele2nd_ecalDriven= 0;
446  //
447  // second electron selection variables: only if requested by the user
448  //
449  ele2nd_iso_track = 0;
450  ele2nd_iso_ecal = 0;
451  ele2nd_iso_hcal = 0;
452  //
453  ele2nd_id_sihih = 0;
454  ele2nd_id_deta = 0;
455  ele2nd_id_dphi = 0;
456  ele2nd_id_hoe = 0;
457  //
459  ele2nd_cr_dcot = 0;
460  ele2nd_cr_dist = 0;
461  //
462  ele2nd_vx = 0;
463  ele2nd_vy = 0;
464  ele2nd_vz = 0;
465  //
466  ele2nd_gsfCharge = 0;
467  // must keep the ctf track collection, i.e. general track collection
468  ele2nd_ctfCharge = 0;
469  ele2nd_scPixCharge = 0;
470  ele2nd_eop = 0;
471  ele2nd_tip_bs = 0;
472  ele2nd_tip_pv = 0;
474  //
475  // convention for ele2nd_passes_selection
476  // 0 passes no selection
477  // 1 passes WP95
478  // 2 passes WP90
479  // 3 passes WP85
480  // 4 passes WP80
481  // 5 passes WP70
482  // 6 passes WP60
483  if (myElec->userInt("hasSecondElectron") == 1 && storeExtraInformation_) {
484  const pat::Electron * mySecondElec=
485  dynamic_cast<const pat::Electron*> (wenu.daughter("secondElec"));
486  ele2nd_sc_gsf_et = (Float_t) mySecondElec->superCluster()->energy()/TMath::CosH(mySecondElec->gsfTrack()->eta());
487 
488  ele2nd_sc_eta = (Float_t) mySecondElec->superCluster()->eta();
489  ele2nd_sc_phi = (Float_t) mySecondElec->superCluster()->phi();
490  double sc2x = mySecondElec->superCluster()->x();
491  double sc2y = mySecondElec->superCluster()->y();
492  double sc2z = mySecondElec->superCluster()->z();
493  ele2nd_sc_rho = (Float_t) sqrt(sc2x*sc2x + sc2y*sc2y + sc2z*sc2z);
494  ele2nd_cand_eta = (Float_t) mySecondElec->eta();
495  ele2nd_cand_phi = (Float_t) mySecondElec->phi();
496  ele2nd_cand_et = (Float_t) mySecondElec->et();
497  ele2nd_pin = (Float_t) mySecondElec->trackMomentumAtVtx().R();;
498  ele2nd_pout = (Float_t) mySecondElec->trackMomentumOut().R();
499  ele2nd_ecalDriven= (Int_t) mySecondElec->ecalDrivenSeed();
500  // check the selections
501  bool isIDCalc = mySecondElec->isElectronIDAvailable("simpleEleId95relIso") &&
502  mySecondElec->isElectronIDAvailable("simpleEleId90relIso") &&
503  mySecondElec->isElectronIDAvailable("simpleEleId85relIso") &&
504  mySecondElec->isElectronIDAvailable("simpleEleId80relIso") &&
505  mySecondElec->isElectronIDAvailable("simpleEleId70relIso") &&
506  mySecondElec->isElectronIDAvailable("simpleEleId60relIso");
507  if (isIDCalc) {
509  if (fabs(mySecondElec->electronID("simpleEleId60relIso")-7) < 0.1) ele2nd_passes_selection = 6;
510  else if (fabs(mySecondElec->electronID("simpleEleId70relIso")-7) < 0.1) ele2nd_passes_selection = 5;
511  else if (fabs(mySecondElec->electronID("simpleEleId80relIso")-7) < 0.1) ele2nd_passes_selection = 4;
512  else if (fabs(mySecondElec->electronID("simpleEleId85relIso")-7) < 0.1) ele2nd_passes_selection = 3;
513  else if (fabs(mySecondElec->electronID("simpleEleId90relIso")-7) < 0.1) ele2nd_passes_selection = 2;
514  else if (fabs(mySecondElec->electronID("simpleEleId95relIso")-7) < 0.1) ele2nd_passes_selection = 1;
515  }
517  ele2nd_iso_track = (Float_t) mySecondElec->dr03IsolationVariables().tkSumPt / ele2nd_cand_et;
519  ele2nd_iso_hcal = (Float_t) ( mySecondElec->dr03IsolationVariables().hcalDepth1TowerSumEt +
521  ele2nd_id_sihih = (Float_t) mySecondElec->sigmaIetaIeta();
522  ele2nd_id_deta = (Float_t) mySecondElec->deltaEtaSuperClusterTrackAtVtx();
523  ele2nd_id_dphi = (Float_t) mySecondElec->deltaPhiSuperClusterTrackAtVtx();
524  ele2nd_id_hoe = (Float_t) mySecondElec->hadronicOverEm();
525 
526  ele2nd_cr_mhitsinner = mySecondElec->gsfTrack()->trackerExpectedHitsInner().numberOfHits();
527  ele2nd_cr_dcot = mySecondElec->convDcot();
528  ele2nd_cr_dist = mySecondElec->convDist();
529 
530  ele2nd_vx = (Float_t) mySecondElec->vx();
531  ele2nd_vy = (Float_t) mySecondElec->vy();
532  ele2nd_vz = (Float_t) mySecondElec->vz();
533  ele2nd_gsfCharge = (Int_t) mySecondElec->gsfTrack()->charge();
534  // must keep the ctf track collection, i.e. general track collection
535  ele2nd_ctfCharge = (Int_t) mySecondElec->closestCtfTrackRef().isNonnull() ? mySecondElec->closestCtfTrackRef()->charge():-9999;
536  ele2nd_scPixCharge = (Int_t) mySecondElec->chargeInfo().scPixCharge;
537  ele2nd_eop = (Float_t) mySecondElec->eSuperClusterOverP();
538  ele2nd_tip_bs = (Float_t) -mySecondElec->dB();
539  if (Vtx.size() > 0) {
540  ele2nd_tip_pv = mySecondElec->gsfTrack()->dxy(Vtx[0].position());
541  }
542  if (VtxBS.size() > 0) {
543  ele2nd_tip_pvbs = mySecondElec->gsfTrack()->dxy(VtxBS[0].position());
544  }
545  ele2nd_hltmatched_dr = mySecondElec->userFloat("HLTMatchingDR");
546  }
547  }
548  // some extra information
550  ele_hltmatched_dr = -999.;
551  VtxTracksSize.clear();
552  VtxNormalizedChi2.clear();
553  VtxTracksSizeBS.clear();
554  VtxNormalizedChi2BS.clear();
556  if (myElec->hasUserFloat("HLTMatchingDR")) {
557  ele_hltmatched_dr = myElec->userFloat("HLTMatchingDR");
558  }
559  if (myElec->hasUserInt("triggerDecision")) {
560  event_triggerDecision = myElec->userInt("triggerDecision");
561  }
562  // extra information related to the primary vtx collection
563  for (Int_t i=0; i < (Int_t) Vtx.size(); ++i) {
564  VtxTracksSize.push_back(Vtx[i].tracksSize());
565  VtxNormalizedChi2.push_back(Vtx[i].normalizedChi2());
566  }
567  for (Int_t i=0; i < (Int_t) VtxBS.size(); ++i) {
568  VtxTracksSizeBS.push_back(VtxBS[i].tracksSize());
569  VtxNormalizedChi2BS.push_back(VtxBS[i].normalizedChi2());
570  }
571  }
572  // if the electron passes the selection
573  // it is meant to be a precalculated selection here, in order to include
574  // conversion rejection too
575  if (CheckCuts(myElec) && myElec->userInt("failsSecondElectronCut") == 0) {
576  vbtfSele_tree->Fill();
577  }
578  vbtfPresele_tree->Fill();
579 
580 
581 
582  //
583  // _______________________________________________________________________
584  //
585  // histogram production --------------------------------------------------
586  // _______________________________________________________________________
587  //
588  // if you want some preselection: Conv rejection, hit pattern
589  if (usePreselection_) {
590  if (not PassPreselectionCriteria(myElec)) return;
591  }
592  //
593  // some variables here
594  Double_t scEta = myElec->superCluster()->eta();
595  Double_t scPhi = myElec->superCluster()->phi();
596  Double_t scEt = myElec->superCluster()->energy()/TMath::CosH(scEta);
597  Double_t met = myMet->et();
598  Double_t metPhi = myMet->phi();
599  Double_t mt = TMath::Sqrt(2.0*scEt*met*(1.0-(TMath::Cos(scPhi)*TMath::Cos(metPhi)+TMath::Sin(scPhi)*TMath::Sin(metPhi))));
600 
601  Double_t trackIso = myElec->userIsolation(pat::TrackIso);
602  Double_t ecalIso = myElec->userIsolation(pat::EcalIso);
603  Double_t hcalIso = myElec->userIsolation(pat::HcalIso);
604  Double_t sihih = myElec->scSigmaIEtaIEta();
605  Double_t dphi = myElec->deltaPhiSuperClusterTrackAtVtx();
606  Double_t deta = myElec->deltaEtaSuperClusterTrackAtVtx();
607  Double_t HoE = myElec->hadronicOverEm();
608  //
609  //
610  //
611  // the inverted selection plots:
612  // only if not using precalcID
613  if (not usePrecalcID_) {
614  if (CheckCutsInverse(myElec)){
615  //std::cout << "-----------------INVERSION-----------passed" << std::endl;
616  h_met_inverse->Fill(met);
617  h_mt_inverse->Fill(mt);
618  if(TMath::Abs(scEta)<1.479){
619  h_met_inverse_EB->Fill(met);
620  h_mt_inverse_EB->Fill(mt);
621  }
622  if(TMath::Abs(scEta)>1.479){
623  h_met_inverse_EE->Fill(met);
624  h_mt_inverse_EE->Fill(mt);
625  }
626  }
627  }
628  //
630  //
631  // N-1 plots: plot some variable so that all the other cuts are satisfied
632  //
633  // make these plots only if you have the normal selection, not pre-calced
634  if (not usePrecalcID_) {
635  if ( TMath::Abs(scEta) < 1.479) { // reminder: the precise fiducial cuts are in
636  // in the filter
637  if (CheckCutsNminusOne(myElec, 0))
638  h_trackIso_eb_NmOne->Fill(trackIso);
639  }
640  else {
641  if (CheckCutsNminusOne(myElec, 0))
642  h_trackIso_ee_NmOne->Fill(trackIso);
643  }
644  }
645  //
646  // SELECTION APPLICATION
647  //
648  // from here on you have only events that pass the full selection
649  if (not CheckCuts(myElec)) return;
651 
652  h_met->Fill(met);
653  h_mt->Fill(mt);
654  if(TMath::Abs(scEta)<1.479){
655  h_met_EB->Fill(met);
656  h_mt_EB->Fill(mt);
657 
658  h_EB_trkiso->Fill( trackIso );
659  h_EB_ecaliso->Fill( ecalIso );
660  h_EB_hcaliso->Fill( hcalIso );
661  h_EB_sIetaIeta->Fill( sihih );
662  h_EB_dphi->Fill( dphi );
663  h_EB_deta->Fill( deta );
664  h_EB_HoE->Fill( HoE );
665 
666  }
667  if(TMath::Abs(scEta)>1.479){
668  h_met_EE->Fill(met);
669  h_mt_EE->Fill(mt);
670 
671  h_EE_trkiso->Fill( trackIso );
672  h_EE_ecaliso->Fill( ecalIso );
673  h_EE_hcaliso->Fill( hcalIso );
674  h_EE_sIetaIeta->Fill( sihih );
675  h_EE_dphi->Fill( dphi );
676  h_EE_deta->Fill( deta );
677  h_EE_HoE->Fill( HoE );
678 
679  }
680  // uncomment for debugging purposes
681  /*
682  std::cout << "tracIso: " << trackIso << ", " << myElec->trackIso() << ", ecaliso: " << ecalIso
683  << ", " << myElec->ecalIso() << ", hcaliso: " << hcalIso << ", " << myElec->hcalIso()
684  << ", mishits: "
685  << myElec->gsfTrack()->trackerExpectedHitsInner().numberOfHits()
686  << std::endl;
687  std::cout << "Electron ID: 95relIso=" << myElec->electronID("simpleEleId95relIso")
688  << " 90relIso=" << myElec->electronID("simpleEleId90relIso")
689  << " 85relIso=" << myElec->electronID("simpleEleId85relIso")
690  << " 80relIso=" << myElec->electronID("simpleEleId80relIso")
691  << " 70relIso=" << myElec->electronID("simpleEleId70relIso")
692  << " 60relIso=" << myElec->electronID("simpleEleId60relIso")
693  << " 95cIso=" << myElec->electronID("simpleEleId95cIso")
694  << " 90cIso=" << myElec->electronID("simpleEleId90cIso")
695  << " 85cIso=" << myElec->electronID("simpleEleId85cIso")
696  << " 80cIso=" << myElec->electronID("simpleEleId80cIso")
697  << " 70cIso=" << myElec->electronID("simpleEleId70cIso")
698  << " 60cIso=" << myElec->electronID("simpleEleId60cIso")
699  << std::endl;
700  std::cout << "mySelection: " << (CheckCuts(myElec) && PassPreselectionCriteria(myElec)) << endl;
701  */
702  h_scEt->Fill(scEt);
703  h_scEta->Fill(scEta);
704  h_scPhi->Fill(scPhi);
705 
706 }
707 
708 /***********************************************************************
709  *
710  * Checking Cuts and making selections:
711  * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
712  * all the available methods take input a pointer to a pat::Electron
713  *
714  * Bool_t CheckCuts(const pat::Electron *):
715  * true if the input selection is satisfied
716  * Bool_t CheckCutsInverse(const pat::Electron *ele):
717  * true if the cuts with inverted the ones specified in the
718  * cfg are satisfied
719  * Bool_t CheckCutsNminusOne(const pat::Electron *ele, int jj):
720  * true if all the cuts with cut #jj ignored are satisfied
721  *
722  ***********************************************************************/
724 {
725  if (usePrecalcID_) {
726  if (not ele-> isElectronIDAvailable(usePrecalcIDType_)) {
727  std::cout << "Error! not existing ID with name: "
728  << usePrecalcIDType_ << " function will return true!"
729  << std::endl;
730  return true;
731  }
732  Double_t val = ele->electronID(usePrecalcIDType_);
733  if (usePrecalcIDSign_ == "<") {
734  return val < usePrecalcIDValue_;
735  }
736  else if (usePrecalcIDSign_ == ">") {
737  return val > usePrecalcIDValue_;
738  }
739  else { // equality: it returns 0,1,2,3 but as float
740  return TMath::Abs(val-usePrecalcIDValue_)<0.1;
741  }
742  }
743  else {
744  for (int i=0; i<nBarrelVars_; ++i) {
745  if (not CheckCut(ele, i)) return false;
746  }
747  return true;
748  }
749 }
751 
753 {
754  for (int i=0; i<nBarrelVars_; ++i){
755  if ( CheckCutInv(ele, i) == false) return false;
756  }
757  return true;
758 
759 }
762 {
763  for (int i=0; i<nBarrelVars_; ++i){
764  if (i==jj) continue;
765  if ( CheckCut(ele, i) == false) return false;
766  }
767  return true;
768 }
770 Bool_t WenuPlots::CheckCut(const pat::Electron *ele, int i) {
771  Double_t fabseta = TMath::Abs(ele->superCluster()->eta());
772  if ( fabseta<1.479) {
773  return TMath::Abs(ReturnCandVar(ele, i)) < CutVars_[i];
774  }
775  return TMath::Abs(ReturnCandVar(ele, i)) < CutVars_[i+nBarrelVars_];
776 }
778 Bool_t WenuPlots::CheckCutInv(const pat::Electron *ele, int i) {
779  Double_t fabseta = TMath::Abs(ele->superCluster()->eta());
780  if ( fabseta<1.479) {
781  if (InvVars_[i])
782  return TMath::Abs(ReturnCandVar(ele, i))>CutVars_[i];
783  return TMath::Abs(ReturnCandVar(ele, i)) < CutVars_[i];
784  }
785  if (InvVars_[i+nBarrelVars_]) {
786  if (InvVars_[i])
787  return TMath::Abs(ReturnCandVar(ele, i))>CutVars_[i+nBarrelVars_];
788  }
789  return TMath::Abs(ReturnCandVar(ele, i)) < CutVars_[i+nBarrelVars_];
790 }
792 Double_t WenuPlots::ReturnCandVar(const pat::Electron *ele, int i) {
793  if (i==0) return ele->dr03TkSumPt()/ele->p4().Pt();
794  else if (i==1) return ele->dr03EcalRecHitSumEt()/ele->p4().Pt();
795  else if (i==2) return ele->dr03HcalTowerSumEt()/ele->p4().Pt();
796  else if (i==3) return ele->scSigmaIEtaIEta();
797  else if (i==4) return ele->deltaPhiSuperClusterTrackAtVtx();
798  else if (i==5) return ele->deltaEtaSuperClusterTrackAtVtx();
799  else if (i==6) return ele->hadronicOverEm();
800  else if (i==7) {
801  if (ele->isEB()){
802  return ( ele->dr03TkSumPt()+std::max(float(0.),ele->dr03EcalRecHitSumEt()-1)
803  + ele->dr03HcalTowerSumEt())/ele->p4().Pt(); }
804  else { // pedestal subtraction is only in barrel
805  return ( ele->dr03TkSumPt()+ele->dr03EcalRecHitSumEt()
806  + ele->dr03HcalTowerSumEt())/ele->p4().Pt(); }
807  }
808  // else if (i==8) return ele->gsfTrack()->dxy(bspotPosition_);
809  else if (i==8) return fabs(ele->dB());
810  else if (i==9) return ele->eSuperClusterOverP();
811  else if (i==10) return ele->userIsolation(pat::TrackIso);
812  else if (i==11) return ele->userIsolation(pat::EcalIso);
813  else if (i==12) return ele->userIsolation(pat::HcalIso);
814  std::cout << "Error in WenuPlots::ReturnCandVar" << std::endl;
815  return -1.;
816 
817 }
820  Bool_t passConvRej = true;
821  Bool_t passPXB = true;
822  Bool_t passEMH = true;
824  if (ele->hasUserInt("PassConversionRejection")) {
825  //std::cout << "con rej: " << ele->userInt("PassConversionRejection") << std::endl;
826  if (not (ele->userInt("PassConversionRejection")==1)) passConvRej = false;
827  }
828  else {
829  std::cout << "WenuPlots: WARNING: Conversion Rejection Request Disregarded: "
830  << "you must calculate it before " << std::endl;
831  // return true;
832  }
833  }
834  if (useValidFirstPXBHit_) {
835  if (ele->hasUserInt("PassValidFirstPXBHit")) {
836  //std::cout << "valid1stPXB: " << ele->userInt("PassValidFirstPXBHit") << std::endl;
837  if (not (ele->userInt("PassValidFirstPXBHit")==1)) passPXB = false;
838  }
839  else {
840  std::cout << "WenuPlots: WARNING: Valid First PXB Hit Request Disregarded: "
841  << "you must calculate it before " << std::endl;
842  // return true;
843  }
844  }
846  if (ele->hasUserInt("NumberOfExpectedMissingHits")) {
847  //std::cout << "missing hits: " << ele->userInt("NumberOfExpectedMissingHits") << std::endl;
848  if (ele->userInt("NumberOfExpectedMissingHits")>maxNumberOfExpectedMissingHits_)
849  passEMH = false;
850  }
851  else {
852  std::cout << "WenuPlots: WARNING: Number of Expected Missing Hits Request Disregarded: "
853  << "you must calculate it before " << std::endl;
854  // return true;
855  }
856  }
857  return passConvRej && passPXB && passEMH;
858 }
859 // ------------ method called once each job just before starting event loop --
860 void
862 {
863  //std::cout << "In beginJob()" << std::endl;
864  // Double_t Pi = TMath::Pi();
865  // TString histo_file = outputFile_;
866  // histofile = new TFile( histo_file,"RECREATE");
867 
868  h_met = new TH1F("h_met", "h_met", 200, 0, 200);
869  h_met_inverse = new TH1F("h_met_inverse", "h_met_inverse", 200, 0, 200);
870 
871  h_mt = new TH1F("h_mt", "h_mt", 200, 0, 200);
872  h_mt_inverse = new TH1F("h_mt_inverse", "h_mt_inverse", 200, 0, 200);
873 
874 
875  h_met_EB = new TH1F("h_met_EB", "h_met_EB", 200, 0, 200);
876  h_met_inverse_EB = new TH1F("h_met_inverse_EB", "h_met_inverse_EB", 200, 0, 200);
877 
878  h_mt_EB = new TH1F("h_mt_EB", "h_mt_EB", 200, 0, 200);
879  h_mt_inverse_EB = new TH1F("h_mt_inverse_EB", "h_mt_inverse_EB", 200, 0, 200);
880 
881 
882  h_met_EE = new TH1F("h_met_EE", "h_met_EE", 200, 0, 200);
883  h_met_inverse_EE = new TH1F("h_met_inverse_EE", "h_met_inverse_EE", 200, 0, 200);
884 
885  h_mt_EE = new TH1F("h_mt_EE", "h_mt_EE", 200, 0, 200);
886  h_mt_inverse_EE = new TH1F("h_mt_inverse_EE", "h_mt_inverse_EE", 200, 0, 200);
887 
888 
889  h_scEt = new TH1F("h_scEt", "h_scEt", 200, 0, 100);
890  h_scEta = new TH1F("h_scEta", "h_scEta", 200, -3, 3);
891  h_scPhi = new TH1F("h_scPhi", "h_scPhi", 200, -4, 4);
892 
893 
894  //VALIDATION PLOTS
895  //EB
896  h_EB_trkiso = new TH1F("h_EB_trkiso","h_EB_trkiso",200 , 0.0, 9.0);
897  h_EB_ecaliso = new TH1F("h_EB_ecaliso","h_EB_ecaliso",200, 0.0 , 9.0);
898  h_EB_hcaliso = new TH1F("h_EB_hcaliso","h_EB_hcaliso",200, 0.0 , 9.0);
899  h_EB_sIetaIeta = new TH1F("h_EB_sIetaIeta","h_EB_sIetaIeta",200, 0.0 , 0.02 );
900  h_EB_dphi = new TH1F("h_EB_dphi","h_EB_dphi",200, -0.03 , 0.03 );
901  h_EB_deta = new TH1F("h_EB_deta","h_EB_deta",200, -0.01 , 0.01) ;
902  h_EB_HoE = new TH1F("h_EB_HoE","h_EB_HoE",200, 0.0 , 0.2 );
903  //EE
904  h_EE_trkiso = new TH1F("h_EE_trkiso","h_EE_trkiso",200 , 0.0, 9.0);
905  h_EE_ecaliso = new TH1F("h_EE_ecaliso","h_EE_ecaliso",200, 0.0 , 9.0);
906  h_EE_hcaliso = new TH1F("h_EE_hcaliso","h_EE_hcaliso",200, 0.0 , 9.0);
907  h_EE_sIetaIeta = new TH1F("h_EE_sIetaIeta","h_EE_sIetaIeta",200, 0.0 , 0.1 );
908  h_EE_dphi = new TH1F("h_EE_dphi","h_EE_dphi",200, -0.03 , 0.03 );
909  h_EE_deta = new TH1F("h_EE_deta","h_EE_deta",200, -0.01 , 0.01) ;
910  h_EE_HoE = new TH1F("h_EE_HoE","h_EE_HoE",200, 0.0 , 0.2 );
911 
912 
913  //
914  //
916  new TH1F("h_trackIso_eb_NmOne","trackIso EB N-1 plot",80,0,8);
918  new TH1F("h_trackIso_ee_NmOne","trackIso EE N-1 plot",80,0,8);
919 
920 
921  // if you add some new variable change the nBarrelVars_ accordingly
922  // reminder: in the current implementation you must have the same number
923  // of vars in both barrel and endcaps
924  nBarrelVars_ = 13;
925  //
926  // Put EB variables together and EE variables together
927  // number of barrel variables = number of endcap variable
928  // if you don't want to use some variable put a very high cut
929  CutVars_.push_back( trackIso_EB_ );//0
930  CutVars_.push_back( ecalIso_EB_ ); //1
931  CutVars_.push_back( hcalIso_EB_ ); //2
932  CutVars_.push_back( sihih_EB_ ); //3
933  CutVars_.push_back( dphi_EB_ ); //4
934  CutVars_.push_back( deta_EB_ ); //5
935  CutVars_.push_back( hoe_EB_ ); //6
936  CutVars_.push_back( cIso_EB_ ); //7
937  CutVars_.push_back( tip_bspot_EB_);//8
938  CutVars_.push_back( eop_EB_ ); //9
939  CutVars_.push_back( trackIsoUser_EB_ );//10
940  CutVars_.push_back( ecalIsoUser_EB_ );//11
941  CutVars_.push_back( hcalIsoUser_EB_ );//12
942  //
943  CutVars_.push_back( trackIso_EE_);//0
944  CutVars_.push_back( ecalIso_EE_); //1
945  CutVars_.push_back( hcalIso_EE_); //2
946  CutVars_.push_back( sihih_EE_); //3
947  CutVars_.push_back( dphi_EE_); //4
948  CutVars_.push_back( deta_EE_); //5
949  CutVars_.push_back( hoe_EE_ ); //6
950  CutVars_.push_back( cIso_EE_ ); //7
951  CutVars_.push_back(tip_bspot_EE_);//8
952  CutVars_.push_back( eop_EE_ ); //9
953  CutVars_.push_back( trackIsoUser_EE_ );//10
954  CutVars_.push_back( ecalIsoUser_EE_ );//11
955  CutVars_.push_back( hcalIsoUser_EE_ );//12
956  //
957  InvVars_.push_back( trackIso_EB_inv);//0
958  InvVars_.push_back( ecalIso_EB_inv); //1
959  InvVars_.push_back( hcalIso_EB_inv); //2
960  InvVars_.push_back( sihih_EB_inv); //3
961  InvVars_.push_back( dphi_EB_inv); //4
962  InvVars_.push_back( deta_EB_inv); //5
963  InvVars_.push_back( hoe_EB_inv); //6
964  InvVars_.push_back( cIso_EB_inv); //7
965  InvVars_.push_back(tip_bspot_EB_inv);//8
966  InvVars_.push_back( eop_EB_inv); //9
967  InvVars_.push_back( trackIsoUser_EB_inv );//10
968  InvVars_.push_back( ecalIsoUser_EB_inv );//11
969  InvVars_.push_back( hcalIsoUser_EB_inv );//12
970  //
971  InvVars_.push_back( trackIso_EE_inv);//0
972  InvVars_.push_back( ecalIso_EE_inv); //1
973  InvVars_.push_back( hcalIso_EE_inv); //2
974  InvVars_.push_back( sihih_EE_inv); //3
975  InvVars_.push_back( dphi_EE_inv); //4
976  InvVars_.push_back( deta_EE_inv); //5
977  InvVars_.push_back( hoe_EE_inv); //6
978  InvVars_.push_back( cIso_EE_inv); //7
979  InvVars_.push_back(tip_bspot_EE_inv);//8
980  InvVars_.push_back( eop_EE_inv); //9
981  InvVars_.push_back( trackIsoUser_EE_inv );//10
982  InvVars_.push_back( ecalIsoUser_EE_inv );//11
983  InvVars_.push_back( hcalIsoUser_EE_inv );//12
984  //
985  //
986  // ________________________________________________________________________
987  //
988  // The VBTF Root Tuples ---------------------------------------------------
989  // ________________________________________________________________________
990  //
992  "RECREATE");
993 
994  vbtfSele_tree = new TTree("vbtfSele_tree",
995  "Tree to store the W Candidates that pass the VBTF selection");
996  vbtfSele_tree->Branch("runNumber", &runNumber, "runNumber/I");
997  vbtfSele_tree->Branch("eventNumber", &eventNumber, "eventNumber/L");
998  vbtfSele_tree->Branch("lumiSection", &lumiSection, "lumiSection/I");
999  //
1000  vbtfSele_tree->Branch("ele_sc_gsf_et", &ele_sc_gsf_et,"ele_sc_gsf_et/F");
1001  vbtfSele_tree->Branch("ele_sc_energy", &ele_sc_energy,"ele_sc_energy/F");
1002  vbtfSele_tree->Branch("ele_sc_eta", &ele_sc_eta,"ele_sc_eta/F");
1003  vbtfSele_tree->Branch("ele_sc_phi", &ele_sc_phi,"ele_sc_phi/F");
1004  vbtfSele_tree->Branch("ele_sc_rho", &ele_sc_rho,"ele_sc_rho/F");
1005  vbtfSele_tree->Branch("ele_cand_et", &ele_cand_et, "ele_cand_et/F");
1006  vbtfSele_tree->Branch("ele_cand_eta", &ele_cand_eta,"ele_cand_eta/F");
1007  vbtfSele_tree->Branch("ele_cand_phi",&ele_cand_phi,"ele_cand_phi/F");
1008  vbtfSele_tree->Branch("ele_iso_track",&ele_iso_track,"ele_iso_track/F");
1009  vbtfSele_tree->Branch("ele_iso_ecal",&ele_iso_ecal,"ele_iso_ecal/F");
1010  vbtfSele_tree->Branch("ele_iso_hcal",&ele_iso_hcal,"ele_iso_hcal/F");
1011  vbtfSele_tree->Branch("ele_id_sihih",&ele_id_sihih,"ele_id_sihih/F");
1012  vbtfSele_tree->Branch("ele_id_deta",&ele_id_deta,"ele_id_deta/F");
1013  vbtfSele_tree->Branch("ele_id_dphi",&ele_id_dphi,"ele_id_dphi/F");
1014  vbtfSele_tree->Branch("ele_id_hoe",&ele_id_hoe,"ele_id_hoe/F");
1015  vbtfSele_tree->Branch("ele_cr_mhitsinner",&ele_cr_mhitsinner,"ele_cr_mhitsinner/I");
1016  vbtfSele_tree->Branch("ele_cr_dcot",&ele_cr_dcot,"ele_cr_dcot/F");
1017  vbtfSele_tree->Branch("ele_cr_dist",&ele_cr_dist,"ele_cr_dist/F");
1018  vbtfSele_tree->Branch("ele_vx",&ele_vx,"ele_vx/F");
1019  vbtfSele_tree->Branch("ele_vy",&ele_vy,"ele_vy/F");
1020  vbtfSele_tree->Branch("ele_vz",&ele_vz,"ele_vz/F");
1021  vbtfSele_tree->Branch("pv_x",&pv_x,"pv_x/F");
1022  vbtfSele_tree->Branch("pv_y",&pv_y,"pv_y/F");
1023  vbtfSele_tree->Branch("pv_z",&pv_z,"pv_z/F");
1024  vbtfSele_tree->Branch("ele_gsfCharge",&ele_gsfCharge,"ele_gsfCharge/I");
1025  vbtfSele_tree->Branch("ele_ctfCharge",&ele_ctfCharge,"ele_ctfCharge/I");
1026  vbtfSele_tree->Branch("ele_scPixCharge",&ele_scPixCharge,"ele_scPixCharge/I");
1027  vbtfSele_tree->Branch("ele_eop",&ele_eop,"ele_eop/F");
1028  vbtfSele_tree->Branch("ele_tip_bs",&ele_tip_bs,"ele_tip_bs/F");
1029  vbtfSele_tree->Branch("ele_tip_pv",&ele_tip_pv,"ele_tip_pv/F");
1030  vbtfSele_tree->Branch("ele_pin",&ele_pin,"ele_pin/F");
1031  vbtfSele_tree->Branch("ele_pout",&ele_pout,"ele_pout/F");
1032  vbtfSele_tree->Branch("event_caloMET",&event_caloMET,"event_caloMET/F");
1033  vbtfSele_tree->Branch("event_pfMET",&event_pfMET,"event_pfMET/F");
1034  vbtfSele_tree->Branch("event_tcMET",&event_tcMET,"event_tcMET/F");
1035  vbtfSele_tree->Branch("event_caloMT",&event_caloMT,"event_caloMT/F");
1036  vbtfSele_tree->Branch("event_pfMT",&event_pfMT,"event_pfMT/F");
1037  vbtfSele_tree->Branch("event_tcMT",&event_tcMT,"event_tcMT/F");
1038  vbtfSele_tree->Branch("event_caloMET_phi",&event_caloMET_phi,"event_caloMET_phi/F");
1039  vbtfSele_tree->Branch("event_pfMET_phi",&event_pfMET_phi,"event_pfMET_phi/F");
1040  vbtfSele_tree->Branch("event_tcMET_phi",&event_tcMET_phi,"event_tcMET_phi/F");
1041  //
1042  // the extra jet variables:
1044  vbtfSele_tree->Branch("calojet_et",calojet_et,"calojet_et[5]/F");
1045  vbtfSele_tree->Branch("calojet_eta",calojet_eta,"calojet_eta[5]/F");
1046  vbtfSele_tree->Branch("calojet_phi",calojet_phi,"calojet_phi[5]/F");
1047  vbtfSele_tree->Branch("pfjet_et",pfjet_et,"pfjet_et[5]/F");
1048  vbtfSele_tree->Branch("pfjet_eta",pfjet_eta,"pfjet_eta[5]/F");
1049  vbtfSele_tree->Branch("pfjet_phi",pfjet_phi,"pfjet_phi[5]/F");
1050  }
1051  if (storeExtraInformation_) {
1052  vbtfSele_tree->Branch("ele2nd_sc_gsf_et", &ele2nd_sc_gsf_et,"ele2nd_sc_gsf_et/F");
1053  vbtfSele_tree->Branch("ele2nd_passes_selection", &ele2nd_passes_selection,"ele2nd_passes_selection/I");
1054  vbtfSele_tree->Branch("ele2nd_ecalDriven",&ele2nd_ecalDriven,"ele2nd_ecalDriven/I");
1055  vbtfSele_tree->Branch("event_caloSumEt",&event_caloSumEt,"event_caloSumEt/F");
1056  vbtfSele_tree->Branch("event_pfSumEt",&event_pfSumEt,"event_pfSumEt/F");
1057  vbtfSele_tree->Branch("event_tcSumEt",&event_tcSumEt,"event_tcSumEt/F");
1058  }
1059  vbtfSele_tree->Branch("event_datasetTag",&event_datasetTag,"event_dataSetTag/I");
1060  //
1061  //
1062  // everything after preselection
1063  //
1064  WENU_VBTFpreseleFile_ = new TFile(TString(WENU_VBTFpreseleFileName_),
1065  "RECREATE");
1066 
1067  vbtfPresele_tree = new TTree("vbtfPresele_tree",
1068  "Tree to store the W Candidates that pass the VBTF preselection");
1069  vbtfPresele_tree->Branch("runNumber", &runNumber, "runNumber/I");
1070  vbtfPresele_tree->Branch("eventNumber", &eventNumber, "eventNumber/L");
1071  vbtfPresele_tree->Branch("lumiSection", &lumiSection, "lumiSection/I");
1072  //
1073  vbtfPresele_tree->Branch("ele_sc_gsf_et", &ele_sc_gsf_et,"ele_sc_gsf_et/F");
1074  vbtfPresele_tree->Branch("ele_sc_energy", &ele_sc_energy,"ele_sc_energy/F");
1075  vbtfPresele_tree->Branch("ele_sc_eta", &ele_sc_eta,"ele_sc_eta/F");
1076  vbtfPresele_tree->Branch("ele_sc_phi", &ele_sc_phi,"ele_sc_phi/F");
1077  vbtfPresele_tree->Branch("ele_sc_rho", &ele_sc_rho,"ele_sc_rho/F");
1078  vbtfPresele_tree->Branch("ele_cand_et", &ele_cand_et, "ele_cand_et/F");
1079  vbtfPresele_tree->Branch("ele_cand_eta", &ele_cand_eta,"ele_cand_eta/F");
1080  vbtfPresele_tree->Branch("ele_cand_phi",&ele_cand_phi,"ele_cand_phi/F");
1081  vbtfPresele_tree->Branch("ele_iso_track",&ele_iso_track,"ele_iso_track/F");
1082  vbtfPresele_tree->Branch("ele_iso_ecal",&ele_iso_ecal,"ele_iso_ecal/F");
1083  vbtfPresele_tree->Branch("ele_iso_hcal",&ele_iso_hcal,"ele_iso_hcal/F");
1084  vbtfPresele_tree->Branch("ele_id_sihih",&ele_id_sihih,"ele_id_sihih/F");
1085  vbtfPresele_tree->Branch("ele_id_deta",&ele_id_deta,"ele_id_deta/F");
1086  vbtfPresele_tree->Branch("ele_id_dphi",&ele_id_dphi,"ele_id_dphi/F");
1087  vbtfPresele_tree->Branch("ele_id_hoe",&ele_id_hoe,"ele_id_hoe/F");
1088  vbtfPresele_tree->Branch("ele_cr_mhitsinner",&ele_cr_mhitsinner,"ele_cr_mhitsinner/I");
1089  vbtfPresele_tree->Branch("ele_cr_dcot",&ele_cr_dcot,"ele_cr_dcot/F");
1090  vbtfPresele_tree->Branch("ele_cr_dist",&ele_cr_dist,"ele_cr_dist/F");
1091  vbtfPresele_tree->Branch("ele_vx",&ele_vx,"ele_vx/F");
1092  vbtfPresele_tree->Branch("ele_vy",&ele_vy,"ele_vy/F");
1093  vbtfPresele_tree->Branch("ele_vz",&ele_vz,"ele_vz/F");
1094  vbtfPresele_tree->Branch("pv_x",&pv_x,"pv_x/F");
1095  vbtfPresele_tree->Branch("pv_y",&pv_y,"pv_y/F");
1096  vbtfPresele_tree->Branch("pv_z",&pv_z,"pv_z/F");
1097  vbtfPresele_tree->Branch("ele_gsfCharge",&ele_gsfCharge,"ele_gsfCharge/I");
1098  vbtfPresele_tree->Branch("ele_ctfCharge",&ele_ctfCharge,"ele_ctfCharge/I");
1099  vbtfPresele_tree->Branch("ele_scPixCharge",&ele_scPixCharge,"ele_scPixCharge/I");
1100  vbtfPresele_tree->Branch("ele_eop",&ele_eop,"ele_eop/F");
1101  vbtfPresele_tree->Branch("ele_tip_bs",&ele_tip_bs,"ele_tip_bs/F");
1102  vbtfPresele_tree->Branch("ele_tip_pv",&ele_tip_pv,"ele_tip_pv/F");
1103  vbtfPresele_tree->Branch("ele_pin",&ele_pin,"ele_pin/F");
1104  vbtfPresele_tree->Branch("ele_pout",&ele_pout,"ele_pout/F");
1105  vbtfPresele_tree->Branch("event_caloMET",&event_caloMET,"event_caloMET/F");
1106  vbtfPresele_tree->Branch("event_pfMET",&event_pfMET,"event_pfMET/F");
1107  vbtfPresele_tree->Branch("event_tcMET",&event_tcMET,"event_tcMET/F");
1108  vbtfPresele_tree->Branch("event_caloMT",&event_caloMT,"event_caloMT/F");
1109  vbtfPresele_tree->Branch("event_pfMT",&event_pfMT,"event_pfMT/F");
1110  vbtfPresele_tree->Branch("event_tcMT",&event_tcMT,"event_tcMT/F");
1111  vbtfPresele_tree->Branch("event_caloMET_phi",&event_caloMET_phi,"event_caloMET_phi/F");
1112  vbtfPresele_tree->Branch("event_pfMET_phi",&event_pfMET_phi,"event_pfMET_phi/F");
1113  vbtfPresele_tree->Branch("event_tcMET_phi",&event_tcMET_phi,"event_tcMET_phi/F");
1114  vbtfPresele_tree->Branch("event_caloSumEt",&event_caloSumEt,"event_caloSumEt/F");
1115  vbtfPresele_tree->Branch("event_pfSumEt",&event_pfSumEt,"event_pfSumEt/F");
1116  vbtfPresele_tree->Branch("event_tcSumEt",&event_tcSumEt,"event_tcSumEt/F");
1117  // the extra jet variables:
1119  vbtfPresele_tree->Branch("calojet_et",calojet_et,"calojet_et[5]/F");
1120  vbtfPresele_tree->Branch("calojet_eta",calojet_eta,"calojet_eta[5]/F");
1121  vbtfPresele_tree->Branch("calojet_phi",calojet_phi,"calojet_phi[5]/F");
1122  vbtfPresele_tree->Branch("pfjet_et",pfjet_et,"pfjet_et[5]/F");
1123  vbtfPresele_tree->Branch("pfjet_eta",pfjet_eta,"pfjet_eta[5]/F");
1124  vbtfPresele_tree->Branch("pfjet_phi",pfjet_phi,"pfjet_phi[5]/F");
1125  }
1126  if (storeExtraInformation_) {
1127  vbtfPresele_tree->Branch("ele2nd_sc_gsf_et",&ele2nd_sc_gsf_et,"ele2nd_sc_gsf_et/F");
1128  vbtfPresele_tree->Branch("ele2nd_sc_eta",&ele2nd_sc_eta,"ele2nd_sc_eta/F");
1129  vbtfPresele_tree->Branch("ele2nd_sc_phi",&ele2nd_sc_phi,"ele2nd_sc_phi/F");
1130  vbtfPresele_tree->Branch("ele2nd_sc_rho",&ele2nd_sc_rho,"ele2nd_sc_rho/F");
1131  vbtfPresele_tree->Branch("ele2nd_cand_eta",&ele2nd_cand_eta,"ele2nd_cand_eta/F");
1132  vbtfPresele_tree->Branch("ele2nd_cand_phi",&ele2nd_cand_phi,"ele2nd_cand_phi/F");
1133  vbtfPresele_tree->Branch("ele2nd_pin",&ele2nd_pin,"ele2nd_pin/F");
1134  vbtfPresele_tree->Branch("ele2nd_pout",&ele2nd_pout,"ele2nd_pout/F");
1135  vbtfPresele_tree->Branch("ele2nd_ecalDriven",&ele2nd_ecalDriven,"ele2nd_ecalDriven/I");
1136  vbtfPresele_tree->Branch("ele2nd_passes_selection",&ele2nd_passes_selection,"ele2nd_passes_selection/I");
1137  vbtfPresele_tree->Branch("ele_hltmatched_dr",&ele_hltmatched_dr,"ele_hltmatched_dr/F");
1138  vbtfPresele_tree->Branch("event_triggerDecision",&event_triggerDecision,"event_triggerDecision/I");
1139  vbtfPresele_tree->Branch("VtxTracksSize",&VtxTracksSize);
1140  vbtfPresele_tree->Branch("VtxNormalizedChi2",&VtxNormalizedChi2);
1141  vbtfPresele_tree->Branch("VtxTracksSizeBS",&VtxTracksSizeBS);
1142  vbtfPresele_tree->Branch("VtxNormalizedChi2BS",&VtxNormalizedChi2BS);
1143  }
1145  vbtfPresele_tree->Branch("ele2nd_cand_et",&ele2nd_cand_et,"ele2nd_cand_et/F");
1146  vbtfPresele_tree->Branch("ele2nd_iso_track",&ele2nd_iso_track ,"ele2nd_iso_track /F");
1147  vbtfPresele_tree->Branch("ele2nd_iso_ecal",&ele2nd_iso_ecal,"ele2nd_iso_ecal/F");
1148  vbtfPresele_tree->Branch("ele2nd_iso_hcal",&ele2nd_iso_hcal,"ele2nd_iso_hcal/F");
1149  vbtfPresele_tree->Branch("ele2nd_id_sihih",&ele2nd_id_sihih,"ele2nd_id_sihih/F");
1150  vbtfPresele_tree->Branch("ele2nd_id_deta",&ele2nd_id_deta,"ele2nd_id_deta/F");
1151  vbtfPresele_tree->Branch("ele2nd_id_dphi",&ele2nd_id_dphi,"ele2nd_id_dphi/F");
1152  vbtfPresele_tree->Branch("ele2nd_id_hoe",&ele2nd_id_hoe,"ele2nd_id_hoe/F");
1153  vbtfPresele_tree->Branch("ele2nd_cr_mhitsinner",&ele2nd_cr_mhitsinner,"ele2nd_cr_mhitsinner/I");
1154  vbtfPresele_tree->Branch("ele2nd_cr_dcot",&ele2nd_cr_dcot,"ele2nd_cr_dcot/F");
1155  vbtfPresele_tree->Branch("ele2nd_cr_dist",&ele2nd_cr_dist ,"ele2nd_cr_dist/F");
1156  vbtfPresele_tree->Branch("ele2nd_vx",&ele2nd_vx,"ele2nd_vx/F");
1157  vbtfPresele_tree->Branch("ele2nd_vy",&ele2nd_vy,"ele2nd_vy/F");
1158  vbtfPresele_tree->Branch("ele2nd_vz",&ele2nd_vz,"ele2nd_vz/F");
1159 
1160  vbtfPresele_tree->Branch("ele2nd_gsfCharge",&ele2nd_gsfCharge,"ele2nd_gsfCharge/I");
1161  vbtfPresele_tree->Branch("ele2nd_ctfCharge",&ele2nd_ctfCharge,"ele2nd_ctfCharge/I");
1162  vbtfPresele_tree->Branch("ele2nd_scPixCharge",&ele2nd_scPixCharge,"ele2nd_scPixCharge/I");
1163  vbtfPresele_tree->Branch("ele2nd_eop",&ele2nd_eop,"ele2nd_eop/F");
1164  vbtfPresele_tree->Branch("ele2nd_tip_bs",&ele2nd_tip_bs,"ele2nd_tip_bs/F");
1165  vbtfPresele_tree->Branch("ele2nd_tip_pv",&ele2nd_tip_pv,"ele2nd_tip_pv/F");
1166  vbtfPresele_tree->Branch("ele2nd_hltmatched_dr",&ele2nd_hltmatched_dr,"ele2nd_hltmatched_dr/F");
1167  }
1168  vbtfPresele_tree->Branch("event_datasetTag",&event_datasetTag,"event_dataSetTag/I");
1169 
1170  //
1171  // _________________________________________________________________________
1172  //
1173  //
1174  //
1175 
1176 
1177 }
1178 
1179 // ------------ method called once each job just after ending the event loop -
1180 void
1182  TFile * newfile = new TFile(TString(outputFile_),"RECREATE");
1183  //
1184  // for consistency all the plots are in the root file
1185  // even though they may be empty (in the case when
1186  // usePrecalcID_== true inverted and N-1 are empty)
1187  h_met->Write();
1188  h_met_inverse->Write();
1189  h_mt->Write();
1190  h_mt_inverse->Write();
1191 
1192  h_met_EB->Write();
1193  h_met_inverse_EB->Write();
1194  h_mt_EB->Write();
1195  h_mt_inverse_EB->Write();
1196 
1197  h_met_EE->Write();
1198  h_met_inverse_EE->Write();
1199  h_mt_EE->Write();
1200  h_mt_inverse_EE->Write();
1201 
1202  h_scEt->Write();
1203  h_scEta->Write();
1204  h_scPhi->Write();
1205 
1206  h_EB_trkiso->Write();
1207  h_EB_ecaliso->Write();
1208  h_EB_hcaliso->Write();
1209  h_EB_sIetaIeta->Write();
1210  h_EB_dphi->Write();
1211  h_EB_deta->Write();
1212  h_EB_HoE->Write();
1213 
1214  h_EE_trkiso->Write();
1215  h_EE_ecaliso->Write();
1216  h_EE_hcaliso->Write();
1217  h_EE_sIetaIeta->Write();
1218  h_EE_dphi->Write();
1219  h_EE_deta->Write();
1220  h_EE_HoE->Write();
1221 
1222  //
1223  h_trackIso_eb_NmOne->Write();
1224  h_trackIso_ee_NmOne->Write();
1225  //
1226  newfile->Close();
1227  //
1228  // write the VBTF trees
1229  //
1230  WENU_VBTFpreseleFile_->Write();
1231  WENU_VBTFpreseleFile_->Close();
1232  WENU_VBTFselectionFile_->Write();
1233  WENU_VBTFselectionFile_->Close();
1234 
1235 }
1236 
1237 
1238 //define this as a plug-in
Float_t ele_vy
Definition: WenuPlots.h:196
TH1F * h_mt_inverse_EE
Definition: WenuPlots.h:88
Analysis-level particle class.
Analysis-level MET class.
Definition: MET.h:42
Float_t ele2nd_cr_dcot
Definition: WenuPlots.h:240
Double_t trackIsoUser_EB_
Definition: WenuPlots.h:141
T getUntrackedParameter(std::string const &, T const &) const
Int_t ele2nd_ctfCharge
Definition: WenuPlots.h:242
Float_t ele2nd_id_deta
Definition: WenuPlots.h:239
virtual double et() const GCC11_FINAL
transverse energy
int i
Definition: DBlmapReader.cc:9
Float_t ele2nd_sc_gsf_et
Definition: WenuPlots.h:211
Int_t maxNumberOfExpectedMissingHits_
Definition: WenuPlots.h:61
Double_t cIso_EE_
Definition: WenuPlots.h:137
Double_t trackIso_EB_
Definition: WenuPlots.h:117
Bool_t PassPreselectionCriteria(const pat::Electron *ele)
Definition: WenuPlots.cc:819
Float_t ele_iso_ecal
Definition: WenuPlots.h:192
std::string WENU_VBTFselectionFileName_
Definition: WenuPlots.h:229
tuple met
____________________________________________________________________________||
Definition: CaloMET_cfi.py:7
TH1F * h_met_inverse_EB
Definition: WenuPlots.h:81
Bool_t hcalIso_EE_inv
Definition: WenuPlots.h:154
edm::InputTag wenuCollectionTag_
Definition: WenuPlots.h:64
Bool_t deta_EE_inv
Definition: WenuPlots.h:165
const LorentzVector & p4(P4Kind kind) const
Definition: GsfElectron.cc:204
float eSuperClusterOverP() const
Definition: GsfElectron.h:230
reco::TrackRef closestCtfTrackRef() const
override the reco::GsfElectron::closestCtfTrackRef method, to access the internal storage of the trac...
Definition: Electron.cc:206
Float_t event_caloMET
Definition: WenuPlots.h:201
Float_t ele_iso_hcal
Definition: WenuPlots.h:192
Float_t ele2nd_tip_bs
Definition: WenuPlots.h:243
Float_t ele2nd_id_hoe
Definition: WenuPlots.h:239
Double_t eop_EE_
Definition: WenuPlots.h:139
Float_t ele_eop
Definition: WenuPlots.h:200
Bool_t ecalIso_EB_inv
Definition: WenuPlots.h:149
TH1F * h_EE_trkiso
Definition: WenuPlots.h:103
Double_t trackIsoUser_EE_
Definition: WenuPlots.h:144
Int_t nBarrelVars_
Definition: WenuPlots.h:180
Float_t pfjet_eta[5]
Definition: WenuPlots.h:209
Float_t ele2nd_eop
Definition: WenuPlots.h:243
TH1F * h_EB_HoE
Definition: WenuPlots.h:101
TH1F * h_met_EB
Definition: WenuPlots.h:80
Float_t pvbs_z
Definition: WenuPlots.h:249
Int_t lumiSection
Definition: WenuPlots.h:187
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
Float_t event_tcMET_phi
Definition: WenuPlots.h:203
Int_t ele2nd_passes_selection
Definition: WenuPlots.h:219
TH1F * h_mt
Definition: WenuPlots.h:77
Float_t ele_vz
Definition: WenuPlots.h:196
Double_t cIso_EB_
Definition: WenuPlots.h:129
Float_t ele_pout
Definition: WenuPlots.h:197
reco::SuperClusterRef superCluster() const
override the reco::GsfElectron::superCluster method, to access the internal storage of the superclust...
Definition: Electron.cc:152
Float_t ele_sc_rho
Definition: WenuPlots.h:189
Int_t ele2nd_scPixCharge
Definition: WenuPlots.h:242
Bool_t tip_bspot_EE_inv
Definition: WenuPlots.h:169
Float_t event_caloMET_phi
Definition: WenuPlots.h:203
Float_t ele_id_dphi
Definition: WenuPlots.h:193
TH1F * h_trackIso_ee_NmOne
Definition: WenuPlots.h:113
Bool_t tip_bspot_EB_inv
Definition: WenuPlots.h:161
math::XYZVectorF trackMomentumAtVtx() const
Definition: GsfElectron.h:273
Float_t ele_cr_dist
Definition: WenuPlots.h:194
std::string WENU_VBTFpreseleFileName_
Definition: WenuPlots.h:230
WenuPlots(const edm::ParameterSet &)
Definition: WenuPlots.cc:61
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
Bool_t CheckCutInv(const pat::Electron *wenu, Int_t i)
Definition: WenuPlots.cc:778
TH1F * h_scPhi
Definition: WenuPlots.h:93
Int_t ele2nd_ecalDriven
Definition: WenuPlots.h:220
Double_t ecalIsoUser_EB_
Definition: WenuPlots.h:142
Int_t ele_gsfCharge
Definition: WenuPlots.h:199
reco::GsfTrackRef gsfTrack() const
override the reco::GsfElectron::gsfTrack method, to access the internal storage of the supercluster ...
Definition: Electron.cc:133
Float_t calojet_eta[5]
Definition: WenuPlots.h:206
Bool_t includeJetInformationInNtuples_
Definition: WenuPlots.h:231
Int_t runNumber
Definition: WenuPlots.h:187
Double_t dphi_EE_
Definition: WenuPlots.h:135
Bool_t sihih_EE_inv
Definition: WenuPlots.h:164
TTree * vbtfSele_tree
Definition: WenuPlots.h:227
TH1F * h_EB_trkiso
Definition: WenuPlots.h:95
Float_t ele2nd_pout
Definition: WenuPlots.h:218
Bool_t dphi_EE_inv
Definition: WenuPlots.h:166
Bool_t hcalIsoUser_EE_inv
Definition: WenuPlots.h:177
Float_t pv_x
Definition: WenuPlots.h:198
Bool_t usePreselection_
Definition: WenuPlots.h:62
Float_t ele2nd_vy
Definition: WenuPlots.h:241
Float_t event_caloSumEt
Definition: WenuPlots.h:202
Double_t tip_bspot_EB_
Definition: WenuPlots.h:130
Float_t ele2nd_sc_eta
Definition: WenuPlots.h:212
Bool_t CheckCutsInverse(const pat::Electron *ele)
Definition: WenuPlots.cc:752
Float_t ele2nd_sc_phi
Definition: WenuPlots.h:213
Bool_t ecalIso_EE_inv
Definition: WenuPlots.h:153
float convDist() const
Definition: GsfElectron.h:505
Bool_t CheckCuts(const pat::Electron *ele)
Definition: WenuPlots.cc:723
std::vector< Double_t > CutVars_
Definition: WenuPlots.h:182
Float_t ele_sc_eta
Definition: WenuPlots.h:189
virtual double vy() const
y coordinate of vertex position
Double_t deta_EE_
Definition: WenuPlots.h:134
TH1F * h_EE_sIetaIeta
Definition: WenuPlots.h:106
Float_t ele2nd_vx
Definition: WenuPlots.h:241
Float_t ele2nd_id_sihih
Definition: WenuPlots.h:239
Float_t event_pfMET
Definition: WenuPlots.h:201
float float float z
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
bool isEB() const
Definition: GsfElectron.h:334
Bool_t useExpectedMissingHits_
Definition: WenuPlots.h:60
float userFloat(const std::string &key) const
Definition: PATObject.h:755
TH1F * h_EB_sIetaIeta
Definition: WenuPlots.h:98
Int_t DatasetTag_
Definition: WenuPlots.h:234
Float_t ele2nd_cand_phi
Definition: WenuPlots.h:216
Double_t hcalIso_EB_
Definition: WenuPlots.h:119
std::string usePrecalcIDSign_
Definition: WenuPlots.h:54
Float_t pv_y
Definition: WenuPlots.h:198
Float_t ele_sc_phi
Definition: WenuPlots.h:189
Double_t trackIso_EE_
Definition: WenuPlots.h:121
float convDcot() const
Definition: GsfElectron.h:506
TH1F * h_met_EE
Definition: WenuPlots.h:85
Double_t deta_EB_
Definition: WenuPlots.h:126
TH1F * h_met
Definition: WenuPlots.h:75
TH1F * h_EB_ecaliso
Definition: WenuPlots.h:96
bool hasUserInt(const std::string &key) const
Return true if there is a user-defined int with a given name.
Definition: PATObject.h:339
Float_t ele_id_deta
Definition: WenuPlots.h:193
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
TH1F * h_scEt
Definition: WenuPlots.h:91
Double_t hcalIsoUser_EB_
Definition: WenuPlots.h:143
Double_t hcalIso_EE_
Definition: WenuPlots.h:123
tuple newfile
Definition: runonSM.py:48
Float_t ele2nd_cand_et
Definition: WenuPlots.h:237
Float_t ele_cand_et
Definition: WenuPlots.h:191
Bool_t deta_EB_inv
Definition: WenuPlots.h:157
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
TFile * WENU_VBTFselectionFile_
Definition: WenuPlots.h:226
Bool_t hcalIsoUser_EB_inv
Definition: WenuPlots.h:174
Double_t sihih_EE_
Definition: WenuPlots.h:133
virtual void beginJob()
Definition: WenuPlots.cc:861
float deltaEtaSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:234
int iEvent
Definition: GenABIO.cc:243
TH1F * h_EE_ecaliso
Definition: WenuPlots.h:104
TH1F * h_EB_hcaliso
Definition: WenuPlots.h:97
float sigmaIetaIeta() const
Definition: GsfElectron.h:386
Float_t ele2nd_pin
Definition: WenuPlots.h:217
float hadronicOverEm() const
Definition: GsfElectron.h:410
TH1F * h_met_inverse
Definition: WenuPlots.h:76
Float_t ele2nd_tip_pvbs
Definition: WenuPlots.h:250
Bool_t ecalIsoUser_EE_inv
Definition: WenuPlots.h:176
Int_t event_triggerDecision
Definition: WenuPlots.h:222
Float_t ele2nd_hltmatched_dr
Definition: WenuPlots.h:244
const T & max(const T &a, const T &b)
Bool_t eop_EE_inv
Definition: WenuPlots.h:170
edm::InputTag PrimaryVerticesCollectionBS_
Definition: WenuPlots.h:68
Float_t pvbs_x
Definition: WenuPlots.h:249
T sqrt(T t)
Definition: SSEVec.h:48
Float_t ele2nd_sc_rho
Definition: WenuPlots.h:214
Double_t ecalIso_EB_
Definition: WenuPlots.h:118
Float_t ele2nd_cand_eta
Definition: WenuPlots.h:215
math::XYZVectorF trackMomentumOut() const
Definition: GsfElectron.h:275
float deltaPhiSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:237
Float_t ele_hltmatched_dr
Definition: WenuPlots.h:221
Float_t ele_vx
Definition: WenuPlots.h:196
Double_t eop_EB_
Definition: WenuPlots.h:131
TH1F * h_met_inverse_EE
Definition: WenuPlots.h:86
TH1F * h_mt_inverse
Definition: WenuPlots.h:78
Double_t usePrecalcIDValue_
Definition: WenuPlots.h:56
TH1F * h_EE_dphi
Definition: WenuPlots.h:107
Double_t hcalIsoUser_EE_
Definition: WenuPlots.h:146
Bool_t trackIso_EE_inv
Definition: WenuPlots.h:152
Float_t ele_tip_pvbs
Definition: WenuPlots.h:250
RunNumber_t run() const
Definition: Event.h:88
float dr03TkSumPt() const
Definition: GsfElectron.h:443
edm::InputTag caloJetCollectionTag_
Definition: WenuPlots.h:65
Float_t ele_id_hoe
Definition: WenuPlots.h:193
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
Int_t ele_scPixCharge
Definition: WenuPlots.h:199
std::vector< Int_t > VtxTracksSizeBS
Definition: WenuPlots.h:247
Bool_t eop_EB_inv
Definition: WenuPlots.h:162
Bool_t storeAllSecondElectronVariables_
Definition: WenuPlots.h:236
Bool_t useConversionRejection_
Definition: WenuPlots.h:59
Float_t calojet_phi[5]
Definition: WenuPlots.h:207
std::vector< Int_t > VtxTracksSize
Definition: WenuPlots.h:245
Double_t ReturnCandVar(const pat::Electron *ele, Int_t i)
Definition: WenuPlots.cc:792
TH1F * h_EB_deta
Definition: WenuPlots.h:100
Float_t ele_tip_pv
Definition: WenuPlots.h:200
TFile * WENU_VBTFpreseleFile_
Definition: WenuPlots.h:225
bool isValid() const
Definition: HandleBase.h:76
virtual double vz() const
z coordinate of vertex position
float scSigmaIEtaIEta() const
Definition: GsfElectron.h:406
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
TH1F * h_scEta
Definition: WenuPlots.h:92
Float_t ele2nd_iso_hcal
Definition: WenuPlots.h:238
Float_t pfjet_phi[5]
Definition: WenuPlots.h:210
Float_t ele_iso_track
Definition: WenuPlots.h:192
Int_t ele2nd_gsfCharge
Definition: WenuPlots.h:242
TTree * vbtfPresele_tree
Definition: WenuPlots.h:228
Int_t event_datasetTag
Definition: WenuPlots.h:223
Float_t ele_pin
Definition: WenuPlots.h:197
TH1F * h_EB_dphi
Definition: WenuPlots.h:99
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
Float_t event_tcSumEt
Definition: WenuPlots.h:202
Int_t ele_cr_mhitsinner
Definition: WenuPlots.h:195
TH1F * h_trackIso_eb_NmOne
Definition: WenuPlots.h:112
EventAuxiliary const & eventAuxiliary() const
Definition: Event.h:72
Float_t pv_z
Definition: WenuPlots.h:198
Bool_t sihih_EB_inv
Definition: WenuPlots.h:156
const ChargeInfo & chargeInfo() const
Definition: GsfElectron.h:142
Float_t ele2nd_iso_track
Definition: WenuPlots.h:238
float electronID(const std::string &name) const
Returns a specific electron ID associated to the pat::Electron given its name.
Definition: Electron.cc:344
Bool_t CheckCutsNminusOne(const pat::Electron *ele, Int_t jj)
Definition: WenuPlots.cc:761
float userIsolation(IsolationKeys key) const
Definition: Lepton.h:49
std::vector< CompositeCandidate > CompositeCandidateCollection
edm::InputTag PrimaryVerticesCollection_
Definition: WenuPlots.h:67
Float_t ele_cand_eta
Definition: WenuPlots.h:191
Bool_t cIso_EB_inv
Definition: WenuPlots.h:160
Bool_t trackIsoUser_EE_inv
Definition: WenuPlots.h:175
Float_t pfjet_et[5]
Definition: WenuPlots.h:208
Bool_t hcalIso_EB_inv
Definition: WenuPlots.h:150
int32_t userInt(const std::string &key) const
Definition: PATObject.h:774
Bool_t storeExtraInformation_
Definition: WenuPlots.h:232
Bool_t hoe_EE_inv
Definition: WenuPlots.h:167
Float_t ele2nd_vz
Definition: WenuPlots.h:241
Int_t ele_ctfCharge
Definition: WenuPlots.h:199
Analysis-level electron class.
Definition: Electron.h:52
Float_t event_pfMT
Definition: WenuPlots.h:204
virtual void endJob()
Definition: WenuPlots.cc:1181
Float_t event_tcMT
Definition: WenuPlots.h:204
T const * product() const
Definition: Handle.h:81
float dr03EcalRecHitSumEt() const
Definition: GsfElectron.h:444
Bool_t useValidFirstPXBHit_
Definition: WenuPlots.h:58
bool isElectronIDAvailable(const std::string &name) const
Returns true if a specific ID is available in this pat::Electron.
Definition: Electron.cc:359
edm::InputTag pfJetCollectionTag_
Definition: WenuPlots.h:66
std::string usePrecalcIDType_
Definition: WenuPlots.h:55
Float_t ele_cand_phi
Definition: WenuPlots.h:191
Bool_t ecalIsoUser_EB_inv
Definition: WenuPlots.h:173
std::vector< PFJet > PFJetCollection
collection of PFJet objects
TH1F * h_EE_deta
Definition: WenuPlots.h:108
TH1F * h_mt_inverse_EB
Definition: WenuPlots.h:83
Double_t DRJetFromElectron_
Definition: WenuPlots.h:233
const IsolationVariables & dr03IsolationVariables() const
Definition: GsfElectron.h:451
Float_t ele2nd_tip_pv
Definition: WenuPlots.h:243
Float_t ele2nd_cr_dist
Definition: WenuPlots.h:240
static std::atomic< unsigned int > counter
Float_t event_tcMET
Definition: WenuPlots.h:201
Float_t event_pfMET_phi
Definition: WenuPlots.h:203
Float_t pvbs_y
Definition: WenuPlots.h:249
Bool_t cIso_EE_inv
Definition: WenuPlots.h:168
Float_t event_caloMT
Definition: WenuPlots.h:204
std::string outputFile_
Definition: WenuPlots.h:63
TH1F * h_mt_EB
Definition: WenuPlots.h:82
virtual double vx() const
x coordinate of vertex position
float dr03HcalTowerSumEt() const
Definition: GsfElectron.h:447
Float_t ele2nd_id_dphi
Definition: WenuPlots.h:239
Bool_t dphi_EB_inv
Definition: WenuPlots.h:158
tuple cout
Definition: gather_cfg.py:121
Float_t calojet_et[5]
Definition: WenuPlots.h:205
Double_t hoe_EB_
Definition: WenuPlots.h:128
Float_t ele_id_sihih
Definition: WenuPlots.h:193
Bool_t trackIsoUser_EB_inv
Definition: WenuPlots.h:172
Float_t ele_tip_bs
Definition: WenuPlots.h:200
std::vector< Float_t > VtxNormalizedChi2BS
Definition: WenuPlots.h:248
TH1F * h_mt_EE
Definition: WenuPlots.h:87
virtual void analyze(const edm::Event &, const edm::EventSetup &)
Definition: WenuPlots.cc:205
Definition: DDAxes.h:10
Int_t ele2nd_cr_mhitsinner
Definition: WenuPlots.h:242
Double_t tip_bspot_EE_
Definition: WenuPlots.h:138
Double_t dphi_EB_
Definition: WenuPlots.h:127
Double_t sihih_EB_
Definition: WenuPlots.h:125
Float_t ele2nd_iso_ecal
Definition: WenuPlots.h:238
std::vector< Bool_t > InvVars_
Definition: WenuPlots.h:183
tuple pfJets
Definition: pfJets_cff.py:8
Float_t ele_cr_dcot
Definition: WenuPlots.h:194
Bool_t trackIso_EB_inv
Definition: WenuPlots.h:148
Double_t ecalIsoUser_EE_
Definition: WenuPlots.h:145
Float_t ele_sc_energy
Definition: WenuPlots.h:189
Double_t ecalIso_EE_
Definition: WenuPlots.h:122
EventNumber_t event() const
double dB(IpType type=None) const
Impact parameter wrt primary vertex or beamspot.
Definition: Electron.cc:414
TH1F * h_EE_HoE
Definition: WenuPlots.h:109
Float_t ele_sc_gsf_et
Definition: WenuPlots.h:190
Bool_t usePrecalcID_
Definition: WenuPlots.h:53
TH1F * h_EE_hcaliso
Definition: WenuPlots.h:105
Float_t event_pfSumEt
Definition: WenuPlots.h:202
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects
Bool_t hoe_EB_inv
Definition: WenuPlots.h:159
Double_t hoe_EE_
Definition: WenuPlots.h:136
bool ecalDrivenSeed() const
Definition: GsfElectron.h:173
std::vector< Float_t > VtxNormalizedChi2
Definition: WenuPlots.h:246
Long64_t eventNumber
Definition: WenuPlots.h:188
Bool_t CheckCut(const pat::Electron *wenu, Int_t i)
Definition: WenuPlots.cc:770