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