CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DiElectronVertexValidation.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Alignment/OfflineValidation
4 // Class: DiElectronVertexValidation
5 //
13 //
14 // Original Author: Marco Musich
15 // Created: Thu, 13 May 2021 10:24:07 GMT
16 //
17 //
18 
19 // system include files
20 #include <memory>
21 
22 // user include files
25 
28 
31 
32 // electrons
38 
39 // tracks
46 
47 // vertices
50 
51 // TFileService
54 
55 // utilities
58 
59 // ROOT
60 #include "TLorentzVector.h"
61 #include "TH1F.h"
62 #include "TH2F.h"
63 
64 //
65 // class declaration
66 //
67 class DiElectronVertexValidation : public edm::one::EDAnalyzer<edm::one::SharedResources> {
68 public:
70  ~DiElectronVertexValidation() override;
71 
72  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
73 
74 private:
75  void beginJob() override;
76  void analyze(const edm::Event&, const edm::EventSetup&) override;
77  void endJob() override;
79 
80  // ----------member data ---------------------------
82  std::vector<double> pTthresholds_;
83  float maxSVdist_;
84 
85  // plot configurations
86 
95 
98  electronsToken_; //used to select what electrons to read from configuration
100  gsfTracksToken_; //used to select what tracks to read from configuration file
101  edm::EDGetTokenT<reco::VertexCollection> vertexToken_; //used to select what vertices to read from configuration file
102 
103  TH1F* hSVProb_;
104  TH1F* hSVDist_;
105  TH1F* hGSFMult_;
107  TH1F* hGSF0Pt_;
108  TH1F* hGSF0Eta_;
109  TH1F* hGSF1Pt_;
110  TH1F* hGSF1Eta_;
111  TH1F* hSVDistSig_;
112  TH1F* hSVDist3D_;
114  TH1F* hCosPhi_;
115  TH1F* hCosPhi3D_;
117  TH1F* hInvMass_;
119  TH1F* hCutFlow_;
120 
121  // 2D maps
122 
131 };
132 
133 //
134 // constants, enums and typedefs
135 //
136 
137 static constexpr float cmToum = 10e4;
138 static constexpr float emass2 = 0.0005109990615 * 0.0005109990615; //electron mass squared (GeV^2/c^4)
139 
140 //
141 // constructors and destructor
142 //
144  : pTthresholds_(iConfig.getParameter<std::vector<double>>("pTThresholds")),
145  maxSVdist_(iConfig.getParameter<double>("maxSVdist")),
146  CosPhiConfiguration_(iConfig.getParameter<edm::ParameterSet>("CosPhiConfig")),
147  CosPhi3DConfiguration_(iConfig.getParameter<edm::ParameterSet>("CosPhi3DConfig")),
148  VtxProbConfiguration_(iConfig.getParameter<edm::ParameterSet>("VtxProbConfig")),
149  VtxDistConfiguration_(iConfig.getParameter<edm::ParameterSet>("VtxDistConfig")),
150  VtxDist3DConfiguration_(iConfig.getParameter<edm::ParameterSet>("VtxDist3DConfig")),
151  VtxDistSigConfiguration_(iConfig.getParameter<edm::ParameterSet>("VtxDistSigConfig")),
152  VtxDist3DSigConfiguration_(iConfig.getParameter<edm::ParameterSet>("VtxDist3DSigConfig")),
153  DiMuMassConfiguration_(iConfig.getParameter<edm::ParameterSet>("DiMuMassConfig")),
154  ttbESToken_(esConsumes(edm::ESInputTag("", "TransientTrackBuilder"))),
155  electronsToken_(consumes<reco::GsfElectronCollection>(iConfig.getParameter<edm::InputTag>("electrons"))),
156  gsfTracksToken_(consumes<reco::GsfTrackCollection>(iConfig.getParameter<edm::InputTag>("gsfTracks"))),
157  vertexToken_(consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("vertices"))) {
158  usesResource(TFileService::kSharedResource);
159 
160  // sort the vector of thresholds
161  std::sort(pTthresholds_.begin(), pTthresholds_.end(), [](const double& lhs, const double& rhs) { return lhs > rhs; });
162 
163  edm::LogInfo("DiElectronVertexValidation") << __FUNCTION__;
164  for (const auto& thr : pTthresholds_) {
165  edm::LogInfo("DiElectronVertexValidation") << " Threshold: " << thr << " ";
166  }
167  edm::LogInfo("DiElectronVertexValidation") << "Max SV distance: " << maxSVdist_ << " ";
168 }
169 
171 
172 //
173 // member functions
174 //
175 
176 // ------------ method called for each event ------------
178  using namespace edm;
179 
181 
182  std::vector<const reco::GsfElectron*> myGoodGsfElectrons;
183 
184  int totGsfCounter = 0;
185  for (const auto& gsfEle : iEvent.get(electronsToken_)) {
186  totGsfCounter++;
187  if (gsfEle.pt() > pTthresholds_[1] && passLooseSelection(gsfEle)) {
188  myGoodGsfElectrons.emplace_back(&gsfEle);
189  }
190  }
191 
192  hGSFMult_->Fill(totGsfCounter);
193 
194  std::sort(myGoodGsfElectrons.begin(),
195  myGoodGsfElectrons.end(),
196  [](const reco::GsfElectron*& lhs, const reco::GsfElectron*& rhs) { return lhs->pt() > rhs->pt(); });
197 
198  hGSFMultAftPt_->Fill(myGoodGsfElectrons.size());
199 
200  // reject if there's no Z
201  if (myGoodGsfElectrons.size() < 2)
202  return;
203 
205 
206  if ((myGoodGsfElectrons[0]->pt()) < pTthresholds_[0] || (myGoodGsfElectrons[1]->pt() < pTthresholds_[1]))
207  return;
208 
210 
211  if (myGoodGsfElectrons[0]->charge() * myGoodGsfElectrons[1]->charge() > 0)
212  return;
213 
214  if (std::max(std::abs(myGoodGsfElectrons[0]->eta()), std::abs(myGoodGsfElectrons[1]->eta())) > 2.4)
215  return;
216 
218 
219  const auto& ele1 = myGoodGsfElectrons[1]->p4();
220  const auto& ele0 = myGoodGsfElectrons[0]->p4();
221  const auto& mother = ele1 + ele0;
222 
223  float invMass = mother.M();
224  hInvMass_->Fill(invMass);
225 
226  // just copy the top two muons
227  std::vector<const reco::GsfElectron*> theZElectronVector;
228  theZElectronVector.reserve(2);
229  theZElectronVector.emplace_back(myGoodGsfElectrons[1]);
230  theZElectronVector.emplace_back(myGoodGsfElectrons[0]);
231 
232  // do the matching of Z muons with inner tracks
233 
234  std::vector<const reco::GsfTrack*> myGoodGsfTracks;
235 
236  unsigned int i = 0;
237  for (const auto& electron : theZElectronVector) {
238  i++;
239  float minD = 1000.;
240  const reco::GsfTrack* theMatch = nullptr;
241  for (const auto& track : iEvent.get(gsfTracksToken_)) {
242  float D = ::deltaR(electron->gsfTrack()->eta(), electron->gsfTrack()->phi(), track.eta(), track.phi());
243  if (D < minD) {
244  minD = D;
245  theMatch = &track;
246  }
247  }
248  myGoodGsfTracks.emplace_back(theMatch);
249  }
250 
251  hGSF0Pt_->Fill(myGoodGsfTracks[0]->pt());
252  hGSF0Eta_->Fill(myGoodGsfTracks[0]->eta());
253  hGSF1Pt_->Fill(myGoodGsfTracks[1]->pt());
254  hGSF1Eta_->Fill(myGoodGsfTracks[1]->eta());
255 
256  const TransientTrackBuilder* theB = &iSetup.getData(ttbESToken_);
257  TransientVertex aTransVtx;
258  std::vector<reco::TransientTrack> tks;
259 
260  std::vector<const reco::GsfTrack*> myTracks;
261  myTracks.emplace_back(myGoodGsfTracks[0]);
262  myTracks.emplace_back(myGoodGsfTracks[1]);
263 
264  if (myTracks.size() != 2)
265  return;
266 
267  const auto& e1 = myTracks[1]->momentum();
268  const auto& e0 = myTracks[0]->momentum();
269  const auto& ditrack = e1 + e0;
270 
271  const auto& tplus = myTracks[0]->charge() > 0 ? myTracks[0] : myTracks[1];
272  const auto& tminus = myTracks[0]->charge() < 0 ? myTracks[0] : myTracks[1];
273 
274  TLorentzVector p4_tplus(tplus->px(), tplus->py(), tplus->pz(), sqrt((tplus->p() * tplus->p()) + emass2));
275  TLorentzVector p4_tminus(tminus->px(), tminus->py(), tminus->pz(), sqrt((tminus->p() * tminus->p()) + emass2));
276 
277  // creat the pair of TLorentVectors used to make the plos
278  std::pair<TLorentzVector, TLorentzVector> tktk_p4 = std::make_pair(p4_tplus, p4_tminus);
279 
280  const auto& Zp4 = p4_tplus + p4_tminus;
281  float track_invMass = Zp4.M();
282  hTrackInvMass_->Fill(track_invMass);
283 
284  // fill the z->mm mass plots
285  ZMassPlots.fillPlots(track_invMass, tktk_p4);
286 
287  math::XYZPoint ZpT(ditrack.x(), ditrack.y(), 0);
288  math::XYZPoint Zp(ditrack.x(), ditrack.y(), ditrack.z());
289 
290  for (const auto& track : myTracks) {
291  reco::TransientTrack trajectory = theB->build(track);
292  tks.push_back(trajectory);
293  }
294 
295  KalmanVertexFitter kalman(true);
296  aTransVtx = kalman.vertex(tks);
297 
298  double SVProb = TMath::Prob(aTransVtx.totalChiSquared(), (int)aTransVtx.degreesOfFreedom());
299  hSVProb_->Fill(SVProb);
300 
301  if (!aTransVtx.isValid())
302  return;
303 
305 
306  // fill the VtxProb plots
307  VtxProbPlots.fillPlots(SVProb, tktk_p4);
308 
309  // get collection of reconstructed vertices from event
311 
312  math::XYZPoint mainVtx(0, 0, 0);
313  reco::Vertex TheMainVtx; // = vertexHandle.product()->front();
314 
315  VertexDistanceXY vertTool;
316  VertexDistance3D vertTool3D;
317 
318  if (vertexHandle.isValid()) {
319  const reco::VertexCollection* vertices = vertexHandle.product();
320  float minD = 9999.;
321  int closestVtxIndex = 0;
322  int counter = 0;
323  for (const auto& vtx : *vertices) {
324  double dist3D = vertTool3D.distance(aTransVtx, vtx).value();
325  if (dist3D < minD) {
326  minD = dist3D;
327  closestVtxIndex = counter;
328  }
329  counter++;
330  }
331  if ((*vertices).at(closestVtxIndex).isValid()) {
332  hClosestVtxIndex_->Fill(closestVtxIndex);
333  TheMainVtx = (*vertices).at(closestVtxIndex);
334  mainVtx.SetXYZ(TheMainVtx.position().x(), TheMainVtx.position().y(), TheMainVtx.position().z());
335  }
336  }
337 
338  const math::XYZPoint myVertex(aTransVtx.position().x(), aTransVtx.position().y(), aTransVtx.position().z());
339  const math::XYZPoint deltaVtx(mainVtx.x() - myVertex.x(), mainVtx.y() - myVertex.y(), mainVtx.z() - myVertex.z());
340 
341  if (TheMainVtx.isValid()) {
342  // Z Vertex distance in the xy plane
343  double distance = vertTool.distance(aTransVtx, TheMainVtx).value();
344  double dist_err = vertTool.distance(aTransVtx, TheMainVtx).error();
345 
346  hSVDist_->Fill(distance * cmToum);
347  hSVDistSig_->Fill(distance / dist_err);
348 
349  // fill the VtxDist plots
350  VtxDistPlots.fillPlots(distance * cmToum, tktk_p4);
351 
352  // fill the VtxDisSig plots
353  VtxDistSigPlots.fillPlots(distance / dist_err, tktk_p4);
354 
355  // Z Vertex distance in 3D
356  double distance3D = vertTool3D.distance(aTransVtx, TheMainVtx).value();
357  double dist3D_err = vertTool3D.distance(aTransVtx, TheMainVtx).error();
358 
359  hSVDist3D_->Fill(distance3D * cmToum);
360  hSVDist3DSig_->Fill(distance3D / dist3D_err);
361 
362  // fill the VtxDist3D plots
363  VtxDist3DPlots.fillPlots(distance3D * cmToum, tktk_p4);
364 
365  // fill the VtxDisSig plots
366  VtxDist3DSigPlots.fillPlots(distance3D / dist3D_err, tktk_p4);
367 
368  // cut on the PV - SV distance
369  if (distance * cmToum < maxSVdist_) {
371 
372  double cosphi = (ZpT.x() * deltaVtx.x() + ZpT.y() * deltaVtx.y()) /
373  (sqrt(ZpT.x() * ZpT.x() + ZpT.y() * ZpT.y()) *
374  sqrt(deltaVtx.x() * deltaVtx.x() + deltaVtx.y() * deltaVtx.y()));
375 
376  double cosphi3D = (Zp.x() * deltaVtx.x() + Zp.y() * deltaVtx.y() + Zp.z() * deltaVtx.z()) /
377  (sqrt(Zp.x() * Zp.x() + Zp.y() * Zp.y() + Zp.z() * Zp.z()) *
378  sqrt(deltaVtx.x() * deltaVtx.x() + deltaVtx.y() * deltaVtx.y() + deltaVtx.z() * deltaVtx.z()));
379 
380  hCosPhi_->Fill(cosphi);
381  hCosPhi3D_->Fill(cosphi3D);
382 
383  // fill the cosphi plots
384  CosPhiPlots.fillPlots(cosphi, tktk_p4);
385 
386  // fill the VtxDisSig plots
387  CosPhi3DPlots.fillPlots(cosphi3D, tktk_p4);
388  }
389  }
390 }
391 
393  float dEtaln = fabs(el.deltaEtaSuperClusterTrackAtVtx());
394  float dPhiln = fabs(el.deltaPhiSuperClusterTrackAtVtx());
395  float sigmaletaleta = el.full5x5_sigmaIetaIeta();
396  float hem = el.hadronicOverEm();
397  double resol = fabs((1 / el.ecalEnergy()) - (el.eSuperClusterOverP() / el.ecalEnergy()));
398  double mHits = el.gsfTrack()->hitPattern().numberOfAllHits(reco::HitPattern::MISSING_INNER_HITS);
399  bool barrel = (fabs(el.superCluster()->eta()) <= 1.479);
400  bool endcap = (!barrel && fabs(el.superCluster()->eta()) < 2.5);
401 
402  // loose electron ID
403 
404  if (barrel && dEtaln < 0.00477 && dPhiln < 0.222 && sigmaletaleta < 0.011 && hem < 0.298 && resol < 0.241 &&
405  mHits <= 1)
406  return true;
407  if (endcap && dEtaln < 0.00868 && dPhiln < 0.213 && sigmaletaleta < 0.0314 && hem < 0.101 && resol < 0.14 &&
408  mHits <= 1)
409  return true;
410 
411  return false;
412 }
413 
414 // ------------ method called once each job just before starting event loop ------------
416  // please remove this method if not needed
418 
419  // clang-format off
420  TH1F::SetDefaultSumw2(kTRUE);
421 
422  hGSFMult_= fs->make<TH1F>("GSFMult", ";# gsf tracks;N. events", 20, 0., 20.);
423  hGSFMultAftPt_= fs->make<TH1F>("GSFMultAftPt", ";# gsf tracks;N. events", 20, 0., 20.);
424  hGSF0Pt_= fs->make<TH1F>("GSF0Pt", ";leading GSF track p_{T};N. GSF tracks", 100, 0., 100.);
425  hGSF0Eta_= fs->make<TH1F>("GSF0Eta", ";leading GSF track #eta;N. GSF tracks", 50, -2.5, 2.5);
426  hGSF1Pt_= fs->make<TH1F>("GSF1Pt", ";sub-leading GSF track p_{T};N. GSF tracks", 100, 0., 100.);
427  hGSF1Eta_= fs->make<TH1F>("GSF1Eta", ";sub-leading GSF track #eta;N. GSF tracks", 50, -2.5, 2.5);
428 
429  hSVProb_ = fs->make<TH1F>("VtxProb", ";ZV vertex probability;N(e^{+}e^{-} pairs)", 100, 0., 1.);
430 
431  hSVDist_ = fs->make<TH1F>("VtxDist", ";PV-ZV xy distance [#mum];N(e^{+}e^{-} pairs)", 100, 0., 1000.);
432  hSVDistSig_ = fs->make<TH1F>("VtxDistSig", ";PV-ZV xy distance signficance;N(e^{+}e^{-} pairs)", 100, 0., 5.);
433 
434  hSVDist3D_ = fs->make<TH1F>("VtxDist3D", ";PV-ZV 3D distance [#mum];N(e^{+}e^{-} pairs)", 100, 0., 1000.);
435  hSVDist3DSig_ = fs->make<TH1F>("VtxDist3DSig", ";PV-ZV 3D distance signficance;N(e^{+}e^{-} pairs)", 100, 0., 5.);
436 
437  hCosPhi_ = fs->make<TH1F>("CosPhi", ";cos(#phi_{xy});N(ee pairs)", 50, -1., 1.);
438  hCosPhi3D_ = fs->make<TH1F>("CosPhi3D", ";cos(#phi_{3D});N(ee pairs)", 50, -1., 1.);
439  hTrackInvMass_ = fs->make<TH1F>("TkTkInvMass", ";M(tk,tk) [GeV];N(tk tk pairs)", 70., 50., 120.);
440  hInvMass_ = fs->make<TH1F>("InvMass", ";M(#mu#mu) [GeV];N(#mu#mu pairs)", 70., 50., 120.);
441 
442  hClosestVtxIndex_ = fs->make<TH1I>("ClosestVtxIndex", ";closest vertex index;N(tk tk pairs)", 20, -0.5, 19.5);
443 
444  // 2D Maps
445 
446  TFileDirectory dirCosPhi = fs->mkdir("CosPhiPlots");
448 
449  TFileDirectory dirCosPhi3D = fs->mkdir("CosPhi3DPlots");
451 
452  TFileDirectory dirVtxProb = fs->mkdir("VtxProbPlots");
454 
455  TFileDirectory dirVtxDist = fs->mkdir("VtxDistPlots");
457 
458  TFileDirectory dirVtxDist3D = fs->mkdir("VtxDist3DPlots");
460 
461  TFileDirectory dirVtxDistSig = fs->mkdir("VtxDistSigPlots");
463 
464  TFileDirectory dirVtxDist3DSig = fs->mkdir("VtxDist3DSigPlots");
466 
467  TFileDirectory dirInvariantMass = fs->mkdir("InvariantMassPlots");
469 
470  // cut flow
471 
472  hCutFlow_ = fs->make<TH1F>("hCutFlow","cut flow;cut step;events left",6,-0.5,5.5);
473  std::string names[6]={"Total","Mult.",">pT","<eta","hasVtx","VtxDist"};
474  for(unsigned int i=0;i<6;i++){
475  hCutFlow_->GetXaxis()->SetBinLabel(i+1,names[i].c_str());
476  }
477 
478  myCounts.zeroAll();
479 }
480 
481 // ------------ method called once each job just after ending the event loop ------------
484 
485  hCutFlow_->SetBinContent(1,myCounts.eventsTotal);
486  hCutFlow_->SetBinContent(2,myCounts.eventsAfterMult);
487  hCutFlow_->SetBinContent(3,myCounts.eventsAfterPt);
488  hCutFlow_->SetBinContent(4,myCounts.eventsAfterEta);
489  hCutFlow_->SetBinContent(5,myCounts.eventsAfterVtx);
490  hCutFlow_->SetBinContent(6,myCounts.eventsAfterDist);
491 }
492 
493 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
496  desc.add<edm::InputTag>("gsfTracks",edm::InputTag("electronGsfTracks"));
497  desc.add<edm::InputTag>("vertices", edm::InputTag("offlinePrimaryVertices"));
498  desc.add<edm::InputTag>("electrons", edm::InputTag("gedGsfElectrons"));
499  desc.add<std::vector<double>>("pTThresholds", {25., 15.});
500  desc.add<double>("maxSVdist", 50.);
501 
502  {
503  edm::ParameterSetDescription psDiMuMass;
504  psDiMuMass.add<std::string>("name", "DiMuMass");
505  psDiMuMass.add<std::string>("title", "M(#mu#mu)");
506  psDiMuMass.add<std::string>("yUnits", "[GeV]");
507  psDiMuMass.add<int>("NxBins", 24);
508  psDiMuMass.add<int>("NyBins", 50);
509  psDiMuMass.add<double>("ymin", 70.);
510  psDiMuMass.add<double>("ymax", 120.);
511  desc.add<edm::ParameterSetDescription>("DiMuMassConfig", psDiMuMass);
512  }
513  {
515  psCosPhi.add<std::string>("name", "CosPhi");
516  psCosPhi.add<std::string>("title", "cos(#phi_{xy})");
517  psCosPhi.add<std::string>("yUnits", "");
518  psCosPhi.add<int>("NxBins", 50);
519  psCosPhi.add<int>("NyBins", 50);
520  psCosPhi.add<double>("ymin", -1.);
521  psCosPhi.add<double>("ymax", 1.);
522  desc.add<edm::ParameterSetDescription>("CosPhiConfig", psCosPhi);
523  }
524  {
525  edm::ParameterSetDescription psCosPhi3D;
526  psCosPhi3D.add<std::string>("name", "CosPhi3D");
527  psCosPhi3D.add<std::string>("title", "cos(#phi_{3D})");
528  psCosPhi3D.add<std::string>("yUnits", "");
529  psCosPhi3D.add<int>("NxBins", 50);
530  psCosPhi3D.add<int>("NyBins", 50);
531  psCosPhi3D.add<double>("ymin", -1.);
532  psCosPhi3D.add<double>("ymax", 1.);
533  desc.add<edm::ParameterSetDescription>("CosPhi3DConfig", psCosPhi3D);
534  }
535  {
537  psVtxProb.add<std::string>("name", "VtxProb");
538  psVtxProb.add<std::string>("title", "Prob(#chi^{2}_{SV})");
539  psVtxProb.add<std::string>("yUnits", "");
540  psVtxProb.add<int>("NxBins", 50);
541  psVtxProb.add<int>("NyBins", 50);
542  psVtxProb.add<double>("ymin", 0);
543  psVtxProb.add<double>("ymax", 1.);
544  desc.add<edm::ParameterSetDescription>("VtxProbConfig", psVtxProb);
545  }
546  {
548  psVtxDist.add<std::string>("name", "VtxDist");
549  psVtxDist.add<std::string>("title", "d_{xy}(PV,SV)");
550  psVtxDist.add<std::string>("yUnits", "[#mum]");
551  psVtxDist.add<int>("NxBins", 50);
552  psVtxDist.add<int>("NyBins", 100);
553  psVtxDist.add<double>("ymin", 0);
554  psVtxDist.add<double>("ymax", 300.);
555  desc.add<edm::ParameterSetDescription>("VtxDistConfig", psVtxDist);
556  }
557  {
558  edm::ParameterSetDescription psVtxDist3D;
559  psVtxDist3D.add<std::string>("name", "VtxDist3D");
560  psVtxDist3D.add<std::string>("title", "d_{3D}(PV,SV)");
561  psVtxDist3D.add<std::string>("yUnits", "[#mum]");
562  psVtxDist3D.add<int>("NxBins", 50);
563  psVtxDist3D.add<int>("NyBins", 250);
564  psVtxDist3D.add<double>("ymin", 0);
565  psVtxDist3D.add<double>("ymax", 500.);
566  desc.add<edm::ParameterSetDescription>("VtxDist3DConfig", psVtxDist3D);
567  }
568  {
569  edm::ParameterSetDescription psVtxDistSig;
570  psVtxDistSig.add<std::string>("name", "VtxDistSig");
571  psVtxDistSig.add<std::string>("title", "d_{xy}(PV,SV)/#sigma_{dxy}(PV,SV)");
572  psVtxDistSig.add<std::string>("yUnits", "");
573  psVtxDistSig.add<int>("NxBins", 50);
574  psVtxDistSig.add<int>("NyBins", 100);
575  psVtxDistSig.add<double>("ymin", 0);
576  psVtxDistSig.add<double>("ymax", 5.);
577  desc.add<edm::ParameterSetDescription>("VtxDistSigConfig", psVtxDistSig);
578  }
579  {
580  edm::ParameterSetDescription psVtxDist3DSig;
581  psVtxDist3DSig.add<std::string>("name", "VtxDist3DSig");
582  psVtxDist3DSig.add<std::string>("title", "d_{3D}(PV,SV)/#sigma_{d3D}(PV,SV)");
583  psVtxDist3DSig.add<std::string>("yUnits", "");
584  psVtxDist3DSig.add<int>("NxBins", 50);
585  psVtxDist3DSig.add<int>("NyBins", 100);
586  psVtxDist3DSig.add<double>("ymin", 0);
587  psVtxDist3DSig.add<double>("ymax", 5.);
588  desc.add<edm::ParameterSetDescription>("VtxDist3DSigConfig", psVtxDist3DSig);
589  }
590 
591  descriptions.addWithDefaultLabel(desc);
592 }
593 
594 //define this as a plug-in
static const std::string kSharedResource
Definition: TFileService.h:76
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
DiLeptonHelp::PlotsVsKinematics CosPhiPlots
float eSuperClusterOverP() const
Definition: GsfElectron.h:221
~DiElectronVertexValidation() override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
static constexpr float emass2
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
DiLeptonHelp::PlotsVsKinematics VtxDist3DPlots
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
DiLeptonHelp::PlotsVsKinematics CosPhi3DPlots
DiLeptonHelp::PlotsVsKinematics VtxDistSigPlots
std::vector< Vertex > VertexCollection
Definition: Vertex.h:12
DiLeptonHelp::PlotsVsKinematics VtxProbPlots
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
const std::string names[nVars_]
float full5x5_sigmaIetaIeta() const
Definition: GsfElectron.h:471
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const override
bool getData(T &iHolder) const
Definition: EventSetup.h:128
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
Definition: GsfElectron.h:156
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
Definition: Event.h:563
void analyze(const edm::Event &, const edm::EventSetup &) override
float deltaEtaSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:225
int iEvent
Definition: GenABIO.cc:224
float hadronicOverEm() const
Definition: GsfElectron.h:500
bool passLooseSelection(const reco::GsfElectron &electron)
edm::EDGetTokenT< reco::GsfElectronCollection > electronsToken_
T sqrt(T t)
Definition: SSEVec.h:19
float deltaPhiSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:228
std::vector< GsfTrack > GsfTrackCollection
collection of GsfTracks
Definition: GsfTrackFwd.h:9
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool get(ProductID const &oid, Handle< PROD > &result) const
Definition: Event.h:346
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Log< level::Info, false > LogInfo
DiLeptonHelp::PlotsVsKinematics VtxDist3DSigPlots
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
Definition: TFileService.h:69
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
float ecalEnergy() const
Definition: GsfElectron.h:896
static std::atomic< unsigned int > counter
void fillPlots(const float val, const std::pair< TLorentzVector, TLorentzVector > &momenta)
void bookFromPSet(const TFileDirectory &fs, const edm::ParameterSet &hpar)
static constexpr float cmToum
DiLeptonHelp::PlotsVsKinematics VtxDistPlots
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
edm::EDGetTokenT< reco::VertexCollection > vertexToken_
const edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > ttbESToken_
SuperClusterRef superCluster() const override
reference to a SuperCluster
Definition: GsfElectron.h:155
DiLeptonHelp::PlotsVsKinematics ZMassPlots
edm::EDGetTokenT< reco::GsfTrackCollection > gsfTracksToken_
DiElectronVertexValidation(const edm::ParameterSet &)