CMS 3D CMS Logo

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  for (const auto& electron : theZElectronVector) {
237  float minD = 1000.;
238  const reco::GsfTrack* theMatch = nullptr;
239  for (const auto& track : iEvent.get(gsfTracksToken_)) {
240  float D = ::deltaR(electron->gsfTrack()->eta(), electron->gsfTrack()->phi(), track.eta(), track.phi());
241  if (D < minD) {
242  minD = D;
243  theMatch = &track;
244  }
245  }
246  myGoodGsfTracks.emplace_back(theMatch);
247  }
248 
249  hGSF0Pt_->Fill(myGoodGsfTracks[0]->pt());
250  hGSF0Eta_->Fill(myGoodGsfTracks[0]->eta());
251  hGSF1Pt_->Fill(myGoodGsfTracks[1]->pt());
252  hGSF1Eta_->Fill(myGoodGsfTracks[1]->eta());
253 
254  const TransientTrackBuilder* theB = &iSetup.getData(ttbESToken_);
255  TransientVertex aTransVtx;
256  std::vector<reco::TransientTrack> tks;
257 
258  std::vector<const reco::GsfTrack*> myTracks;
259  myTracks.emplace_back(myGoodGsfTracks[0]);
260  myTracks.emplace_back(myGoodGsfTracks[1]);
261 
262  if (myTracks.size() != 2)
263  return;
264 
265  const auto& e1 = myTracks[1]->momentum();
266  const auto& e0 = myTracks[0]->momentum();
267  const auto& ditrack = e1 + e0;
268 
269  const auto& tplus = myTracks[0]->charge() > 0 ? myTracks[0] : myTracks[1];
270  const auto& tminus = myTracks[0]->charge() < 0 ? myTracks[0] : myTracks[1];
271 
272  TLorentzVector p4_tplus(tplus->px(), tplus->py(), tplus->pz(), sqrt((tplus->p() * tplus->p()) + emass2));
273  TLorentzVector p4_tminus(tminus->px(), tminus->py(), tminus->pz(), sqrt((tminus->p() * tminus->p()) + emass2));
274 
275  // creat the pair of TLorentVectors used to make the plos
276  std::pair<TLorentzVector, TLorentzVector> tktk_p4 = std::make_pair(p4_tplus, p4_tminus);
277 
278  const auto& Zp4 = p4_tplus + p4_tminus;
279  float track_invMass = Zp4.M();
280  hTrackInvMass_->Fill(track_invMass);
281 
282  // fill the z->mm mass plots
283  ZMassPlots.fillPlots(track_invMass, tktk_p4);
284 
285  math::XYZPoint ZpT(ditrack.x(), ditrack.y(), 0);
286  math::XYZPoint Zp(ditrack.x(), ditrack.y(), ditrack.z());
287 
288  for (const auto& track : myTracks) {
289  reco::TransientTrack trajectory = theB->build(track);
290  tks.push_back(trajectory);
291  }
292 
293  KalmanVertexFitter kalman(true);
294  aTransVtx = kalman.vertex(tks);
295 
296  double SVProb = TMath::Prob(aTransVtx.totalChiSquared(), (int)aTransVtx.degreesOfFreedom());
297  hSVProb_->Fill(SVProb);
298 
299  if (!aTransVtx.isValid())
300  return;
301 
303 
304  // fill the VtxProb plots
305  VtxProbPlots.fillPlots(SVProb, tktk_p4);
306 
307  // get collection of reconstructed vertices from event
308  edm::Handle<reco::VertexCollection> vertexHandle = iEvent.getHandle(vertexToken_);
309 
310  math::XYZPoint mainVtx(0, 0, 0);
311  reco::Vertex TheMainVtx; // = vertexHandle.product()->front();
312 
313  VertexDistanceXY vertTool;
314  VertexDistance3D vertTool3D;
315 
316  if (vertexHandle.isValid()) {
317  const reco::VertexCollection* vertices = vertexHandle.product();
318  float minD = 9999.;
319  int closestVtxIndex = 0;
320  int counter = 0;
321  for (const auto& vtx : *vertices) {
322  double dist3D = vertTool3D.distance(aTransVtx, vtx).value();
323  if (dist3D < minD) {
324  minD = dist3D;
325  closestVtxIndex = counter;
326  }
327  counter++;
328  }
329  if ((*vertices).at(closestVtxIndex).isValid()) {
330  hClosestVtxIndex_->Fill(closestVtxIndex);
331  TheMainVtx = (*vertices).at(closestVtxIndex);
332  mainVtx.SetXYZ(TheMainVtx.position().x(), TheMainVtx.position().y(), TheMainVtx.position().z());
333  }
334  }
335 
336  const math::XYZPoint myVertex(aTransVtx.position().x(), aTransVtx.position().y(), aTransVtx.position().z());
337  const math::XYZPoint deltaVtx(mainVtx.x() - myVertex.x(), mainVtx.y() - myVertex.y(), mainVtx.z() - myVertex.z());
338 
339  if (TheMainVtx.isValid()) {
340  // Z Vertex distance in the xy plane
341  double distance = vertTool.distance(aTransVtx, TheMainVtx).value();
342  double dist_err = vertTool.distance(aTransVtx, TheMainVtx).error();
343 
344  hSVDist_->Fill(distance * cmToum);
345  hSVDistSig_->Fill(distance / dist_err);
346 
347  // fill the VtxDist plots
349 
350  // fill the VtxDisSig plots
351  VtxDistSigPlots.fillPlots(distance / dist_err, tktk_p4);
352 
353  // Z Vertex distance in 3D
354  double distance3D = vertTool3D.distance(aTransVtx, TheMainVtx).value();
355  double dist3D_err = vertTool3D.distance(aTransVtx, TheMainVtx).error();
356 
357  hSVDist3D_->Fill(distance3D * cmToum);
358  hSVDist3DSig_->Fill(distance3D / dist3D_err);
359 
360  // fill the VtxDist3D plots
361  VtxDist3DPlots.fillPlots(distance3D * cmToum, tktk_p4);
362 
363  // fill the VtxDisSig plots
364  VtxDist3DSigPlots.fillPlots(distance3D / dist3D_err, tktk_p4);
365 
366  // cut on the PV - SV distance
367  if (distance * cmToum < maxSVdist_) {
369 
370  double cosphi = (ZpT.x() * deltaVtx.x() + ZpT.y() * deltaVtx.y()) /
371  (sqrt(ZpT.x() * ZpT.x() + ZpT.y() * ZpT.y()) *
372  sqrt(deltaVtx.x() * deltaVtx.x() + deltaVtx.y() * deltaVtx.y()));
373 
374  double cosphi3D = (Zp.x() * deltaVtx.x() + Zp.y() * deltaVtx.y() + Zp.z() * deltaVtx.z()) /
375  (sqrt(Zp.x() * Zp.x() + Zp.y() * Zp.y() + Zp.z() * Zp.z()) *
376  sqrt(deltaVtx.x() * deltaVtx.x() + deltaVtx.y() * deltaVtx.y() + deltaVtx.z() * deltaVtx.z()));
377 
378  hCosPhi_->Fill(cosphi);
379  hCosPhi3D_->Fill(cosphi3D);
380 
381  // fill the cosphi plots
382  CosPhiPlots.fillPlots(cosphi, tktk_p4);
383 
384  // fill the VtxDisSig plots
385  CosPhi3DPlots.fillPlots(cosphi3D, tktk_p4);
386  }
387  }
388 }
389 
391  float dEtaln = fabs(el.deltaEtaSuperClusterTrackAtVtx());
392  float dPhiln = fabs(el.deltaPhiSuperClusterTrackAtVtx());
393  float sigmaletaleta = el.full5x5_sigmaIetaIeta();
394  float hem = el.hadronicOverEm();
395  double resol = fabs((1 / el.ecalEnergy()) - (el.eSuperClusterOverP() / el.ecalEnergy()));
396  double mHits = el.gsfTrack()->hitPattern().numberOfAllHits(reco::HitPattern::MISSING_INNER_HITS);
397  bool barrel = (fabs(el.superCluster()->eta()) <= 1.479);
398  bool endcap = (!barrel && fabs(el.superCluster()->eta()) < 2.5);
399 
400  // loose electron ID
401 
402  if (barrel && dEtaln < 0.00477 && dPhiln < 0.222 && sigmaletaleta < 0.011 && hem < 0.298 && resol < 0.241 &&
403  mHits <= 1)
404  return true;
405  if (endcap && dEtaln < 0.00868 && dPhiln < 0.213 && sigmaletaleta < 0.0314 && hem < 0.101 && resol < 0.14 &&
406  mHits <= 1)
407  return true;
408 
409  return false;
410 }
411 
412 // ------------ method called once each job just before starting event loop ------------
414  // please remove this method if not needed
416 
417  // clang-format off
418  TH1F::SetDefaultSumw2(kTRUE);
419 
420  hGSFMult_= fs->make<TH1F>("GSFMult", ";# gsf tracks;N. events", 20, 0., 20.);
421  hGSFMultAftPt_= fs->make<TH1F>("GSFMultAftPt", ";# gsf tracks;N. events", 20, 0., 20.);
422  hGSF0Pt_= fs->make<TH1F>("GSF0Pt", ";leading GSF track p_{T};N. GSF tracks", 100, 0., 100.);
423  hGSF0Eta_= fs->make<TH1F>("GSF0Eta", ";leading GSF track #eta;N. GSF tracks", 50, -2.5, 2.5);
424  hGSF1Pt_= fs->make<TH1F>("GSF1Pt", ";sub-leading GSF track p_{T};N. GSF tracks", 100, 0., 100.);
425  hGSF1Eta_= fs->make<TH1F>("GSF1Eta", ";sub-leading GSF track #eta;N. GSF tracks", 50, -2.5, 2.5);
426 
427  hSVProb_ = fs->make<TH1F>("VtxProb", ";ZV vertex probability;N(e^{+}e^{-} pairs)", 100, 0., 1.);
428 
429  hSVDist_ = fs->make<TH1F>("VtxDist", ";PV-ZV xy distance [#mum];N(e^{+}e^{-} pairs)", 100, 0., 1000.);
430  hSVDistSig_ = fs->make<TH1F>("VtxDistSig", ";PV-ZV xy distance signficance;N(e^{+}e^{-} pairs)", 100, 0., 5.);
431 
432  hSVDist3D_ = fs->make<TH1F>("VtxDist3D", ";PV-ZV 3D distance [#mum];N(e^{+}e^{-} pairs)", 100, 0., 1000.);
433  hSVDist3DSig_ = fs->make<TH1F>("VtxDist3DSig", ";PV-ZV 3D distance signficance;N(e^{+}e^{-} pairs)", 100, 0., 5.);
434 
435  hCosPhi_ = fs->make<TH1F>("CosPhi", ";cos(#phi_{xy});N(ee pairs)", 50, -1., 1.);
436  hCosPhi3D_ = fs->make<TH1F>("CosPhi3D", ";cos(#phi_{3D});N(ee pairs)", 50, -1., 1.);
437  hTrackInvMass_ = fs->make<TH1F>("TkTkInvMass", ";M(tk,tk) [GeV];N(tk tk pairs)", 70., 50., 120.);
438  hInvMass_ = fs->make<TH1F>("InvMass", ";M(#mu#mu) [GeV];N(#mu#mu pairs)", 70., 50., 120.);
439 
440  hClosestVtxIndex_ = fs->make<TH1I>("ClosestVtxIndex", ";closest vertex index;N(tk tk pairs)", 20, -0.5, 19.5);
441 
442  // 2D Maps
443 
444  TFileDirectory dirCosPhi = fs->mkdir("CosPhiPlots");
446 
447  TFileDirectory dirCosPhi3D = fs->mkdir("CosPhi3DPlots");
449 
450  TFileDirectory dirVtxProb = fs->mkdir("VtxProbPlots");
452 
453  TFileDirectory dirVtxDist = fs->mkdir("VtxDistPlots");
455 
456  TFileDirectory dirVtxDist3D = fs->mkdir("VtxDist3DPlots");
458 
459  TFileDirectory dirVtxDistSig = fs->mkdir("VtxDistSigPlots");
461 
462  TFileDirectory dirVtxDist3DSig = fs->mkdir("VtxDist3DSigPlots");
464 
465  TFileDirectory dirInvariantMass = fs->mkdir("InvariantMassPlots");
467 
468  // cut flow
469 
470  hCutFlow_ = fs->make<TH1F>("hCutFlow","cut flow;cut step;events left",6,-0.5,5.5);
471  std::string names[6]={"Total","Mult.",">pT","<eta","hasVtx","VtxDist"};
472  for(unsigned int i=0;i<6;i++){
473  hCutFlow_->GetXaxis()->SetBinLabel(i+1,names[i].c_str());
474  }
475 
476  myCounts.zeroAll();
477 }
478 
479 // ------------ method called once each job just after ending the event loop ------------
482 
483  hCutFlow_->SetBinContent(1,myCounts.eventsTotal);
484  hCutFlow_->SetBinContent(2,myCounts.eventsAfterMult);
485  hCutFlow_->SetBinContent(3,myCounts.eventsAfterPt);
486  hCutFlow_->SetBinContent(4,myCounts.eventsAfterEta);
487  hCutFlow_->SetBinContent(5,myCounts.eventsAfterVtx);
488  hCutFlow_->SetBinContent(6,myCounts.eventsAfterDist);
489 }
490 
491 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
494  desc.add<edm::InputTag>("gsfTracks",edm::InputTag("electronGsfTracks"));
495  desc.add<edm::InputTag>("vertices", edm::InputTag("offlinePrimaryVertices"));
496  desc.add<edm::InputTag>("electrons", edm::InputTag("gedGsfElectrons"));
497  desc.add<std::vector<double>>("pTThresholds", {25., 15.});
498  desc.add<double>("maxSVdist", 50.);
499 
500  {
501  edm::ParameterSetDescription psDiMuMass;
502  psDiMuMass.add<std::string>("name", "DiMuMass");
503  psDiMuMass.add<std::string>("title", "M(#mu#mu)");
504  psDiMuMass.add<std::string>("yUnits", "[GeV]");
505  psDiMuMass.add<int>("NxBins", 24);
506  psDiMuMass.add<int>("NyBins", 50);
507  psDiMuMass.add<double>("ymin", 70.);
508  psDiMuMass.add<double>("ymax", 120.);
509  desc.add<edm::ParameterSetDescription>("DiMuMassConfig", psDiMuMass);
510  }
511  {
513  psCosPhi.add<std::string>("name", "CosPhi");
514  psCosPhi.add<std::string>("title", "cos(#phi_{xy})");
515  psCosPhi.add<std::string>("yUnits", "");
516  psCosPhi.add<int>("NxBins", 50);
517  psCosPhi.add<int>("NyBins", 50);
518  psCosPhi.add<double>("ymin", -1.);
519  psCosPhi.add<double>("ymax", 1.);
520  desc.add<edm::ParameterSetDescription>("CosPhiConfig", psCosPhi);
521  }
522  {
523  edm::ParameterSetDescription psCosPhi3D;
524  psCosPhi3D.add<std::string>("name", "CosPhi3D");
525  psCosPhi3D.add<std::string>("title", "cos(#phi_{3D})");
526  psCosPhi3D.add<std::string>("yUnits", "");
527  psCosPhi3D.add<int>("NxBins", 50);
528  psCosPhi3D.add<int>("NyBins", 50);
529  psCosPhi3D.add<double>("ymin", -1.);
530  psCosPhi3D.add<double>("ymax", 1.);
531  desc.add<edm::ParameterSetDescription>("CosPhi3DConfig", psCosPhi3D);
532  }
533  {
535  psVtxProb.add<std::string>("name", "VtxProb");
536  psVtxProb.add<std::string>("title", "Prob(#chi^{2}_{SV})");
537  psVtxProb.add<std::string>("yUnits", "");
538  psVtxProb.add<int>("NxBins", 50);
539  psVtxProb.add<int>("NyBins", 50);
540  psVtxProb.add<double>("ymin", 0);
541  psVtxProb.add<double>("ymax", 1.);
542  desc.add<edm::ParameterSetDescription>("VtxProbConfig", psVtxProb);
543  }
544  {
546  psVtxDist.add<std::string>("name", "VtxDist");
547  psVtxDist.add<std::string>("title", "d_{xy}(PV,SV)");
548  psVtxDist.add<std::string>("yUnits", "[#mum]");
549  psVtxDist.add<int>("NxBins", 50);
550  psVtxDist.add<int>("NyBins", 100);
551  psVtxDist.add<double>("ymin", 0);
552  psVtxDist.add<double>("ymax", 300.);
553  desc.add<edm::ParameterSetDescription>("VtxDistConfig", psVtxDist);
554  }
555  {
556  edm::ParameterSetDescription psVtxDist3D;
557  psVtxDist3D.add<std::string>("name", "VtxDist3D");
558  psVtxDist3D.add<std::string>("title", "d_{3D}(PV,SV)");
559  psVtxDist3D.add<std::string>("yUnits", "[#mum]");
560  psVtxDist3D.add<int>("NxBins", 50);
561  psVtxDist3D.add<int>("NyBins", 250);
562  psVtxDist3D.add<double>("ymin", 0);
563  psVtxDist3D.add<double>("ymax", 500.);
564  desc.add<edm::ParameterSetDescription>("VtxDist3DConfig", psVtxDist3D);
565  }
566  {
567  edm::ParameterSetDescription psVtxDistSig;
568  psVtxDistSig.add<std::string>("name", "VtxDistSig");
569  psVtxDistSig.add<std::string>("title", "d_{xy}(PV,SV)/#sigma_{dxy}(PV,SV)");
570  psVtxDistSig.add<std::string>("yUnits", "");
571  psVtxDistSig.add<int>("NxBins", 50);
572  psVtxDistSig.add<int>("NyBins", 100);
573  psVtxDistSig.add<double>("ymin", 0);
574  psVtxDistSig.add<double>("ymax", 5.);
575  desc.add<edm::ParameterSetDescription>("VtxDistSigConfig", psVtxDistSig);
576  }
577  {
578  edm::ParameterSetDescription psVtxDist3DSig;
579  psVtxDist3DSig.add<std::string>("name", "VtxDist3DSig");
580  psVtxDist3DSig.add<std::string>("title", "d_{3D}(PV,SV)/#sigma_{d3D}(PV,SV)");
581  psVtxDist3DSig.add<std::string>("yUnits", "");
582  psVtxDist3DSig.add<int>("NxBins", 50);
583  psVtxDist3DSig.add<int>("NyBins", 100);
584  psVtxDist3DSig.add<double>("ymin", 0);
585  psVtxDist3DSig.add<double>("ymax", 5.);
586  desc.add<edm::ParameterSetDescription>("VtxDist3DSigConfig", psVtxDist3DSig);
587  }
588 
589  descriptions.addWithDefaultLabel(desc);
590 }
591 
592 //define this as a plug-in
static const std::string kSharedResource
Definition: TFileService.h:76
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
float totalChiSquared() const
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
double pt() const final
transverse momentum
GlobalPoint position() const
DiLeptonHelp::PlotsVsKinematics CosPhiPlots
Measurement1D distance(const GlobalPoint &vtx1Position, const GlobalError &vtx1PositionError, const GlobalPoint &vtx2Position, const GlobalError &vtx2PositionError) const override
T z() const
Definition: PV3DBase.h:61
~DiElectronVertexValidation() override
const Point & position() const
position
Definition: Vertex.h:127
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
T const * product() const
Definition: Handle.h:70
static constexpr float emass2
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
DiLeptonHelp::PlotsVsKinematics VtxDist3DPlots
DiLeptonHelp::PlotsVsKinematics CosPhi3DPlots
DiLeptonHelp::PlotsVsKinematics VtxDistSigPlots
std::vector< Vertex > VertexCollection
Definition: Vertex.h:31
DiLeptonHelp::PlotsVsKinematics VtxProbPlots
float degreesOfFreedom() const
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
const std::string names[nVars_]
float eSuperClusterOverP() const
Definition: GsfElectron.h:221
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const override
reco::TransientTrack build(const reco::Track *p) const
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
Definition: GsfElectron.h:156
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
void analyze(const edm::Event &, const edm::EventSetup &) override
int iEvent
Definition: GenABIO.cc:224
bool isValid() const
bool passLooseSelection(const reco::GsfElectron &electron)
edm::EDGetTokenT< reco::GsfElectronCollection > electronsToken_
T sqrt(T t)
Definition: SSEVec.h:19
std::vector< GsfTrack > GsfTrackCollection
collection of GsfTracks
Definition: GsfTrackFwd.h:9
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Measurement1D distance(const GlobalPoint &vtx1Position, const GlobalError &vtx1PositionError, const GlobalPoint &vtx2Position, const GlobalError &vtx2PositionError) const override
float deltaPhiSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:228
Log< level::Info, false > LogInfo
DiLeptonHelp::PlotsVsKinematics VtxDist3DSigPlots
float deltaEtaSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:225
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
float ecalEnergy() const
Definition: GsfElectron.h:896
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
bool isValid() const
Definition: HandleBase.h:70
double value() const
Definition: Measurement1D.h:25
fixed size matrix
HLT enums.
static std::atomic< unsigned int > counter
double error() const
Definition: Measurement1D.h:27
void fillPlots(const float val, const std::pair< TLorentzVector, TLorentzVector > &momenta)
void bookFromPSet(const TFileDirectory &fs, const edm::ParameterSet &hpar)
float full5x5_sigmaIetaIeta() const
Definition: GsfElectron.h:471
static constexpr float cmToum
DiLeptonHelp::PlotsVsKinematics VtxDistPlots
edm::EDGetTokenT< reco::VertexCollection > vertexToken_
const edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > ttbESToken_
float hadronicOverEm() const
Definition: GsfElectron.h:500
SuperClusterRef superCluster() const override
reference to a SuperCluster
Definition: GsfElectron.h:155
bool isValid() const
Tells whether the vertex is valid.
Definition: Vertex.h:72
DiLeptonHelp::PlotsVsKinematics ZMassPlots
edm::EDGetTokenT< reco::GsfTrackCollection > gsfTracksToken_
DiElectronVertexValidation(const edm::ParameterSet &)