CMS 3D CMS Logo

HeavyFlavorDQMAnalyzer.cc
Go to the documentation of this file.
2 
3 void throwMissingCollection(const char* requested, const char* missing) {
4  throw cms::Exception("Configuration") << "Requested plots for from the collection " << requested
5  << " also requires a collection in " << missing << std::endl;
6 }
7 
9  float mass = cand.mass();
10  if (cand.hasUserFloat("fitMass")) {
11  mass = cand.userFloat("fitMass");
12  }
13  return mass;
14 }
15 
16 //
17 // constructors and destructor
18 //
20  : folder_(iConfig.getParameter<std::string>("folder")),
21  pvCollectionToken(consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("pvCollection"))),
22  beamSpotToken(consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("beamSpot"))) {
23  if (iConfig.existsAs<edm::InputTag>("OniaToMuMuCands")) {
25  consumes<pat::CompositeCandidateCollection>(iConfig.getParameter<edm::InputTag>("OniaToMuMuCands"));
26  }
27  if (iConfig.existsAs<edm::InputTag>("BuToJPsiKCands")) {
29  throwMissingCollection("BuToJPsiKCands", "OniaToMuMuCands");
31  consumes<pat::CompositeCandidateCollection>(iConfig.getParameter<edm::InputTag>("BuToJPsiKCands"));
32  }
33  if (iConfig.existsAs<edm::InputTag>("Kx0ToKPiCands")) {
35  consumes<pat::CompositeCandidateCollection>(iConfig.getParameter<edm::InputTag>("Kx0ToKPiCands"));
36  }
37  if (iConfig.existsAs<edm::InputTag>("BdToJPsiKx0Cands")) {
39  throwMissingCollection("BdToJPsiKx0Cands", "OniaToMuMuCands");
41  throwMissingCollection("BdToJPsiKx0Cands", "Kx0ToKPiCands");
43  consumes<pat::CompositeCandidateCollection>(iConfig.getParameter<edm::InputTag>("BdToJPsiKx0Cands"));
44  }
45  if (iConfig.existsAs<edm::InputTag>("PhiToKKCands")) {
47  consumes<pat::CompositeCandidateCollection>(iConfig.getParameter<edm::InputTag>("PhiToKKCands"));
48  }
49  if (iConfig.existsAs<edm::InputTag>("BsToJPsiPhiCands")) {
51  throwMissingCollection("BsToJPsiPhiCands", "OniaToMuMuCands");
53  throwMissingCollection("BsToJPsiPhiCands", "PhiToKKCands");
55  consumes<pat::CompositeCandidateCollection>(iConfig.getParameter<edm::InputTag>("BsToJPsiPhiCands"));
56  }
57  if (iConfig.existsAs<edm::InputTag>("K0sToPiPiCands")) {
59  consumes<pat::CompositeCandidateCollection>(iConfig.getParameter<edm::InputTag>("K0sToPiPiCands"));
60  }
61  if (iConfig.existsAs<edm::InputTag>("BdToJPsiK0sCands")) {
63  throwMissingCollection("BdToJPsiK0sCands", "OniaToMuMuCands");
65  throwMissingCollection("BdToJPsiK0sCands", "K0sToPiPiCands");
67  consumes<pat::CompositeCandidateCollection>(iConfig.getParameter<edm::InputTag>("BdToJPsiK0sCands"));
68  }
69  if (iConfig.existsAs<edm::InputTag>("Lambda0ToPPiCands")) {
71  consumes<pat::CompositeCandidateCollection>(iConfig.getParameter<edm::InputTag>("Lambda0ToPPiCands"));
72  }
73  if (iConfig.existsAs<edm::InputTag>("LambdaBToJPsiLambda0Cands")) {
75  throwMissingCollection("LambdaBToJPsiLambda0Cands", "OniaToMuMuCands");
77  throwMissingCollection("LambdaBToJPsiLambda0Cands", "Lambda0ToPPiCands");
79  consumes<pat::CompositeCandidateCollection>(iConfig.getParameter<edm::InputTag>("LambdaBToJPsiLambda0Cands"));
80  }
81  if (iConfig.existsAs<edm::InputTag>("BcToJPsiPiCands")) {
83  throwMissingCollection("BcToJPsiPiCands", "OniaToMuMuCands");
85  consumes<pat::CompositeCandidateCollection>(iConfig.getParameter<edm::InputTag>("BcToJPsiPiCands"));
86  }
87  if (iConfig.existsAs<edm::InputTag>("Psi2SToJPsiPiPiCands")) {
89  throwMissingCollection("Psi2SToJPsiPiPiCands", "OniaToMuMuCands");
91  consumes<pat::CompositeCandidateCollection>(iConfig.getParameter<edm::InputTag>("Psi2SToJPsiPiPiCands"));
92  }
93  if (iConfig.existsAs<edm::InputTag>("BuToPsi2SKCands")) {
95  throwMissingCollection("BuToPsi2SKCands", "Psi2SToJPsiPiPiCands");
97  consumes<pat::CompositeCandidateCollection>(iConfig.getParameter<edm::InputTag>("BuToPsi2SKCands"));
98  }
99 }
100 
102  // do anything here that needs to be done at desctruction time
103  // (e.g. close files, deallocate resources etc.)
104 }
105 
106 //
107 // member functions
108 //
109 
110 // ------------ method called for each event ------------
111 
113  edm::EventSetup const& iSetup,
114  Histograms const& histos) const {
115  auto& pvColl = iEvent.get(pvCollectionToken);
116  auto bs = iEvent.getHandle(beamSpotToken).product();
117 
118  std::vector<bool> displacedJPsiToMuMu;
121  lOniaToMuMu = iEvent.get(oniaToMuMuCandsToken);
122  displacedJPsiToMuMu.resize(lOniaToMuMu.size(), false);
123  }
124 
126  auto lBuToJPsiK = iEvent.get(buToJPsiKCandsToken);
127  for (auto&& cand : lBuToJPsiK) {
128  auto jpsi = *cand.userData<edm::Ref<pat::CompositeCandidateCollection>>("refToJPsi");
129  auto jpsiMass = getMass(*jpsi);
130  if (jpsiMass < 2.9 or jpsiMass > 3.3)
131  continue;
132 
133  auto closestPV = fillDecayHistograms(histos.buToJPsiK, cand, pvColl);
134  if (not closestPV)
135  continue;
136  fillBuToJPsiKComponents(histos.buToJPsiK, cand, bs, closestPV);
137 
138  displacedJPsiToMuMu[jpsi.index()] = true;
139  }
140  }
141 
142  std::vector<bool> displacedPsi2SToJPsiPiPi;
143  pat::CompositeCandidateCollection lPsi2SToJPsiPiPi;
145  lPsi2SToJPsiPiPi = iEvent.get(psi2SToJPsiPiPiCandsToken);
146  displacedPsi2SToJPsiPiPi.resize(lPsi2SToJPsiPiPi.size(), false);
147  }
148 
150  auto lBuToPsi2SK = iEvent.get(buToPsi2SKCandsToken);
151  for (auto&& cand : lBuToPsi2SK) {
152  auto psi2S = *cand.userData<edm::Ref<pat::CompositeCandidateCollection>>("refToPsi2S");
153  auto psi2SMass = getMass(*psi2S);
154  if (psi2SMass < 3.65 or psi2SMass > 3.72)
155  continue;
156 
157  auto jpsi = *psi2S->userData<edm::Ref<pat::CompositeCandidateCollection>>("refToJPsi");
158  auto jpsiMass = getMass(*jpsi);
159  if (jpsiMass < 2.9 or jpsiMass > 3.3)
160  continue;
161 
162  auto closestPV = fillDecayHistograms(histos.buToPsi2SK, cand, pvColl);
163  if (not closestPV)
164  continue;
165  fillBuToPsi2SKComponents(histos.buToPsi2SK, cand, bs, closestPV);
166 
167  displacedPsi2SToJPsiPiPi[psi2S.index()] = true;
168  displacedJPsiToMuMu[jpsi.index()] = true;
169  }
170  }
171 
172  for (size_t i = 0; i < lPsi2SToJPsiPiPi.size(); i++) {
173  auto&& cand = lPsi2SToJPsiPiPi[i];
174 
175  auto jpsi = *cand.userData<edm::Ref<pat::CompositeCandidateCollection>>("refToJPsi");
176  auto jpsiMass = getMass(*jpsi);
177  if (jpsiMass < 2.9 or jpsiMass > 3.3)
178  continue;
179 
180  auto closestPV = fillDecayHistograms(histos.psi2SToJPsiPiPi, cand, pvColl);
181  if (not closestPV)
182  continue;
183  fillPsi2SToJPsiPiPiComponents(histos.psi2SToJPsiPiPi, cand, bs, closestPV);
184 
185  auto decayHistos = &histos.psi2SToJPsiPiPiPrompt;
186  if (displacedPsi2SToJPsiPiPi[i]) {
187  decayHistos = &histos.psi2SToJPsiPiPiDispl;
188  }
189 
190  fillDecayHistograms(*decayHistos, cand, pvColl);
191  fillPsi2SToJPsiPiPiComponents(*decayHistos, cand, bs, closestPV);
192  }
193  lPsi2SToJPsiPiPi.clear();
194  displacedPsi2SToJPsiPiPi.clear();
195 
196  std::vector<bool> displacedKx0ToKPi;
199  lKx0ToKPi = iEvent.get(kx0ToKPiCandsToken);
200  displacedKx0ToKPi.resize(lKx0ToKPi.size(), false);
201  }
202 
204  auto lBdToJPsiKx0 = iEvent.get(bdToJPsiKx0CandsToken);
205  for (auto&& cand : lBdToJPsiKx0) {
206  auto jpsi = *cand.userData<edm::Ref<pat::CompositeCandidateCollection>>("refToJPsi");
207  auto jpsiMass = getMass(*jpsi);
208  if (jpsiMass < 2.9 or jpsiMass > 3.3)
209  continue;
210 
211  auto kx0 = *cand.userData<edm::Ref<pat::CompositeCandidateCollection>>("refToKx0");
212  auto kx0Mass = getMass(*kx0);
213  if (kx0Mass < 0.77 or kx0Mass > 1.02)
214  continue;
215 
216  auto closestPV = fillDecayHistograms(histos.bdToJPsiKx0, cand, pvColl);
217  if (not closestPV)
218  continue;
219  fillBdToJPsiKx0Components(histos.bdToJPsiKx0, cand, bs, closestPV);
220 
221  displacedKx0ToKPi[kx0.index()] = true;
222  }
223  }
224 
225  for (size_t i = 0; i < lKx0ToKPi.size(); i++) {
226  auto&& cand = lKx0ToKPi[i];
227 
228  auto closestPV = fillDecayHistograms(histos.kx0ToKPi, cand, pvColl);
229  if (not closestPV)
230  continue;
231  fillKx0ToKPiComponents(histos.kx0ToKPi, cand, bs, closestPV);
232 
233  auto decayHistos = &histos.kx0ToKPiPrompt;
234  if (displacedKx0ToKPi[i]) {
235  decayHistos = &histos.kx0ToKPiDispl;
236  }
237 
238  fillDecayHistograms(*decayHistos, cand, pvColl);
239  fillKx0ToKPiComponents(*decayHistos, cand, bs, closestPV);
240  }
241  lKx0ToKPi.clear();
242  displacedKx0ToKPi.clear();
243 
244  std::vector<bool> displacedPhiToKK;
247  lPhiToKK = iEvent.get(phiToKKCandsToken);
248  displacedPhiToKK.resize(lPhiToKK.size(), false);
249  }
250 
252  auto lBsToJPsiPhi = iEvent.get(bsToJPsiPhiCandsToken);
253  for (auto&& cand : lBsToJPsiPhi) {
254  auto jpsi = *cand.userData<edm::Ref<pat::CompositeCandidateCollection>>("refToJPsi");
255  auto jpsiMass = getMass(*jpsi);
256  if (jpsiMass < 2.9 or jpsiMass > 3.3)
257  continue;
258 
259  auto phi = *cand.userData<edm::Ref<pat::CompositeCandidateCollection>>("refToPhi");
260  auto phiMass = getMass(*phi);
261  if (phiMass < 1.005 or phiMass > 1.035)
262  continue;
263 
264  auto closestPV = fillDecayHistograms(histos.bsToJPsiPhi, cand, pvColl);
265  if (not closestPV)
266  continue;
267  fillBsToJPsiPhiComponents(histos.bsToJPsiPhi, cand, bs, closestPV);
268 
269  displacedJPsiToMuMu[jpsi.index()] = true;
270  displacedPhiToKK[phi.index()] = true;
271  }
272  }
273 
274  for (size_t i = 0; i < lPhiToKK.size(); i++) {
275  auto&& cand = lPhiToKK[i];
276 
277  auto closestPV = fillDecayHistograms(histos.phiToKK, cand, pvColl);
278  if (not closestPV)
279  continue;
280  fillPhiToKKComponents(histos.phiToKK, cand, bs, closestPV);
281 
282  auto decayHistos = &histos.phiToKKPrompt;
283  if (displacedPhiToKK[i]) {
284  decayHistos = &histos.phiToKKDispl;
285  }
286 
287  fillDecayHistograms(*decayHistos, cand, pvColl);
288  fillPhiToKKComponents(*decayHistos, cand, bs, closestPV);
289  }
290  lPhiToKK.clear();
291  displacedPhiToKK.clear();
292 
294  auto lBdToJPsiK0s = iEvent.get(bdToJPsiK0sCandsToken);
295  for (auto&& cand : lBdToJPsiK0s) {
296  auto jpsi = *cand.userData<edm::Ref<pat::CompositeCandidateCollection>>("refToJPsi");
297  auto jpsiMass = getMass(*jpsi);
298  if (jpsiMass < 2.9 or jpsiMass > 3.3)
299  continue;
300 
301  auto closestPV = fillDecayHistograms(histos.bdToJPsiK0s, cand, pvColl);
302  if (not closestPV)
303  continue;
304  fillBdToJPsiK0sComponents(histos.bdToJPsiK0s, cand, bs, closestPV);
305 
306  displacedJPsiToMuMu[jpsi.index()] = true;
307  }
308  }
309 
311  auto lBcToJPsiPi = iEvent.get(bcToJPsiPiCandsToken);
312  for (auto&& cand : lBcToJPsiPi) {
313  auto jpsi = *cand.userData<edm::Ref<pat::CompositeCandidateCollection>>("refToJPsi");
314  auto jpsiMass = getMass(*jpsi);
315  if (jpsiMass < 2.9 or jpsiMass > 3.3)
316  continue;
317 
318  auto closestPV = fillDecayHistograms(histos.bcToJPsiPi, cand, pvColl);
319  if (not closestPV)
320  continue;
321  fillBcToJPsiPiComponents(histos.bcToJPsiPi, cand, bs, closestPV);
322 
323  displacedJPsiToMuMu[jpsi.index()] = true;
324  }
325  }
326 
328  auto lLambdaBToJPsiLambda0 = iEvent.get(lambdaBToJPsiLambda0CandsToken);
329  for (auto&& cand : lLambdaBToJPsiLambda0) {
330  auto jpsi = *cand.userData<edm::Ref<pat::CompositeCandidateCollection>>("refToJPsi");
331  auto jpsiMass = getMass(*jpsi);
332  if (jpsiMass < 2.9 or jpsiMass > 3.3)
333  continue;
334 
335  auto closestPV = fillDecayHistograms(histos.lambdaBToJPsiLambda0, cand, pvColl);
336  if (not closestPV)
337  continue;
338  fillLambdaBToJPsiLambda0Components(histos.lambdaBToJPsiLambda0, cand, bs, closestPV);
339 
340  displacedJPsiToMuMu[jpsi.index()] = true;
341  }
342  }
343 
344  for (size_t i = 0; i < lOniaToMuMu.size(); i++) {
345  auto&& cand = lOniaToMuMu[i];
346 
347  auto closestPV = fillDecayHistograms(histos.oniaToMuMu, cand, pvColl);
348  if (not closestPV)
349  continue;
350  fillOniaToMuMuComponents(histos.oniaToMuMu, cand, bs, closestPV);
351 
352  auto decayHistos = &histos.oniaToMuMuPrompt;
353  if (displacedJPsiToMuMu[i]) {
354  decayHistos = &histos.oniaToMuMuDispl;
355  }
356 
357  fillDecayHistograms(*decayHistos, cand, pvColl);
358  fillOniaToMuMuComponents(*decayHistos, cand, bs, closestPV);
359  }
360  lOniaToMuMu.clear();
361  displacedJPsiToMuMu.clear();
362 
364  auto lK0sToPiPi = iEvent.get(k0sToPiPiCandsToken);
365  for (auto&& cand : lK0sToPiPi) {
366  auto closestPV = fillDecayHistograms(histos.k0sToPiPi, cand, pvColl);
367  if (not closestPV)
368  continue;
369  fillK0sToPiPiComponents(histos.k0sToPiPi, cand, bs, closestPV);
370  }
371  }
372 
374  auto lLambda0ToPPi = iEvent.get(lambda0ToPPiCandsToken);
375  for (auto&& cand : lLambda0ToPPi) {
376  auto closestPV = fillDecayHistograms(histos.lambda0ToPPi, cand, pvColl);
377  if (not closestPV)
378  continue;
379  fillLambda0ToPPiComponents(histos.lambda0ToPPi, cand, bs, closestPV);
380  }
381  }
382 }
383 
385  edm::Run const&,
386  edm::EventSetup const&,
387  DecayHists& decayHists,
388  std::string const& name,
389  std::string const& products,
390  int nMassBins,
391  float massMin,
392  float massMax,
393  float distanceScaleFactor) const {
394  std::string histTitle = name + " #rightarrow " + products + ";";
395 
396  decayHists.h_mass =
397  ibook.book1D("h_mass", histTitle + "M(" + products + ") fitted [GeV]", nMassBins, massMin, massMax);
398  decayHists.h_pt = ibook.book1D("h_pt", histTitle + "fitted p_{T} [GeV]", 100, 0.00, 200.0);
399  decayHists.h_eta = ibook.book1D("h_eta", histTitle + "fitted #eta", 100, -3, 3);
400  decayHists.h_phi = ibook.book1D("h_phi", histTitle + "fitted #varphi [rad]", 100, -TMath::Pi(), TMath::Pi());
401  decayHists.h_displ2D =
402  ibook.book1D("h_displ2D", histTitle + "vertex 2D displacement [cm]", 100, 0.00, 2.0 * distanceScaleFactor);
403  decayHists.h_sign2D =
404  ibook.book1D("h_sign2D", histTitle + "vertex 2D displ. significance", 100, 0.00, 200.0 * distanceScaleFactor);
405  decayHists.h_ct = ibook.book1D("h_ct", histTitle + "ct [cm]", 100, 0.00, 0.4 * distanceScaleFactor);
406  decayHists.h_pointing = ibook.book1D("h_pointing", histTitle + "cos( 2D pointing angle )", 100, -1, 1);
407  decayHists.h_vertNormChi2 = ibook.book1D("h_vertNormChi2", histTitle + "vertex #chi^{2}/ndof", 100, 0.00, 10);
408  decayHists.h_vertProb = ibook.book1D("h_vertProb", histTitle + "vertex prob.", 100, 0.00, 1.0);
409 }
410 
412  edm::Run const& run,
413  edm::EventSetup const& iSetup,
414  Histograms& histos) const {
416  ibook.cd();
417  ibook.setCurrentFolder(folder_ + "/JPsiToMuMuPrompt");
418  bookDecayHists(ibook, run, iSetup, histos.oniaToMuMuPrompt, "J/#psi", "#mu^{+}#mu^{-}", 100, 2.9, 3.3);
419 
420  ibook.setCurrentFolder(folder_ + "/JPsiToMuMuPrompt/components");
421  initOniaToMuMuComponentHistograms(ibook, run, iSetup, histos.oniaToMuMuPrompt);
422 
423  ibook.cd();
424  ibook.setCurrentFolder(folder_ + "/JPsiToMuMuDisplaced");
425  bookDecayHists(ibook, run, iSetup, histos.oniaToMuMuDispl, "J/#psi", "#mu^{+}#mu^{-}", 100, 2.9, 3.3);
426 
427  ibook.setCurrentFolder(folder_ + "/JPsiToMuMuDisplaced/components");
428  initOniaToMuMuComponentHistograms(ibook, run, iSetup, histos.oniaToMuMuDispl);
429 
430  ibook.cd();
431  ibook.setCurrentFolder(folder_ + "/OniaToMuMu");
432  bookDecayHists(ibook, run, iSetup, histos.oniaToMuMu, "Onia", "#mu^{+}#mu^{-}", 750, 0, 15);
433 
434  ibook.setCurrentFolder(folder_ + "/OniaToMuMu/components");
435  initOniaToMuMuComponentHistograms(ibook, run, iSetup, histos.oniaToMuMu);
436  }
437 
439  ibook.cd();
440  ibook.setCurrentFolder(folder_ + "/Kx0ToKPiPrompt");
441  bookDecayHists(ibook, run, iSetup, histos.kx0ToKPiPrompt, "K*^{0}", "#pi^{+} K^{-}", 100, 0.75, 1.05);
442 
443  ibook.setCurrentFolder(folder_ + "/Kx0ToKPiPrompt/components");
444  initKx0ToKPiComponentHistograms(ibook, run, iSetup, histos.kx0ToKPiPrompt);
445 
446  ibook.cd();
447  ibook.setCurrentFolder(folder_ + "/Kx0ToKPiDisplaced");
448  bookDecayHists(ibook, run, iSetup, histos.kx0ToKPiDispl, "K*^{0}", "#pi^{+} K^{-}", 100, 0.75, 1.05);
449 
450  ibook.setCurrentFolder(folder_ + "/Kx0ToKPiDisplaced/components");
451  initKx0ToKPiComponentHistograms(ibook, run, iSetup, histos.kx0ToKPiDispl);
452 
453  ibook.cd();
454  ibook.setCurrentFolder(folder_ + "/Kx0ToKPi");
455  bookDecayHists(ibook, run, iSetup, histos.kx0ToKPi, "K*^{0}", "#pi^{+} K^{-}", 100, 0.75, 1.05);
456 
457  ibook.setCurrentFolder(folder_ + "/Kx0ToKPi/components");
458  initKx0ToKPiComponentHistograms(ibook, run, iSetup, histos.kx0ToKPi);
459  }
460 
462  ibook.cd();
463  ibook.setCurrentFolder(folder_ + "/PhiToKKPrompt");
464  bookDecayHists(ibook, run, iSetup, histos.phiToKKPrompt, "#phi", "K^{+} K^{-}", 100, 1.005, 1.035);
465 
466  ibook.setCurrentFolder(folder_ + "/PhiToKKPrompt/components");
467  initPhiToKKComponentHistograms(ibook, run, iSetup, histos.phiToKKPrompt);
468 
469  ibook.cd();
470  ibook.setCurrentFolder(folder_ + "/PhiToKKDisplaced");
471  bookDecayHists(ibook, run, iSetup, histos.phiToKKDispl, "#phi", "K^{+} K^{-}", 100, 1.005, 1.035);
472 
473  ibook.setCurrentFolder(folder_ + "/PhiToKKDisplaced/components");
474  initPhiToKKComponentHistograms(ibook, run, iSetup, histos.phiToKKDispl);
475 
476  ibook.cd();
477  ibook.setCurrentFolder(folder_ + "/PhiToKK");
478  bookDecayHists(ibook, run, iSetup, histos.phiToKK, "#phi", "K^{+} K^{-}", 100, 1.005, 1.035);
479 
480  ibook.setCurrentFolder(folder_ + "/PhiToKK/components");
481  initPhiToKKComponentHistograms(ibook, run, iSetup, histos.phiToKK);
482  }
483 
485  ibook.cd();
486  ibook.setCurrentFolder(folder_ + "/Psi2SToJPsiPiPiPrompt");
488  ibook, run, iSetup, histos.psi2SToJPsiPiPiPrompt, "#Psi(2S)", "J/#psi #pi^{+} #pi^{-}", 100, 3.65, 3.72);
489 
490  ibook.setCurrentFolder(folder_ + "/Psi2SToJPsiPiPiPrompt/components");
491  initPsi2SToJPsiPiPiComponentHistograms(ibook, run, iSetup, histos.psi2SToJPsiPiPiPrompt);
492 
493  ibook.cd();
494  ibook.setCurrentFolder(folder_ + "/Psi2SToJPsiPiPiDisplaced");
496  ibook, run, iSetup, histos.psi2SToJPsiPiPiDispl, "#Psi(2S)", "J/#psi #pi^{+} #pi^{-}", 100, 3.65, 3.72);
497 
498  ibook.setCurrentFolder(folder_ + "/Psi2SToJPsiPiPiDisplaced/components");
499  initPsi2SToJPsiPiPiComponentHistograms(ibook, run, iSetup, histos.psi2SToJPsiPiPiDispl);
500 
501  ibook.cd();
502  ibook.setCurrentFolder(folder_ + "/Psi2SToJPsiPiPi");
504  ibook, run, iSetup, histos.psi2SToJPsiPiPi, "#Psi(2S)/X(3872)", "J/#psi #pi^{+} #pi^{-}", 200, 3.60, 3.80);
505 
506  ibook.setCurrentFolder(folder_ + "/Psi2SToJPsiPiPi/components");
507  initPsi2SToJPsiPiPiComponentHistograms(ibook, run, iSetup, histos.psi2SToJPsiPiPi);
508  }
509 
511  ibook.cd();
512  ibook.setCurrentFolder(folder_ + "/K0sToPiPi");
513  bookDecayHists(ibook, run, iSetup, histos.k0sToPiPi, "K^{0}_{S}", "#pi^{+} #pi^{-}", 100, 0.44, 0.56, 4);
514 
515  ibook.setCurrentFolder(folder_ + "/K0sToPiPi/components");
516  initK0sToPiPiComponentHistograms(ibook, run, iSetup, histos.k0sToPiPi);
517  }
518 
520  ibook.cd();
521  ibook.setCurrentFolder(folder_ + "/Lambda0ToPPi");
522  bookDecayHists(ibook, run, iSetup, histos.lambda0ToPPi, "#Lambda^{0}", "p^{+} #pi^{-}", 100, 1.06, 1.16, 4);
523 
524  ibook.setCurrentFolder(folder_ + "/Lambda0ToPPi/components");
525  initLambda0ToPPiComponentHistograms(ibook, run, iSetup, histos.lambda0ToPPi);
526  }
527 
529  ibook.cd();
530  ibook.setCurrentFolder(folder_ + "/BuToJPsiK");
531  bookDecayHists(ibook, run, iSetup, histos.buToJPsiK, "B^{+}", "J/#psi K^{+}", 100, 5.00, 6.00);
532 
533  ibook.setCurrentFolder(folder_ + "/BuToJPsiK/components");
534  initBuToJPsiKComponentHistograms(ibook, run, iSetup, histos.buToJPsiK);
535  }
536 
538  ibook.cd();
539  ibook.setCurrentFolder(folder_ + "/BuToPsi2SK");
540  bookDecayHists(ibook, run, iSetup, histos.buToPsi2SK, "B^{+}", "#Psi(2S) K^{+}", 100, 5.00, 6.00);
541 
542  ibook.setCurrentFolder(folder_ + "/BuToPsi2SK/components");
543  initBuToPsi2SKComponentHistograms(ibook, run, iSetup, histos.buToPsi2SK);
544  }
545 
547  ibook.cd();
548  ibook.setCurrentFolder(folder_ + "/BdToJPsiKx0");
549  bookDecayHists(ibook, run, iSetup, histos.bdToJPsiKx0, "B^{0}", "J/#psi K*^{0}", 100, 5.00, 6.00);
550 
551  ibook.setCurrentFolder(folder_ + "/BdToJPsiKx0/components");
552  initBdToJPsiKx0ComponentHistograms(ibook, run, iSetup, histos.bdToJPsiKx0);
553  }
554 
556  ibook.cd();
557  ibook.setCurrentFolder(folder_ + "/BsToJPsiPhi");
558  bookDecayHists(ibook, run, iSetup, histos.bsToJPsiPhi, "B^{0}_{s}", "J/#psi #phi", 100, 5.00, 6.00);
559 
560  ibook.setCurrentFolder(folder_ + "/BsToJPsiPhi/components");
561  initBsToJPsiPhiComponentHistograms(ibook, run, iSetup, histos.bsToJPsiPhi);
562  }
563 
565  ibook.cd();
566  ibook.setCurrentFolder(folder_ + "/BdToJPsiK0s");
567  bookDecayHists(ibook, run, iSetup, histos.bdToJPsiK0s, "B^{0}", "J/#psi K^{0}_{S}", 100, 5.00, 6.00);
568 
569  ibook.setCurrentFolder(folder_ + "/BdToJPsiK0s/components");
570  initBdToJPsiK0sComponentHistograms(ibook, run, iSetup, histos.bdToJPsiK0s);
571  }
572 
574  ibook.cd();
575  ibook.setCurrentFolder(folder_ + "/BcToJPsiPi");
576  bookDecayHists(ibook, run, iSetup, histos.bcToJPsiPi, "B^{+}_{c}", "J/#psi #pi^{+}", 100, 6.00, 7.00);
577 
578  ibook.setCurrentFolder(folder_ + "/BcToJPsiPi/components");
579  initBcToJPsiPiComponentHistograms(ibook, run, iSetup, histos.bcToJPsiPi);
580  }
581 
583  ibook.cd();
584  ibook.setCurrentFolder(folder_ + "/LambdaBToJPsiLambda0");
586  ibook, run, iSetup, histos.lambdaBToJPsiLambda0, "#Lambda^{0}_{b}", "J/#psi #Lambda^{0}", 100, 5.00, 6.00);
587 
588  ibook.setCurrentFolder(folder_ + "/LambdaBToJPsiLambda0/components");
589  initLambdaBToJPsiLambda0ComponentHistograms(ibook, run, iSetup, histos.lambdaBToJPsiLambda0);
590  }
591 }
592 
594  edm::Run const&,
595  edm::EventSetup const&,
597  TString const& componentName) const {
599 
600  comp.h_pt = ibook.book1D(componentName + "_pt", ";p_{T} [GeV]", 200, 0, 20);
601  comp.h_eta = ibook.book1D(componentName + "_eta", ";#eta", 200, -3, 3);
602  comp.h_phi = ibook.book1D(componentName + "_phi", ";#phi", 200, -TMath::Pi(), TMath::Pi());
603  comp.h_dxy = ibook.book1D(componentName + "_dxyBS", ";d_{xy}(BS) [cm]", 200, -3, 3);
604  comp.h_exy = ibook.book1D(componentName + "_exy", ";#sigma(d_{xy}(BS)) [cm]", 200, 0, 0.2);
605  comp.h_dz = ibook.book1D(componentName + "_dzPV", ";d_{z}(PV) [cm]", 200, -20, 20);
606  comp.h_ez = ibook.book1D(componentName + "_ez", ";#sigma(d_{z}(PV)) [cm]", 200, 0, 2);
607  comp.h_chi2 = ibook.book1D(componentName + "_chi2", ";#chi^{2}", 200, 0, 20);
608 
609  histos.decayComponents.push_back(comp);
610 }
611 
613  edm::Run const& run,
614  edm::EventSetup const& iSetup,
615  DecayHists& histos) const {
616  initComponentHists(ibook, run, iSetup, histos, "lead_mu");
617  initComponentHists(ibook, run, iSetup, histos, "soft_mu");
618 }
619 
621  edm::Run const& run,
622  edm::EventSetup const& iSetup,
623  DecayHists& histos) const {
624  initComponentHists(ibook, run, iSetup, histos, "k");
625  initComponentHists(ibook, run, iSetup, histos, "pi");
626 }
627 
629  edm::Run const& run,
630  edm::EventSetup const& iSetup,
631  DecayHists& histos) const {
632  initComponentHists(ibook, run, iSetup, histos, "lead_k");
633  initComponentHists(ibook, run, iSetup, histos, "soft_k");
634 }
635 
637  edm::Run const& run,
638  edm::EventSetup const& iSetup,
639  DecayHists& histos) const {
640  initComponentHists(ibook, run, iSetup, histos, "lead_pi");
641  initComponentHists(ibook, run, iSetup, histos, "soft_pi");
642 }
643 
645  edm::Run const& run,
646  edm::EventSetup const& iSetup,
647  DecayHists& histos) const {
648  initComponentHists(ibook, run, iSetup, histos, "p");
649  initComponentHists(ibook, run, iSetup, histos, "pi");
650 }
651 
653  edm::Run const& run,
654  edm::EventSetup const& iSetup,
655  DecayHists& histos) const {
657  initComponentHists(ibook, run, iSetup, histos, "k");
658 }
659 
661  edm::Run const& run,
662  edm::EventSetup const& iSetup,
663  DecayHists& histos) const {
665  initComponentHists(ibook, run, iSetup, histos, "k");
666 }
667 
669  edm::Run const& run,
670  edm::EventSetup const& iSetup,
671  DecayHists& histos) const {
673  initKx0ToKPiComponentHistograms(ibook, run, iSetup, histos);
674 }
675 
677  edm::Run const& run,
678  edm::EventSetup const& iSetup,
679  DecayHists& histos) const {
681  initPhiToKKComponentHistograms(ibook, run, iSetup, histos);
682 }
683 
685  edm::Run const& run,
686  edm::EventSetup const& iSetup,
687  DecayHists& histos) const {
690 }
691 
693  edm::Run const& run,
694  edm::EventSetup const& iSetup,
695  DecayHists& histos) const {
697  initComponentHists(ibook, run, iSetup, histos, "pi");
698 }
699 
701  edm::Run const& run,
702  edm::EventSetup const& iSetup,
703  DecayHists& histos) const {
706 }
707 
709  edm::Run const& run,
710  edm::EventSetup const& iSetup,
711  DecayHists& histos) const {
713  initComponentHists(ibook, run, iSetup, histos, "lead_pi");
714  initComponentHists(ibook, run, iSetup, histos, "soft_pi");
715 }
716 
719  reco::VertexCollection const& pvs) const {
720  // if (not cand.hasUserData("fitMomentum")) {
721  // return -2;
722  // }
723  // auto mass = cand.userFloat("fitMass");
724  // auto& momentum = *cand.userData<GlobalVector>("fitMomentum");
725  if (not allTracksAvailable(cand)) {
726  return nullptr;
727  }
728 
729  auto svtx = cand.userData<reco::Vertex>("vertex");
730  if (not svtx->isValid()) {
731  return nullptr;
732  }
733 
734  float mass = cand.mass();
735  reco::Candidate::Vector momentum = cand.momentum();
736  if (cand.hasUserData("fitMomentum")) {
737  mass = cand.userFloat("fitMass");
738  momentum = *cand.userData<GlobalVector>("fitMomentum");
739  }
740 
741  auto pvtx = std::min_element(pvs.begin(), pvs.end(), [svtx](reco::Vertex const& pv1, reco::Vertex const& pv2) {
742  return abs(pv1.z() - svtx->z()) < abs(pv2.z() - svtx->z());
743  });
744  if (pvtx == pvs.end()) {
745  return nullptr;
746  }
747 
748  VertexDistanceXY vdistXY;
749  Measurement1D distXY = vdistXY.distance(*svtx, *pvtx);
750 
751  auto pvtPos = pvtx->position();
752  auto svtPos = svtx->position();
753 
754  math::XYZVector displVect2D(svtPos.x() - pvtPos.x(), svtPos.y() - pvtPos.y(), 0);
755  auto cosAlpha = displVect2D.Dot(momentum) / (displVect2D.Rho() * momentum.rho());
756 
757  auto ct = distXY.value() * cosAlpha * mass / momentum.rho();
758 
759  histos.h_pointing->Fill(cosAlpha);
760 
761  histos.h_mass->Fill(mass);
762 
763  histos.h_pt->Fill(momentum.rho());
764  histos.h_eta->Fill(momentum.eta());
765  histos.h_phi->Fill(momentum.phi());
766 
767  histos.h_ct->Fill(ct);
768 
769  histos.h_displ2D->Fill(distXY.value());
770  histos.h_sign2D->Fill(distXY.significance());
771 
772  // FIXME workaround for tracks with non pos-def cov. matrix
773  if (svtx->chi2() >= 0) {
774  histos.h_vertNormChi2->Fill(svtx->chi2() / svtx->ndof());
775  histos.h_vertProb->Fill(ChiSquaredProbability(svtx->chi2(), svtx->ndof()));
776  }
777 
778  return &*pvtx;
779 }
780 
783  reco::BeamSpot const* bs,
784  reco::Vertex const* pv,
785  int startPosition) const {
786  startPosition = fillComponentHistogramsLeadSoft(histos, cand, "MuPos", "MuNeg", bs, pv, startPosition);
787 
788  return startPosition;
789 }
790 
793  reco::BeamSpot const* bs,
794  reco::Vertex const* pv,
795  int startPosition) const {
796  startPosition = fillComponentHistogramsSinglePart(histos, cand, "Kaon", bs, pv, startPosition);
797  startPosition = fillComponentHistogramsSinglePart(histos, cand, "Pion", bs, pv, startPosition);
798 
799  return startPosition;
800 }
801 
804  reco::BeamSpot const* bs,
805  reco::Vertex const* pv,
806  int startPosition) const {
807  startPosition = fillComponentHistogramsLeadSoft(histos, cand, "KPos", "KNeg", bs, pv, startPosition);
808 
809  return startPosition;
810 }
811 
814  reco::BeamSpot const* bs,
815  reco::Vertex const* pv,
816  int startPosition) const {
817  startPosition = fillComponentHistogramsLeadSoft(histos, cand, "PionPos", "PionNeg", bs, pv, startPosition);
818 
819  return startPosition;
820 }
821 
824  reco::BeamSpot const* bs,
825  reco::Vertex const* pv,
826  int startPosition) const {
827  startPosition = fillComponentHistogramsSinglePart(histos, cand, "Proton", bs, pv, startPosition);
828  startPosition = fillComponentHistogramsSinglePart(histos, cand, "Pion", bs, pv, startPosition);
829 
830  return startPosition;
831 }
832 
835  reco::BeamSpot const* bs,
836  reco::Vertex const* pv,
837  int startPosition) const {
838  startPosition = fillOniaToMuMuComponents(
839  histos, **cand.userData<edm::Ref<pat::CompositeCandidateCollection>>("refToJPsi"), bs, pv, startPosition);
840  startPosition = fillComponentHistogramsSinglePart(histos, cand, "Kaon", bs, pv, startPosition);
841 
842  return startPosition;
843 }
844 
847  reco::BeamSpot const* bs,
848  reco::Vertex const* pv,
849  int startPosition) const {
850  startPosition = fillPsi2SToJPsiPiPiComponents(
851  histos, **cand.userData<edm::Ref<pat::CompositeCandidateCollection>>("refToPsi2S"), bs, pv, startPosition);
852  startPosition = fillComponentHistogramsSinglePart(histos, cand, "Kaon", bs, pv, startPosition);
853 
854  return startPosition;
855 }
856 
859  reco::BeamSpot const* bs,
860  reco::Vertex const* pv,
861  int startPosition) const {
862  startPosition = fillOniaToMuMuComponents(
863  histos, **cand.userData<edm::Ref<pat::CompositeCandidateCollection>>("refToJPsi"), bs, pv, startPosition);
864  startPosition = fillKx0ToKPiComponents(
865  histos, **cand.userData<edm::Ref<pat::CompositeCandidateCollection>>("refToKx0"), bs, pv, startPosition);
866 
867  return startPosition;
868 }
869 
872  reco::BeamSpot const* bs,
873  reco::Vertex const* pv,
874  int startPosition) const {
875  startPosition = fillOniaToMuMuComponents(
876  histos, **cand.userData<edm::Ref<pat::CompositeCandidateCollection>>("refToJPsi"), bs, pv, startPosition);
877  startPosition = fillPhiToKKComponents(
878  histos, **cand.userData<edm::Ref<pat::CompositeCandidateCollection>>("refToPhi"), bs, pv, startPosition);
879 
880  return startPosition;
881 }
882 
885  reco::BeamSpot const* bs,
886  reco::Vertex const* pv,
887  int startPosition) const {
888  startPosition = fillOniaToMuMuComponents(
889  histos, **cand.userData<edm::Ref<pat::CompositeCandidateCollection>>("refToJPsi"), bs, pv, startPosition);
890  startPosition = fillK0sToPiPiComponents(
891  histos, **cand.userData<edm::Ref<pat::CompositeCandidateCollection>>("refToK0s"), bs, pv, startPosition);
892 
893  return startPosition;
894 }
895 
898  reco::BeamSpot const* bs,
899  reco::Vertex const* pv,
900  int startPosition) const {
901  startPosition = fillOniaToMuMuComponents(
902  histos, **cand.userData<edm::Ref<pat::CompositeCandidateCollection>>("refToJPsi"), bs, pv, startPosition);
903  startPosition = fillComponentHistogramsSinglePart(histos, cand, "Pion", bs, pv, startPosition);
904 
905  return startPosition;
906 }
907 
910  reco::BeamSpot const* bs,
911  reco::Vertex const* pv,
912  int startPosition) const {
913  startPosition = fillOniaToMuMuComponents(
914  histos, **cand.userData<edm::Ref<pat::CompositeCandidateCollection>>("refToJPsi"), bs, pv, startPosition);
915  startPosition = fillLambda0ToPPiComponents(
916  histos, **cand.userData<edm::Ref<pat::CompositeCandidateCollection>>("refToLambda0"), bs, pv, startPosition);
917 
918  return startPosition;
919 }
920 
923  reco::BeamSpot const* bs,
924  reco::Vertex const* pv,
925  int startPosition) const {
926  startPosition = fillOniaToMuMuComponents(
927  histos, **cand.userData<edm::Ref<pat::CompositeCandidateCollection>>("refToJPsi"), bs, pv, startPosition);
928  startPosition = fillComponentHistogramsLeadSoft(histos, cand, "PionPos", "PionNeg", bs, pv, startPosition);
929  return startPosition;
930 }
931 
933  reco::Track const& component,
934  reco::BeamSpot const* bs,
935  reco::Vertex const* pv) const {
936  histos.h_pt->Fill(component.pt());
937  histos.h_eta->Fill(component.eta());
938  histos.h_phi->Fill(component.phi());
939 
940  math::XYZPoint zero(0, 0, 0);
941  math::Error<3>::type zeroCov; // needed for dxyError
942  if (bs) {
943  histos.h_dxy->Fill(component.dxy(*bs));
944  histos.h_exy->Fill(component.dxyError(*bs));
945  } else {
946  histos.h_dxy->Fill(component.dxy(zero));
947  histos.h_exy->Fill(component.dxyError(zero, zeroCov));
948  }
949  if (pv) {
950  histos.h_dz->Fill(component.dz(pv->position()));
951  } else {
952  histos.h_dz->Fill(component.dz(zero));
953  }
954  histos.h_ez->Fill(component.dzError());
955 
956  histos.h_chi2->Fill(component.chi2() / component.ndof());
957 }
958 
960  for (auto&& name : cand.roles()) {
961  auto track = getDaughterTrack(cand, name, false);
962  if (not track) {
963  return false;
964  }
965  }
966  return true;
967 }
968 
970  std::string const& name,
971  bool throwOnMissing) const {
972  auto daugh = cand.daughter(name);
973  auto trackModeLabel = "trackMode_" + name;
974  auto trackMode = cand.userData<std::string>(trackModeLabel);
975  if (!trackMode or trackMode->empty()) {
976  if (throwOnMissing) {
977  throw cms::Exception("TrackNotFound") << "Could not determine track mode from candidate with name " << name
978  << " with label " << trackModeLabel << std::endl;
979  }
980  return nullptr;
981  }
982 
983  auto track = BPHTrackReference::getTrack(*daugh, trackMode->c_str());
984 
985  if (throwOnMissing and not track) {
986  throw cms::Exception("TrackNotFound") << "BPHTrackReference could not extract a track as type " << trackMode
987  << " from candidate with name " << name << std::endl;
988  }
989 
990  return track;
991 }
992 
995  std::string const& name,
996  reco::BeamSpot const* bs,
997  reco::Vertex const* pv,
998  int startPosition) const {
999  fillComponentHistograms(histos.decayComponents[startPosition], *getDaughterTrack(cand, name), bs, pv);
1000 
1001  return startPosition + 1;
1002 }
1003 
1006  std::string const& name1,
1007  std::string const& name2,
1008  reco::BeamSpot const* bs,
1009  reco::Vertex const* pv,
1010  int startPosition) const {
1011  auto daughSoft = getDaughterTrack(cand, name1);
1012  auto daughLead = getDaughterTrack(cand, name2);
1013 
1014  if (daughLead->pt() < daughSoft->pt()) {
1015  std::swap(daughLead, daughSoft);
1016  }
1017 
1018  fillComponentHistograms(histos.decayComponents[startPosition], *daughLead, bs, pv);
1019  fillComponentHistograms(histos.decayComponents[startPosition + 1], *daughSoft, bs, pv);
1020 
1021  return startPosition + 2;
1022 }
1023 
1024 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
1027 
1028  desc.add<std::string>("folder", "Physics/HeavyFlavor");
1029 
1030  desc.add<edm::InputTag>("pvCollection");
1031  desc.add<edm::InputTag>("beamSpot");
1032 
1033  desc.addOptional<edm::InputTag>("OniaToMuMuCands");
1034  desc.addOptional<edm::InputTag>("Kx0ToKPiCands");
1035  desc.addOptional<edm::InputTag>("PhiToKKCands");
1036  desc.addOptional<edm::InputTag>("BuToJPsiKCands");
1037  desc.addOptional<edm::InputTag>("BuToPsi2SKCands");
1038  desc.addOptional<edm::InputTag>("BdToJPsiKx0Cands");
1039  desc.addOptional<edm::InputTag>("BsToJPsiPhiCands");
1040  desc.addOptional<edm::InputTag>("K0sToPiPiCands");
1041  desc.addOptional<edm::InputTag>("Lambda0ToPPiCands");
1042  desc.addOptional<edm::InputTag>("BdToJPsiK0sCands");
1043  desc.addOptional<edm::InputTag>("LambdaBToJPsiLambda0Cands");
1044  desc.addOptional<edm::InputTag>("BcToJPsiPiCands");
1045  desc.addOptional<edm::InputTag>("Psi2SToJPsiPiPiCands");
1046 
1047  descriptions.add("HeavyFlavorDQMAnalyzer", desc);
1048 }
1049 
1050 // define this as a plug-in
int fillKx0ToKPiComponents(DecayHists const &histos, pat::CompositeCandidate const &cand, reco::BeamSpot const *bs, reco::Vertex const *pv, int startPosition=0) const
Analysis-level particle class.
const double Pi
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
int fillLambdaBToJPsiLambda0Components(DecayHists const &histos, pat::CompositeCandidate const &cand, reco::BeamSpot const *bs, reco::Vertex const *pv, int startPosition=0) const
dqm::reco::MonitorElement * h_displ2D
HeavyFlavorDQMAnalyzer(const edm::ParameterSet &)
const reco::Track * getDaughterTrack(pat::CompositeCandidate const &cand, std::string const &name, bool throwOnMissing=true) const
edm::EDGetTokenT< pat::CompositeCandidateCollection > bdToJPsiKx0CandsToken
void initPsi2SToJPsiPiPiComponentHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, DecayHists &) const
edm::EDGetTokenT< pat::CompositeCandidateCollection > lambdaBToJPsiLambda0CandsToken
std::string folder_
math::XYZVector Vector
point in the space
Definition: Candidate.h:42
double z() const
z coordinate
Definition: Vertex.h:133
void initOniaToMuMuComponentHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, DecayHists &) const
dqm::reco::MonitorElement * h_phi
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
Measurement1D distance(const GlobalPoint &vtx1Position, const GlobalError &vtx1PositionError, const GlobalPoint &vtx2Position, const GlobalError &vtx2PositionError) const override
int fillComponentHistogramsSinglePart(DecayHists const &, pat::CompositeCandidate const &cand, std::string const &name, reco::BeamSpot const *bs, reco::Vertex const *pv, int startPosition=0) const
ESProducts< std::remove_reference_t< TArgs >... > products(TArgs &&... args)
Definition: ESProducts.h:128
void fillComponentHistograms(ComponentHists const &histos, reco::Track const &component, reco::BeamSpot const *bs, reco::Vertex const *pv) const
dqm::reco::MonitorElement * h_vertNormChi2
bool allTracksAvailable(pat::CompositeCandidate const &cand) const
constexpr bool isUninitialized() const noexcept
Definition: EDGetToken.h:104
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
edm::EDGetTokenT< pat::CompositeCandidateCollection > lambda0ToPPiCandsToken
ErrorD< N >::type type
Definition: Error.h:32
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:172
dqm::reco::MonitorElement * h_vertProb
std::vector< Vertex > VertexCollection
Definition: Vertex.h:31
edm::EDGetTokenT< pat::CompositeCandidateCollection > phiToKKCandsToken
reco::Vertex const * fillDecayHistograms(DecayHists const &, pat::CompositeCandidate const &cand, reco::VertexCollection const &pvs) const
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:112
missing
Definition: combine.py:5
edm::EDGetTokenT< pat::CompositeCandidateCollection > oniaToMuMuCandsToken
void dqmAnalyze(edm::Event const &, edm::EventSetup const &, Histograms const &) const override
void initK0sToPiPiComponentHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, DecayHists &) const
double pt() const
track transverse momentum
Definition: TrackBase.h:637
void initBcToJPsiPiComponentHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, DecayHists &) const
double ndof() const
number of degrees of freedom of the fit
Definition: TrackBase.h:590
void initBuToJPsiKComponentHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, DecayHists &) const
int fillOniaToMuMuComponents(DecayHists const &histos, pat::CompositeCandidate const &cand, reco::BeamSpot const *bs, reco::Vertex const *pv, int startPosition=0) const
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
Definition: TrackBase.h:622
void initLambdaBToJPsiLambda0ComponentHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, DecayHists &) const
int iEvent
Definition: GenABIO.cc:224
int fillPhiToKKComponents(DecayHists const &histos, pat::CompositeCandidate const &cand, reco::BeamSpot const *bs, reco::Vertex const *pv, int startPosition=0) const
edm::EDGetTokenT< pat::CompositeCandidateCollection > buToJPsiKCandsToken
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
dqm::reco::MonitorElement * h_pointing
int fillPsi2SToJPsiPiPiComponents(DecayHists const &histos, pat::CompositeCandidate const &cand, reco::BeamSpot const *bs, reco::Vertex const *pv, int startPosition=0) const
edm::EDGetTokenT< reco::VertexCollection > pvCollectionToken
void initComponentHists(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, DecayHists &, TString const &) const
double dxyError() const
error on dxy
Definition: TrackBase.h:769
double dzError() const
error on dz
Definition: TrackBase.h:778
int fillBsToJPsiPhiComponents(DecayHists const &histos, pat::CompositeCandidate const &cand, reco::BeamSpot const *bs, reco::Vertex const *pv, int startPosition=0) const
dqm::reco::MonitorElement * h_ct
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
int fillBdToJPsiKx0Components(DecayHists const &histos, pat::CompositeCandidate const &cand, reco::BeamSpot const *bs, reco::Vertex const *pv, int startPosition=0) const
edm::EDGetTokenT< pat::CompositeCandidateCollection > bdToJPsiK0sCandsToken
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken
edm::EDGetTokenT< pat::CompositeCandidateCollection > bcToJPsiPiCandsToken
void initBsToJPsiPhiComponentHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, DecayHists &) const
static const reco::Track * getTrack(const reco::Candidate &rc, const char *modeList="cfhbpmnigset", char *modeFlag=nullptr)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
float getMass(pat::CompositeCandidate const &cand)
edm::EDGetTokenT< pat::CompositeCandidateCollection > buToPsi2SKCandsToken
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:649
float ChiSquaredProbability(double chiSquared, double nrDOF)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
dqm::reco::MonitorElement * h_mass
int fillBcToJPsiPiComponents(DecayHists const &histos, pat::CompositeCandidate const &cand, reco::BeamSpot const *bs, reco::Vertex const *pv, int startPosition=0) const
int fillBuToJPsiKComponents(DecayHists const &histos, pat::CompositeCandidate const &cand, reco::BeamSpot const *bs, reco::Vertex const *pv, int startPosition=0) const
edm::EDGetTokenT< pat::CompositeCandidateCollection > kx0ToKPiCandsToken
void initPhiToKKComponentHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, DecayHists &) const
int fillComponentHistogramsLeadSoft(DecayHists const &, pat::CompositeCandidate const &cand, std::string const &name1, std::string const &name2, reco::BeamSpot const *bs, reco::Vertex const *pv, int startPosition=0) const
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
int fillBuToPsi2SKComponents(DecayHists const &histos, pat::CompositeCandidate const &cand, reco::BeamSpot const *bs, reco::Vertex const *pv, int startPosition=0) const
std::vector< CompositeCandidate > CompositeCandidateCollection
void initLambda0ToPPiComponentHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, DecayHists &) const
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
void bookDecayHists(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, DecayHists &, std::string const &, std::string const &, int, float, float, float distanceScaleFactor=1.) const
double chi2() const
chi-squared of the fit
Definition: TrackBase.h:587
void initKx0ToKPiComponentHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, DecayHists &) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
int fillLambda0ToPPiComponents(DecayHists const &histos, pat::CompositeCandidate const &cand, reco::BeamSpot const *bs, reco::Vertex const *pv, int startPosition=0) const
int fillBdToJPsiK0sComponents(DecayHists const &histos, pat::CompositeCandidate const &cand, reco::BeamSpot const *bs, reco::Vertex const *pv, int startPosition=0) const
double value() const
Definition: Measurement1D.h:25
double significance() const
Definition: Measurement1D.h:29
histos
Definition: combine.py:4
void initBdToJPsiKx0ComponentHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, DecayHists &) const
fixed size matrix
HLT enums.
void initBuToPsi2SKComponentHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, DecayHists &) const
edm::EDGetTokenT< pat::CompositeCandidateCollection > psi2SToJPsiPiPiCandsToken
int fillK0sToPiPiComponents(DecayHists const &histos, pat::CompositeCandidate const &cand, reco::BeamSpot const *bs, reco::Vertex const *pv, int startPosition=0) const
void throwMissingCollection(const char *requested, const char *missing)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
dqm::reco::MonitorElement * h_eta
dqm::reco::MonitorElement * h_sign2D
void initBdToJPsiK0sComponentHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, DecayHists &) const
dqm::reco::MonitorElement * h_pt
edm::EDGetTokenT< pat::CompositeCandidateCollection > k0sToPiPiCandsToken
edm::EDGetTokenT< pat::CompositeCandidateCollection > bsToJPsiPhiCandsToken
Definition: Run.h:45
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:608
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, Histograms &) const override