10 #include "CLHEP/Units/defs.h"
11 #include "CLHEP/Units/PhysicalConstants.h"
12 #include "CLHEP/Units/SystemOfUnits.h"
14 #include "fastjet/JetDefinition.hh"
15 #include "fastjet/ClusterSequence.hh"
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)) {
44 i.setCurrentFolder(
"Generator/MBUEandQCD");
49 nEvt =
dqm.book1dHisto(
"nEvt",
"n analyzed Events", 1, 0., 1.,
" ",
"Number of events");
53 "nNoFwdTrig",
"n Events no forward trigger", 1, 0., 1.,
" ",
"Number of Events with no Forward Trigger");
57 "n Events single arm forward trigger",
62 "Number of Events with Single Arm Forward Trigger");
65 nbquark =
dqm.book1dHisto(
"nbquark",
"n Events with b quark", 1, 0., 1.,
" ",
"Number of Events with b Quarks");
69 "ncandbquark",
"n Events with c and b quark", 1, 0., 1.,
"",
"Number of Events with c and b Quark");
73 "ncnobquark",
"n Events with c and no b quark", 1, 0., 1.,
"",
"Number of Events with c and no b Quark");
77 "nEvt1",
"n Events QCD-09-010", 1, 0., 1.,
"",
"Number of Events passing the QCD-09-010 selection");
84 "P_{t}^{charged tracks QCD-09-010 selection} (GeV)",
85 "Number of Charged Tracks");
88 "dNchdeta QCD-09-010",
92 "#eta^{charged tracks QCD-09-010 selection}",
93 "Number of Charged Tracks");
97 "nEvt2",
"n Events QCD-10-001", 1, 0., 1.,
"",
"Number of Events passing the QCD-10-001 selection");
100 "leading track pt QCD-10-001",
104 "P_{t}^{lead track QCD-10-001 selection} (GeV)",
108 "leading track eta QCD-10-001",
112 "#eta^{lead track QCD-10-001 selection}",
115 nChaDenLpt =
i.bookProfile(
"nChaDenLpt",
"charged density vs leading pt", 200, 0., 100., 0., 100.,
" ");
117 sptDenLpt =
i.bookProfile(
"sptDenLpt",
"sum pt density vs leading pt", 200, 0., 100., 0., 300.,
" ");
120 "dNchdpt QCD-10-001",
124 "P_{t}^{charged tracks QCD-10-001 selection} (GeV)",
125 "Number of Charged Tracks");
128 "dNchdeta QCD-10-001",
132 "#eta^{charged tracks QCD-10-001 selection}",
133 "Number of Charged Tracks");
136 "nCha",
"n charged QCD-10-001", 100, 0., 100.,
"N^{charged tracks QCD-10-001 selection}",
"Number of Events");
139 "dNchdSpt QCD-10-001",
143 "P_{t}^{charged trackes in transverse region QCD-10-001selection} (GeV)",
144 "Number of Charged Tracks");
146 dNchdphi =
i.bookProfile(
"dNchdphi",
"dNchdphi QCD-10-001",
nphiBin, -180., 180., 0., 30.,
" ");
148 dSptdphi =
i.bookProfile(
"dSptdphi",
"dSptdphi QCD-10-001",
nphiBin, -180., 180., 0., 30.,
" ");
152 "nChj",
"n charged jets QCD-10-001", 30, 0, 30.,
"N^{charged jets QCD-10-001 selection}",
"Number of Events");
155 "dNchjdeta QCD-10-001",
159 "#eta^{charged jets QCD-10-001 selection}",
160 "Number of charged Jets");
163 "dNchjdpt QCD-10-001",
167 "P_{t}^{charged jets QCD-10-001 selection}",
168 "Number of charged Jets");
171 "leadChjpt QCD-10-001",
175 "P_{t}^{lead charged jet QCD-10-001 selection}",
176 "Number of charged Jets");
179 "leadChjeta QCD-10-001",
183 "#eta^{lead charged jet QCD-10-001 selection}",
184 "Number of charged Jets");
186 pt1pt2optotch =
i.bookProfile(
"pt1pt2optotch",
"sum 2 leading jets over ptot", 50, 0., 100., 0., 1.,
" ");
190 "nPPbar",
"nPPbar QCD-10-001", 30, 0., 30.,
"N_{p/#bar{p}}^{QCD-10-001 selection}",
"Number of p/#bar{p}");
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}");
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");
198 "nOmega",
"nOmega QCD-10-001", 30, 0., 30.,
"N_{#Omega^{#pm}}^{QCD-10-001 selection}",
"Number of #Omega^{#pm}");
201 "Log10(pt) PPbar QCD-10-001",
205 "log_{10}(P_{t}^{p/#bar{p} QCD-10-001 selection}) (log_{10}(GeV))",
206 "Number of p/#bar{p}");
208 "Log10(pt) Kpm QCD-10-001",
212 "log_{10}(P_{t}^{K^{#pm} QCD-10-001 selection}) (log_{10}(GeV))",
213 "Number of K^{#pm}");
215 "Log10(pt) K0s QCD-10-001",
219 "log_{10}(P_{t}^{K^{0} QCD-10-001 selection}) (log_{10}(GeV))",
221 pL0 =
dqm.book1dHisto(
"pL0",
222 "Log10(pt) L0 QCD-10-001",
226 "log_{10}(P_{t}^{#Lambda^{0} QCD-10-001 selection}) (log_{10}(GeV))",
227 "Number of #Lambda^{0}");
229 "Log10(pt) Xim QCD-10-001",
233 "log_{10}(P_{t}^{#Xi^{#pm} QCD-10-001 selection}) (log_{10}(GeV))",
236 "Log10(pt) Omega QCD-10-001",
240 "log_{10}(P_{t}^{#Omega^{#pm} QCD-10-001 selection}) (log_{10}(GeV))",
241 "Number of #Omega^{#pm}");
245 "nNNbar",
"nNNbar QCD-10-001", 30, 0., 30.,
"N_{n/#bar{n}}^{QCD-10-001 selection}",
"Number of Events");
247 "nGamma",
"nGamma QCD-10-001", 50, 0., 200.,
"N_{#gamma}^{QCD-10-001 selection}",
"Number of Events");
250 "Log10(pt) NNbar QCD-10-001",
254 "log_{10}(P_{t}^{n/#bar{n} QCD-10-001 selection}) (log_{10}(GeV))",
255 "Number of n/#bar{n}");
257 "Log10(pt) Gamma QCD-10-001",
261 "log_{10}(P_{t}^{#gamma QCD-10-001 selection}) (log_{10}(GeV))",
266 "highest pt electron Log10(pt)",
270 "log_{10}(P_{t}^{highest e} (log_{10}(GeV))",
275 "highest pt muon Log10(pt)",
279 "log_{10}(P_{t}^{highest #mu} (log_{10}(GeV))",
284 "nDijet",
"n Dijet Events", 1, 0., 1.,
" ",
"Number of Events Passing Di-jet JME-10-001 Selection");
286 nj =
dqm.book1dHisto(
"nj",
"n jets ", 30, 0, 30.,
"N_{jets}^{JME-10-001}",
"Number of Events");
288 dNjdeta =
dqm.book1dHisto(
"dNjdeta",
"dNjdeta ", 50, -5., 5.,
"#eta_{jets}^{JME-10-001 selection}",
"Number of Jets");
290 dNjdpt =
dqm.book1dHisto(
"dNjdpt",
"dNjdpt ", 60, 0., 300.,
"P_{t}^{jets JME-10-001 selection}",
"Number of Jets");
292 pt1pt2optot =
i.bookProfile(
"pt1pt2optot",
"sum 2 leading jets over Et tot ", 60, 0., 300., 0., 1.,
" ");
295 dqm.book1dHisto(
"pt1pt2balance",
296 "2 leading jets pt difference ",
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");
304 "pt1 pt2 delta phi ",
308 "#Delta#phi(jet^{1st},jet^{2nd})^{JME-10-001 selection} (rad)",
309 "Number of Di-jet Events");
312 "pt1 pt2 invariant mass ",
316 "M_{di-jet}^{JME-10-001 selection}",
317 "Number of di-jet events");
320 "2 pt3 over pt1+pt2 ",
324 "#frac{P_{t}^{3rd jet}}{P_{t}^{1st jet}+P_{t}^{2nd jet}}^{JME-10-001 selection}",
325 "Number of 3rd Jets");
328 "sumJEt",
"sum Jet Et ", 60, 0., 300.,
"#Sigma E_{t}^{jets JME-10-001 selection}",
"Number of di-jet events");
331 "missing Et over sumJet Et ",
335 "E_{t}^{miss}/#Sigma E_{t}^{jets JME-10-001 selection}",
336 "Number of Di-jet Events");
343 "#Sigma P_{t}^{particles passing JME-10-001 selection}",
347 "sum charged particle Pt ",
351 "#Sigma P_{t}^{charged particles passing JME-10-001 selection}",
361 "Number of Events passing JME-10-001, FWD-10-002 and Jet-Multiplicity selection");
373 "dEdeta HF QCD dijet",
383 "nHFSD",
"n single diffraction in HF", 1, 0., 1.,
" ",
"Number of single diffraction in HF FWD-10-001 selection");
390 "#Sigma E_{cal. cells/corrected for the longitudinal mometum}^{FWD-10-001 selection}",
394 "number of HF- tower SD",
398 " N_{cells over threshold for single diffraction in HF Towers}^{FWD-10-001 selection}",
402 "eneHFmSel",
"energy in HF-", 40, 0., 200.,
"#Sigma E_{cal. cells}^{FWD-10-001 selection}",
"Number of Events");
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");
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");
421 "Differential Jet Rate 1#rightarrow0",
425 "log_{10}(d_{min}(n,n+1)) for n=0",
428 "Differential Jet Rate 2#rightarrow1",
432 "log_{10}(d_{min}(n,n+1)) for n=1",
435 "Differential Jet Rate 3#rightarrow2",
439 "log_{10}(d_{min}(n,n+1)) for n=2",
442 "Differential Jet Rate 4#rightarrow3",
446 "log_{10}(d_{min}(n,n+1)) for n=3",
451 "sumET",
"Sum of stable particles Et", 150, 0, 600.,
"#Sigma E_{t}^{stable particles}",
"Number of Events");
453 "Sum of stable particles Et (eta<0.5)",
457 "#Sigma E_{t}^{stable particles (#eta<0.5)}",
460 "Sum of stable particles Et (0.5<eta<1.0)",
464 "#Sigma E_{t}^{stable particles (0.5<#eta<1.0)}",
467 "Sum of stable particles Et (1.0<eta<1.5)",
471 "#Sigma E_{t}^{stable particles (1.0<#eta<1.5)}",
474 "Sum of stable particles Et (1.5<eta<2.0)",
478 "#Sigma E_{t}^{stable particles (1.5<#eta<2.0)}",
481 "Sum of stable particles Et (2.0<eta<5.0)",
485 "#Sigma E_{t}^{stable particles (2.0<#eta<5.0)}",
519 for (HepMC::GenEvent::particle_const_iterator iter = myGenEvent->particles_begin();
520 iter != myGenEvent->particles_end();
522 if (std::fabs((*iter)->pdg_id()) == 4) {
525 if (std::fabs((*iter)->pdg_id()) == 5) {
528 if ((*iter)->status() == 1) {
531 if (PData ==
nullptr) {
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()
595 if ((nBSCp > 0 || nBSCm > 0) && eneHFp >= 3. && eneHFm >= 3.) {
601 if ((nBSCp > 0 || nBSCm > 0) && nChaVtx >= 3 && nChapt05 > 1) {
607 if (nBSCp == 0 && nBSCm == 0) {
613 if ((nBSCp > 0 && nBSCm == 0) || (nBSCm > 0 && nBSCp == 0)) {
619 if (nBSCp > 0 && nBSCm > 0) {
625 if (sel5 && nChaVtx > 3) {
631 if (nChaVtx >= 3 && nBSCm > 0 && eneHFp < 8.) {
651 if (nb > 0 && nc > 0)
653 if (nb == 0 && nc > 0)
658 unsigned int iMax = 0;
660 unsigned int ppbar = 0;
661 unsigned int nnbar = 0;
662 unsigned int kpm = 0;
663 unsigned int k0s = 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;
768 unsigned int nCellOvTh = 0;
771 for (
unsigned int icell = 0; icell <
eneInCell.size(); icell++) {
793 std::vector<unsigned int> nchvsphi(
nphiBin, 0);
794 std::vector<double> sptvsphi(
nphiBin, 0.);
795 unsigned int nChaTra = 0;
798 double binPhiW = 360. /
nphiBin;
803 if (thePhi < -180.) {
805 }
else if (thePhi > 180.) {
808 unsigned int thePhiBin = (
int)((thePhi + 180.) / binPhiW);
812 nchvsphi[thePhiBin]++;
815 if (std::fabs(thePhi) > 60. && std::fabs(thePhi) < 120.) {
833 double thisPhi = -180. + (
i + 0.5) * binPhiW;
843 unsigned int nJets = 0;
846 reco::GenJetCollection::const_iterator ij1 = genChJets->begin();
847 reco::GenJetCollection::const_iterator ij2 = genChJets->begin();
849 for (reco::GenJetCollection::const_iterator iter = genChJets->begin(); iter != genChJets->end(); ++iter) {
850 double eta = (*iter).eta();
851 double pt = (*iter).pt();
854 << (*iter).eta() << std::setw(14) <<
std::fixed << (*iter).phi() << std::endl;
856 if (std::fabs(
eta) < 2.) {
866 if (pt < pt1 && pt >=
pt2) {
874 if (nJets > 0 && ij1 != genChJets->end()) {
877 if (nJets > 1 && ij2 != genChJets->end()) {
907 reco::GenJetCollection::const_iterator ij3 =
genJets->begin();
909 for (reco::GenJetCollection::const_iterator iter =
genJets->begin(); iter !=
genJets->end(); ++iter) {
910 double eta = (*iter).eta();
911 double pt = (*iter).pt();
914 << (*iter).eta() << std::setw(14) <<
std::fixed << (*iter).phi() << std::endl;
916 if (std::fabs(
eta) < 5.) {
922 if (pt < pt1 && pt >=
pt2) {
926 if (pt < pt2 && pt >= pt3) {
933 if (fabs(iter->eta()) < 3. && iter->pt() > 25.) {
935 jm25HT += iter->pt();
936 if (iter->pt() > jm25pt1) {
940 jm25pt1 = iter->pt();
941 }
else if (iter->pt() > jm25pt2) {
944 jm25pt2 = iter->pt();
945 }
else if (iter->pt() > jm25pt3) {
947 jm25pt3 = iter->pt();
948 }
else if (iter->pt() > jm25pt4) {
949 jm25pt4 = iter->pt();
952 if (iter->pt() > 80.) {
954 jm80HT += iter->pt();
955 if (iter->pt() > jm80pt1) {
959 jm80pt1 = iter->pt();
960 }
else if (iter->pt() > jm80pt2) {
963 jm80pt2 = iter->pt();
964 }
else if (iter->pt() > jm80pt3) {
966 jm80pt3 = iter->pt();
967 }
else if (iter->pt() > jm80pt4) {
968 jm80pt4 = iter->pt();
992 double sumPartPt = 0.;
993 double sumChPartPt = 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;
1002 if (std::fabs(
deltaPhi) > 2.5 * CLHEP::degree) {
1024 double invMass = (*ij1).energy() * (*ij2).energy() - (*ij1).px() * (*ij2).px() - (*ij1).py() * (*ij2).py() -
1025 (*ij1).pz() * (*ij2).pz();
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.) {
1042 sumJetEt += (*iter).pt();
1043 jpx += (*iter).px();
1044 jpy += (*iter).py();
1049 double mEt =
std::sqrt(jpx * jpx + jpy * jpy);
1053 if (nSelJets >= 3) {
1065 std::vector<const HepMC::GenParticle*> qcdActivity;
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);
1080 fastjet::ClusterSequence cseq(vecs, fastjet::JetDefinition(fastjet::kt_algorithm, 1., fastjet::E_scheme));
1088 std::vector<const HepMC::GenParticle*> allStable;
1098 for (std::vector<const HepMC::GenParticle*>::const_iterator iter = allStable.begin(); iter != allStable.end();
1100 double thisEta = fabs((*iter)->momentum().eta());
1103 const HepMC::FourVector mom = (*iter)->momentum();
1104 double px = mom.px();
1105 double py = mom.py();
1106 double pz = mom.pz();
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;
1119 sumEt5 += thisSumEt;
1172 unsigned int iBin = 999;
1179 if (std::fabs(
eta) >= theEtaRanges[
i] && std::fabs(
eta) < theEtaRanges[
i + 1]) {