CMS 3D CMS Logo

BPHMonitor.cc
Go to the documentation of this file.
1 #include <string>
2 #include <vector>
3 
46 
47 class BPHMonitor : public DQMEDAnalyzer, public TriggerDQMBase {
48 public:
51 
53  ~BPHMonitor() throw() override;
54  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
55 
56 protected:
58  void analyze(edm::Event const& iEvent, edm::EventSetup const& iSetup) override;
59 
60  template <typename T>
61  bool matchToTrigger(const std::string& theTriggerName, T t);
62 
63  double Prescale(const std::string num,
64  const std::string den,
66  edm::EventSetup const& iSetup,
68 
69 private:
71 
74 
80 
81  edm::EDGetTokenT<reco::MuonCollection> muoToken_;
82  edm::EDGetTokenT<reco::BeamSpot> bsToken_;
83  edm::EDGetTokenT<reco::TrackCollection> trToken_;
86 
88 
102 
103  ObjME muPhi_;
104  ObjME muEta_;
105  ObjME muPt_;
106  ObjME mud0_;
107  ObjME muz0_;
108 
109  ObjME mu1Phi_;
110  ObjME mu1Eta_;
111  ObjME mu1Pt_;
112  ObjME mu1d0_;
113  ObjME mu1z0_;
114  ObjME mu2Phi_;
115  ObjME mu2Eta_;
116  ObjME mu2Pt_;
117  ObjME mu2d0_;
118  ObjME mu2z0_;
119  ObjME mu3Phi_;
120  ObjME mu3Eta_;
121  ObjME mu3Pt_;
122  ObjME mu3d0_;
123  ObjME mu3z0_;
124 
125  ObjME phPhi_;
126  ObjME phEta_;
127  ObjME phPt_;
128  ObjME DiMuPhi_;
129  ObjME DiMuEta_;
130  ObjME DiMuPt_;
131  ObjME DiMuPVcos_;
132  ObjME DiMuProb_;
133  ObjME DiMuDS_;
134  ObjME DiMuDCA_;
135  ObjME DiMuMass_;
136  ObjME BMass_;
137  ObjME DiMudR_;
138 
141 
143 
148 
149  int nmuons_;
150  bool tnp_;
151  int L3_;
152  int ptCut_;
154  int trOrMu_;
155  int Jpsi_;
156  int Upsilon_;
157  int enum_;
158  int seagull_;
159  double maxmass_;
160  double minmass_;
161  double maxmassJpsi;
162  double minmassJpsi;
165  double maxmassTkTk;
166  double minmassTkTk;
169  double kaon_mass;
170  double mu_mass;
171  double min_dR;
172  double max_dR;
173 
174  double minprob;
175  double mincos;
176  double minDS;
185 
187 
190  std::string getTriggerName(std::string partialName);
191 };
192 
194  : folderName_(iConfig.getParameter<std::string>("FolderName")),
195  requireValidHLTPaths_(iConfig.getParameter<bool>("requireValidHLTPaths")),
197  muoInputTag_(iConfig.getParameter<edm::InputTag>("muons")),
198  bsInputTag_(iConfig.getParameter<edm::InputTag>("beamSpot")),
199  trInputTag_(iConfig.getParameter<edm::InputTag>("tracks")),
200  phInputTag_(iConfig.getParameter<edm::InputTag>("photons")),
201  vtxInputTag_(iConfig.getParameter<edm::InputTag>("offlinePVs")),
202  muoToken_(mayConsume<reco::MuonCollection>(muoInputTag_)),
203  bsToken_(mayConsume<reco::BeamSpot>(bsInputTag_)),
204  trToken_(mayConsume<reco::TrackCollection>(trInputTag_)),
205  phToken_(mayConsume<reco::PhotonCollection>(phInputTag_)),
208  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double>>("ptBinning")),
210  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double>>("dMuPtBinning")),
212  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double>>("probBinning")),
214  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("phiPSet"))),
216  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("etaPSet"))),
217  d0_binning_(
218  getHistoPSet(iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("d0PSet"))),
219  z0_binning_(
220  getHistoPSet(iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("z0PSet"))),
221  dR_binning_(
222  getHistoPSet(iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("dRPSet"))),
224  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("massPSet"))),
226  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("BmassPSet"))),
228  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("dcaPSet"))),
229  ds_binning_(
230  getHistoPSet(iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("dsPSet"))),
232  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("cosPSet"))),
234  iConfig.getParameter<edm::ParameterSet>("numGenericTriggerEventPSet"), consumesCollector(), *this)),
236  iConfig.getParameter<edm::ParameterSet>("denGenericTriggerEventPSet"), consumesCollector(), *this)),
237  hltPrescale_(new HLTPrescaleProvider(iConfig, consumesCollector(), *this)),
238  muoSelection_(iConfig.getParameter<std::string>("muoSelection")),
239  muoSelection_ref(iConfig.getParameter<std::string>("muoSelection_ref")),
240  muoSelection_tag(iConfig.getParameter<std::string>("muoSelection_tag")),
241  muoSelection_probe(iConfig.getParameter<std::string>("muoSelection_probe")),
242  nmuons_(iConfig.getParameter<int>("nmuons")),
243  tnp_(iConfig.getParameter<bool>("tnp")),
244  L3_(iConfig.getParameter<int>("L3")),
245  ptCut_(iConfig.getParameter<int>("ptCut")),
246  displaced_(iConfig.getParameter<int>("displaced")),
247  trOrMu_(iConfig.getParameter<int>("trOrMu")),
248  Jpsi_(iConfig.getParameter<int>("Jpsi")),
249  Upsilon_(iConfig.getParameter<int>("Upsilon")) // if ==1 path with Upsilon constraint
250  ,
251  enum_(iConfig.getParameter<int>("enum")),
252  seagull_(iConfig.getParameter<int>("seagull")),
253  maxmass_(iConfig.getParameter<double>("maxmass")),
254  minmass_(iConfig.getParameter<double>("minmass")),
255  maxmassJpsi(iConfig.getParameter<double>("maxmassJpsi")),
256  minmassJpsi(iConfig.getParameter<double>("minmassJpsi")),
257  maxmassUpsilon(iConfig.getParameter<double>("maxmassUpsilon")),
258  minmassUpsilon(iConfig.getParameter<double>("minmassUpsilon")),
259  maxmassTkTk(iConfig.getParameter<double>("maxmassTkTk")),
260  minmassTkTk(iConfig.getParameter<double>("minmassTkTk")),
261  maxmassJpsiTk(iConfig.getParameter<double>("maxmassJpsiTk")),
262  minmassJpsiTk(iConfig.getParameter<double>("minmassJpsiTk")),
263  kaon_mass(iConfig.getParameter<double>("kaon_mass")),
264  mu_mass(iConfig.getParameter<double>("mu_mass")),
265  min_dR(iConfig.getParameter<double>("min_dR")),
266  max_dR(iConfig.getParameter<double>("max_dR")),
267  minprob(iConfig.getParameter<double>("minprob")),
268  mincos(iConfig.getParameter<double>("mincos")),
269  minDS(iConfig.getParameter<double>("minDS")),
270  hltInputTag_1(iConfig.getParameter<edm::InputTag>("hltTriggerSummaryAOD")),
271  hltInputTag_(mayConsume<trigger::TriggerEvent>(iConfig.getParameter<edm::InputTag>("hltTriggerSummaryAOD"))),
272  hltpaths_num(iConfig.getParameter<edm::ParameterSet>("numGenericTriggerEventPSet")
273  .getParameter<std::vector<std::string>>("hltPaths")),
274  hltpaths_den(iConfig.getParameter<edm::ParameterSet>("denGenericTriggerEventPSet")
275  .getParameter<std::vector<std::string>>("hltPaths")),
276  trSelection_(iConfig.getParameter<std::string>("muoSelection")),
277  trSelection_ref(iConfig.getParameter<std::string>("trSelection_ref")),
278  DMSelection_ref(iConfig.getParameter<std::string>("DMSelection_ref")) {
279  if (!tnp_) {
280  magneticFieldToken_ = esConsumes<MagneticField, IdealMagneticFieldRecord>();
281  }
282 }
283 
286  num_genTriggerEventFlag_.reset();
287  }
289  den_genTriggerEventFlag_.reset();
290  }
291 
292  delete hltPrescale_;
293 }
294 
295 void BPHMonitor::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, edm::EventSetup const& iSetup) {
296  // Initialize the GenericTriggerEventFlag
298  num_genTriggerEventFlag_->initRun(iRun, iSetup);
299  }
301  den_genTriggerEventFlag_->initRun(iRun, iSetup);
302  }
303 
304  // check if every HLT path specified in numerator and denominator has a valid match in the HLT Menu
306  den_genTriggerEventFlag_->on() && num_genTriggerEventFlag_->allHLTPathsAreValid() &&
307  den_genTriggerEventFlag_->allHLTPathsAreValid());
308 
309  // if valid HLT paths are required,
310  // create DQM outputs only if all paths are valid
312  return;
313  }
314 
315  std::string histname, histtitle, istnp, trMuPh;
316 
317  bool Ph_ = false;
318  if (enum_ == 7)
319  Ph_ = true;
320  if (tnp_)
321  istnp = "Tag_and_Probe/";
322  else
323  istnp = "";
324 
325  std::string currentFolder = folderName_ + istnp;
326  ibooker.setCurrentFolder(currentFolder);
327 
328  if (trOrMu_)
329  trMuPh = "tr";
330  else if (Ph_)
331  trMuPh = "ph";
332  else
333  trMuPh = "mu";
334 
335  if (enum_ == 7 || enum_ == 1 || enum_ == 9 || enum_ == 10) {
336  histname = trMuPh + "Pt";
337  histtitle = trMuPh + "_P_{t}";
338  bookME(ibooker, muPt_, histname, histtitle, pt_variable_binning_);
339  setMETitle(muPt_, trMuPh + "_Pt[GeV]", "events / 1 GeV");
340 
341  histname = trMuPh + "Phi";
342  histtitle = trMuPh + "Phi";
343  bookME(ibooker, muPhi_, histname, histtitle, phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax);
344  setMETitle(muPhi_, trMuPh + "_#phi", "events / 0.1 rad");
345 
346  histname = trMuPh + "Eta";
347  histtitle = trMuPh + "_Eta";
348  bookME(ibooker, muEta_, histname, histtitle, eta_binning_.nbins, eta_binning_.xmin, eta_binning_.xmax);
349  setMETitle(muEta_, trMuPh + "_#eta", "events / 0.2");
350 
351  if (enum_ == 9) {
352  histname = "BMass";
353  histtitle = "BMass";
354  bookME(ibooker, BMass_, histname, histtitle, Bmass_binning_.nbins, mass_binning_.xmin, mass_binning_.xmax);
355  setMETitle(BMass_, "B_#mass", "events /");
356  }
357  } else {
358  if (enum_ != 8) {
359  histname = trMuPh + "1Pt";
360  histtitle = trMuPh + "1_P_{t}";
361  bookME(ibooker, mu1Pt_, histname, histtitle, pt_variable_binning_);
362  setMETitle(mu1Pt_, trMuPh + "_Pt[GeV]", "events / 1 GeV");
363 
364  histname = trMuPh + "1Phi";
365  histtitle = trMuPh + "1Phi";
366  bookME(ibooker, mu1Phi_, histname, histtitle, phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax);
367  setMETitle(mu1Phi_, trMuPh + "_#phi", "events / 0.1 rad");
368 
369  histname = trMuPh + "1Eta";
370  histtitle = trMuPh + "1_Eta";
371  bookME(ibooker, mu1Eta_, histname, histtitle, eta_binning_.nbins, eta_binning_.xmin, eta_binning_.xmax);
372  setMETitle(mu1Eta_, trMuPh + "_#eta", "events / 0.2");
373 
374  histname = trMuPh + "2Pt";
375  histtitle = trMuPh + "2_P_{t}";
376  bookME(ibooker, mu2Pt_, histname, histtitle, pt_variable_binning_);
377  setMETitle(mu2Pt_, trMuPh + "_Pt[GeV]", "events / 1 GeV");
378 
379  histname = trMuPh + "2Phi";
380  histtitle = trMuPh + "2Phi";
381  bookME(ibooker, mu2Phi_, histname, histtitle, phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax);
382  setMETitle(mu2Phi_, trMuPh + "_#phi", "events / 0.1 rad");
383 
384  histname = trMuPh + "2Eta";
385  histtitle = trMuPh + "2_Eta";
386  bookME(ibooker, mu2Eta_, histname, histtitle, eta_binning_.nbins, eta_binning_.xmin, eta_binning_.xmax);
387  setMETitle(mu2Eta_, trMuPh + "_#eta", "events / 0.2");
388  if (enum_ == 11) {
389  histname = "BMass";
390  histtitle = "BMass";
391  bookME(ibooker, BMass_, histname, histtitle, Bmass_binning_.nbins, mass_binning_.xmin, mass_binning_.xmax);
392  setMETitle(BMass_, "B_#mass", "events /");
393  }
394  }
395  if (enum_ == 6) {
396  histname = trMuPh + "3Eta";
397  histtitle = trMuPh + "3Eta";
398  bookME(ibooker, mu3Eta_, histname, histtitle, eta_binning_.nbins, eta_binning_.xmin, eta_binning_.xmax);
399  setMETitle(mu3Eta_, trMuPh + "3#eta", "events / 0.2");
400 
401  histname = trMuPh + "3Pt";
402  histtitle = trMuPh + "3_P_{t}";
403  bookME(ibooker, mu3Pt_, histname, histtitle, pt_variable_binning_);
404  setMETitle(mu3Pt_, trMuPh + "3_Pt[GeV]", "events / 1 GeV");
405 
406  histname = trMuPh + "3Phi";
407  histtitle = trMuPh + "3Phi";
408  bookME(ibooker, mu3Phi_, histname, histtitle, phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax);
409  setMETitle(mu3Phi_, trMuPh + "3_#phi", "events / 0.1 rad");
410 
411  } else if (enum_ == 2 || enum_ == 4 || enum_ == 5 || enum_ == 8) {
412  histname = "DiMuEta";
413  histtitle = "DiMuEta";
414  bookME(ibooker, DiMuEta_, histname, histtitle, eta_binning_.nbins, eta_binning_.xmin, eta_binning_.xmax);
415  setMETitle(DiMuEta_, "DiMu#eta", "events / 0.2");
416 
417  histname = "DiMuPt";
418  histtitle = "DiMu_P_{t}";
419  bookME(ibooker, DiMuPt_, histname, histtitle, dMu_pt_variable_binning_);
420  setMETitle(DiMuPt_, "DiMu_Pt[GeV]", "events / 1 GeV");
421 
422  histname = "DiMuPhi";
423  histtitle = "DiMuPhi";
424  bookME(ibooker, DiMuPhi_, histname, histtitle, phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax);
425  setMETitle(DiMuPhi_, "DiMu_#phi", "events / 0.1 rad");
426 
427  if (enum_ == 4 || enum_ == 5) {
428  histname = "DiMudR";
429  histtitle = "DiMudR";
430  bookME(ibooker, DiMudR_, histname, histtitle, dR_binning_.nbins, dR_binning_.xmin, dR_binning_.xmax);
431  setMETitle(DiMudR_, "DiMu_#dR", "events /");
432 
433  if (enum_ == 4) {
434  histname = "DiMuMass";
435  histtitle = "DiMuMass";
436  bookME(ibooker, DiMuMass_, histname, histtitle, mass_binning_.nbins, mass_binning_.xmin, mass_binning_.xmax);
437  setMETitle(DiMuMass_, "DiMu_#mass", "events /");
438  }
439  } else if (enum_ == 8) {
440  histname = "DiMuProb";
441  histtitle = "DiMuProb";
442  bookME(ibooker, DiMuProb_, histname, histtitle, prob_variable_binning_);
443  setMETitle(DiMuProb_, "DiMu_#prob", "events /");
444 
445  histname = "DiMuPVcos";
446  histtitle = "DiMuPVcos";
447  bookME(ibooker, DiMuPVcos_, histname, histtitle, cos_binning_.nbins, cos_binning_.xmin, cos_binning_.xmax);
448  setMETitle(DiMuPVcos_, "DiMu_#cosPV", "events /");
449 
450  histname = "DiMuDS";
451  histtitle = "DiMuDS";
452  bookME(ibooker, DiMuDS_, histname, histtitle, ds_binning_.nbins, ds_binning_.xmin, ds_binning_.xmax);
453  setMETitle(DiMuDS_, "DiMu_#ds", "events /");
454 
455  histname = "DiMuDCA";
456  histtitle = "DiMuDCA";
457  bookME(ibooker, DiMuDCA_, histname, histtitle, dca_binning_.nbins, dca_binning_.xmin, dca_binning_.xmax);
458  setMETitle(DiMuDCA_, "DiMu_#dca", "events /");
459  }
460  } // if (enum_ == 2 || enum_ == 4 || enum_ == 5 || enum_ == 8)
461  }
462 
463  bool changed = true;
464 
465  hltPrescale_->init(iRun, iSetup, "HLT", changed);
467 }
468 
470  // if valid HLT paths are required,
471  // analyze event only if all paths are valid
473  return;
474  }
475 
477  iEvent.getByToken(bsToken_, beamSpot);
478  if (!beamSpot.isValid()) {
479  return;
480  }
481 
483  iEvent.getByToken(muoToken_, muoHandle);
484  if (!muoHandle.isValid()) {
485  return;
486  }
487 
489  iEvent.getByToken(trToken_, trHandle);
490  if (!trHandle.isValid()) {
491  return;
492  }
493 
495  iEvent.getByToken(phToken_, phHandle);
496 
497  edm::Handle<edm::TriggerResults> handleTriggerTrigRes;
498 
499  const std::string& hltpath = getTriggerName(hltpaths_den[0]);
500  const std::string& hltpath1 = getTriggerName(hltpaths_num[0]);
501 
502  double PrescaleWeight = 1.0;
503  if (den_genTriggerEventFlag_->on() && den_genTriggerEventFlag_->accept(iEvent, iSetup) &&
504  num_genTriggerEventFlag_->on() && num_genTriggerEventFlag_->accept(iEvent, iSetup))
505  PrescaleWeight = Prescale(hltpath1, hltpath, iEvent, iSetup, hltPrescale_);
506 
507  if (tnp_ > 0) { //TnP method
508 
509  if (den_genTriggerEventFlag_->on() && !den_genTriggerEventFlag_->accept(iEvent, iSetup))
510  return;
512  if (handleTriggerEvent->sizeFilters() == 0)
513  return;
514 
515  std::vector<reco::Muon> tagMuons;
516  for (auto const& m : *muoHandle) { // applying tag selection
517  if (!matchToTrigger(hltpath, m))
518  continue;
519  if (muoSelection_ref(m))
520  tagMuons.push_back(m);
521  }
522 
523  for (int i = 0; i < int(tagMuons.size()); i++) {
524  for (auto const& m : *muoHandle) {
525  if (!matchToTrigger(hltpath, m))
526  continue;
527  if ((tagMuons[i].pt() == m.pt()))
528  continue; //not the same
529  if ((tagMuons[i].p4() + m.p4()).M() > minmass_ &&
530  (tagMuons[i].p4() + m.p4()).M() < maxmass_) { //near to J/psi mass
531  muPhi_.denominator->Fill(m.phi());
532  muEta_.denominator->Fill(m.eta());
533  muPt_.denominator->Fill(m.pt());
534  if (muoSelection_(m) && num_genTriggerEventFlag_->on() && num_genTriggerEventFlag_->accept(iEvent, iSetup)) {
535  muPhi_.numerator->Fill(m.phi(), PrescaleWeight);
536  muEta_.numerator->Fill(m.eta(), PrescaleWeight);
537  muPt_.numerator->Fill(m.pt(), PrescaleWeight);
538  }
539  }
540  }
541  }
542 
543  } else { // reference method
544 
545  if (den_genTriggerEventFlag_->on() && (!den_genTriggerEventFlag_->accept(iEvent, iSetup)))
546  return;
547 
549  if (handleTriggerEvent->sizeFilters() == 0)
550  return;
551 
552  for (auto const& m : *muoHandle) {
553  if (!muoSelection_ref(m))
554  continue;
555  if (!matchToTrigger(hltpath, m))
556  continue;
557 
558  for (auto const& m1 : *muoHandle) {
559  if (!(m1.pt() > m.pt()))
560  continue;
561  if (ptCut_) {
562  if (!muoSelection_(m1))
563  continue;
564  } else if (!muoSelection_ref(m1))
565  continue;
566  if (!matchToTrigger(hltpath, m1))
567  continue;
568 
569  if (enum_ != 10) {
570  if (!DMSelection_ref(m1.p4() + m.p4()))
571  continue;
572  if (m.charge() * m1.charge() > 0)
573  continue;
574  }
575 
576  // dimuon vertex reconstruction
578  const reco::BeamSpot& vertexBeamSpot = *beamSpot;
579  std::vector<reco::TransientTrack> j_tks;
580  reco::TransientTrack mu1TT(m.track(), &magneticField);
581  reco::TransientTrack mu2TT(m1.track(), &magneticField);
582  j_tks.push_back(mu1TT);
583  j_tks.push_back(mu2TT);
584  KalmanVertexFitter jkvf;
585  TransientVertex jtv = jkvf.vertex(j_tks);
586  if (!jtv.isValid())
587  continue;
588  reco::Vertex jpsivertex = jtv;
589  float dimuonCL = 0;
590  if ((jpsivertex.chi2() >= 0) && (jpsivertex.ndof() > 0))
591  dimuonCL = TMath::Prob(jpsivertex.chi2(), jpsivertex.ndof());
592  math::XYZVector jpperp(m.px() + m1.px(), m.py() + m1.py(), 0.);
593  GlobalPoint jVertex = jtv.position();
594  GlobalError jerr = jtv.positionError();
595  GlobalPoint displacementFromBeamspotJpsi(
596  -1 * ((vertexBeamSpot.x0() - jVertex.x()) + (jVertex.z() - vertexBeamSpot.z0()) * vertexBeamSpot.dxdz()),
597  -1 * ((vertexBeamSpot.y0() - jVertex.y()) + (jVertex.z() - vertexBeamSpot.z0()) * vertexBeamSpot.dydz()),
598  0);
599  reco::Vertex::Point vperpj(displacementFromBeamspotJpsi.x(), displacementFromBeamspotJpsi.y(), 0.);
600  float jpsi_cos = vperpj.Dot(jpperp) / (vperpj.R() * jpperp.R());
601  TrajectoryStateClosestToPoint mu1TS = mu1TT.impactPointTSCP();
602  TrajectoryStateClosestToPoint mu2TS = mu2TT.impactPointTSCP();
604  if (mu1TS.isValid() && mu2TS.isValid()) {
605  if (!cApp.calculate(mu1TS.theState(), mu2TS.theState()))
606  continue;
607  } else
608  continue;
609  double DiMuMass = (m1.p4() + m.p4()).M();
610 
611  switch (
612  enum_) { // enum_ = 1...9, represents different sets of variables for different paths, we want to have different hists for different paths
613 
614  case 1:
615 
616  tnp_ = true; // already filled hists for tnp method
617  [[fallthrough]];
618  case 2:
619 
620  if ((Jpsi_) && (!Upsilon_))
621  if (DiMuMass > maxmassJpsi || DiMuMass < minmassJpsi)
622  continue;
623  if ((!Jpsi_) && (Upsilon_))
624  if (DiMuMass > maxmassUpsilon || DiMuMass < minmassUpsilon)
625  continue;
626  if (dimuonCL < minprob)
627  continue;
628 
629  mu1Phi_.denominator->Fill(m.phi());
630  mu1Eta_.denominator->Fill(m.eta());
631  mu1Pt_.denominator->Fill(m.pt());
632  mu2Phi_.denominator->Fill(m1.phi());
633  mu2Eta_.denominator->Fill(m1.eta());
634  mu2Pt_.denominator->Fill(m1.pt());
635  DiMuPt_.denominator->Fill((m1.p4() + m.p4()).Pt());
636  DiMuEta_.denominator->Fill((m1.p4() + m.p4()).Eta());
637  DiMuPhi_.denominator->Fill((m1.p4() + m.p4()).Phi());
638 
639  if (num_genTriggerEventFlag_->on() && num_genTriggerEventFlag_->accept(iEvent, iSetup)) {
640  if (!matchToTrigger(hltpath1, m1))
641  continue;
642  if (!matchToTrigger(hltpath1, m))
643  continue;
644  mu1Phi_.numerator->Fill(m.phi(), PrescaleWeight);
645  mu1Eta_.numerator->Fill(m.eta(), PrescaleWeight);
646  mu1Pt_.numerator->Fill(m.pt(), PrescaleWeight);
647  mu2Phi_.numerator->Fill(m1.phi(), PrescaleWeight);
648  mu2Eta_.numerator->Fill(m1.eta(), PrescaleWeight);
649  mu2Pt_.numerator->Fill(m1.pt(), PrescaleWeight);
650  DiMuPt_.numerator->Fill((m1.p4() + m.p4()).Pt(), PrescaleWeight);
651  DiMuEta_.numerator->Fill((m1.p4() + m.p4()).Eta(), PrescaleWeight);
652  DiMuPhi_.numerator->Fill((m1.p4() + m.p4()).Phi(), PrescaleWeight);
653  }
654 
655  break;
656 
657  case 3:
658 
659  if ((Jpsi_) && (!Upsilon_))
660  if (DiMuMass > maxmassJpsi || DiMuMass < minmassJpsi)
661  continue;
662  if ((!Jpsi_) && (Upsilon_))
663  if (DiMuMass > maxmassUpsilon || DiMuMass < minmassUpsilon)
664  continue;
665  if (dimuonCL < minprob)
666  continue;
667 
668  mu1Phi_.denominator->Fill(m.phi());
669  mu1Eta_.denominator->Fill(m.eta());
670  mu1Pt_.denominator->Fill(m.pt());
671  mu2Phi_.denominator->Fill(m1.phi());
672  mu2Eta_.denominator->Fill(m1.eta());
673  mu2Pt_.denominator->Fill(m1.pt());
674 
675  if (num_genTriggerEventFlag_->on() && num_genTriggerEventFlag_->accept(iEvent, iSetup)) {
676  if (!matchToTrigger(hltpath1, m1))
677  continue;
678  if (!matchToTrigger(hltpath1, m))
679  continue;
680  mu1Phi_.numerator->Fill(m.phi(), PrescaleWeight);
681  mu1Eta_.numerator->Fill(m.eta(), PrescaleWeight);
682  mu1Pt_.numerator->Fill(m.pt(), PrescaleWeight);
683  mu2Phi_.numerator->Fill(m1.phi(), PrescaleWeight);
684  mu2Eta_.numerator->Fill(m1.eta(), PrescaleWeight);
685  mu2Pt_.numerator->Fill(m1.pt(), PrescaleWeight);
686  }
687 
688  break;
689 
690  case 4:
691 
692  if (dimuonCL < minprob)
693  continue;
694 
695  // fill mass plots without selecting mass region
696  DiMuMass_.denominator->Fill(DiMuMass);
697  if (num_genTriggerEventFlag_->on() && num_genTriggerEventFlag_->accept(iEvent, iSetup) &&
698  !(seagull_ && m.charge() * deltaPhi(m.phi(), m1.phi()) > 0) && matchToTrigger(hltpath1, m1) &&
699  matchToTrigger(hltpath1, m))
700  DiMuMass_.numerator->Fill(DiMuMass, PrescaleWeight);
701 
702  if ((Jpsi_) && (!Upsilon_))
703  if (DiMuMass > maxmassJpsi || DiMuMass < minmassJpsi)
704  continue;
705  if ((!Jpsi_) && (Upsilon_))
706  if (DiMuMass > maxmassUpsilon || DiMuMass < minmassUpsilon)
707  continue;
708 
709  mu1Phi_.denominator->Fill(m.phi());
710  mu1Eta_.denominator->Fill(m.eta());
711  mu1Pt_.denominator->Fill(m.pt());
712  mu2Phi_.denominator->Fill(m1.phi());
713  mu2Eta_.denominator->Fill(m1.eta());
714  mu2Pt_.denominator->Fill(m1.pt());
715  DiMuPt_.denominator->Fill((m1.p4() + m.p4()).Pt());
716  DiMuEta_.denominator->Fill((m1.p4() + m.p4()).Eta());
717  DiMuPhi_.denominator->Fill((m1.p4() + m.p4()).Phi());
719 
720  if (num_genTriggerEventFlag_->on() && num_genTriggerEventFlag_->accept(iEvent, iSetup)) {
721  if (seagull_ && m.charge() * deltaPhi(m.phi(), m1.phi()) > 0)
722  continue;
723  if (!matchToTrigger(hltpath1, m1))
724  continue;
725  if (!matchToTrigger(hltpath1, m))
726  continue;
727  mu1Phi_.numerator->Fill(m.phi(), PrescaleWeight);
728  mu1Eta_.numerator->Fill(m.eta(), PrescaleWeight);
729  mu1Pt_.numerator->Fill(m.pt(), PrescaleWeight);
730  mu2Phi_.numerator->Fill(m1.phi(), PrescaleWeight);
731  mu2Eta_.numerator->Fill(m1.eta(), PrescaleWeight);
732  mu2Pt_.numerator->Fill(m1.pt(), PrescaleWeight);
733  DiMuPt_.numerator->Fill((m1.p4() + m.p4()).Pt(), PrescaleWeight);
734  DiMuEta_.numerator->Fill((m1.p4() + m.p4()).Eta(), PrescaleWeight);
735  DiMuPhi_.numerator->Fill((m1.p4() + m.p4()).Phi(), PrescaleWeight);
736  DiMudR_.numerator->Fill(reco::deltaR(m, m1), PrescaleWeight);
737  }
738 
739  break;
740 
741  case 5:
742 
743  if (dimuonCL < minprob)
744  continue;
745  if ((Jpsi_) && (!Upsilon_))
746  if (DiMuMass > maxmassJpsi || DiMuMass < minmassJpsi)
747  continue;
748  if ((!Jpsi_) && (Upsilon_))
749  if (DiMuMass > maxmassUpsilon || DiMuMass < minmassUpsilon)
750  continue;
751 
752  mu1Phi_.denominator->Fill(m.phi());
753  mu1Eta_.denominator->Fill(m.eta());
754  mu1Pt_.denominator->Fill(m.pt());
755  mu2Phi_.denominator->Fill(m1.phi());
756  mu2Eta_.denominator->Fill(m1.eta());
757  mu2Pt_.denominator->Fill(m1.pt());
758  DiMuPt_.denominator->Fill((m1.p4() + m.p4()).Pt());
759  DiMuEta_.denominator->Fill((m1.p4() + m.p4()).Eta());
760  DiMuPhi_.denominator->Fill((m1.p4() + m.p4()).Phi());
762 
763  if (num_genTriggerEventFlag_->on() && num_genTriggerEventFlag_->accept(iEvent, iSetup)) {
764  if (seagull_ && m.charge() * deltaPhi(m.phi(), m1.phi()) > 0)
765  continue;
766  if (!matchToTrigger(hltpath1, m1))
767  continue;
768  if (!matchToTrigger(hltpath1, m))
769  continue;
770  mu1Phi_.numerator->Fill(m.phi(), PrescaleWeight);
771  mu1Eta_.numerator->Fill(m.eta(), PrescaleWeight);
772  mu1Pt_.numerator->Fill(m.pt(), PrescaleWeight);
773  mu2Phi_.numerator->Fill(m1.phi(), PrescaleWeight);
774  mu2Eta_.numerator->Fill(m1.eta(), PrescaleWeight);
775  mu2Pt_.numerator->Fill(m1.pt(), PrescaleWeight);
776  DiMuPt_.numerator->Fill((m1.p4() + m.p4()).Pt(), PrescaleWeight);
777  DiMuEta_.numerator->Fill((m1.p4() + m.p4()).Eta(), PrescaleWeight);
778  DiMuPhi_.numerator->Fill((m1.p4() + m.p4()).Phi(), PrescaleWeight);
779  DiMudR_.numerator->Fill(reco::deltaR(m, m1), PrescaleWeight);
780  }
781 
782  break;
783 
784  case 6:
785 
786  if (dimuonCL < minprob)
787  continue;
788  if ((Jpsi_) && (!Upsilon_))
789  if (DiMuMass > maxmassJpsi || DiMuMass < minmassJpsi)
790  continue;
791  if ((!Jpsi_) && (Upsilon_))
792  if (DiMuMass > maxmassUpsilon || DiMuMass < minmassUpsilon)
793  continue;
794 
795  for (auto const& m2 : *muoHandle) {
796  if (m2.pt() == m.pt())
797  continue; // remove duplicates but do not introduce ordering
798  if (m2.pt() == m1.pt())
799  continue; // -> m2 will be the non-resonant and non-vertexing muon in the triplet
800  if (!matchToTrigger(hltpath, m2))
801  continue;
802 
803  mu1Phi_.denominator->Fill(m.phi());
804  mu1Eta_.denominator->Fill(m.eta());
805  mu1Pt_.denominator->Fill(m.pt());
806  mu2Phi_.denominator->Fill(m1.phi());
807  mu2Eta_.denominator->Fill(m1.eta());
808  mu2Pt_.denominator->Fill(m1.pt());
809  mu3Phi_.denominator->Fill(m2.phi());
810  mu3Eta_.denominator->Fill(m2.eta());
811  mu3Pt_.denominator->Fill(m2.pt());
812 
813  if (num_genTriggerEventFlag_->on() && num_genTriggerEventFlag_->accept(iEvent, iSetup)) {
814  if (!matchToTrigger(hltpath1, m1))
815  continue;
816  if (!matchToTrigger(hltpath1, m))
817  continue;
818  if (!matchToTrigger(hltpath1, m2))
819  continue;
820  mu1Phi_.numerator->Fill(m.phi(), PrescaleWeight);
821  mu1Eta_.numerator->Fill(m.eta(), PrescaleWeight);
822  mu1Pt_.numerator->Fill(m.pt(), PrescaleWeight);
823  mu2Phi_.numerator->Fill(m1.phi(), PrescaleWeight);
824  mu2Eta_.numerator->Fill(m1.eta(), PrescaleWeight);
825  mu2Pt_.numerator->Fill(m1.pt(), PrescaleWeight);
826  mu3Phi_.numerator->Fill(m2.phi(), PrescaleWeight);
827  mu3Eta_.numerator->Fill(m2.eta(), PrescaleWeight);
828  mu3Pt_.numerator->Fill(m2.pt(), PrescaleWeight);
829  }
830  }
831 
832  break;
833 
834  case 7:
835 
836  if (phHandle.isValid()) {
837  if (!phHandle->empty())
838  for (auto const& p : *phHandle) {
839  if (!matchToTrigger(hltpath, p))
840  continue;
841 
842  phPhi_.denominator->Fill(p.phi());
843  phEta_.denominator->Fill(p.eta());
844  phPt_.denominator->Fill(p.pt());
845 
846  if (num_genTriggerEventFlag_->on() && num_genTriggerEventFlag_->accept(iEvent, iSetup)) {
847  if (!matchToTrigger(hltpath1, p))
848  continue;
849  if (!matchToTrigger(hltpath1, m))
850  continue;
851  if (!matchToTrigger(hltpath1, m1))
852  continue;
853  phPhi_.numerator->Fill(p.phi(), PrescaleWeight);
854  phEta_.numerator->Fill(p.eta(), PrescaleWeight);
855  phPt_.numerator->Fill(p.pt(), PrescaleWeight);
856  }
857  }
858  } else {
859  // if Handle is not valid, because the InputTag has been mis-configured, then skip the event
860  if (!phInputTag_.label().empty())
861  return;
862  }
863 
864  break;
865 
866  case 8: //vtx monitoring, filling probability, DS, DCA, cos of pointing angle to the PV, eta, pT of dimuon
867 
868  if (displaced_)
869  if ((displacementFromBeamspotJpsi.perp() / sqrt(jerr.rerr(displacementFromBeamspotJpsi))) < minDS)
870  continue;
871  if ((Jpsi_) && (!Upsilon_))
872  if (DiMuMass > maxmassJpsi || DiMuMass < minmassJpsi)
873  continue;
874  if ((!Jpsi_) && (Upsilon_))
875  if (DiMuMass > maxmassUpsilon || DiMuMass < minmassUpsilon)
876  continue;
877 
878  // fill vtx-prob plots before selecting on this variable
879  DiMuProb_.denominator->Fill(dimuonCL);
880  if (num_genTriggerEventFlag_->on() && num_genTriggerEventFlag_->accept(iEvent, iSetup) &&
881  matchToTrigger(hltpath1, m1) && matchToTrigger(hltpath1, m))
882  DiMuProb_.numerator->Fill(dimuonCL, PrescaleWeight);
883 
884  if (dimuonCL < minprob)
885  continue;
886 
887  DiMuDS_.denominator->Fill(displacementFromBeamspotJpsi.perp() /
888  sqrt(jerr.rerr(displacementFromBeamspotJpsi)));
889  DiMuPVcos_.denominator->Fill(jpsi_cos);
890  DiMuPt_.denominator->Fill((m1.p4() + m.p4()).Pt());
891  DiMuEta_.denominator->Fill((m1.p4() + m.p4()).Eta());
892  DiMuPhi_.denominator->Fill((m1.p4() + m.p4()).Phi());
894 
895  if (num_genTriggerEventFlag_->on() && num_genTriggerEventFlag_->accept(iEvent, iSetup)) {
896  if (!matchToTrigger(hltpath1, m1))
897  continue;
898  if (!matchToTrigger(hltpath1, m))
899  continue;
901  displacementFromBeamspotJpsi.perp() / sqrt(jerr.rerr(displacementFromBeamspotJpsi)), PrescaleWeight);
902  DiMuPVcos_.numerator->Fill(jpsi_cos, PrescaleWeight);
903  DiMuPt_.numerator->Fill((m1.p4() + m.p4()).Pt(), PrescaleWeight);
904  DiMuEta_.numerator->Fill((m1.p4() + m.p4()).Eta(), PrescaleWeight);
905  DiMuPhi_.numerator->Fill((m1.p4() + m.p4()).Phi(), PrescaleWeight);
906  DiMuDCA_.numerator->Fill(cApp.distance(), PrescaleWeight);
907  }
908 
909  break;
910 
911  case 9:
912 
913  if (dimuonCL < minprob)
914  continue;
915  if (fabs(jpsi_cos) < mincos)
916  continue;
917  if ((displacementFromBeamspotJpsi.perp() / sqrt(jerr.rerr(displacementFromBeamspotJpsi))) < minDS)
918  continue;
919 
920  if (trHandle.isValid())
921  for (auto const& t : *trHandle) {
922  if (!trSelection_ref(t))
923  continue;
924  const reco::Track& itrk1 = t;
925  if (reco::deltaR(t, m1) <= min_dR)
926  continue;
927  if (reco::deltaR(t, m) <= min_dR)
928  continue;
930  continue;
931 
932  // reconstruct B+ hadron
934  double trackMass2 = kaon_mass * kaon_mass;
935  double MuMass2 = mu_mass * mu_mass;
936  double e1 = sqrt(m.momentum().Mag2() + MuMass2);
937  double e2 = sqrt(m1.momentum().Mag2() + MuMass2);
938  double e3 = sqrt(itrk1.momentum().Mag2() + trackMass2);
939  p1 = reco::Particle::LorentzVector(m.px(), m.py(), m.pz(), e1);
940  p2 = reco::Particle::LorentzVector(m1.px(), m1.py(), m1.pz(), e2);
941  p3 = reco::Particle::LorentzVector(itrk1.px(), itrk1.py(), itrk1.pz(), e3);
942  pB = p1 + p2 + p3;
943  if (pB.mass() > maxmassJpsiTk || pB.mass() < minmassJpsiTk)
944  continue;
945  reco::TransientTrack trTT(itrk1, &magneticField);
946  std::vector<reco::TransientTrack> t_tks;
947  t_tks.push_back(mu1TT);
948  t_tks.push_back(mu2TT);
949  t_tks.push_back(trTT);
950  KalmanVertexFitter kvf;
951  TransientVertex tv = kvf.vertex(t_tks);
952  reco::Vertex vertex = tv;
953  if (!tv.isValid())
954  continue;
955  float JpsiTkCL = 0;
956  if ((vertex.chi2() >= 0.0) && (vertex.ndof() > 0))
957  JpsiTkCL = TMath::Prob(vertex.chi2(), vertex.ndof());
958  math::XYZVector pperp(m.px() + m1.px() + itrk1.px(), m.py() + m1.py() + itrk1.py(), 0.);
961  GlobalPoint displacementFromBeamspot(
962  -1 * ((vertexBeamSpot.x0() - secondaryVertex.x()) +
963  (secondaryVertex.z() - vertexBeamSpot.z0()) * vertexBeamSpot.dxdz()),
964  -1 * ((vertexBeamSpot.y0() - secondaryVertex.y()) +
965  (secondaryVertex.z() - vertexBeamSpot.z0()) * vertexBeamSpot.dydz()),
966  0);
967  reco::Vertex::Point vperp(displacementFromBeamspot.x(), displacementFromBeamspot.y(), 0.);
968  float jpsiKcos = vperp.Dot(pperp) / (vperp.R() * pperp.R());
969  if (JpsiTkCL < minprob)
970  continue;
971  if (fabs(jpsiKcos) < mincos)
972  continue;
973  if ((displacementFromBeamspot.perp() / sqrt(err.rerr(displacementFromBeamspot))) < minDS)
974  continue;
975 
976  muPhi_.denominator->Fill(t.phi());
977  muEta_.denominator->Fill(t.eta());
978  muPt_.denominator->Fill(t.pt());
979  BMass_.denominator->Fill(pB.mass());
980 
981  if (num_genTriggerEventFlag_->on() && num_genTriggerEventFlag_->accept(iEvent, iSetup)) {
982  if (!matchToTrigger(hltpath1, m1))
983  continue;
984  if (!matchToTrigger(hltpath1, m))
985  continue;
986  if (!matchToTrigger(hltpath1, t))
987  continue;
988  muPhi_.numerator->Fill(t.phi(), PrescaleWeight);
989  muEta_.numerator->Fill(t.eta(), PrescaleWeight);
990  muPt_.numerator->Fill(t.pt(), PrescaleWeight);
991  BMass_.numerator->Fill(pB.mass(), PrescaleWeight);
992  }
993  }
994 
995  break;
996 
997  case 10:
998 
999  if (trHandle.isValid())
1000  for (auto const& t : *trHandle) {
1001  if (!trSelection_ref(t))
1002  continue;
1003  const reco::Track& itrk1 = t;
1004  if (reco::deltaR(t, m1) <= min_dR)
1005  continue;
1006  if (reco::deltaR(t, m) <= min_dR)
1007  continue;
1009  continue;
1010 
1011  // reconstruct Mu+TkMu structure
1013  double trackMass2 = kaon_mass * kaon_mass;
1014  double MuMass2 = mu_mass * mu_mass;
1015  double e2 = sqrt(m1.momentum().Mag2() + MuMass2);
1016  double e3 = sqrt(itrk1.momentum().Mag2() + trackMass2);
1017  p2 = reco::Particle::LorentzVector(m1.px(), m1.py(), m1.pz(), e2);
1018  p3 = reco::Particle::LorentzVector(itrk1.px(), itrk1.py(), itrk1.pz(), e3);
1019  pB = p2 + p3;
1020  if (pB.mass() > maxmassJpsiTk || pB.mass() < minmassJpsiTk)
1021  continue;
1022  reco::TransientTrack trTT(itrk1, &magneticField);
1023  std::vector<reco::TransientTrack> t_tks;
1024  t_tks.push_back(mu2TT);
1025  t_tks.push_back(trTT);
1026  KalmanVertexFitter kvf;
1027  TransientVertex tv = kvf.vertex(t_tks);
1028  reco::Vertex vertex = tv;
1029  if (!tv.isValid())
1030  continue;
1031  float JpsiTkCL = 0;
1032  if ((vertex.chi2() >= 0.0) && (vertex.ndof() > 0))
1033  JpsiTkCL = TMath::Prob(vertex.chi2(), vertex.ndof());
1034  math::XYZVector pperp(m1.px() + itrk1.px(), m1.py() + itrk1.py(), 0.);
1036  GlobalError err = tv.positionError();
1037  GlobalPoint displacementFromBeamspot(
1038  -1 * ((vertexBeamSpot.x0() - secondaryVertex.x()) +
1039  (secondaryVertex.z() - vertexBeamSpot.z0()) * vertexBeamSpot.dxdz()),
1040  -1 * ((vertexBeamSpot.y0() - secondaryVertex.y()) +
1041  (secondaryVertex.z() - vertexBeamSpot.z0()) * vertexBeamSpot.dydz()),
1042  0);
1043  reco::Vertex::Point vperp(displacementFromBeamspot.x(), displacementFromBeamspot.y(), 0.);
1044  if (JpsiTkCL < minprob)
1045  continue;
1046 
1047  muPhi_.denominator->Fill(m1.phi());
1048  muEta_.denominator->Fill(m1.eta());
1049  muPt_.denominator->Fill(m1.pt());
1050 
1051  if (num_genTriggerEventFlag_->on() && num_genTriggerEventFlag_->accept(iEvent, iSetup)) {
1052  if (!matchToTrigger(hltpath1, m1))
1053  continue;
1054  if (!matchToTrigger(hltpath1, m))
1055  continue;
1056  if (!matchToTrigger(hltpath1, t))
1057  continue;
1058  muPhi_.numerator->Fill(m1.phi(), PrescaleWeight);
1059  muEta_.numerator->Fill(m1.eta(), PrescaleWeight);
1060  muPt_.numerator->Fill(m1.pt(), PrescaleWeight);
1061  }
1062  }
1063 
1064  break;
1065 
1066  case 11:
1067 
1068  if (dimuonCL < minprob)
1069  continue;
1070  if (fabs(jpsi_cos) < mincos)
1071  continue;
1072  if (displacementFromBeamspotJpsi.perp() / sqrt(jerr.rerr(displacementFromBeamspotJpsi)) < minDS)
1073  continue;
1074 
1075  if (trHandle.isValid())
1076  for (auto const& t : *trHandle) {
1077  if (!trSelection_ref(t))
1078  continue;
1079  if ((reco::deltaR(t, m) <= min_dR))
1080  continue;
1081  if ((reco::deltaR(t, m1) <= min_dR))
1082  continue;
1083 
1084  for (auto const& t1 : *trHandle) {
1085  if (&t - &(*trHandle)[0] >= &t1 - &(*trHandle)[0])
1086  continue; // not enough, need the following DeltaR checks
1087  if (!trSelection_ref(t1))
1088  continue;
1089  if ((reco::deltaR(t1, m) <= min_dR))
1090  continue;
1091  if ((reco::deltaR(t1, m1) <= min_dR))
1092  continue;
1093  if ((reco::deltaR(t, t1) <= min_dR))
1094  continue;
1095  const reco::Track& itrk1 = t;
1096  const reco::Track& itrk2 = t1;
1098  continue;
1100  continue;
1101 
1102  // reconstruct Bs candidate
1103  reco::Particle::LorentzVector pB, pTkTk, p1, p2, p3, p4;
1104  double trackMass2 = kaon_mass * kaon_mass;
1105  double MuMass2 = mu_mass * mu_mass;
1106  double e1 = sqrt(m.momentum().Mag2() + MuMass2);
1107  double e2 = sqrt(m1.momentum().Mag2() + MuMass2);
1108  double e3 = sqrt(itrk1.momentum().Mag2() + trackMass2);
1109  double e4 = sqrt(itrk2.momentum().Mag2() + trackMass2);
1110  p1 = reco::Particle::LorentzVector(m.px(), m.py(), m.pz(), e1);
1111  p2 = reco::Particle::LorentzVector(m1.px(), m1.py(), m1.pz(), e2);
1112  p3 = reco::Particle::LorentzVector(itrk1.px(), itrk1.py(), itrk1.pz(), e3);
1113  p4 = reco::Particle::LorentzVector(itrk2.px(), itrk2.py(), itrk2.pz(), e4);
1114  pTkTk = p3 + p4;
1115  if (pTkTk.mass() > maxmassTkTk || pTkTk.mass() < minmassTkTk)
1116  continue;
1117  pB = p1 + p2 + p3 + p4;
1118  if (pB.mass() > maxmassJpsiTk || pB.mass() < minmassJpsiTk)
1119  continue;
1120  reco::TransientTrack mu1TT(m.track(), &magneticField);
1121  reco::TransientTrack mu2TT(m1.track(), &magneticField);
1122  reco::TransientTrack trTT(itrk1, &magneticField);
1123  reco::TransientTrack tr1TT(itrk2, &magneticField);
1124  std::vector<reco::TransientTrack> t_tks;
1125  t_tks.push_back(mu1TT);
1126  t_tks.push_back(mu2TT);
1127  t_tks.push_back(trTT);
1128  t_tks.push_back(tr1TT);
1129  KalmanVertexFitter kvf;
1130  TransientVertex tv = kvf.vertex(t_tks); // this will compare the tracks
1131  reco::Vertex vertex = tv;
1132  if (!tv.isValid())
1133  continue;
1134  float JpsiTkCL = 0;
1135  if ((vertex.chi2() >= 0.0) && (vertex.ndof() > 0))
1136  JpsiTkCL = TMath::Prob(vertex.chi2(), vertex.ndof());
1137  math::XYZVector pperp(
1138  m.px() + m1.px() + itrk1.px() + itrk2.px(), m.py() + m1.py() + itrk1.py() + itrk2.py(), 0.);
1140  GlobalError err = tv.positionError();
1141  GlobalPoint displacementFromBeamspot(
1142  -1 * ((vertexBeamSpot.x0() - secondaryVertex.x()) +
1143  (secondaryVertex.z() - vertexBeamSpot.z0()) * vertexBeamSpot.dxdz()),
1144  -1 * ((vertexBeamSpot.y0() - secondaryVertex.y()) +
1145  (secondaryVertex.z() - vertexBeamSpot.z0()) * vertexBeamSpot.dydz()),
1146  0);
1147  reco::Vertex::Point vperp(displacementFromBeamspot.x(), displacementFromBeamspot.y(), 0.);
1148  float jpsiKcos = vperp.Dot(pperp) / (vperp.R() * pperp.R());
1149  if (JpsiTkCL < minprob)
1150  continue;
1151  if (fabs(jpsiKcos) < mincos)
1152  continue;
1153  if ((displacementFromBeamspot.perp() / sqrt(err.rerr(displacementFromBeamspot))) < minDS)
1154  continue;
1155 
1156  mu1Phi_.denominator->Fill(t.phi());
1157  mu1Eta_.denominator->Fill(t.eta());
1158  mu1Pt_.denominator->Fill(t.pt());
1159  mu2Phi_.denominator->Fill(t1.phi());
1160  mu2Eta_.denominator->Fill(t1.eta());
1161  mu2Pt_.denominator->Fill(t1.pt());
1162  BMass_.denominator->Fill(pB.mass());
1163 
1164  if (num_genTriggerEventFlag_->on() && num_genTriggerEventFlag_->accept(iEvent, iSetup)) {
1165  if (!matchToTrigger(hltpath1, m))
1166  continue;
1167  if (!matchToTrigger(hltpath1, m1))
1168  continue;
1169  if (!matchToTrigger(hltpath1, t))
1170  continue;
1171  if (!matchToTrigger(hltpath1, t1))
1172  continue;
1173  mu1Phi_.numerator->Fill(t.phi(), PrescaleWeight);
1174  mu1Eta_.numerator->Fill(t.eta(), PrescaleWeight);
1175  mu1Pt_.numerator->Fill(t.pt(), PrescaleWeight);
1176  mu2Phi_.numerator->Fill(t1.phi(), PrescaleWeight);
1177  mu2Eta_.numerator->Fill(t1.eta(), PrescaleWeight);
1178  mu2Pt_.numerator->Fill(t1.pt(), PrescaleWeight);
1179  BMass_.numerator->Fill(pB.mass(), PrescaleWeight);
1180  }
1181 
1182  } // for (auto const & t1 : *trHandle)
1183  } // for (auto const & t : *trHandle)
1184 
1185  break;
1186  }
1187  }
1188  }
1189  }
1190 }
1191 
1194  desc.add<std::string>("FolderName", "HLT/BPH/");
1195  desc.add<bool>("requireValidHLTPaths", true);
1196 
1197  desc.add<edm::InputTag>("tracks", edm::InputTag("generalTracks"));
1198  desc.add<edm::InputTag>("photons", edm::InputTag("photons"));
1199  desc.add<edm::InputTag>("offlinePVs", edm::InputTag("offlinePrimaryVertices"));
1200  desc.add<edm::InputTag>("beamSpot", edm::InputTag("offlineBeamSpot"));
1201  desc.add<edm::InputTag>("muons", edm::InputTag("muons"));
1202  desc.add<edm::InputTag>("hltTriggerSummaryAOD", edm::InputTag("hltTriggerSummaryAOD", "", "HLT"));
1203  desc.add<std::string>("muoSelection", "");
1204  desc.add<std::string>("muoSelection_ref",
1205  "isPFMuon & isGlobalMuon & innerTrack.hitPattern.trackerLayersWithMeasurement>5 & "
1206  "innerTrack.hitPattern.numberOfValidPixelHits> 0");
1207  desc.add<std::string>(
1208  "muoSelection_tag",
1209  "isGlobalMuon && isPFMuon && isTrackerMuon && abs(eta) < 2.4 && innerTrack.hitPattern.numberOfValidPixelHits > 0 "
1210  "&& innerTrack.hitPattern.trackerLayersWithMeasurement > 5 && globalTrack.hitPattern.numberOfValidMuonHits > 0 "
1211  "&& globalTrack.normalizedChi2 < 10"); // tight selection for tag muon
1212  desc.add<std::string>("muoSelection_probe",
1213  "isPFMuon & isGlobalMuon & innerTrack.hitPattern.trackerLayersWithMeasurement>5 & "
1214  "innerTrack.hitPattern.numberOfValidPixelHits> 0");
1215  desc.add<std::string>("trSelection_ref", "");
1216  desc.add<std::string>("DMSelection_ref", "Pt>4 & abs(eta)");
1217 
1218  desc.add<int>("nmuons", 1);
1219  desc.add<bool>("tnp", false);
1220  desc.add<int>("L3", 0);
1221  desc.add<int>("ptCut", 0);
1222  desc.add<int>("displaced", 0);
1223  desc.add<int>("trOrMu", 0); // if =0, track param monitoring
1224  desc.add<int>("Jpsi", 0);
1225  desc.add<int>("Upsilon", 0);
1226  desc.add<int>("enum", 1); // 1...9, 9 sets of variables to be filled, depends on the hlt path
1227  desc.add<int>("seagull", 1);
1228  desc.add<double>("maxmass", 3.596);
1229  desc.add<double>("minmass", 2.596);
1230  desc.add<double>("maxmassJpsi", 3.2);
1231  desc.add<double>("minmassJpsi", 3.);
1232  desc.add<double>("maxmassUpsilon", 10.0);
1233  desc.add<double>("minmassUpsilon", 8.8);
1234  desc.add<double>("maxmassTkTk", 10);
1235  desc.add<double>("minmassTkTk", 0);
1236  desc.add<double>("maxmassJpsiTk", 5.46);
1237  desc.add<double>("minmassJpsiTk", 5.1);
1238  desc.add<double>("kaon_mass", 0.493677);
1239  desc.add<double>("mu_mass", 0.1056583745);
1240  desc.add<double>("min_dR", 0.001);
1241  desc.add<double>("max_dR", 1.4);
1242  desc.add<double>("minprob", 0.005);
1243  desc.add<double>("mincos", 0.95);
1244  desc.add<double>("minDS", 3.);
1246  desc, 1, edm::InputTag("gtStage2Digis"), edm::InputTag("gtStage2Digis"), false);
1247 
1250 
1251  desc.add<edm::ParameterSetDescription>("numGenericTriggerEventPSet", genericTriggerEventPSet);
1252  desc.add<edm::ParameterSetDescription>("denGenericTriggerEventPSet", genericTriggerEventPSet);
1253 
1258  edm::ParameterSetDescription dMu_ptPSet;
1272  fillHistoPSetDescription(dMu_ptPSet);
1282  fillHistoPSetDescription(probPSet);
1283  histoPSet.add<std::vector<double>>("ptBinning", {-0.5, 0, 2, 4, 8, 10, 12, 16, 20, 25, 30, 35, 40, 50});
1284  histoPSet.add<std::vector<double>>("dMuPtBinning", {6, 8, 12, 16, 20, 25, 30, 35, 40, 50, 70});
1285  histoPSet.add<std::vector<double>>("probBinning",
1286  {0.01, 0.02, 0.04, 0.06, 0.08, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0});
1297  desc.add<edm::ParameterSetDescription>("histoPSet", histoPSet);
1298 
1299  descriptions.add("bphMonitoring", desc);
1300 }
1301 
1303  const std::string trigger_name_tmp = partialName.substr(0, partialName.find("v*"));
1304  const unsigned int Ntriggers(hltConfig_.size());
1305  std::string trigger_name = "";
1306  for (unsigned int i = 0; i < Ntriggers; i++) {
1307  trigger_name = hltConfig_.triggerName(i);
1308  if (trigger_name.find(trigger_name_tmp) != std::string::npos)
1309  break;
1310  }
1311 
1312  return trigger_name;
1313 }
1314 
1315 template <typename T>
1316 bool BPHMonitor::matchToTrigger(const std::string& theTriggerName, T t) {
1317  bool matched = false;
1318  //validity check
1319  if (!hltConfig_.inited())
1320  return false;
1321 
1322  //Find the precise trigger name
1323  std::string trigger_name = getTriggerName(theTriggerName);
1324  const unsigned int trigger_index = hltConfig_.triggerIndex(trigger_name);
1325 
1326  //loop over all the modules for this trigger
1327  //by default use the last one
1328  unsigned int Nmodules = hltConfig_.size(trigger_index);
1329  const vector<string>& moduleLabels(hltConfig_.moduleLabels(trigger_index));
1330  unsigned int fIdx = 0;
1331  for (unsigned int i = 0; i < Nmodules; i++) {
1332  const unsigned int tmp_fIdx =
1334  if (tmp_fIdx < handleTriggerEvent->sizeFilters()) //index of not used filters are set to sizeFilters()
1335  {
1336  fIdx = tmp_fIdx;
1337  } //good index
1338  }
1339 
1340  //loop over all the objects in the filter of choice
1341  const trigger::Keys& KEYS(handleTriggerEvent->filterKeys(fIdx));
1342  const trigger::size_type nK(KEYS.size());
1344  for (trigger::size_type i = 0; i != nK; ++i) {
1345  const trigger::TriggerObject& TO(TOC[KEYS[i]]);
1346  //perform matching: deltaR and pt check
1347  if ((reco::deltaR(t.eta(), t.phi(), TO.eta(), TO.phi()) <= 0.2) && (TMath::Abs(t.pt() - TO.pt()) < 0.12)) {
1348  matched = true;
1349  }
1350  }
1351 
1352  return matched;
1353 }
1354 
1355 double BPHMonitor::Prescale(const std::string hltpath1,
1356  const std::string hltpath,
1357  edm::Event const& iEvent,
1358  edm::EventSetup const& iSetup,
1360  double Prescale_num = 1;
1361  double L1P = 1, HLTP = 1;
1362  bool flag = true;
1363  std::vector<bool> theSame_den;
1364  std::vector<bool> theSame_num;
1365  // object holding L1T (double) and HLT (uint) prescales
1366  auto const prescales_den = hltPrescale_->prescaleValuesInDetail<double>(iEvent, iSetup, hltpath);
1367  auto const prescales_num = hltPrescale_->prescaleValuesInDetail<double>(iEvent, iSetup, hltpath1);
1368  // retrieving HLT prescale
1369  auto PrescaleHLT_den = prescales_den.second;
1370  auto PrescaleHLT_num = prescales_num.second;
1371  if (PrescaleHLT_den > 0 && PrescaleHLT_num > 0)
1372  HLTP = PrescaleHLT_num / std::min(PrescaleHLT_num, PrescaleHLT_den);
1373 
1374  //retrieving L1 prescale
1375  //Checking if we have the same l1 seeds in den and num
1376  //taking into account that they can be written in different order in num and den
1377  //and some of them can be also switched off
1378 
1379  //check if for each den l1 there is the same l1 seed in num
1380  if (not prescales_den.first.empty()) {
1381  for (size_t iSeed = 0; iSeed < prescales_den.first.size(); ++iSeed) {
1382  auto l1_den = prescales_den.first.at(iSeed).first;
1383  auto l1_denp = prescales_den.first.at(iSeed).second;
1384  if (l1_denp < 1)
1385  continue;
1386  flag = false;
1387  for (size_t iSeed1 = 0; iSeed1 < prescales_num.first.size(); ++iSeed1) {
1388  auto l1_num = prescales_num.first.at(iSeed1).first;
1389  auto l1_nump = prescales_num.first.at(iSeed1).second;
1390  if (l1_num == l1_den && l1_nump >= 1) //the same seed
1391  {
1392  flag = true;
1393  break;
1394  }
1395  }
1396  theSame_den.push_back(flag);
1397  }
1398  }
1399  //check if for each num l1 there is the same l1 seed in den
1400  if (not prescales_num.first.empty()) {
1401  for (size_t iSeed = 0; iSeed < prescales_num.first.size(); ++iSeed) {
1402  auto l1_num = prescales_num.first.at(iSeed).first;
1403  auto l1_nump = prescales_num.first.at(iSeed).second;
1404  if (l1_nump < 1)
1405  continue;
1406  flag = false;
1407  for (size_t iSeed1 = 0; iSeed1 < prescales_den.first.size(); ++iSeed1) {
1408  auto l1_den = prescales_den.first.at(iSeed1).first;
1409  auto l1_denp = prescales_den.first.at(iSeed1).second;
1410  if (l1_den == l1_num && l1_denp >= 1) //the same seed
1411  {
1412  flag = true;
1413  break;
1414  }
1415  }
1416  theSame_num.push_back(flag);
1417  }
1418  }
1419  flag = true;
1420 
1421  if (theSame_num.size() == theSame_den.size()) {
1422  for (size_t i = 0; i < theSame_num.size(); ++i) {
1423  if ((!theSame_num.at(i)) || (!theSame_den.at(i))) {
1424  flag = false;
1425  break;
1426  }
1427  }
1428  }
1429 
1430  if (flag && (theSame_num.size() == theSame_den.size())) {
1431  L1P = 1; //den and num have the same set of l1 seeds
1432  } else {
1433  if (not prescales_num.first.empty()) {
1434  Prescale_num = 1;
1435  for (size_t iSeed = 0; iSeed < prescales_num.first.size(); ++iSeed) {
1436  auto l1 = prescales_num.first.at(iSeed).second;
1437  if (l1 < 1)
1438  continue;
1439  if (l1 == 1) {
1440  Prescale_num = 1;
1441  break;
1442  } else
1443  Prescale_num *= 1 - (1.0 / (l1));
1444  }
1445  if (Prescale_num != 1)
1446  Prescale_num = 1.0 / (1 - Prescale_num);
1447  }
1448  L1P = Prescale_num;
1449  }
1450 
1451  return L1P * HLTP;
1452 }
1453 
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:552
const bool requireValidHLTPaths_
Definition: BPHMonitor.cc:72
ObjME muPhi_
Definition: BPHMonitor.cc:103
MEbinning z0_binning_
Definition: BPHMonitor.cc:95
const std::string & triggerName(unsigned int triggerIndex) const
ObjME DiMuMass_
Definition: BPHMonitor.cc:135
static void fillPSetDescription(edm::ParameterSetDescription &desc, unsigned int stageL1Trigger, edm::InputTag const &l1tAlgBlkInputTag, edm::InputTag const &l1tExtBlkInputTag, bool readPrescalesFromFile)
const Keys & filterKeys(trigger::size_type index) const
Definition: TriggerEvent.h:119
ObjME DiMuProb_
Definition: BPHMonitor.cc:132
double max_dR
Definition: BPHMonitor.cc:172
T perp() const
Definition: PV3DBase.h:69
bool hltPathsAreValid_
Definition: BPHMonitor.cc:73
double maxmassJpsiTk
Definition: BPHMonitor.cc:167
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
double kaon_mass
Definition: BPHMonitor.cc:169
GlobalPoint position() const
float distance() const override
ObjME muz0_
Definition: BPHMonitor.cc:107
ObjME phPhi_
Definition: BPHMonitor.cc:125
HLTPrescaleProvider * hltPrescale_
Definition: BPHMonitor.cc:142
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
StringCutObjectSelector< reco::Track, true > trSelection_
Definition: BPHMonitor.cc:182
T z() const
Definition: PV3DBase.h:61
GlobalError positionError() const
StringCutObjectSelector< reco::Candidate::LorentzVector, true > DMSelection_ref
Definition: BPHMonitor.cc:184
edm::EDGetTokenT< reco::MuonCollection > muoToken_
Definition: BPHMonitor.cc:81
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:640
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: BPHMonitor.cc:140
edm::InputTag bsInputTag_
Definition: BPHMonitor.cc:76
ObjME mu1d0_
Definition: BPHMonitor.cc:112
trigger::size_type sizeFilters() const
Definition: TriggerEvent.h:147
ObjME DiMuPt_
Definition: BPHMonitor.cc:130
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
double Prescale(const std::string num, const std::string den, edm::Event const &iEvent, edm::EventSetup const &iSetup, HLTPrescaleProvider *hltPrescale_)
Definition: BPHMonitor.cc:1355
std::pair< std::vector< std::pair< std::string, TL1 > >, THLT > prescaleValuesInDetail(const edm::Event &iEvent, const edm::EventSetup &iSetup, const std::string &trigger)
ObjME mu1z0_
Definition: BPHMonitor.cc:113
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:643
StringCutObjectSelector< reco::Muon, true > muoSelection_ref
Definition: BPHMonitor.cc:145
ObjME mu3Eta_
Definition: BPHMonitor.cc:120
HLTConfigProvider const & hltConfigProvider() const
double dydz() const
dydz slope
Definition: BeamSpot.h:80
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
ObjME phEta_
Definition: BPHMonitor.cc:126
ObjME DiMudR_
Definition: BPHMonitor.cc:137
MEbinning eta_binning_
Definition: BPHMonitor.cc:93
static void fillHistoPSetDescription(edm::ParameterSetDescription &pset)
ObjME DiMuDCA_
Definition: BPHMonitor.cc:134
std::string const & label() const
Definition: InputTag.h:36
edm::EDGetTokenT< trigger::TriggerEvent > hltInputTag_
Definition: BPHMonitor.cc:179
double maxmassTkTk
Definition: BPHMonitor.cc:165
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
double ndof() const
Definition: Vertex.h:124
std::vector< Vertex > VertexCollection
Definition: Vertex.h:31
muons
the two sets of parameters below are mutually exclusive, depending if RECO or ALCARECO is used the us...
Definition: DiMuonV_cfg.py:214
uint16_t size_type
ObjME muEta_
Definition: BPHMonitor.cc:104
void setMETitle(ObjME &me, const std::string &titleX, const std::string &titleY)
edm::EDGetTokenT< reco::TrackCollection > trToken_
Definition: BPHMonitor.cc:83
double minmass_
Definition: BPHMonitor.cc:160
bool inited() const
Accessors (const methods)
ObjME mu2Pt_
Definition: BPHMonitor.cc:116
std::vector< Muon > MuonCollection
collection of Muon objects
Definition: MuonFwd.h:9
double minprob
Definition: BPHMonitor.cc:174
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const override
void Fill(long long x)
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:21
double x0() const
x coordinate
Definition: BeamSpot.h:61
ObjME mu3Pt_
Definition: BPHMonitor.cc:121
MEbinning dca_binning_
Definition: BPHMonitor.cc:99
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
static MEbinning getHistoPSet(const edm::ParameterSet &pset)
const std::string folderName_
Definition: BPHMonitor.cc:70
int displaced_
Definition: BPHMonitor.cc:153
int iEvent
Definition: GenABIO.cc:224
ObjME mu2d0_
Definition: BPHMonitor.cc:117
ObjME mu1Pt_
Definition: BPHMonitor.cc:111
Definition: Muon.py:1
double mincos
Definition: BPHMonitor.cc:175
unsigned int size() const
number of trigger paths in trigger table
double maxmassJpsi
Definition: BPHMonitor.cc:161
bool isValid() const
ObjME mud0_
Definition: BPHMonitor.cc:106
bool calculate(const TrajectoryStateOnSurface &sta, const TrajectoryStateOnSurface &stb) override
edm::InputTag muoInputTag_
Definition: BPHMonitor.cc:75
ObjME DiMuPVcos_
Definition: BPHMonitor.cc:131
T sqrt(T t)
Definition: SSEVec.h:19
MEbinning dR_binning_
Definition: BPHMonitor.cc:96
edm::InputTag vtxInputTag_
Definition: BPHMonitor.cc:79
edm::Handle< edm::TriggerResults > HLTR
Definition: BPHMonitor.cc:189
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
StringCutObjectSelector< reco::Track, true > trSelection_ref
Definition: BPHMonitor.cc:183
double mu_mass
Definition: BPHMonitor.cc:170
edm::EDGetTokenT< reco::VertexCollection > vtxToken_
Definition: BPHMonitor.cc:85
MonitorElement * denominator
ObjME mu2Phi_
Definition: BPHMonitor.cc:114
MonitorElement * numerator
HLTConfigProvider hltConfig_
Definition: BPHMonitor.cc:188
BPHMonitor(const edm::ParameterSet &)
Definition: BPHMonitor.cc:193
dqm::reco::DQMStore DQMStore
Definition: BPHMonitor.cc:50
const TriggerObjectCollection & getObjects() const
Definition: TriggerEvent.h:102
ObjME mu3Phi_
Definition: BPHMonitor.cc:119
math::XYZTLorentzVector LorentzVector
math::XYZPoint Point
point in the space
Definition: Vertex.h:40
def template(fileName, svg, replaceme="REPLACEME")
Definition: svgfig.py:521
MEbinning phi_binning_
Definition: BPHMonitor.cc:92
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
enum
Upsilon = 1,.
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
dqm::reco::MonitorElement MonitorElement
Definition: BPHMonitor.cc:49
ObjME DiMuEta_
Definition: BPHMonitor.cc:129
double y0() const
y coordinate
Definition: BeamSpot.h:63
ObjME DiMuPhi_
Definition: BPHMonitor.cc:128
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magneticFieldToken_
Definition: BPHMonitor.cc:87
MEbinning ds_binning_
Definition: BPHMonitor.cc:100
edm::EDGetTokenT< edm::TriggerResults > hltTrigResTag_
Definition: BPHMonitor.cc:177
ObjME BMass_
Definition: BPHMonitor.cc:136
void analyze(edm::Event const &iEvent, edm::EventSetup const &iSetup) override
Definition: BPHMonitor.cc:469
ObjME mu1Phi_
Definition: BPHMonitor.cc:109
ObjME mu3d0_
Definition: BPHMonitor.cc:122
double maxmass_
Definition: BPHMonitor.cc:159
MEbinning cos_binning_
Definition: BPHMonitor.cc:101
std::vector< std::string > hltpaths_den
Definition: BPHMonitor.cc:181
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
MEbinning d0_binning_
Definition: BPHMonitor.cc:94
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: BPHMonitor.cc:295
std::vector< double > pt_variable_binning_
Definition: BPHMonitor.cc:89
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:75
double minmassJpsiTk
Definition: BPHMonitor.cc:168
std::vector< double > dMu_pt_variable_binning_
Definition: BPHMonitor.cc:90
edm::EDGetTokenT< reco::PhotonCollection > phToken_
Definition: BPHMonitor.cc:84
ObjME mu1Eta_
Definition: BPHMonitor.cc:110
edm::EDGetTokenT< reco::BeamSpot > bsToken_
Definition: BPHMonitor.cc:82
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: BPHMonitor.cc:1192
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
Definition: TriggerEvent.h:133
~BPHMonitor() override
Definition: BPHMonitor.cc:284
double minDS
Definition: BPHMonitor.cc:176
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
std::vector< size_type > Keys
ObjME DiMuDS_
Definition: BPHMonitor.cc:133
double minmassUpsilon
Definition: BPHMonitor.cc:164
std::vector< Photon > PhotonCollection
collectin of Photon objects
Definition: PhotonFwd.h:9
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:646
double dxdz() const
dxdz slope
Definition: BeamSpot.h:78
ObjME mu2Eta_
Definition: BPHMonitor.cc:115
StringCutObjectSelector< reco::Muon, true > muoSelection_probe
Definition: BPHMonitor.cc:147
std::string getTriggerName(std::string partialName)
Definition: BPHMonitor.cc:1302
edm::Handle< trigger::TriggerEvent > handleTriggerEvent
Definition: BPHMonitor.cc:186
const FreeTrajectoryState & theState() const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
StringCutObjectSelector< reco::Muon, true > muoSelection_
Definition: BPHMonitor.cc:144
edm::InputTag hltInputTag_1
Definition: BPHMonitor.cc:178
double maxmassUpsilon
Definition: BPHMonitor.cc:163
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:664
bool isValid() const
Definition: HandleBase.h:70
void bookME(DQMStore::IBooker &, ObjME &me, const std::string &histname, const std::string &histtitle, const uint nbins, const double xmin, const double xmax, const bool bookDen=true)
ObjME mu2z0_
Definition: BPHMonitor.cc:118
double chi2() const
chi-squares
Definition: Vertex.h:117
double minmassTkTk
Definition: BPHMonitor.cc:166
double z0() const
z coordinate
Definition: BeamSpot.h:65
ObjME muPt_
Definition: BPHMonitor.cc:105
bool matchToTrigger(const std::string &theTriggerName, T t)
Definition: BPHMonitor.cc:1316
fixed size matrix
HLT enums.
edm::InputTag trInputTag_
Definition: BPHMonitor.cc:77
StringCutObjectSelector< reco::Muon, true > muoSelection_tag
Definition: BPHMonitor.cc:146
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: BPHMonitor.cc:139
MEbinning mass_binning_
Definition: BPHMonitor.cc:97
T rerr(const GlobalPoint &aPoint) const
ObjME mu3z0_
Definition: BPHMonitor.cc:123
std::vector< std::string > hltpaths_num
Definition: BPHMonitor.cc:180
double minmassJpsi
Definition: BPHMonitor.cc:162
edm::InputTag phInputTag_
Definition: BPHMonitor.cc:78
ObjME phPt_
Definition: BPHMonitor.cc:127
std::string const & process() const
Definition: InputTag.h:40
std::vector< double > prob_variable_binning_
Definition: BPHMonitor.cc:91
long double T
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:21
static void fillPSetDescription(edm::ParameterSetDescription &desc)
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
MEbinning Bmass_binning_
Definition: BPHMonitor.cc:98
Definition: Run.h:45
double min_dR
Definition: BPHMonitor.cc:171