CMS 3D CMS Logo

MBUEandQCDValidation.cc
Go to the documentation of this file.
1 /*Class MBUEandQCDValidation
2  *
3  * Class to fill dqm monitor elements from existing EDM file
4  *
5  */
6 
7 #include "MBUEandQCDValidation.h"
9 
10 #include "CLHEP/Units/defs.h"
11 #include "CLHEP/Units/PhysicalConstants.h"
12 #include "CLHEP/Units/SystemOfUnits.h"
13 
14 #include "fastjet/JetDefinition.hh"
15 #include "fastjet/ClusterSequence.hh"
17 using namespace edm;
18 
20  : wmanager_(iPSet, consumesCollector()),
21  hepmcCollection_(iPSet.getParameter<edm::InputTag>("hepmcCollection")),
22  genchjetCollection_(iPSet.getParameter<edm::InputTag>("genChjetsCollection")),
23  genjetCollection_(iPSet.getParameter<edm::InputTag>("genjetsCollection")),
24  verbosity_(iPSet.getUntrackedParameter<unsigned int>("verbosity", 0)) {
25  hepmcGPCollection.reserve(initSize);
26  hepmcCharge.reserve(initSize);
27 
29 
31 
32  hepmcCollectionToken_ = consumes<HepMCProduct>(hepmcCollection_);
33  genjetCollectionToken_ = consumes<reco::GenJetCollection>(genjetCollection_);
34  genchjetCollectionToken_ = consumes<reco::GenJetCollection>(genchjetCollection_);
35 }
36 
38 
40 
43  DQMHelper dqm(&i);
44  i.setCurrentFolder("Generator/MBUEandQCD");
45 
47 
48  // Number of analyzed events
49  nEvt = dqm.book1dHisto("nEvt", "n analyzed Events", 1, 0., 1., " ", "Number of events");
50 
51  // Number of events with no forward trigger
52  nNoFwdTrig = dqm.book1dHisto(
53  "nNoFwdTrig", "n Events no forward trigger", 1, 0., 1., " ", "Number of Events with no Forward Trigger");
54 
55  // Number of Events with a single arm forward trigger
56  nSaFwdTrig = dqm.book1dHisto("nSaFwdTrig",
57  "n Events single arm forward trigger",
58  1,
59  0.,
60  1.,
61  " ",
62  "Number of Events with Single Arm Forward Trigger");
63 
64  // Number of Events with b quark
65  nbquark = dqm.book1dHisto("nbquark", "n Events with b quark", 1, 0., 1., " ", "Number of Events with b Quarks");
66 
67  // Number of Events with c and b quark
68  ncandbquark = dqm.book1dHisto(
69  "ncandbquark", "n Events with c and b quark", 1, 0., 1., "", "Number of Events with c and b Quark");
70 
71  // Number of Events with c and no b quark
72  ncnobquark = dqm.book1dHisto(
73  "ncnobquark", "n Events with c and no b quark", 1, 0., 1., "", "Number of Events with c and no b Quark");
74 
75  // Number of selected events for QCD-09-010
76  nEvt1 = dqm.book1dHisto(
77  "nEvt1", "n Events QCD-09-010", 1, 0., 1., "", "Number of Events passing the QCD-09-010 selection");
78  // dNchdpt QCD-09-010
79  dNchdpt1 = dqm.book1dHisto("dNchdpt1",
80  "dNchdpt QCD-09-010",
81  30,
82  0.,
83  6.,
84  "P_{t}^{charged tracks QCD-09-010 selection} (GeV)",
85  "Number of Charged Tracks");
86  // dNchdeta QCD-09-010
87  dNchdeta1 = dqm.book1dHisto("dNchdeta1",
88  "dNchdeta QCD-09-010",
89  10,
90  -2.5,
91  2.5,
92  "#eta^{charged tracks QCD-09-010 selection}",
93  "Number of Charged Tracks");
94  // Number of selected events for QCD-10-001
95 
96  nEvt2 = dqm.book1dHisto(
97  "nEvt2", "n Events QCD-10-001", 1, 0., 1., "", "Number of Events passing the QCD-10-001 selection");
98  // Leading track pt QCD-10-001
99  leadTrackpt = dqm.book1dHisto("leadTrackpt",
100  "leading track pt QCD-10-001",
101  200,
102  0.,
103  100.,
104  "P_{t}^{lead track QCD-10-001 selection} (GeV)",
105  "Number of Events");
106  // Leading track eta QCD-10-001
107  leadTracketa = dqm.book1dHisto("leadTracketa",
108  "leading track eta QCD-10-001",
109  50.,
110  -2.5,
111  2.5,
112  "#eta^{lead track QCD-10-001 selection}",
113  "Number of Events");
114  // transverse charged particle density vs leading track pt
115  nChaDenLpt = i.bookProfile("nChaDenLpt", "charged density vs leading pt", 200, 0., 100., 0., 100., " ");
116  // transverse charged particle density vs leading track pt
117  sptDenLpt = i.bookProfile("sptDenLpt", "sum pt density vs leading pt", 200, 0., 100., 0., 300., " ");
118  // dNchdpt QCD-10-001 transverse
119  dNchdpt2 = dqm.book1dHisto("dNchdpt2",
120  "dNchdpt QCD-10-001",
121  200,
122  0.,
123  100.,
124  "P_{t}^{charged tracks QCD-10-001 selection} (GeV)",
125  "Number of Charged Tracks");
126  // dNchdeta QCD-10-001 transverse
127  dNchdeta2 = dqm.book1dHisto("dNchdeta2",
128  "dNchdeta QCD-10-001",
129  50,
130  -2.5,
131  2.5,
132  "#eta^{charged tracks QCD-10-001 selection}",
133  "Number of Charged Tracks");
134  // nCha QCD-10-001 transverse
135  nCha = dqm.book1dHisto(
136  "nCha", "n charged QCD-10-001", 100, 0., 100., "N^{charged tracks QCD-10-001 selection}", "Number of Events");
137  // dNchdSpt transverse
138  dNchdSpt = dqm.book1dHisto("dNchdSpt",
139  "dNchdSpt QCD-10-001",
140  300,
141  0.,
142  300.,
143  "P_{t}^{charged trackes in transverse region QCD-10-001selection} (GeV)",
144  "Number of Charged Tracks");
145  // dNchdphi
146  dNchdphi = i.bookProfile("dNchdphi", "dNchdphi QCD-10-001", nphiBin, -180., 180., 0., 30., " ");
147  // dSptdphi
148  dSptdphi = i.bookProfile("dSptdphi", "dSptdphi QCD-10-001", nphiBin, -180., 180., 0., 30., " ");
149 
150  // number of charged jets QCD-10-001
151  nChj = dqm.book1dHisto(
152  "nChj", "n charged jets QCD-10-001", 30, 0, 30., "N^{charged jets QCD-10-001 selection}", "Number of Events");
153  // dNchjdeta QCD-10-001
154  dNchjdeta = dqm.book1dHisto("dNchjdeta",
155  "dNchjdeta QCD-10-001",
156  50,
157  -2.5,
158  2.5,
159  "#eta^{charged jets QCD-10-001 selection}",
160  "Number of charged Jets");
161  // dNchjdpt QCD-10-001
162  dNchjdpt = dqm.book1dHisto("dNchjdpt",
163  "dNchjdpt QCD-10-001",
164  100,
165  0.,
166  100.,
167  "P_{t}^{charged jets QCD-10-001 selection}",
168  "Number of charged Jets");
169  // leading charged jet pt QCD-10-001
170  leadChjpt = dqm.book1dHisto("leadChjpt",
171  "leadChjpt QCD-10-001",
172  100,
173  0.,
174  100.,
175  "P_{t}^{lead charged jet QCD-10-001 selection}",
176  "Number of charged Jets");
177  // leading charged jet eta QCD-10-001
178  leadChjeta = dqm.book1dHisto("leadChjeta",
179  "leadChjeta QCD-10-001",
180  50,
181  -2.5,
182  2.5,
183  "#eta^{lead charged jet QCD-10-001 selection}",
184  "Number of charged Jets");
185  // (pt1+pt2)/ptot
186  pt1pt2optotch = i.bookProfile("pt1pt2optotch", "sum 2 leading jets over ptot", 50, 0., 100., 0., 1., " ");
187 
188  // particle rates in tracker acceptance
189  nPPbar = dqm.book1dHisto(
190  "nPPbar", "nPPbar QCD-10-001", 30, 0., 30., "N_{p/#bar{p}}^{QCD-10-001 selection}", "Number of p/#bar{p}");
191  nKpm = dqm.book1dHisto(
192  "nKpm", "nKpm QCD-10-001", 30, 0., 30., "N_{K^{#pm}}^{QCD-10-001 selection}", "Number of K^{#pm}");
193  nK0s = dqm.book1dHisto("nK0s", "nK0s QCD-10-001", 30, 0., 30., "N_{K^{0}}^{QCD-10-001 selection}", "Number of K^{0}");
194  nL0 = dqm.book1dHisto(
195  "nL0", "nL0 QCD-10-001", 30, 0., 30., "N_{#Lambda^{0}}^{QCD-10-001 selection}", "Number of #Lambda^{0}");
196  nXim = dqm.book1dHisto("nXim", "nXim QCD-10-001", 30, 0., 30., "N_{#Xi}^{QCD-10-001 selection}", "Number of #Xi");
197  nOmega = dqm.book1dHisto(
198  "nOmega", "nOmega QCD-10-001", 30, 0., 30., "N_{#Omega^{#pm}}^{QCD-10-001 selection}", "Number of #Omega^{#pm}");
199 
200  pPPbar = dqm.book1dHisto("pPPbar",
201  "Log10(pt) PPbar QCD-10-001",
202  25,
203  -2.,
204  3.,
205  "log_{10}(P_{t}^{p/#bar{p} QCD-10-001 selection}) (log_{10}(GeV))",
206  "Number of p/#bar{p}");
207  pKpm = dqm.book1dHisto("pKpm",
208  "Log10(pt) Kpm QCD-10-001",
209  25,
210  -2.,
211  3.,
212  "log_{10}(P_{t}^{K^{#pm} QCD-10-001 selection}) (log_{10}(GeV))",
213  "Number of K^{#pm}");
214  pK0s = dqm.book1dHisto("pK0s",
215  "Log10(pt) K0s QCD-10-001",
216  25,
217  -2.,
218  3.,
219  "log_{10}(P_{t}^{K^{0} QCD-10-001 selection}) (log_{10}(GeV))",
220  "Number of K^{0}");
221  pL0 = dqm.book1dHisto("pL0",
222  "Log10(pt) L0 QCD-10-001",
223  25,
224  -2.,
225  3.,
226  "log_{10}(P_{t}^{#Lambda^{0} QCD-10-001 selection}) (log_{10}(GeV))",
227  "Number of #Lambda^{0}");
228  pXim = dqm.book1dHisto("pXim",
229  "Log10(pt) Xim QCD-10-001",
230  25,
231  -2.,
232  3.,
233  "log_{10}(P_{t}^{#Xi^{#pm} QCD-10-001 selection}) (log_{10}(GeV))",
234  "Number of #Xi");
235  pOmega = dqm.book1dHisto("pOmega",
236  "Log10(pt) Omega QCD-10-001",
237  25,
238  -2.,
239  3.,
240  "log_{10}(P_{t}^{#Omega^{#pm} QCD-10-001 selection}) (log_{10}(GeV))",
241  "Number of #Omega^{#pm}");
242 
243  // neutral rate in the barrel + HF acceptance
244  nNNbar = dqm.book1dHisto(
245  "nNNbar", "nNNbar QCD-10-001", 30, 0., 30., "N_{n/#bar{n}}^{QCD-10-001 selection}", "Number of Events");
246  nGamma = dqm.book1dHisto(
247  "nGamma", "nGamma QCD-10-001", 50, 0., 200., "N_{#gamma}^{QCD-10-001 selection}", "Number of Events");
248 
249  pNNbar = dqm.book1dHisto("pNNbar",
250  "Log10(pt) NNbar QCD-10-001",
251  25,
252  -2.,
253  3.,
254  "log_{10}(P_{t}^{n/#bar{n} QCD-10-001 selection}) (log_{10}(GeV))",
255  "Number of n/#bar{n}");
256  pGamma = dqm.book1dHisto("pGamma",
257  "Log10(pt) Gamma QCD-10-001",
258  25,
259  -2.,
260  3.,
261  "log_{10}(P_{t}^{#gamma QCD-10-001 selection}) (log_{10}(GeV))",
262  "Number of #gamma");
263 
264  // highest pt electron spectrum
265  elePt = dqm.book1dHisto("elePt",
266  "highest pt electron Log10(pt)",
267  30,
268  -2.,
269  4.,
270  "log_{10}(P_{t}^{highest e} (log_{10}(GeV))",
271  "Number of Events");
272 
273  // highest pt muon spectrum
274  muoPt = dqm.book1dHisto("muoPt",
275  "highest pt muon Log10(pt)",
276  30,
277  -2.,
278  4.,
279  "log_{10}(P_{t}^{highest #mu} (log_{10}(GeV))",
280  "Number of Events");
281 
282  // number of selected di-jet events
283  nDijet = dqm.book1dHisto(
284  "nDijet", "n Dijet Events", 1, 0., 1., " ", "Number of Events Passing Di-jet JME-10-001 Selection");
285  // number of jets
286  nj = dqm.book1dHisto("nj", "n jets ", 30, 0, 30., "N_{jets}^{JME-10-001}", "Number of Events");
287  // dNjdeta
288  dNjdeta = dqm.book1dHisto("dNjdeta", "dNjdeta ", 50, -5., 5., "#eta_{jets}^{JME-10-001 selection}", "Number of Jets");
289  // dNjdpt
290  dNjdpt = dqm.book1dHisto("dNjdpt", "dNjdpt ", 60, 0., 300., "P_{t}^{jets JME-10-001 selection}", "Number of Jets");
291  // (pt1+pt2)/ptot
292  pt1pt2optot = i.bookProfile("pt1pt2optot", "sum 2 leading jets over Et tot ", 60, 0., 300., 0., 1., " ");
293  // pt1-pt2
294  pt1pt2balance =
295  dqm.book1dHisto("pt1pt2balance",
296  "2 leading jets pt difference ",
297  10,
298  0.,
299  1.,
300  "#frac{P_{t}^{1st jet}-P_{t}^{2nd jet}}{P_{t}^{1st jet}+P_{t}^{2nd jet}}^{JME-10-001 selection}",
301  "Number of Di-jet Events");
302  // pt1 pt2 Delta phi
303  pt1pt2Dphi = dqm.book1dHisto("pt1pt2Dphi",
304  "pt1 pt2 delta phi ",
305  nphiBin,
306  0.,
307  180.,
308  "#Delta#phi(jet^{1st},jet^{2nd})^{JME-10-001 selection} (rad)",
309  "Number of Di-jet Events");
310  // pt1 pt2 invariant mass
311  pt1pt2InvM = dqm.book1dHisto("pt1pt2InvM",
312  "pt1 pt2 invariant mass ",
313  60,
314  0.,
315  600.,
316  "M_{di-jet}^{JME-10-001 selection}",
317  "Number of di-jet events");
318  // pt3 fraction
319  pt3Frac = dqm.book1dHisto("pt3Frac",
320  "2 pt3 over pt1+pt2 ",
321  30,
322  0.,
323  1.,
324  "#frac{P_{t}^{3rd jet}}{P_{t}^{1st jet}+P_{t}^{2nd jet}}^{JME-10-001 selection}",
325  "Number of 3rd Jets");
326  // sum of jets Et
327  sumJEt = dqm.book1dHisto(
328  "sumJEt", "sum Jet Et ", 60, 0., 300., "#Sigma E_{t}^{jets JME-10-001 selection}", "Number of di-jet events");
329  // fraction of missing Et over sum of jets Et
330  missEtosumJEt = dqm.book1dHisto("missEtosumJEt",
331  "missing Et over sumJet Et ",
332  30,
333  0.,
334  1.,
335  "E_{t}^{miss}/#Sigma E_{t}^{jets JME-10-001 selection}",
336  "Number of Di-jet Events");
337  // sum of final state particle Pt
338  sumPt = dqm.book1dHisto("sumPt",
339  "sum particle Pt ",
340  60,
341  0.,
342  600.,
343  "#Sigma P_{t}^{particles passing JME-10-001 selection}",
344  "Number of jets");
345  // sum of final state charged particle Pt
346  sumChPt = dqm.book1dHisto("sumChPt",
347  "sum charged particle Pt ",
348  60,
349  0.,
350  300.,
351  "#Sigma P_{t}^{charged particles passing JME-10-001 selection}",
352  "Number of Jets");
353 
354  //Number of selected events for the HF energy flux analysis
355  nHFflow = dqm.book1dHisto("nHFflow",
356  "n HF flow events",
357  1,
358  0.,
359  1.,
360  " ",
361  "Number of Events passing JME-10-001, FWD-10-002 and Jet-Multiplicity selection");
362  //Forward energy flow for MinBias BSC selection
363  dEdetaHFmb = i.bookProfile("dEdetaHFmb",
364  "dEdeta HF MinBias",
366  0,
368  0.,
369  300.,
370  " ");
371  //Forward energy flow for QCD dijet selection
372  dEdetaHFdj = i.bookProfile("dEdetaHFdj",
373  "dEdeta HF QCD dijet",
375  0,
377  0.,
378  300.,
379  " ");
380 
381  // FWD-10-001 like diffraction analysis
382  nHFSD = dqm.book1dHisto(
383  "nHFSD", "n single diffraction in HF", 1, 0., 1., " ", "Number of single diffraction in HF FWD-10-001 selection");
384  // E-pz HF-
385  EmpzHFm = dqm.book1dHisto("EmpzHFm",
386  "E-pz HF- SD",
387  40,
388  0.,
389  200.,
390  "#Sigma E_{cal. cells/corrected for the longitudinal mometum}^{FWD-10-001 selection}",
391  "Number of Events");
392  // Number of cells above threshold
393  ntHFm = dqm.book1dHisto("ntHFm",
394  "number of HF- tower SD",
395  20,
396  0.,
397  20.,
398  " N_{cells over threshold for single diffraction in HF Towers}^{FWD-10-001 selection}",
399  "Number of Events");
400  // Energy in HF-
401  eneHFmSel = dqm.book1dHisto(
402  "eneHFmSel", "energy in HF-", 40, 0., 200., "#Sigma E_{cal. cells}^{FWD-10-001 selection}", "Number of Events");
403 
404  // number of jets accepted in the 'Jet-Multiplicity' analysis
405  _JM25njets = dqm.book1dHisto("JM25njets", "n jets", 15, 0, 15., "Number of JM25 Jets", "Number of Events");
406  _JM25ht = dqm.book1dHisto("JM25ht", "HT", 80, 0, 800., "H_{t}^{JM25} (GeV)", "Number of Events");
407  _JM25pt1 = dqm.book1dHisto("JM25pt1", "pt", 40, 0, 200., "P_{t}^{JM25,1st Jet} (GeV)", "Number of JM25 Jets");
408  _JM25pt2 = dqm.book1dHisto("JM25pt2", "pt", 40, 0, 200., "P_{t}^{JM25,2nd Jet} (GeV)", "Number of JM25 Jets");
409  _JM25pt3 = dqm.book1dHisto("JM25pt3", "pt", 40, 0, 200., "P_{t}^{JM25,3rd Jet} (GeV)", "Number of JM25 Jets");
410  _JM25pt4 = dqm.book1dHisto("JM25pt4", "pt", 40, 0, 200., "P_{t}^{JM25,4th Jet} (GeV)", "Number of JM25 Jets");
411 
412  _JM80njets = dqm.book1dHisto("JM80njets", "n jets", 15, 0, 15., "Number of JM80 Jets", "Number of Events");
413  _JM80ht = dqm.book1dHisto("JM80ht", "HT", 80, 300, 1100., "H_{t}^{JM80} (GeV", "Number of Events");
414  _JM80pt1 = dqm.book1dHisto("JM80pt1", "pt", 40, 60, 260., "P_{t}^{JM80,1st Jet} (GeV)", "Number of JM80 Jets");
415  _JM80pt2 = dqm.book1dHisto("JM80pt2", "pt", 40, 60, 260., "P_{t}^{JM80,2nd Jet} (GeV)", "Number of JM80 Jets");
416  _JM80pt3 = dqm.book1dHisto("JM80pt3", "pt", 40, 60, 260., "P_{t}^{JM80,3rd Jet} (GeV)", "Number of JM80 Jets");
417  _JM80pt4 = dqm.book1dHisto("JM80pt4", "pt", 40, 60, 260., "P_{t}^{JM80,4th Jet} (GeV)", "Number of JM80 Jets");
418 
419  // differential jet rates
420  djr10 = dqm.book1dHisto("djr10",
421  "Differential Jet Rate 1#rightarrow0",
422  60,
423  -1.,
424  5.,
425  "log_{10}(d_{min}(n,n+1)) for n=0",
426  "Number of Events");
427  djr21 = dqm.book1dHisto("djr21",
428  "Differential Jet Rate 2#rightarrow1",
429  60,
430  -1.,
431  5.,
432  "log_{10}(d_{min}(n,n+1)) for n=1",
433  "Number of Events");
434  djr32 = dqm.book1dHisto("djr32",
435  "Differential Jet Rate 3#rightarrow2",
436  60,
437  -1.,
438  5.,
439  "log_{10}(d_{min}(n,n+1)) for n=2",
440  "Number of Events");
441  djr43 = dqm.book1dHisto("djr43",
442  "Differential Jet Rate 4#rightarrow3",
443  60,
444  -1.,
445  5.,
446  "log_{10}(d_{min}(n,n+1)) for n=3",
447  "Number of Events");
448 
449  // sumET analysis
450  _sumEt = dqm.book1dHisto(
451  "sumET", "Sum of stable particles Et", 150, 0, 600., "#Sigma E_{t}^{stable particles}", "Number of Events");
452  _sumEt1 = dqm.book1dHisto("sumET1",
453  "Sum of stable particles Et (eta<0.5)",
454  150,
455  0,
456  200.,
457  "#Sigma E_{t}^{stable particles (#eta<0.5)}",
458  "Number of Events");
459  _sumEt2 = dqm.book1dHisto("sumET2",
460  "Sum of stable particles Et (0.5<eta<1.0)",
461  150,
462  0,
463  200.,
464  "#Sigma E_{t}^{stable particles (0.5<#eta<1.0)}",
465  "Number of Events");
466  _sumEt3 = dqm.book1dHisto("sumET3",
467  "Sum of stable particles Et (1.0<eta<1.5)",
468  150,
469  0,
470  200.,
471  "#Sigma E_{t}^{stable particles (1.0<#eta<1.5)}",
472  "Number of Events");
473  _sumEt4 = dqm.book1dHisto("sumET4",
474  "Sum of stable particles Et (1.5<eta<2.0)",
475  150,
476  0,
477  200.,
478  "#Sigma E_{t}^{stable particles (1.5<#eta<2.0)}",
479  "Number of Events");
480  _sumEt5 = dqm.book1dHisto("sumET5",
481  "Sum of stable particles Et (2.0<eta<5.0)",
482  150,
483  0,
484  200.,
485  "#Sigma E_{t}^{stable particles (2.0<#eta<5.0)}",
486  "Number of Events");
487 
488  return;
489 }
490 
494  iEvent.getByToken(hepmcCollectionToken_, evt);
495 
496  //Get HepMC EVENT
497  HepMC::GenEvent* myGenEvent = new HepMC::GenEvent(*(evt->GetEvent()));
498 
499  double weight = wmanager_.weight(iEvent);
500 
501  if (verbosity_ > 0) {
502  myGenEvent->print();
503  }
504 
505  double binW = 1.;
506 
507  hepmcGPCollection.clear();
508  hepmcCharge.clear();
509  for (unsigned int i = 0; i < eneInCell.size(); i++) {
510  eneInCell[i] = 0.;
511  }
512 
513  nEvt->Fill(0.5, weight);
514 
515  //Looping through HepMC::GenParticle collection to search for status 1 particles
516  double charge = 0.;
517  unsigned int nb = 0;
518  unsigned int nc = 0;
519  for (HepMC::GenEvent::particle_const_iterator iter = myGenEvent->particles_begin();
520  iter != myGenEvent->particles_end();
521  ++iter) {
522  if (std::fabs((*iter)->pdg_id()) == 4) {
523  nc++;
524  }
525  if (std::fabs((*iter)->pdg_id()) == 5) {
526  nb++;
527  }
528  if ((*iter)->status() == 1) {
529  hepmcGPCollection.push_back(*iter);
530  const HepPDT::ParticleData* PData = fPDGTable->particle(HepPDT::ParticleID((*iter)->pdg_id()));
531  if (PData == nullptr) {
532  charge = -999.;
533  } else
534  charge = PData->charge();
535 
536  hepmcCharge.push_back(charge);
537 
538  if (verbosity_ > 0) {
539  std::cout << "HepMC " << std::setw(14) << std::fixed << (*iter)->barcode() << std::setw(14) << std::fixed
540  << (*iter)->pdg_id() << std::setw(14) << std::fixed << (*iter)->momentum().perp() << std::setw(14)
541  << std::fixed << (*iter)->momentum().eta() << std::setw(14) << std::fixed << (*iter)->momentum().phi()
542  << std::endl;
543  }
544  }
545  }
546 
547  int nBSCp = 0;
548  int nBSCm = 0;
549  double eneHFp = 0.;
550  double eneHFm = 0.;
551  int nChapt05 = 0;
552  int nChaVtx = 0;
553  for (unsigned int i = 0; i < hepmcGPCollection.size(); i++) {
554  if (!isNeutrino(i)) {
555  // BSC trigger
556 
557  if (hepmcGPCollection[i]->momentum().eta() > 3.23 && hepmcGPCollection[i]->momentum().eta() < 4.65) {
558  nBSCp++;
559  }
560  if (hepmcGPCollection[i]->momentum().eta() < -3.23 && hepmcGPCollection[i]->momentum().eta() > -4.65) {
561  nBSCm++;
562  }
563 
564  // number of charged particles in different selections
565 
566  if (std::fabs(hepmcGPCollection[i]->momentum().eta()) < 2.5 && hepmcGPCollection[i]->momentum().perp() > 0.5 &&
567  isCharged(i)) {
568  nChapt05++;
569  }
570  if (std::fabs(hepmcGPCollection[i]->momentum().eta()) < 2.5 && hepmcGPCollection[i]->momentum().perp() > 0.1 &&
571  isCharged(i)) {
572  nChaVtx++;
573  }
574  unsigned int theIndex = theCalo->getCellIndexFromAngle(hepmcGPCollection[i]->momentum().eta(),
575  hepmcGPCollection[i]->momentum().phi());
576  if (theIndex < CaloCellManager::nCaloCell)
577  eneInCell[theIndex] += hepmcGPCollection[i]->momentum().rho();
578  }
579  }
580 
581  // Forward calorimeters energy
582 
585  icell++) {
586  if (theCalo->getCellFromIndex(icell)->getEtaMin() < 0.) {
587  eneHFm += eneInCell[icell];
588  } else {
589  eneHFp += eneInCell[icell];
590  }
591  }
592 
593  // QCD-09-010 selection
594  bool sel1 = false;
595  if ((nBSCp > 0 || nBSCm > 0) && eneHFp >= 3. && eneHFm >= 3.) {
596  sel1 = true;
597  }
598 
599  // QCD-10-001 selection
600  bool sel2 = false;
601  if ((nBSCp > 0 || nBSCm > 0) && nChaVtx >= 3 && nChapt05 > 1) {
602  sel2 = true;
603  }
604 
605  // no forward trigger selection
606  bool sel3 = false;
607  if (nBSCp == 0 && nBSCm == 0) {
608  sel3 = true;
609  }
610 
611  // single arm forward trigger selection
612  bool sel4 = false;
613  if ((nBSCp > 0 && nBSCm == 0) || (nBSCm > 0 && nBSCp == 0)) {
614  sel4 = true;
615  }
616 
617  // BSC selection
618  bool sel5 = false;
619  if (nBSCp > 0 && nBSCm > 0) {
620  sel5 = true;
621  }
622 
623  // basic JME-10-001, FWD-10-002 and Jet-Multiplicity selection
624  bool sel6 = false;
625  if (sel5 && nChaVtx > 3) {
626  sel6 = true;
627  }
628 
629  // FWD-10-001 selection
630  bool sel7 = false;
631  if (nChaVtx >= 3 && nBSCm > 0 && eneHFp < 8.) {
632  sel7 = true;
633  }
634 
635  // Fill selection histograms
636  if (sel1)
637  nEvt1->Fill(0.5, weight);
638  if (sel2)
639  nEvt2->Fill(0.5, weight);
640  if (sel3)
641  nNoFwdTrig->Fill(0.5, weight);
642  if (sel4)
643  nSaFwdTrig->Fill(0.5, weight);
644  if (sel6)
645  nHFflow->Fill(0.5, weight);
646  if (sel7)
647  nHFSD->Fill(0.5, weight);
648 
649  if (nb > 0)
650  nbquark->Fill(0.5, weight);
651  if (nb > 0 && nc > 0)
652  ncandbquark->Fill(0.5, weight);
653  if (nb == 0 && nc > 0)
654  ncnobquark->Fill(0.5, weight);
655 
656  // track analyses
657  double ptMax = 0.;
658  unsigned int iMax = 0;
659  double ptot = 0.;
660  unsigned int ppbar = 0;
661  unsigned int nnbar = 0;
662  unsigned int kpm = 0;
663  unsigned int k0s = 0;
664  unsigned int l0 = 0;
665  unsigned int gamma = 0;
666  unsigned int xim = 0;
667  unsigned int omega = 0;
668  unsigned int ele = 0;
669  unsigned int muo = 0;
670  unsigned int eleMax = 0;
671  unsigned int muoMax = 0;
672 
673  std::vector<double> hfMB(CaloCellManager::nForwardEta, 0);
674  std::vector<double> hfDJ(CaloCellManager::nForwardEta, 0);
675 
676  for (unsigned int i = 0; i < hepmcGPCollection.size(); i++) {
677  double eta = hepmcGPCollection[i]->momentum().eta();
678  double pt = hepmcGPCollection[i]->momentum().perp();
679  int pdgId = hepmcGPCollection[i]->pdg_id();
680  if (isCharged(i) && std::fabs(eta) < 2.5) {
681  if (sel1) {
682  // QCD-09-010
683  binW = dNchdpt1->getTH1()->GetBinWidth(1);
684  dNchdpt1->Fill(pt, 1. / binW); // weight to account for the pt bin width
685  binW = dNchdeta1->getTH1()->GetBinWidth(1);
686  dNchdeta1->Fill(eta, 1. / binW); // weight to account for the eta bin width
687  }
688  // search for the leading track QCD-10-001
689  if (sel2) {
690  if (pt > ptMax) {
691  ptMax = pt;
692  iMax = i;
693  }
694  ptot += pt;
695 
696  // identified charged particle
697  if (std::abs(pdgId) == 2212) {
698  ppbar++;
699  pPPbar->Fill(std::log10(pt), weight);
700  } else if (std::abs(pdgId) == 321) {
701  kpm++;
702  pKpm->Fill(std::log10(pt), weight);
703  } else if (std::abs(pdgId) == 3312) {
704  xim++;
705  pXim->Fill(std::log10(pt), weight);
706  } else if (std::abs(pdgId) == 3334) {
707  omega++;
708  pOmega->Fill(std::log10(pt), weight);
709  } else if (std::abs(pdgId) == 11) {
710  ele++;
711  eleMax = i;
712  } else if (std::abs(pdgId) == 13) {
713  muo++;
714  muoMax = i;
715  }
716  }
717  } else if (sel2 && isNeutral(i) && std::fabs(eta) < 2.5) {
718  if (std::abs(pdgId) == 310) {
719  k0s++;
720  pK0s->Fill(std::log10(pt), weight);
721  } else if (std::abs(pdgId) == 3122) {
722  l0++;
723  pL0->Fill(std::log10(pt), weight);
724  }
725  } else if (sel2 && isNeutral(i) && std::fabs(eta) < 5.19) {
726  if (std::abs(pdgId) == 2112) {
727  nnbar++;
728  pNNbar->Fill(std::log10(pt), weight);
729  } else if (std::abs(pdgId) == 22) {
730  gamma++;
731  pGamma->Fill(std::log10(pt), weight);
732  }
733  }
734  unsigned int iBin = getHFbin(eta);
735  if (sel6 && !isNeutrino(i) && iBin < CaloCellManager::nForwardEta) {
736  hfMB[iBin] += hepmcGPCollection[i]->momentum().rho();
737  }
738  }
739  nPPbar->Fill(ppbar, weight);
740  nNNbar->Fill(nnbar, weight);
741  nKpm->Fill(kpm, weight);
742  nK0s->Fill(k0s, weight);
743  nL0->Fill(l0, weight);
744  nXim->Fill(xim, weight);
745  nOmega->Fill(omega, weight);
746  nGamma->Fill(gamma, weight);
747 
748  if (ele > 0)
749  elePt->Fill(std::log10(hepmcGPCollection[eleMax]->momentum().perp()), weight);
750  if (muo > 0)
751  muoPt->Fill(std::log10(hepmcGPCollection[muoMax]->momentum().perp()), weight);
752 
753  leadTrackpt->Fill(hepmcGPCollection[iMax]->momentum().perp(), weight);
754  leadTracketa->Fill(hepmcGPCollection[iMax]->momentum().eta(), weight);
755 
756  std::vector<double> theEtaRanges(theCalo->getEtaRanges());
757 
758  for (unsigned int i = 0; i < CaloCellManager::nForwardEta; i++) {
759  binW = theEtaRanges[CaloCellManager::nBarrelEta + CaloCellManager::nEndcapEta + i + 1] -
761  dEdetaHFmb->Fill(i + 0.5, hfMB[i] / binW);
762  }
763 
764  // FWD-10-001
765 
766  if (sel7) {
767  double empz = 0.;
768  unsigned int nCellOvTh = 0;
769  double threshold = 0.;
770 
771  for (unsigned int icell = 0; icell < eneInCell.size(); icell++) {
773  threshold = 3.;
774  } else {
775  threshold = 4.;
776  }
777 
778  if (eneInCell[icell] > threshold) {
780  nCellOvTh++;
781  }
782  empz += eneInCell[icell] * (1. - std::cos(theCalo->getCellFromIndex(icell)->getThetaCell()));
783  }
784  }
785 
786  EmpzHFm->Fill(empz, weight);
787  ntHFm->Fill(nCellOvTh, weight);
788  eneHFmSel->Fill(eneHFm, weight);
789  }
790 
791  // QCD-10-001
792  double phiMax = hepmcGPCollection[iMax]->momentum().phi();
793  std::vector<unsigned int> nchvsphi(nphiBin, 0);
794  std::vector<double> sptvsphi(nphiBin, 0.);
795  unsigned int nChaTra = 0;
796  double sptTra = 0.;
797 
798  double binPhiW = 360. / nphiBin;
799  if (sel2) {
800  for (unsigned int i = 0; i < hepmcGPCollection.size(); i++) {
801  if (isCharged(i) && std::fabs(hepmcGPCollection[i]->momentum().eta()) < 2.) {
802  double thePhi = (hepmcGPCollection[i]->momentum().phi() - phiMax) / CLHEP::degree;
803  if (thePhi < -180.) {
804  thePhi += 360.;
805  } else if (thePhi > 180.) {
806  thePhi -= 360.;
807  }
808  unsigned int thePhiBin = (int)((thePhi + 180.) / binPhiW);
809  if (thePhiBin == nphiBin) {
810  thePhiBin -= 1;
811  }
812  nchvsphi[thePhiBin]++;
813  sptvsphi[thePhiBin] += hepmcGPCollection[i]->momentum().perp();
814  // analysis in the transverse region
815  if (std::fabs(thePhi) > 60. && std::fabs(thePhi) < 120.) {
816  nChaTra++;
817  sptTra += hepmcGPCollection[i]->momentum().perp();
818  binW = dNchdpt2->getTH1()->GetBinWidth(1);
819  dNchdpt2->Fill(hepmcGPCollection[i]->momentum().perp(), 1. / binW); // weight to account for the pt bin width
820  binW = dNchdeta2->getTH1()->GetBinWidth(1);
821  // weight to account for the eta bin width
822  dNchdeta2->Fill(hepmcGPCollection[i]->momentum().eta(), 1. / binW);
823  }
824  }
825  }
826  nCha->Fill(nChaTra, weight);
827  binW = dNchdSpt->getTH1()->GetBinWidth(1);
828  dNchdSpt->Fill(sptTra, 1.);
829  //how do one apply weights to a profile? MonitorElement doesn't allow to
830  nChaDenLpt->Fill(hepmcGPCollection[iMax]->momentum().perp(), nChaTra / 4. / CLHEP::twopi);
831  sptDenLpt->Fill(hepmcGPCollection[iMax]->momentum().perp(), sptTra / 4. / CLHEP::twopi);
832  for (unsigned int i = 0; i < nphiBin; i++) {
833  double thisPhi = -180. + (i + 0.5) * binPhiW;
834  dNchdphi->Fill(thisPhi, nchvsphi[i] / binPhiW / 4.); // density in phi and eta
835  dSptdphi->Fill(thisPhi, sptvsphi[i] / binPhiW / 4.); // density in phi and eta
836  }
837  }
838 
839  // Gather information in the charged GenJet collection
841  iEvent.getByToken(genchjetCollectionToken_, genChJets);
842 
843  unsigned int nJets = 0;
844  double pt1 = 0.;
845  double pt2 = 0.;
846  reco::GenJetCollection::const_iterator ij1 = genChJets->begin();
847  reco::GenJetCollection::const_iterator ij2 = genChJets->begin();
848  if (sel2) {
849  for (reco::GenJetCollection::const_iterator iter = genChJets->begin(); iter != genChJets->end(); ++iter) {
850  double eta = (*iter).eta();
851  double pt = (*iter).pt();
852  if (verbosity_ > 0) {
853  std::cout << "GenJet " << std::setw(14) << std::fixed << (*iter).pt() << std::setw(14) << std::fixed
854  << (*iter).eta() << std::setw(14) << std::fixed << (*iter).phi() << std::endl;
855  }
856  if (std::fabs(eta) < 2.) {
857  nJets++;
858  binW = dNchjdeta->getTH1()->GetBinWidth(1);
859  dNchjdeta->Fill(eta, 1. / binW);
860  binW = dNchjdpt->getTH1()->GetBinWidth(1);
861  dNchjdpt->Fill(pt, 1. / binW);
862  if (pt >= pt1) {
863  pt1 = pt;
864  ij1 = iter;
865  }
866  if (pt < pt1 && pt >= pt2) {
867  pt2 = pt;
868  ij2 = iter;
869  }
870  }
871  }
872 
873  nChj->Fill(nJets, weight);
874  if (nJets > 0 && ij1 != genChJets->end()) {
876  leadChjeta->Fill((*ij1).eta(), weight);
877  if (nJets > 1 && ij2 != genChJets->end()) {
878  pt1pt2optotch->Fill(pt1 + pt2, (pt1 + pt2) / ptot);
879  }
880  }
881  }
882 
883  // Gather information in the GenJet collection
886 
887  nJets = 0;
888  pt1 = 0.;
889  pt2 = 0.;
890  double pt3 = 0.;
891 
892  // needed for Jet-Multiplicity Analysis
893  int jm25njets = 0;
894  double jm25HT = 0.;
895  double jm25pt1 = 0.;
896  double jm25pt2 = 0.;
897  double jm25pt3 = 0.;
898  double jm25pt4 = 0.;
899 
900  int jm80njets = 0;
901  double jm80HT = 0.;
902  double jm80pt1 = 0.;
903  double jm80pt2 = 0.;
904  double jm80pt3 = 0.;
905  double jm80pt4 = 0.;
906 
907  reco::GenJetCollection::const_iterator ij3 = genJets->begin();
908  if (sel6) {
909  for (reco::GenJetCollection::const_iterator iter = genJets->begin(); iter != genJets->end(); ++iter) {
910  double eta = (*iter).eta();
911  double pt = (*iter).pt();
912  if (verbosity_ > 0) {
913  std::cout << "GenJet " << std::setw(14) << std::fixed << (*iter).pt() << std::setw(14) << std::fixed
914  << (*iter).eta() << std::setw(14) << std::fixed << (*iter).phi() << std::endl;
915  }
916  if (std::fabs(eta) < 5.) {
917  nJets++;
918  if (pt >= pt1) {
919  pt1 = pt;
920  ij1 = iter;
921  }
922  if (pt < pt1 && pt >= pt2) {
923  pt2 = pt;
924  ij2 = iter;
925  }
926  if (pt < pt2 && pt >= pt3) {
927  pt3 = pt;
928  ij3 = iter;
929  }
930  }
931 
932  // find variables for Jet-Multiplicity Analysis
933  if (fabs(iter->eta()) < 3. && iter->pt() > 25.) {
934  jm25njets++;
935  jm25HT += iter->pt();
936  if (iter->pt() > jm25pt1) {
937  jm25pt4 = jm25pt3;
938  jm25pt3 = jm25pt2;
939  jm25pt2 = jm25pt1;
940  jm25pt1 = iter->pt();
941  } else if (iter->pt() > jm25pt2) {
942  jm25pt4 = jm25pt3;
943  jm25pt3 = jm25pt2;
944  jm25pt2 = iter->pt();
945  } else if (iter->pt() > jm25pt3) {
946  jm25pt4 = jm25pt3;
947  jm25pt3 = iter->pt();
948  } else if (iter->pt() > jm25pt4) {
949  jm25pt4 = iter->pt();
950  }
951  // even harder jets...
952  if (iter->pt() > 80.) {
953  jm80njets++;
954  jm80HT += iter->pt();
955  if (iter->pt() > jm80pt1) {
956  jm80pt4 = jm80pt3;
957  jm80pt3 = jm80pt2;
958  jm80pt2 = jm80pt1;
959  jm80pt1 = iter->pt();
960  } else if (iter->pt() > jm80pt2) {
961  jm80pt4 = jm80pt3;
962  jm80pt3 = jm80pt2;
963  jm80pt2 = iter->pt();
964  } else if (iter->pt() > jm80pt3) {
965  jm80pt4 = jm80pt3;
966  jm80pt3 = iter->pt();
967  } else if (iter->pt() > jm80pt4) {
968  jm80pt4 = iter->pt();
969  }
970  }
971  }
972  }
973  if (jm25njets > 3) {
974  _JM25njets->Fill(jm25njets, weight);
975  _JM25ht->Fill(jm25HT, weight);
976  _JM25pt1->Fill(jm25pt1, weight);
977  _JM25pt2->Fill(jm25pt2, weight);
978  _JM25pt3->Fill(jm25pt3, weight);
979  _JM25pt4->Fill(jm25pt4, weight);
980  }
981  if (jm80njets > 3) {
982  _JM80njets->Fill(jm80njets, weight);
983  _JM80ht->Fill(jm80HT, weight);
984  _JM80pt1->Fill(jm80pt1, weight);
985  _JM80pt2->Fill(jm80pt2, weight);
986  _JM80pt3->Fill(jm80pt3, weight);
987  _JM80pt4->Fill(jm80pt4, weight);
988  }
989 
990  // select a di-jet event JME-10-001 variant
991  double sumJetEt = 0;
992  double sumPartPt = 0.;
993  double sumChPartPt = 0.;
994  double jpx = 0;
995  double jpy = 0;
996  if (nJets >= 2 && ij1 != genJets->end() && ij2 != genJets->end()) {
997  if ((*ij1).pt() > 25. && (*ij1).pt() > 25.) {
998  double deltaPhi = std::fabs((*ij1).phi() - (*ij2).phi()) / CLHEP::degree;
999  if (deltaPhi > 180.)
1000  deltaPhi = 360. - deltaPhi;
1002  if (std::fabs(deltaPhi) > 2.5 * CLHEP::degree) {
1003  nDijet->Fill(0.5, weight);
1004 
1005  for (unsigned int i = 0; i < hepmcGPCollection.size(); i++) {
1006  double eta = hepmcGPCollection[i]->momentum().eta();
1007  unsigned int iBin = getHFbin(eta);
1008  if (!isNeutrino(i) && iBin < CaloCellManager::nForwardEta) {
1009  hfDJ[iBin] += hepmcGPCollection[i]->momentum().rho();
1010  }
1011  if (!isNeutrino(i) && std::fabs(eta) < 5.) {
1012  sumPartPt += hepmcGPCollection[i]->momentum().perp();
1013  if (isCharged(i)) {
1014  sumChPartPt += hepmcGPCollection[i]->momentum().perp();
1015  }
1016  }
1017  }
1018  for (unsigned int i = 0; i < CaloCellManager::nForwardEta; i++) {
1019  binW = theEtaRanges[CaloCellManager::nBarrelEta + CaloCellManager::nEndcapEta + i + 1] -
1021  dEdetaHFdj->Fill(i + 0.5, hfDJ[i] / binW);
1022  }
1023 
1024  double invMass = (*ij1).energy() * (*ij2).energy() - (*ij1).px() * (*ij2).px() - (*ij1).py() * (*ij2).py() -
1025  (*ij1).pz() * (*ij2).pz();
1026  invMass = std::sqrt(invMass);
1027  pt1pt2InvM->Fill(invMass, weight);
1028 
1029  sumPt->Fill(sumPartPt, weight);
1030  sumChPt->Fill(sumChPartPt, weight);
1031 
1032  unsigned int nSelJets = 0;
1033  for (reco::GenJetCollection::const_iterator iter = genJets->begin(); iter != genJets->end(); ++iter) {
1034  double pt = (*iter).pt();
1035  double eta = (*iter).eta();
1036  if (std::fabs(eta) < 5.) {
1037  nSelJets++;
1038  binW = dNjdeta->getTH1()->GetBinWidth(1);
1039  dNjdeta->Fill(eta, 1. / binW * weight);
1040  binW = dNjdpt->getTH1()->GetBinWidth(1);
1041  dNjdpt->Fill(pt, 1. / binW * weight);
1042  sumJetEt += (*iter).pt();
1043  jpx += (*iter).px();
1044  jpy += (*iter).py();
1045  }
1046  }
1047 
1048  nj->Fill(nSelJets, weight);
1049  double mEt = std::sqrt(jpx * jpx + jpy * jpy);
1050  sumJEt->Fill(sumJetEt, weight);
1051  missEtosumJEt->Fill(mEt / sumJetEt, weight);
1052 
1053  if (nSelJets >= 3) {
1054  pt3Frac->Fill((*ij3).pt() / (pt1 + pt2), weight);
1055  }
1056 
1057  pt1pt2optot->Fill(pt1 + pt2, (pt1 + pt2) / sumJetEt);
1058  pt1pt2balance->Fill((pt1 - pt2) / (pt1 + pt2), weight);
1059  }
1060  }
1061  }
1062  }
1063 
1064  //compute differential jet rates
1065  std::vector<const HepMC::GenParticle*> qcdActivity;
1066  HepMCValidationHelper::removeIsolatedLeptons(myGenEvent, 0.2, 3., qcdActivity);
1067  //HepMCValidationHelper::allStatus1(myGenEvent, qcdActivity);
1068  //fill PseudoJets to use fastjet
1069  std::vector<fastjet::PseudoJet> vecs;
1070  int counterUser = 1;
1071  std::vector<const HepMC::GenParticle*>::const_iterator iqcdact;
1072  for (iqcdact = qcdActivity.begin(); iqcdact != qcdActivity.end(); ++iqcdact) {
1073  const HepMC::FourVector& fmom = (*iqcdact)->momentum();
1074  fastjet::PseudoJet pseudoJet(fmom.px(), fmom.py(), fmom.pz(), fmom.e());
1075  pseudoJet.set_user_index(counterUser);
1076  vecs.push_back(pseudoJet);
1077  ++counterUser;
1078  }
1079  //compute jets
1080  fastjet::ClusterSequence cseq(vecs, fastjet::JetDefinition(fastjet::kt_algorithm, 1., fastjet::E_scheme));
1081  //access the cluster sequence and get the relevant info
1082  djr10->Fill(std::log10(sqrt(cseq.exclusive_dmerge(0))), weight);
1083  djr21->Fill(std::log10(sqrt(cseq.exclusive_dmerge(1))), weight);
1084  djr32->Fill(std::log10(sqrt(cseq.exclusive_dmerge(2))), weight);
1085  djr43->Fill(std::log10(sqrt(cseq.exclusive_dmerge(3))), weight);
1086 
1087  // compute sumEt for all stable particles
1088  std::vector<const HepMC::GenParticle*> allStable;
1089  HepMCValidationHelper::allStatus1(myGenEvent, allStable);
1090 
1091  double sumEt = 0.;
1092  double sumEt1 = 0.;
1093  double sumEt2 = 0.;
1094  double sumEt3 = 0.;
1095  double sumEt4 = 0.;
1096  double sumEt5 = 0.;
1097 
1098  for (std::vector<const HepMC::GenParticle*>::const_iterator iter = allStable.begin(); iter != allStable.end();
1099  ++iter) {
1100  double thisEta = fabs((*iter)->momentum().eta());
1101 
1102  if (thisEta < 5.) {
1103  const HepMC::FourVector mom = (*iter)->momentum();
1104  double px = mom.px();
1105  double py = mom.py();
1106  double pz = mom.pz();
1107  double E = mom.e();
1108  double thisSumEt = (sqrt(px * px + py * py) * E / sqrt(px * px + py * py + pz * pz));
1109  sumEt += thisSumEt;
1110  if (thisEta < 1.0)
1111  sumEt1 += thisSumEt;
1112  else if (thisEta < 2.0)
1113  sumEt2 += thisSumEt;
1114  else if (thisEta < 3.0)
1115  sumEt3 += thisSumEt;
1116  else if (thisEta < 4.0)
1117  sumEt4 += thisSumEt;
1118  else
1119  sumEt5 += thisSumEt;
1120  }
1121  }
1122 
1123  if (sumEt > 0.)
1124  _sumEt->Fill(sumEt, weight);
1125  if (sumEt1 > 0.)
1126  _sumEt1->Fill(sumEt1, weight);
1127  if (sumEt2 > 0.)
1128  _sumEt2->Fill(sumEt2, weight);
1129  if (sumEt3 > 0.)
1130  _sumEt3->Fill(sumEt3, weight);
1131  if (sumEt4 > 0.)
1132  _sumEt4->Fill(sumEt4, weight);
1133  if (sumEt5 > 0.)
1134  _sumEt5->Fill(sumEt5, weight);
1135 
1136  delete myGenEvent;
1137 } //analyze
1138 
1140  bool status = false;
1141  if (hepmcGPCollection.size() < i + 1) {
1142  return status;
1143  } else {
1144  status = (hepmcCharge[i] != 0. && hepmcCharge[i] != -999.);
1145  }
1146  return status;
1147 }
1148 
1150  bool status = false;
1152  if (hepmcGPCollection.size() < i + 1) {
1153  return status;
1154  } else {
1155  status = (hepmcCharge[i] == 0. && pdgId != 12 && pdgId != 14 && pdgId != 16);
1156  }
1157  return status;
1158 }
1159 
1161  bool status = false;
1163  if (hepmcGPCollection.size() < i + 1) {
1164  return status;
1165  } else {
1166  status = (pdgId == 12 || pdgId == 14 || pdgId == 16);
1167  }
1168  return status;
1169 }
1170 
1171 unsigned int MBUEandQCDValidation::getHFbin(double eta) {
1172  unsigned int iBin = 999;
1173 
1174  std::vector<double> theEtaRanges(theCalo->getEtaRanges());
1175 
1178  i++) {
1179  if (std::fabs(eta) >= theEtaRanges[i] && std::fabs(eta) < theEtaRanges[i + 1]) {
1181  }
1182  }
1183 
1184  return iBin;
1185 }
1186 
1187 const unsigned int MBUEandQCDValidation::nphiBin = 36;
1188 const unsigned int MBUEandQCDValidation::initSize = 1000;
HiggsValidation_cfi.pdg_id
pdg_id
Definition: HiggsValidation_cfi.py:6
MBUEandQCDValidation::dNchdeta2
MonitorElement * dNchdeta2
Definition: MBUEandQCDValidation.h:90
MBUEandQCDValidation::eneInCell
std::vector< double > eneInCell
Definition: MBUEandQCDValidation.h:70
MBUEandQCDValidation::nbquark
MonitorElement * nbquark
Definition: MBUEandQCDValidation.h:77
MBUEandQCDValidation::dNchjdpt
MonitorElement * dNchjdpt
Definition: MBUEandQCDValidation.h:102
MBUEandQCDValidation.h
MBUEandQCDValidation::hepmcCollectionToken_
edm::EDGetTokenT< edm::HepMCProduct > hepmcCollectionToken_
Definition: MBUEandQCDValidation.h:183
MBUEandQCDValidation::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: MBUEandQCDValidation.cc:491
MBUEandQCDValidation::elePt
MonitorElement * elePt
Definition: MBUEandQCDValidation.h:127
alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
mps_fire.i
i
Definition: mps_fire.py:428
MBUEandQCDValidation::nL0
MonitorElement * nL0
Definition: MBUEandQCDValidation.h:111
MBUEandQCDValidation::pXim
MonitorElement * pXim
Definition: MBUEandQCDValidation.h:124
MBUEandQCDValidation::genchjetCollectionToken_
edm::EDGetTokenT< reco::GenJetCollection > genchjetCollectionToken_
Definition: MBUEandQCDValidation.h:184
MBUEandQCDValidation::nSaFwdTrig
MonitorElement * nSaFwdTrig
Definition: MBUEandQCDValidation.h:75
CaloCellManager::nCaloCell
static const unsigned int nCaloCell
Definition: CaloCellManager.h:40
MBUEandQCDValidation::nEvt2
MonitorElement * nEvt2
Definition: MBUEandQCDValidation.h:87
MBUEandQCDValidation::_JM80pt1
MonitorElement * _JM80pt1
Definition: MBUEandQCDValidation.h:164
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
MBUEandQCDValidation::dNchdeta1
MonitorElement * dNchdeta1
Definition: MBUEandQCDValidation.h:84
mps_update.status
status
Definition: mps_update.py:69
edm::Run
Definition: Run.h:45
MBUEandQCDValidation::hepmcCollection_
edm::InputTag hepmcCollection_
Definition: MBUEandQCDValidation.h:48
MBUEandQCDValidation::nK0s
MonitorElement * nK0s
Definition: MBUEandQCDValidation.h:110
multPhiCorr_741_25nsDY_cfi.py
py
Definition: multPhiCorr_741_25nsDY_cfi.py:12
MBUEandQCDValidation::nOmega
MonitorElement * nOmega
Definition: MBUEandQCDValidation.h:115
edm
HLT enums.
Definition: AlignableModifier.h:19
mps_merge.weight
weight
Definition: mps_merge.py:88
MBUEandQCDValidation::pt1pt2InvM
MonitorElement * pt1pt2InvM
Definition: MBUEandQCDValidation.h:138
gather_cfg.cout
cout
Definition: gather_cfg.py:144
MBUEandQCDValidation::nXim
MonitorElement * nXim
Definition: MBUEandQCDValidation.h:114
MBUEandQCDValidation::pL0
MonitorElement * pL0
Definition: MBUEandQCDValidation.h:121
MBUEandQCDValidation::hepmcGPCollection
std::vector< const HepMC::GenParticle * > hepmcGPCollection
status 1 GenParticle collection
Definition: MBUEandQCDValidation.h:58
MBUEandQCDValidation::_JM80njets
MonitorElement * _JM80njets
Definition: MBUEandQCDValidation.h:162
MBUEandQCDValidation::dNchdphi
MonitorElement * dNchdphi
Definition: MBUEandQCDValidation.h:94
MBUEandQCDValidation::_JM80pt2
MonitorElement * _JM80pt2
Definition: MBUEandQCDValidation.h:165
MBUEandQCDValidation::pKpm
MonitorElement * pKpm
Definition: MBUEandQCDValidation.h:119
MBUEandQCDValidation::nphiBin
const static unsigned int nphiBin
Definition: MBUEandQCDValidation.h:180
MBUEandQCDValidation::dNchjdeta
MonitorElement * dNchjdeta
Definition: MBUEandQCDValidation.h:101
MBUEandQCDValidation::nGamma
MonitorElement * nGamma
Definition: MBUEandQCDValidation.h:113
MBUEandQCDValidation::nDijet
MonitorElement * nDijet
Definition: MBUEandQCDValidation.h:131
MBUEandQCDValidation::nCha
MonitorElement * nCha
Definition: MBUEandQCDValidation.h:92
CaloCellManager::getEtaRanges
std::vector< double > getEtaRanges()
Definition: CaloCellManager.cc:180
MBUEandQCDValidation::getHFbin
unsigned int getHFbin(double eta)
Definition: MBUEandQCDValidation.cc:1171
CaloCellId::getSubSys
System getSubSys() const
Definition: CaloCellId.h:26
CaloCellManager
Definition: CaloCellManager.h:15
CustomPhysics_cfi.gamma
gamma
Definition: CustomPhysics_cfi.py:17
MBUEandQCDValidation::djr43
MonitorElement * djr43
Definition: MBUEandQCDValidation.h:170
MBUEandQCDValidation::dNjdeta
MonitorElement * dNjdeta
Definition: MBUEandQCDValidation.h:133
MBUEandQCDValidation::sumChPt
MonitorElement * sumChPt
Definition: MBUEandQCDValidation.h:143
objects.METAnalyzer.sumEt
sumEt
Definition: METAnalyzer.py:97
MBUEandQCDValidation::pt1pt2optotch
MonitorElement * pt1pt2optotch
Definition: MBUEandQCDValidation.h:105
MBUEandQCDValidation::_sumEt1
MonitorElement * _sumEt1
Definition: MBUEandQCDValidation.h:174
MBUEandQCDValidation::_sumEt4
MonitorElement * _sumEt4
Definition: MBUEandQCDValidation.h:177
MBUEandQCDValidation::dEdetaHFmb
MonitorElement * dEdetaHFmb
Definition: MBUEandQCDValidation.h:147
perp
T perp() const
Magnitude of transverse component.
Definition: Basic3DVectorLD.h:133
edm::Handle
Definition: AssociativeIterator.h:50
MBUEandQCDValidation::muoPt
MonitorElement * muoPt
Definition: MBUEandQCDValidation.h:128
HepMC::GenEvent
Definition: hepmc_rootio.cc:9
ParticleData
HepPDT::ParticleData ParticleData
Definition: ParticleDataTable.h:9
CaloCellId::getThetaCell
double getThetaCell()
Definition: CaloCellId.cc:49
MBUEandQCDValidation::nChj
MonitorElement * nChj
Definition: MBUEandQCDValidation.h:100
CaloCellManager::nForwardEta
static const unsigned int nForwardEta
Definition: CaloCellManager.h:30
MBUEandQCDValidation::isCharged
bool isCharged(unsigned int i)
Definition: MBUEandQCDValidation.cc:1139
MBUEandQCDValidation::nEvt1
MonitorElement * nEvt1
QCD-09-010 analysis.
Definition: MBUEandQCDValidation.h:82
MBUEandQCDValidation::sumJEt
MonitorElement * sumJEt
Definition: MBUEandQCDValidation.h:140
DQMHelper.h
MBUEandQCDValidation::_JM25pt4
MonitorElement * _JM25pt4
Definition: MBUEandQCDValidation.h:161
MBUEandQCDValidation::dEdetaHFdj
MonitorElement * dEdetaHFdj
Definition: MBUEandQCDValidation.h:148
MBUEandQCDValidation::pt3Frac
MonitorElement * pt3Frac
Definition: MBUEandQCDValidation.h:139
MBUEandQCDValidation::_sumEt2
MonitorElement * _sumEt2
Definition: MBUEandQCDValidation.h:175
MBUEandQCDValidation::_sumEt
MonitorElement * _sumEt
Definition: MBUEandQCDValidation.h:173
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
MBUEandQCDValidation::eneHFmSel
MonitorElement * eneHFmSel
Definition: MBUEandQCDValidation.h:153
MBUEandQCDValidation::_sumEt5
MonitorElement * _sumEt5
Definition: MBUEandQCDValidation.h:178
MBUEandQCDValidation::theCalo
CaloCellManager * theCalo
manager of calorimetric cell structure
Definition: MBUEandQCDValidation.h:62
AlignmentTrackSelector_cfi.ptMax
ptMax
Definition: AlignmentTrackSelector_cfi.py:12
SiPixelRawToDigiRegional_cfi.deltaPhi
deltaPhi
Definition: SiPixelRawToDigiRegional_cfi.py:9
MBUEandQCDValidation::hepmcCharge
std::vector< double > hepmcCharge
Definition: MBUEandQCDValidation.h:59
MBUEandQCDValidation::nHFSD
MonitorElement * nHFSD
Definition: MBUEandQCDValidation.h:150
PVValHelper::eta
Definition: PVValidationHelpers.h:70
MBUEandQCDValidation::leadChjpt
MonitorElement * leadChjpt
Definition: MBUEandQCDValidation.h:103
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
MBUEandQCDValidation::bookHistograms
void bookHistograms(DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override
Definition: MBUEandQCDValidation.cc:41
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
MBUEandQCDValidation::dNchdpt2
MonitorElement * dNchdpt2
Definition: MBUEandQCDValidation.h:91
AlignmentTrackSelector_cfi.phiMax
phiMax
Definition: AlignmentTrackSelector_cfi.py:17
MBUEandQCDValidation::_JM25njets
MonitorElement * _JM25njets
Definition: MBUEandQCDValidation.h:156
HLT_FULL_cff.pt1
pt1
Definition: HLT_FULL_cff.py:9870
MBUEandQCDValidation::nKpm
MonitorElement * nKpm
Definition: MBUEandQCDValidation.h:109
MBUEandQCDValidation::pt1pt2optot
MonitorElement * pt1pt2optot
Definition: MBUEandQCDValidation.h:135
dqm::impl::MonitorElement::getTH1
virtual TH1 * getTH1()
Definition: MonitorElement.cc:981
MBUEandQCDValidation::sumPt
MonitorElement * sumPt
Definition: MBUEandQCDValidation.h:142
MBUEandQCDValidation::MBUEandQCDValidation
MBUEandQCDValidation(const edm::ParameterSet &)
Definition: MBUEandQCDValidation.cc:19
MBUEandQCDValidation::_JM80ht
MonitorElement * _JM80ht
Definition: MBUEandQCDValidation.h:163
CaloCellManager::nEndcapEta
static const unsigned int nEndcapEta
Definition: CaloCellManager.h:29
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
MBUEandQCDValidation::_JM25pt1
MonitorElement * _JM25pt1
Definition: MBUEandQCDValidation.h:158
MBUEandQCDValidation::dNchdSpt
MonitorElement * dNchdSpt
Definition: MBUEandQCDValidation.h:93
edm::ParameterSet
Definition: ParameterSet.h:47
CaloCellManager::getCellIndexFromAngle
unsigned int getCellIndexFromAngle(double eta, double phi)
Definition: CaloCellManager.cc:162
MBUEandQCDValidation::isNeutrino
bool isNeutrino(unsigned int i)
Definition: MBUEandQCDValidation.cc:1160
MBUEandQCDValidation::ntHFm
MonitorElement * ntHFm
Definition: MBUEandQCDValidation.h:152
MBUEandQCDValidation::genjetCollectionToken_
edm::EDGetTokenT< reco::GenJetCollection > genjetCollectionToken_
Definition: MBUEandQCDValidation.h:185
MBUEandQCDValidation::sptDenLpt
MonitorElement * sptDenLpt
Definition: MBUEandQCDValidation.h:97
MBUEandQCDValidation::isNeutral
bool isNeutral(unsigned int i)
Definition: MBUEandQCDValidation.cc:1149
MBUEandQCDValidation::nNNbar
MonitorElement * nNNbar
Definition: MBUEandQCDValidation.h:112
MBUEandQCDValidation::leadTracketa
MonitorElement * leadTracketa
Definition: MBUEandQCDValidation.h:89
MBUEandQCDValidation::leadTrackpt
MonitorElement * leadTrackpt
Definition: MBUEandQCDValidation.h:88
MBUEandQCDValidation::djr10
MonitorElement * djr10
Definition: MBUEandQCDValidation.h:170
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
CaloCellManager::nEndcapCell
static const unsigned int nEndcapCell
Definition: CaloCellManager.h:37
MBUEandQCDValidation::djr32
MonitorElement * djr32
Definition: MBUEandQCDValidation.h:170
MBUEandQCDValidation::pt1pt2Dphi
MonitorElement * pt1pt2Dphi
Definition: MBUEandQCDValidation.h:137
MBUEandQCDValidation::genchjetCollection_
edm::InputTag genchjetCollection_
Definition: MBUEandQCDValidation.h:49
EgammaValidation_cff.pdgId
pdgId
Definition: EgammaValidation_cff.py:118
ttbarCategorization_cff.genJets
genJets
Definition: ttbarCategorization_cff.py:29
MBUEandQCDValidation::nEvt
MonitorElement * nEvt
Definition: MBUEandQCDValidation.h:72
edm::EventSetup
Definition: EventSetup.h:58
MBUEandQCDValidation::djr21
MonitorElement * djr21
Definition: MBUEandQCDValidation.h:170
MBUEandQCDValidation::pGamma
MonitorElement * pGamma
Definition: MBUEandQCDValidation.h:123
HLT_FULL_cff.pt2
pt2
Definition: HLT_FULL_cff.py:9872
edm::HepMCProduct::GetEvent
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:37
MBUEandQCDValidation::ncandbquark
MonitorElement * ncandbquark
Definition: MBUEandQCDValidation.h:78
WeightManager::weight
double weight(const edm::Event &)
Definition: WeightManager.cc:24
MBUEandQCDValidation::pPPbar
MonitorElement * pPPbar
Definition: MBUEandQCDValidation.h:118
MBUEandQCDValidation::_JM25ht
MonitorElement * _JM25ht
Definition: MBUEandQCDValidation.h:157
MBUEandQCDValidation::nj
MonitorElement * nj
Definition: MBUEandQCDValidation.h:132
MBUEandQCDValidation::nNoFwdTrig
MonitorElement * nNoFwdTrig
Definition: MBUEandQCDValidation.h:74
alignCSCRings.r
r
Definition: alignCSCRings.py:93
MBUEandQCDValidation::pNNbar
MonitorElement * pNNbar
Definition: MBUEandQCDValidation.h:122
DQMHelper
Definition: DQMHelper.h:15
DDAxes::phi
multPhiCorr_741_25nsDY_cfi.px
px
Definition: multPhiCorr_741_25nsDY_cfi.py:10
MBUEandQCDValidation::~MBUEandQCDValidation
~MBUEandQCDValidation() override
Definition: MBUEandQCDValidation.cc:37
CaloCellId::Forward
Definition: CaloCellId.h:16
MBUEandQCDValidation::EmpzHFm
MonitorElement * EmpzHFm
Definition: MBUEandQCDValidation.h:151
HepMCValidationHelper.h
MBUEandQCDValidation::wmanager_
WeightManager wmanager_
Definition: MBUEandQCDValidation.h:47
CaloCellManager::getCellFromIndex
CaloCellId * getCellFromIndex(unsigned int id)
Definition: CaloCellManager.cc:173
MBUEandQCDValidation::pOmega
MonitorElement * pOmega
Definition: MBUEandQCDValidation.h:125
MBUEandQCDValidation::_sumEt3
MonitorElement * _sumEt3
Definition: MBUEandQCDValidation.h:176
CaloCellManager::nBarrelEta
static const unsigned int nBarrelEta
Definition: CaloCellManager.h:28
MBUEandQCDValidation::initSize
const static unsigned int initSize
Definition: MBUEandQCDValidation.h:181
CaloCellManager::nBarrelCell
static const unsigned int nBarrelCell
Definition: CaloCellManager.h:36
MBUEandQCDValidation::_JM80pt3
MonitorElement * _JM80pt3
Definition: MBUEandQCDValidation.h:166
MBUEandQCDValidation::dNchdpt1
MonitorElement * dNchdpt1
Definition: MBUEandQCDValidation.h:83
MBUEandQCDValidation::_JM25pt3
MonitorElement * _JM25pt3
Definition: MBUEandQCDValidation.h:160
MBUEandQCDValidation::missEtosumJEt
MonitorElement * missEtosumJEt
Definition: MBUEandQCDValidation.h:141
MBUEandQCDValidation::fPDGTable
edm::ESHandle< HepPDT::ParticleDataTable > fPDGTable
PDT table.
Definition: MBUEandQCDValidation.h:55
MBUEandQCDValidation::_JM25pt2
MonitorElement * _JM25pt2
Definition: MBUEandQCDValidation.h:159
dqm::implementation::IBooker
Definition: DQMStore.h:43
MBUEandQCDValidation::dqmBeginRun
void dqmBeginRun(const edm::Run &r, const edm::EventSetup &c) override
Definition: MBUEandQCDValidation.cc:39
HepMCValidationHelper::allStatus1
void allStatus1(const HepMC::GenEvent *all, std::vector< const HepMC::GenParticle * > &status1)
Definition: HepMCValidationHelper.cc:72
dqm
Definition: DQMStore.h:18
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
MBUEandQCDValidation::pt1pt2balance
MonitorElement * pt1pt2balance
Definition: MBUEandQCDValidation.h:136
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:430
MBUEandQCDValidation::leadChjeta
MonitorElement * leadChjeta
Definition: MBUEandQCDValidation.h:104
edm::Event
Definition: Event.h:73
MBUEandQCDValidation::verbosity_
unsigned int verbosity_
Definition: MBUEandQCDValidation.h:52
MBUEandQCDValidation::nChaDenLpt
MonitorElement * nChaDenLpt
Definition: MBUEandQCDValidation.h:96
LHEGenericFilter_cfi.ParticleID
ParticleID
Definition: LHEGenericFilter_cfi.py:6
edm::InputTag
Definition: InputTag.h:15
MBUEandQCDValidation::genjetCollection_
edm::InputTag genjetCollection_
Definition: MBUEandQCDValidation.h:50
MBUEandQCDValidation::_JM80pt4
MonitorElement * _JM80pt4
Definition: MBUEandQCDValidation.h:167
MBUEandQCDValidation::dNjdpt
MonitorElement * dNjdpt
Definition: MBUEandQCDValidation.h:134
weight
Definition: weight.py:1
MBUEandQCDValidation::ncnobquark
MonitorElement * ncnobquark
Definition: MBUEandQCDValidation.h:79
HepMCValidationHelper::removeIsolatedLeptons
void removeIsolatedLeptons(const HepMC::GenEvent *all, double deltaR, double sumPt, std::vector< const HepMC::GenParticle * > &pruned)
Definition: HepMCValidationHelper.cc:106
MBUEandQCDValidation::nHFflow
MonitorElement * nHFflow
Definition: MBUEandQCDValidation.h:146
MBUEandQCDValidation::dSptdphi
MonitorElement * dSptdphi
Definition: MBUEandQCDValidation.h:95
CaloCellId::getEtaMin
double getEtaMin() const
Definition: CaloCellId.h:22
MBUEandQCDValidation::nPPbar
MonitorElement * nPPbar
Definition: MBUEandQCDValidation.h:108
MBUEandQCDValidation::pK0s
MonitorElement * pK0s
Definition: MBUEandQCDValidation.h:120