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 {
26 
27  hepmcGPCollection.reserve(initSize);
28  hepmcCharge.reserve(initSize);
29 
31 
33 
34  hepmcCollectionToken_=consumes<HepMCProduct>(hepmcCollection_);
35  genjetCollectionToken_=consumes<reco::GenJetCollection>(genjetCollection_);
36  genchjetCollectionToken_=consumes<reco::GenJetCollection>(genchjetCollection_);
37 
38 }
39 
41 
42  delete theCalo;
43 
44 }
45 
47  c.getData( fPDGTable );
48 }
49 
50 
53  DQMHelper dqm(&i); i.setCurrentFolder("Generator/MBUEandQCD");
54 
56 
57  // Number of analyzed events
58  nEvt = dqm.book1dHisto("nEvt", "n analyzed Events", 1, 0., 1.," ","Number of events");
59 
60  // Number of events with no forward trigger
61  nNoFwdTrig = dqm.book1dHisto("nNoFwdTrig", "n Events no forward trigger", 1, 0., 1.," ","Number of Events with no Forward Trigger");
62 
63  // Number of Events with a single arm forward trigger
64  nSaFwdTrig = dqm.book1dHisto("nSaFwdTrig", "n Events single arm forward trigger", 1, 0., 1.," ","Number of Events with Single Arm Forward Trigger");
65 
66  // Number of Events with b quark
67  nbquark = dqm.book1dHisto("nbquark", "n Events with b quark", 1, 0., 1.," ","Number of Events with b Quarks");
68 
69  // Number of Events with c and b quark
70  ncandbquark = dqm.book1dHisto("ncandbquark", "n Events with c and b quark", 1, 0., 1.,"","Number of Events with c and b Quark");
71 
72  // Number of Events with c and no b quark
73  ncnobquark = dqm.book1dHisto("ncnobquark", "n Events with c and no b quark", 1, 0., 1.,"","Number of Events with c and no b Quark");
74 
75 
76  // Number of selected events for QCD-09-010
77  nEvt1 = dqm.book1dHisto("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", "dNchdpt QCD-09-010", 30, 0., 6.,"P_{t}^{charged tracks QCD-09-010 selection} (GeV)","Number of Charged Tracks");
80  // dNchdeta QCD-09-010
81  dNchdeta1 = dqm.book1dHisto("dNchdeta1", "dNchdeta QCD-09-010", 10, -2.5, 2.5,"#eta^{charged tracks QCD-09-010 selection}","Number of Charged Tracks");
82  // Number of selected events for QCD-10-001
83 
84  nEvt2 = dqm.book1dHisto("nEvt2", "n Events QCD-10-001", 1, 0., 1.,"","Number of Events passing the QCD-10-001 selection");
85  // Leading track pt QCD-10-001
86  leadTrackpt = dqm.book1dHisto("leadTrackpt", "leading track pt QCD-10-001", 200, 0., 100.,"P_{t}^{lead track QCD-10-001 selection} (GeV)","Number of Events");
87  // Leading track eta QCD-10-001
88  leadTracketa = dqm.book1dHisto("leadTracketa", "leading track eta QCD-10-001", 50., -2.5,2.5,"#eta^{lead track QCD-10-001 selection}","Number of Events");
89  // transverse charged particle density vs leading track pt
90  nChaDenLpt = i.bookProfile("nChaDenLpt", "charged density vs leading pt", 200, 0., 100., 0., 100., " ");
91  // transverse charged particle density vs leading track pt
92  sptDenLpt = i.bookProfile("sptDenLpt", "sum pt density vs leading pt", 200, 0., 100., 0., 300., " ");
93  // dNchdpt QCD-10-001 transverse
94  dNchdpt2 = dqm.book1dHisto("dNchdpt2", "dNchdpt QCD-10-001", 200, 0., 100.,"P_{t}^{charged tracks QCD-10-001 selection} (GeV)","Number of Charged Tracks");
95  // dNchdeta QCD-10-001 transverse
96  dNchdeta2 = dqm.book1dHisto("dNchdeta2", "dNchdeta QCD-10-001", 50, -2.5, 2.5,"#eta^{charged tracks QCD-10-001 selection}","Number of Charged Tracks");
97  // nCha QCD-10-001 transverse
98  nCha = dqm.book1dHisto("nCha", "n charged QCD-10-001", 100, 0., 100.,"N^{charged tracks QCD-10-001 selection}","Number of Events");
99  // dNchdSpt transverse
100  dNchdSpt = dqm.book1dHisto("dNchdSpt", "dNchdSpt QCD-10-001", 300, 0., 300.,"P_{t}^{charged trackes in transverse region QCD-10-001selection} (GeV)","Number of Charged Tracks");
101  // dNchdphi
102  dNchdphi = i.bookProfile("dNchdphi", "dNchdphi QCD-10-001", nphiBin, -180., 180., 0., 30., " ");
103  // dSptdphi
104  dSptdphi = i.bookProfile("dSptdphi", "dSptdphi QCD-10-001", nphiBin, -180., 180., 0., 30., " ");
105 
106  // number of charged jets QCD-10-001
107  nChj = dqm.book1dHisto("nChj", "n charged jets QCD-10-001", 30, 0, 30.,"N^{charged jets QCD-10-001 selection}","Number of Events");
108  // dNchjdeta QCD-10-001
109  dNchjdeta = dqm.book1dHisto("dNchjdeta", "dNchjdeta QCD-10-001", 50, -2.5, 2.5,"#eta^{charged jets QCD-10-001 selection}","Number of charged Jets");
110  // dNchjdpt QCD-10-001
111  dNchjdpt = dqm.book1dHisto("dNchjdpt", "dNchjdpt QCD-10-001", 100, 0., 100.,"P_{t}^{charged jets QCD-10-001 selection}","Number of charged Jets");
112  // leading charged jet pt QCD-10-001
113  leadChjpt = dqm.book1dHisto("leadChjpt", "leadChjpt QCD-10-001", 100, 0., 100.,"P_{t}^{lead charged jet QCD-10-001 selection}","Number of charged Jets");
114  // leading charged jet eta QCD-10-001
115  leadChjeta = dqm.book1dHisto("leadChjeta", "leadChjeta QCD-10-001", 50, -2.5, 2.5,"#eta^{lead charged jet QCD-10-001 selection}","Number of charged Jets");
116  // (pt1+pt2)/ptot
117  pt1pt2optotch = i.bookProfile("pt1pt2optotch", "sum 2 leading jets over ptot", 50, 0., 100., 0., 1., " ");
118 
119  // particle rates in tracker acceptance
120  nPPbar = dqm.book1dHisto("nPPbar", "nPPbar QCD-10-001", 30, 0., 30.,"N_{p/#bar{p}}^{QCD-10-001 selection}","Number of p/#bar{p}");
121  nKpm = dqm.book1dHisto("nKpm", "nKpm QCD-10-001", 30, 0., 30.,"N_{K^{#pm}}^{QCD-10-001 selection}","Number of K^{#pm}");
122  nK0s = dqm.book1dHisto("nK0s", "nK0s QCD-10-001", 30, 0., 30.,"N_{K^{0}}^{QCD-10-001 selection}","Number of K^{0}");
123  nL0 = dqm.book1dHisto("nL0", "nL0 QCD-10-001", 30, 0., 30.,"N_{#Lambda^{0}}^{QCD-10-001 selection}","Number of #Lambda^{0}");
124  nXim = dqm.book1dHisto("nXim", "nXim QCD-10-001", 30, 0., 30.,"N_{#Xi}^{QCD-10-001 selection}","Number of #Xi");
125  nOmega = dqm.book1dHisto("nOmega", "nOmega QCD-10-001", 30, 0., 30.,"N_{#Omega^{#pm}}^{QCD-10-001 selection}","Number of #Omega^{#pm}");
126 
127  pPPbar = dqm.book1dHisto("pPPbar", "Log10(pt) PPbar QCD-10-001", 25, -2., 3.,"log_{10}(P_{t}^{p/#bar{p} QCD-10-001 selection}) (log_{10}(GeV))","Number of p/#bar{p}");
128  pKpm = dqm.book1dHisto("pKpm", "Log10(pt) Kpm QCD-10-001", 25, -2., 3.,"log_{10}(P_{t}^{K^{#pm} QCD-10-001 selection}) (log_{10}(GeV))","Number of K^{#pm}");
129  pK0s = dqm.book1dHisto("pK0s", "Log10(pt) K0s QCD-10-001", 25, -2., 3.,"log_{10}(P_{t}^{K^{0} QCD-10-001 selection}) (log_{10}(GeV))","Number of K^{0}");
130  pL0 = dqm.book1dHisto("pL0", "Log10(pt) L0 QCD-10-001", 25, -2., 3.,"log_{10}(P_{t}^{#Lambda^{0} QCD-10-001 selection}) (log_{10}(GeV))","Number of #Lambda^{0}");
131  pXim = dqm.book1dHisto("pXim", "Log10(pt) Xim QCD-10-001", 25, -2., 3.,"log_{10}(P_{t}^{#Xi^{#pm} QCD-10-001 selection}) (log_{10}(GeV))","Number of #Xi");
132  pOmega = dqm.book1dHisto("pOmega", "Log10(pt) Omega QCD-10-001", 25, -2., 3.,"log_{10}(P_{t}^{#Omega^{#pm} QCD-10-001 selection}) (log_{10}(GeV))","Number of #Omega^{#pm}");
133 
134  // neutral rate in the barrel + HF acceptance
135  nNNbar = dqm.book1dHisto("nNNbar", "nNNbar QCD-10-001", 30, 0., 30.,"N_{n/#bar{n}}^{QCD-10-001 selection}","Number of Events");
136  nGamma = dqm.book1dHisto("nGamma", "nGamma QCD-10-001", 50, 0., 200.,"N_{#gamma}^{QCD-10-001 selection}","Number of Events");
137 
138  pNNbar = dqm.book1dHisto("pNNbar", "Log10(pt) NNbar QCD-10-001", 25, -2., 3.,"log_{10}(P_{t}^{n/#bar{n} QCD-10-001 selection}) (log_{10}(GeV))","Number of n/#bar{n}");
139  pGamma = dqm.book1dHisto("pGamma", "Log10(pt) Gamma QCD-10-001", 25, -2., 3.,"log_{10}(P_{t}^{#gamma QCD-10-001 selection}) (log_{10}(GeV))","Number of #gamma");
140 
141  // highest pt electron spectrum
142  elePt = dqm.book1dHisto("elePt", "highest pt electron Log10(pt)", 30, -2., 4.,"log_{10}(P_{t}^{highest e} (log_{10}(GeV))","Number of Events");
143 
144  // highest pt muon spectrum
145  muoPt = dqm.book1dHisto("muoPt", "highest pt muon Log10(pt)", 30, -2., 4.,"log_{10}(P_{t}^{highest #mu} (log_{10}(GeV))","Number of Events");
146 
147 
148  // number of selected di-jet events
149  nDijet = dqm.book1dHisto("nDijet", "n Dijet Events", 1, 0., 1.," ","Number of Events Passing Di-jet JME-10-001 Selection");
150  // number of jets
151  nj = dqm.book1dHisto("nj", "n jets ", 30, 0, 30.,"N_{jets}^{JME-10-001}","Number of Events");
152  // dNjdeta
153  dNjdeta = dqm.book1dHisto("dNjdeta", "dNjdeta ", 50, -5., 5.,"#eta_{jets}^{JME-10-001 selection}","Number of Jets");
154  // dNjdpt
155  dNjdpt = dqm.book1dHisto("dNjdpt", "dNjdpt ", 60, 0., 300.,"P_{t}^{jets JME-10-001 selection}","Number of Jets");
156  // (pt1+pt2)/ptot
157  pt1pt2optot = i.bookProfile("pt1pt2optot", "sum 2 leading jets over Et tot ", 60, 0., 300., 0., 1.," ");
158  // pt1-pt2
159  pt1pt2balance = dqm.book1dHisto("pt1pt2balance", "2 leading jets pt difference ", 10, 0., 1.,"#frac{P_{t}^{1st jet}-P_{t}^{2nd jet}}{P_{t}^{1st jet}+P_{t}^{2nd jet}}^{JME-10-001 selection}","Number of Di-jet Events");
160  // pt1 pt2 Delta phi
161  pt1pt2Dphi = dqm.book1dHisto("pt1pt2Dphi", "pt1 pt2 delta phi ", nphiBin, 0., 180.,"#Delta#phi(jet^{1st},jet^{2nd})^{JME-10-001 selection} (rad)","Number of Di-jet Events");
162  // pt1 pt2 invariant mass
163  pt1pt2InvM = dqm.book1dHisto("pt1pt2InvM", "pt1 pt2 invariant mass ", 60, 0., 600.,"M_{di-jet}^{JME-10-001 selection}","Number of di-jet events");
164  // pt3 fraction
165  pt3Frac = dqm.book1dHisto("pt3Frac", "2 pt3 over pt1+pt2 ", 30, 0., 1.,"#frac{P_{t}^{3rd jet}}{P_{t}^{1st jet}+P_{t}^{2nd jet}}^{JME-10-001 selection}","Number of 3rd Jets");
166  // sum of jets Et
167  sumJEt = dqm.book1dHisto("sumJEt", "sum Jet Et ", 60, 0., 300.,"#Sigma E_{t}^{jets JME-10-001 selection}","Number of di-jet events");
168  // fraction of missing Et over sum of jets Et
169  missEtosumJEt = dqm.book1dHisto("missEtosumJEt", "missing Et over sumJet Et ", 30, 0., 1.,"E_{t}^{miss}/#Sigma E_{t}^{jets JME-10-001 selection}","Number of Di-jet Events");
170  // sum of final state particle Pt
171  sumPt = dqm.book1dHisto("sumPt", "sum particle Pt ", 60, 0., 600.,"#Sigma P_{t}^{particles passing JME-10-001 selection}","Number of jets");
172  // sum of final state charged particle Pt
173  sumChPt = dqm.book1dHisto("sumChPt", "sum charged particle Pt ", 60, 0., 300.,"#Sigma P_{t}^{charged particles passing JME-10-001 selection}","Number of Jets");
174 
175  //Number of selected events for the HF energy flux analysis
176  nHFflow = dqm.book1dHisto("nHFflow", "n HF flow events", 1, 0., 1.," ","Number of Events passing JME-10-001, FWD-10-002 and Jet-Multiplicity selection");
177  //Forward energy flow for MinBias BSC selection
178  dEdetaHFmb = i.bookProfile("dEdetaHFmb", "dEdeta HF MinBias", (int)CaloCellManager::nForwardEta, 0, (double)CaloCellManager::nForwardEta, 0., 300.," ");
179  //Forward energy flow for QCD dijet selection
180  dEdetaHFdj = i.bookProfile("dEdetaHFdj", "dEdeta HF QCD dijet", (int)CaloCellManager::nForwardEta, 0, (double)CaloCellManager::nForwardEta, 0., 300., " ");
181 
182  // FWD-10-001 like diffraction analysis
183  nHFSD = dqm.book1dHisto("nHFSD","n single diffraction in HF", 1, 0., 1.," ","Number of single diffraction in HF FWD-10-001 selection");
184  // E-pz HF-
185  EmpzHFm = dqm.book1dHisto("EmpzHFm", "E-pz HF- SD", 40, 0., 200.,"#Sigma E_{cal. cells/corrected for the longitudinal mometum}^{FWD-10-001 selection}","Number of Events");
186  // Number of cells above threshold
187  ntHFm = dqm.book1dHisto("ntHFm", "number of HF- tower SD", 20, 0., 20.," N_{cells over threshold for single diffraction in HF Towers}^{FWD-10-001 selection}","Number of Events");
188  // Energy in HF-
189  eneHFmSel = dqm.book1dHisto("eneHFmSel", "energy in HF-", 40, 0., 200.,"#Sigma E_{cal. cells}^{FWD-10-001 selection}","Number of Events");
190 
191  // number of jets accepted in the 'Jet-Multiplicity' analysis
192  _JM25njets = dqm.book1dHisto("JM25njets", "n jets", 15, 0, 15.,"Number of JM25 Jets","Number of Events");
193  _JM25ht = dqm.book1dHisto("JM25ht", "HT", 80, 0, 800.,"H_{t}^{JM25} (GeV)","Number of Events");
194  _JM25pt1 = dqm.book1dHisto("JM25pt1", "pt", 40, 0, 200.,"P_{t}^{JM25,1st Jet} (GeV)","Number of JM25 Jets");
195  _JM25pt2 = dqm.book1dHisto("JM25pt2", "pt", 40, 0, 200.,"P_{t}^{JM25,2nd Jet} (GeV)","Number of JM25 Jets");
196  _JM25pt3 = dqm.book1dHisto("JM25pt3", "pt", 40, 0, 200.,"P_{t}^{JM25,3rd Jet} (GeV)","Number of JM25 Jets");
197  _JM25pt4 = dqm.book1dHisto("JM25pt4", "pt", 40, 0, 200.,"P_{t}^{JM25,4th Jet} (GeV)","Number of JM25 Jets");
198 
199  _JM80njets = dqm.book1dHisto("JM80njets", "n jets", 15, 0, 15.,"Number of JM80 Jets","Number of Events");
200  _JM80ht = dqm.book1dHisto("JM80ht", "HT", 80, 300, 1100.,"H_{t}^{JM80} (GeV","Number of Events");
201  _JM80pt1 = dqm.book1dHisto("JM80pt1", "pt", 40, 60, 260.,"P_{t}^{JM80,1st Jet} (GeV)","Number of JM80 Jets");
202  _JM80pt2 = dqm.book1dHisto("JM80pt2", "pt", 40, 60, 260.,"P_{t}^{JM80,2nd Jet} (GeV)","Number of JM80 Jets");
203  _JM80pt3 = dqm.book1dHisto("JM80pt3", "pt", 40, 60, 260.,"P_{t}^{JM80,3rd Jet} (GeV)","Number of JM80 Jets");
204  _JM80pt4 = dqm.book1dHisto("JM80pt4", "pt", 40, 60, 260.,"P_{t}^{JM80,4th Jet} (GeV)","Number of JM80 Jets");
205 
206 
207  // differential jet rates
208  djr10 = dqm.book1dHisto("djr10", "Differential Jet Rate 1#rightarrow0", 60, -1., 5.,"log_{10}(d_{min}(n,n+1)) for n=0","Number of Events");
209  djr21 = dqm.book1dHisto("djr21", "Differential Jet Rate 2#rightarrow1", 60, -1., 5.,"log_{10}(d_{min}(n,n+1)) for n=1","Number of Events");
210  djr32 = dqm.book1dHisto("djr32", "Differential Jet Rate 3#rightarrow2", 60, -1., 5.,"log_{10}(d_{min}(n,n+1)) for n=2","Number of Events");
211  djr43 = dqm.book1dHisto("djr43", "Differential Jet Rate 4#rightarrow3", 60, -1., 5.,"log_{10}(d_{min}(n,n+1)) for n=3","Number of Events");
212 
213  // sumET analysis
214  _sumEt = dqm.book1dHisto("sumET", "Sum of stable particles Et", 150, 0, 600.,"#Sigma E_{t}^{stable particles}","Number of Events");
215  _sumEt1 = dqm.book1dHisto("sumET1", "Sum of stable particles Et (eta<0.5)", 150, 0, 200.,"#Sigma E_{t}^{stable particles (#eta<0.5)}","Number of Events");
216  _sumEt2 = dqm.book1dHisto("sumET2", "Sum of stable particles Et (0.5<eta<1.0)", 150, 0, 200.,"#Sigma E_{t}^{stable particles (0.5<#eta<1.0)}","Number of Events");
217  _sumEt3 = dqm.book1dHisto("sumET3", "Sum of stable particles Et (1.0<eta<1.5)", 150, 0, 200.,"#Sigma E_{t}^{stable particles (1.0<#eta<1.5)}","Number of Events");
218  _sumEt4 = dqm.book1dHisto("sumET4", "Sum of stable particles Et (1.5<eta<2.0)", 150, 0, 200.,"#Sigma E_{t}^{stable particles (1.5<#eta<2.0)}","Number of Events");
219  _sumEt5 = dqm.book1dHisto("sumET5", "Sum of stable particles Et (2.0<eta<5.0)", 150, 0, 200.,"#Sigma E_{t}^{stable particles (2.0<#eta<5.0)}","Number of Events");
220 
221  return;
222 }
223 
225 {
226 
229  iEvent.getByToken(hepmcCollectionToken_, evt);
230 
231  //Get HepMC EVENT
232  HepMC::GenEvent *myGenEvent = new HepMC::GenEvent(*(evt->GetEvent()));
233 
234  double weight = wmanager_.weight(iEvent);
235 
236 
237  if ( verbosity_ > 0 ) { myGenEvent->print(); }
238 
239  double binW = 1.;
240 
241  hepmcGPCollection.clear();
242  hepmcCharge.clear();
243  for (unsigned int i = 0; i < eneInCell.size(); i++) { eneInCell[i] = 0.; }
244 
245  nEvt->Fill(0.5,weight);
246 
247  //Looping through HepMC::GenParticle collection to search for status 1 particles
248  double charge = 0.;
249  unsigned int nb = 0;
250  unsigned int nc = 0;
251  for (HepMC::GenEvent::particle_const_iterator iter = myGenEvent->particles_begin(); iter != myGenEvent->particles_end(); ++iter){
252  if ( std::fabs((*iter)->pdg_id()) == 4 ) { nc++; }
253  if ( std::fabs((*iter)->pdg_id()) == 5 ) { nb++; }
254  if ( (*iter)->status() == 1) {
255  hepmcGPCollection.push_back(*iter);
256  const HepPDT::ParticleData* PData = fPDGTable->particle(HepPDT::ParticleID((*iter)->pdg_id()));
257  if(PData==0) { charge = -999.; }
258  else
259  charge = PData->charge();
260 
261  hepmcCharge.push_back(charge);
262 
263  if ( verbosity_ > 0 ) {
264  std::cout << "HepMC " << std::setw(14) << std::fixed << (*iter)->barcode()
265  << std::setw(14) << std::fixed << (*iter)->pdg_id()
266  << std::setw(14) << std::fixed << (*iter)->momentum().perp()
267  << std::setw(14) << std::fixed << (*iter)->momentum().eta()
268  << std::setw(14) << std::fixed << (*iter)->momentum().phi() << std::endl;
269  }
270 
271  }
272  }
273 
274  int nBSCp = 0; int nBSCm = 0; double eneHFp = 0.; double eneHFm = 0.; int nChapt05 = 0; int nChaVtx = 0;
275  for (unsigned int i = 0; i < hepmcGPCollection.size(); i++ ){
276  if ( !isNeutrino(i) ) {
277 
278  // BSC trigger
279 
280  if ( hepmcGPCollection[i]->momentum().eta() > 3.23 && hepmcGPCollection[i]->momentum().eta() < 4.65 ) { nBSCp++; }
281  if ( hepmcGPCollection[i]->momentum().eta() < -3.23 && hepmcGPCollection[i]->momentum().eta() > -4.65 ) { nBSCm++; }
282 
283  // number of charged particles in different selections
284 
285  if ( std::fabs(hepmcGPCollection[i]->momentum().eta()) < 2.5 && hepmcGPCollection[i]->momentum().perp() > 0.5 && isCharged(i) ) { nChapt05++; }
286  if ( std::fabs(hepmcGPCollection[i]->momentum().eta()) < 2.5 && hepmcGPCollection[i]->momentum().perp() > 0.1 && isCharged(i) ) { nChaVtx++; }
287  unsigned int theIndex = theCalo->getCellIndexFromAngle(hepmcGPCollection[i]->momentum().eta(),hepmcGPCollection[i]->momentum().phi());
288  if ( theIndex < CaloCellManager::nCaloCell ) eneInCell[theIndex] += hepmcGPCollection[i]->momentum().rho();
289  }
290  }
291 
292  // Forward calorimeters energy
293 
294  for (unsigned int icell = CaloCellManager::nBarrelCell+CaloCellManager::nEndcapCell; icell < CaloCellManager::nCaloCell; icell++ ) {
295  if ( theCalo->getCellFromIndex(icell)->getEtaMin() < 0. ) { eneHFm += eneInCell[icell]; }
296  else { eneHFp += eneInCell[icell]; }
297  }
298 
299  // QCD-09-010 selection
300  bool sel1 = false;
301  if ( (nBSCp > 0 || nBSCm > 0) && eneHFp >= 3. && eneHFm >= 3. ) { sel1 = true; }
302 
303  // QCD-10-001 selection
304  bool sel2 = false;
305  if ( (nBSCp >0 || nBSCm > 0) && nChaVtx >= 3 && nChapt05 > 1 ) { sel2 = true; }
306 
307  // no forward trigger selection
308  bool sel3 = false;
309  if ( nBSCp == 0 && nBSCm == 0 ) { sel3 = true; }
310 
311  // single arm forward trigger selection
312  bool sel4 = false;
313  if ( ( nBSCp>0 && nBSCm == 0 ) || ( nBSCm>0 && nBSCp == 0 ) ) { sel4 = true; }
314 
315  // BSC selection
316  bool sel5 = false;
317  if ( nBSCp > 0 && nBSCm > 0 ) { sel5 = true; }
318 
319  // basic JME-10-001, FWD-10-002 and Jet-Multiplicity selection
320  bool sel6 = false;
321  if ( sel5 && nChaVtx > 3 ) { sel6 = true; }
322 
323  // FWD-10-001 selection
324  bool sel7 = false;
325  if ( nChaVtx >= 3 && nBSCm > 0 && eneHFp < 8. ) { sel7 = true; }
326 
327  // Fill selection histograms
328  if ( sel1 ) nEvt1->Fill(0.5,weight);
329  if ( sel2 ) nEvt2->Fill(0.5,weight);
330  if ( sel3 ) nNoFwdTrig->Fill(0.5,weight);
331  if ( sel4 ) nSaFwdTrig->Fill(0.5,weight);
332  if ( sel6 ) nHFflow->Fill(0.5,weight);
333  if ( sel7 ) nHFSD->Fill(0.5,weight);
334 
335  if ( nb > 0 ) nbquark->Fill(0.5,weight);
336  if ( nb > 0 && nc > 0 ) ncandbquark->Fill(0.5,weight);
337  if ( nb == 0 && nc > 0 ) ncnobquark->Fill(0.5,weight);
338 
339  // track analyses
340  double ptMax = 0.;
341  unsigned int iMax = 0;
342  double ptot = 0.;
343  unsigned int ppbar = 0; unsigned int nnbar = 0; unsigned int kpm = 0; unsigned int k0s = 0; unsigned int l0 = 0; unsigned int gamma = 0;
344  unsigned int xim = 0; unsigned int omega = 0;
345  unsigned int ele = 0; unsigned int muo = 0;
346  unsigned int eleMax = 0;
347  unsigned int muoMax = 0;
348 
349  std::vector<double> hfMB (CaloCellManager::nForwardEta,0);
350  std::vector<double> hfDJ (CaloCellManager::nForwardEta,0);
351 
352  for (unsigned int i = 0; i < hepmcGPCollection.size(); i++ ){
353  double eta = hepmcGPCollection[i]->momentum().eta();
354  double pt = hepmcGPCollection[i]->momentum().perp();
355  int pdgId = hepmcGPCollection[i]->pdg_id();
356  if ( isCharged(i) && std::fabs(eta) < 2.5 ) {
357  if ( sel1 ) {
358  // QCD-09-010
359  binW = dNchdpt1->getTH1()->GetBinWidth(1);
360  dNchdpt1->Fill(pt,1./binW); // weight to account for the pt bin width
361  binW = dNchdeta1->getTH1()->GetBinWidth(1);
362  dNchdeta1->Fill(eta,1./binW); // weight to account for the eta bin width
363  }
364  // search for the leading track QCD-10-001
365  if ( sel2 ) {
366  if ( pt > ptMax ) { ptMax = pt; iMax = i; }
367  ptot += pt;
368 
369  // identified charged particle
370  if (std::abs(pdgId) == 2212) {
371  ppbar++;
372  pPPbar->Fill(std::log10(pt),weight);
373  }
374  else if (std::abs(pdgId) == 321) {
375  kpm++;
376  pKpm->Fill(std::log10(pt),weight);
377  }
378  else if (std::abs(pdgId) == 3312) {
379  xim++;
380  pXim->Fill(std::log10(pt),weight);
381  }
382  else if (std::abs(pdgId) == 3334) {
383  omega++;
384  pOmega->Fill(std::log10(pt),weight);
385  }
386  else if (std::abs(pdgId) == 11) {
387  ele++;
388  eleMax = i;
389  }
390  else if (std::abs(pdgId) == 13) {
391  muo++;
392  muoMax = i;
393  }
394  }
395  }
396  else if ( sel2 && isNeutral(i) && std::fabs(eta) < 2.5 ) {
397  if (std::abs(pdgId) == 310) {
398  k0s++;
399  pK0s->Fill(std::log10(pt),weight);
400  }
401  else if (std::abs(pdgId) == 3122) {
402  l0++;
403  pL0->Fill(std::log10(pt),weight);
404  }
405  }
406  else if ( sel2 && isNeutral(i) && std::fabs(eta) < 5.19 ) {
407  if (std::abs(pdgId) == 2112) {
408  nnbar++;
409  pNNbar->Fill(std::log10(pt),weight);
410  }
411  else if (std::abs(pdgId) == 22) {
412  gamma++;
413  pGamma->Fill(std::log10(pt),weight);
414  }
415  }
416  unsigned int iBin = getHFbin(eta);
417  if ( sel6 && !isNeutrino(i) && iBin < CaloCellManager::nForwardEta ) {
418  hfMB[iBin] += hepmcGPCollection[i]->momentum().rho();
419  }
420  }
421  nPPbar->Fill(ppbar,weight);
422  nNNbar->Fill(nnbar,weight);
423  nKpm->Fill(kpm,weight);
424  nK0s->Fill(k0s,weight);
425  nL0->Fill(l0,weight);
426  nXim->Fill(xim,weight);
427  nOmega->Fill(omega,weight);
428  nGamma->Fill(gamma,weight);
429 
430  if ( ele > 0 ) elePt->Fill(std::log10(hepmcGPCollection[eleMax]->momentum().perp()),weight);
431  if ( muo > 0 ) muoPt->Fill(std::log10(hepmcGPCollection[muoMax]->momentum().perp()),weight);
432 
433  leadTrackpt->Fill(hepmcGPCollection[iMax]->momentum().perp(),weight);
434  leadTracketa->Fill(hepmcGPCollection[iMax]->momentum().eta(),weight);
435 
436  std::vector<double> theEtaRanges(theCalo->getEtaRanges());
437 
438  for (unsigned int i = 0; i < CaloCellManager::nForwardEta; i++ ) {
440  dEdetaHFmb->Fill(i+0.5,hfMB[i]/binW);
441  }
442 
443  // FWD-10-001
444 
445  if ( sel7 ) {
446 
447  double empz = 0.;
448  unsigned int nCellOvTh = 0;
449  double threshold = 0.;
450 
451  for (unsigned int icell = 0; icell < eneInCell.size(); icell++ ) {
452 
453  if ( theCalo->getCellFromIndex(icell)->getSubSys() != CaloCellId::Forward ) { threshold = 3.; }
454  else { threshold = 4.; }
455 
456  if ( eneInCell[icell] > threshold ) {
457  if ( theCalo->getCellFromIndex(icell)->getSubSys() == CaloCellId::Forward ) { nCellOvTh++; }
458  empz += eneInCell[icell]*(1.-std::cos(theCalo->getCellFromIndex(icell)->getThetaCell()));
459  }
460 
461  }
462 
463  EmpzHFm->Fill(empz,weight);
464  ntHFm->Fill(nCellOvTh,weight);
465  eneHFmSel->Fill(eneHFm,weight);
466 
467  }
468 
469  // QCD-10-001
470  double phiMax = hepmcGPCollection[iMax]->momentum().phi();
471  std::vector<unsigned int> nchvsphi (nphiBin,0);
472  std::vector<double> sptvsphi (nphiBin,0.);
473  unsigned int nChaTra = 0;
474  double sptTra = 0.;
475 
476  double binPhiW = 360./nphiBin;
477  if ( sel2 ) {
478  for (unsigned int i = 0; i < hepmcGPCollection.size(); i++ ){
479  if ( isCharged(i) && std::fabs(hepmcGPCollection[i]->momentum().eta()) < 2. ) {
480  double thePhi = (hepmcGPCollection[i]->momentum().phi()-phiMax)/CLHEP::degree;
481  if ( thePhi < -180. ) { thePhi += 360.; }
482  else if ( thePhi > 180. ) { thePhi -= 360.; }
483  unsigned int thePhiBin = (int)((thePhi+180.)/binPhiW);
484  if ( thePhiBin == nphiBin ) { thePhiBin -= 1; }
485  nchvsphi[thePhiBin]++;
486  sptvsphi[thePhiBin] += hepmcGPCollection[i]->momentum().perp();
487  // analysis in the transverse region
488  if ( std::fabs(thePhi) > 60. && std::fabs(thePhi) < 120. ) {
489  nChaTra++;
490  sptTra += hepmcGPCollection[i]->momentum().perp();
491  binW = dNchdpt2->getTH1()->GetBinWidth(1);
492  dNchdpt2->Fill(hepmcGPCollection[i]->momentum().perp(),1./binW); // weight to account for the pt bin width
493  binW = dNchdeta2->getTH1()->GetBinWidth(1);
494  dNchdeta2->Fill(hepmcGPCollection[i]->momentum().eta(),1./binW); // weight to account for the eta bin width
495  }
496  }
497  }
498  nCha->Fill(nChaTra,weight);
499  binW = dNchdSpt->getTH1()->GetBinWidth(1);
500  dNchdSpt->Fill(sptTra,1.);
501  //how do one apply weights to a profile? MonitorElement doesn't allow to
502  nChaDenLpt->Fill(hepmcGPCollection[iMax]->momentum().perp(),nChaTra/4./CLHEP::twopi);
503  sptDenLpt->Fill(hepmcGPCollection[iMax]->momentum().perp(),sptTra/4./CLHEP::twopi);
504  for ( unsigned int i = 0; i < nphiBin; i++ ) {
505  double thisPhi = -180.+(i+0.5)*binPhiW;
506  dNchdphi->Fill(thisPhi,nchvsphi[i]/binPhiW/4.); // density in phi and eta
507  dSptdphi->Fill(thisPhi,sptvsphi[i]/binPhiW/4.); // density in phi and eta
508  }
509  }
510 
511  // Gather information in the charged GenJet collection
513  iEvent.getByToken(genchjetCollectionToken_, genChJets );
514 
515  unsigned int nJets = 0;
516  double pt1 = 0.;
517  double pt2 = 0.;
518  reco::GenJetCollection::const_iterator ij1 = genChJets->begin();
519  reco::GenJetCollection::const_iterator ij2 = genChJets->begin();
520  if ( sel2 ) {
521  for (reco::GenJetCollection::const_iterator iter=genChJets->begin();iter!=genChJets->end();++iter){
522  double eta = (*iter).eta();
523  double pt = (*iter).pt();
524  if ( verbosity_ > 0 ) {
525  std::cout << "GenJet " << std::setw(14) << std::fixed << (*iter).pt()
526  << std::setw(14) << std::fixed << (*iter).eta()
527  << std::setw(14) << std::fixed << (*iter).phi() << std::endl;
528  }
529  if ( std::fabs(eta) < 2. ) {
530  nJets++;
531  binW = dNchjdeta->getTH1()->GetBinWidth(1);
532  dNchjdeta->Fill(eta,1./binW);
533  binW = dNchjdpt->getTH1()->GetBinWidth(1);
534  dNchjdpt->Fill(pt,1./binW);
535  if ( pt >= pt1 ) { pt1 = pt; ij1 = iter; }
536  if ( pt < pt1 && pt >= pt2 ) { pt2 = pt; ij2 = iter; }
537  }
538  }
539 
540  nChj->Fill(nJets,weight);
541  if ( nJets > 0 && ij1 != genChJets->end() ) {
542  leadChjpt->Fill(pt1,weight);
543  leadChjeta->Fill((*ij1).eta(),weight);
544  if ( nJets > 1 && ij2 != genChJets->end() ) {
545  pt1pt2optotch->Fill(pt1+pt2,(pt1+pt2)/ptot);
546  }
547  }
548  }
549 
550 
551  // Gather information in the GenJet collection
553  iEvent.getByToken(genjetCollectionToken_, genJets );
554 
555  nJets = 0;
556  pt1 = 0.;
557  pt2 = 0.;
558  double pt3 = 0.;
559 
560 
561  // needed for Jet-Multiplicity Analysis
562  int jm25njets = 0;
563  double jm25HT = 0.;
564  double jm25pt1 = 0.;
565  double jm25pt2 = 0.;
566  double jm25pt3 = 0.;
567  double jm25pt4 = 0.;
568 
569  int jm80njets = 0;
570  double jm80HT = 0.;
571  double jm80pt1 = 0.;
572  double jm80pt2 = 0.;
573  double jm80pt3 = 0.;
574  double jm80pt4 = 0.;
575 
576 
577 
578  reco::GenJetCollection::const_iterator ij3 = genJets->begin();
579  if ( sel6 ) {
580  for (reco::GenJetCollection::const_iterator iter=genJets->begin();iter!=genJets->end();++iter){
581  double eta = (*iter).eta();
582  double pt = (*iter).pt();
583  if ( verbosity_ > 0 ) {
584  std::cout << "GenJet " << std::setw(14) << std::fixed << (*iter).pt()
585  << std::setw(14) << std::fixed << (*iter).eta()
586  << std::setw(14) << std::fixed << (*iter).phi() << std::endl;
587  }
588  if ( std::fabs(eta) < 5. ) {
589  nJets++;
590  if ( pt >= pt1 ) { pt1 = pt; ij1 = iter; }
591  if ( pt < pt1 && pt >= pt2 ) { pt2 = pt; ij2 = iter; }
592  if ( pt < pt2 && pt >= pt3 ) { pt3 = pt; ij3 = iter; }
593  }
594 
595  // find variables for Jet-Multiplicity Analysis
596  if(fabs(iter->eta()) < 3. && iter->pt()>25.) {
597  jm25njets++;
598  jm25HT += iter->pt();
599  if(iter->pt()>jm25pt1) {
600  jm25pt4 = jm25pt3;
601  jm25pt3 = jm25pt2;
602  jm25pt2 = jm25pt1;
603  jm25pt1 = iter->pt();
604  } else if(iter->pt()>jm25pt2) {
605  jm25pt4 = jm25pt3;
606  jm25pt3 = jm25pt2;
607  jm25pt2 = iter->pt();
608  } else if(iter->pt()>jm25pt3) {
609  jm25pt4 = jm25pt3;
610  jm25pt3 = iter->pt();
611  } else if(iter->pt()>jm25pt4) {
612  jm25pt4 = iter->pt();
613  }
614  // even harder jets...
615  if(iter->pt()>80.) {
616  jm80njets++;
617  jm80HT += iter->pt();
618  if(iter->pt()>jm80pt1) {
619  jm80pt4 = jm80pt3;
620  jm80pt3 = jm80pt2;
621  jm80pt2 = jm80pt1;
622  jm80pt1 = iter->pt();
623  } else if(iter->pt()>jm80pt2) {
624  jm80pt4 = jm80pt3;
625  jm80pt3 = jm80pt2;
626  jm80pt2 = iter->pt();
627  } else if(iter->pt()>jm80pt3) {
628  jm80pt4 = jm80pt3;
629  jm80pt3 = iter->pt();
630  } else if(iter->pt()>jm80pt4) {
631  jm80pt4 = iter->pt();
632  }
633  }
634 
635  }
636 
637  }
638  if(jm25njets>3) {
639  _JM25njets ->Fill(jm25njets,weight);
640  _JM25ht ->Fill(jm25HT,weight);
641  _JM25pt1 ->Fill(jm25pt1,weight);
642  _JM25pt2 ->Fill(jm25pt2,weight);
643  _JM25pt3 ->Fill(jm25pt3,weight);
644  _JM25pt4 ->Fill(jm25pt4,weight);
645  }
646  if(jm80njets>3) {
647  _JM80njets ->Fill(jm80njets,weight);
648  _JM80ht ->Fill(jm80HT,weight);
649  _JM80pt1 ->Fill(jm80pt1,weight);
650  _JM80pt2 ->Fill(jm80pt2,weight);
651  _JM80pt3 ->Fill(jm80pt3,weight);
652  _JM80pt4 ->Fill(jm80pt4,weight);
653  }
654 
655  // select a di-jet event JME-10-001 variant
656  double sumJetEt = 0; double sumPartPt = 0.; double sumChPartPt = 0.;
657  double jpx = 0; double jpy = 0;
658  if ( nJets >= 2 && ij1 != genJets->end() && ij2 != genJets->end() ) {
659  if ( (*ij1).pt() > 25. && (*ij1).pt() > 25. ) {
660  double deltaPhi = std::fabs((*ij1).phi()-(*ij2).phi())/CLHEP::degree;
661  if ( deltaPhi > 180. ) deltaPhi = 360.-deltaPhi;
662  pt1pt2Dphi->Fill(deltaPhi,weight);
663  if ( std::fabs(deltaPhi) > 2.5*CLHEP::degree ) {
664 
665  nDijet->Fill(0.5,weight);
666 
667  for (unsigned int i = 0; i < hepmcGPCollection.size(); i++ ){
668  double eta = hepmcGPCollection[i]->momentum().eta();
669  unsigned int iBin = getHFbin(eta);
670  if ( !isNeutrino(i) && iBin < CaloCellManager::nForwardEta ) {
671  hfDJ[iBin] += hepmcGPCollection[i]->momentum().rho();
672  }
673  if ( !isNeutrino(i) && std::fabs(eta) < 5. ) {
674  sumPartPt += hepmcGPCollection[i]->momentum().perp();
675  if ( isCharged(i) ) {
676  sumChPartPt += hepmcGPCollection[i]->momentum().perp();
677  }
678  }
679  }
680  for (unsigned int i = 0; i < CaloCellManager::nForwardEta; i++ ) {
682  dEdetaHFdj->Fill(i+0.5,hfDJ[i]/binW);
683  }
684 
685  double invMass = (*ij1).energy()*(*ij2).energy()-(*ij1).px()*(*ij2).px()-(*ij1).py()*(*ij2).py()-(*ij1).pz()*(*ij2).pz();
686  invMass = std::sqrt(invMass);
687  pt1pt2InvM->Fill(invMass,weight);
688 
689  sumPt->Fill(sumPartPt,weight);
690  sumChPt->Fill(sumChPartPt,weight);
691 
692  unsigned int nSelJets = 0;
693  for (reco::GenJetCollection::const_iterator iter=genJets->begin();iter!=genJets->end();++iter){
694  double pt = (*iter).pt();
695  double eta = (*iter).eta();
696  if ( std::fabs(eta) < 5. ) {
697  nSelJets++;
698  binW = dNjdeta->getTH1()->GetBinWidth(1);
699  dNjdeta->Fill(eta,1./binW*weight);
700  binW = dNjdpt->getTH1()->GetBinWidth(1);
701  dNjdpt->Fill(pt,1./binW*weight);
702  sumJetEt += (*iter).pt();
703  jpx += (*iter).px();
704  jpy += (*iter).py();
705  }
706  }
707 
708  nj->Fill(nSelJets,weight);
709  double mEt = std::sqrt(jpx*jpx+jpy*jpy);
710  sumJEt->Fill(sumJetEt,weight);
711  missEtosumJEt->Fill(mEt/sumJetEt,weight);
712 
713  if ( nSelJets >= 3 ) { pt3Frac->Fill((*ij3).pt()/(pt1+pt2),weight); }
714 
715  pt1pt2optot->Fill(pt1+pt2,(pt1+pt2)/sumJetEt);
716  pt1pt2balance->Fill((pt1-pt2)/(pt1+pt2),weight);
717  }
718  }
719  }
720  }
721 
722 
723  //compute differential jet rates
724  std::vector<const HepMC::GenParticle*> qcdActivity;
725  HepMCValidationHelper::removeIsolatedLeptons(myGenEvent, 0.2, 3., qcdActivity);
726  //HepMCValidationHelper::allStatus1(myGenEvent, qcdActivity);
727  //fill PseudoJets to use fastjet
728  std::vector<fastjet::PseudoJet> vecs;
729  int counterUser = 1;
730  std::vector<const HepMC::GenParticle*>::const_iterator iqcdact;
731  for (iqcdact = qcdActivity.begin(); iqcdact != qcdActivity.end(); ++iqcdact){
732  const HepMC::FourVector& fmom = (*iqcdact)->momentum();
733  fastjet::PseudoJet pseudoJet(fmom.px(), fmom.py(), fmom.pz(), fmom.e());
734  pseudoJet.set_user_index(counterUser);
735  vecs.push_back(pseudoJet);
736  ++counterUser;
737  }
738  //compute jets
739  fastjet::ClusterSequence cseq(vecs, fastjet::JetDefinition(fastjet::kt_algorithm, 1., fastjet::E_scheme));
740  //access the cluster sequence and get the relevant info
741  djr10->Fill(std::log10(sqrt(cseq.exclusive_dmerge(0))),weight);
742  djr21->Fill(std::log10(sqrt(cseq.exclusive_dmerge(1))),weight);
743  djr32->Fill(std::log10(sqrt(cseq.exclusive_dmerge(2))),weight);
744  djr43->Fill(std::log10(sqrt(cseq.exclusive_dmerge(3))),weight);
745 
746 
747  // compute sumEt for all stable particles
748  std::vector<const HepMC::GenParticle*> allStable;
749  HepMCValidationHelper::allStatus1(myGenEvent, allStable);
750 
751  double sumEt = 0.;
752  double sumEt1 = 0.;
753  double sumEt2 = 0.;
754  double sumEt3 = 0.;
755  double sumEt4 = 0.;
756  double sumEt5 = 0.;
757 
758  for(std::vector<const HepMC::GenParticle*>::const_iterator iter=allStable.begin();
759  iter != allStable.end(); ++iter) {
760 
761  double thisEta=fabs((*iter)->momentum().eta());
762 
763  if(thisEta < 5.) {
764  const HepMC::FourVector mom=(*iter)->momentum();
765  double px=mom.px();
766  double py=mom.py();
767  double pz=mom.pz();
768  double E=mom.e();
769  double thisSumEt = (
770  sqrt(px*px + py*py)*E /
771  sqrt(px*px + py*py + pz*pz)
772  );
773  sumEt += thisSumEt;
774  if(thisEta<1.0) sumEt1 += thisSumEt;
775  else if(thisEta<2.0) sumEt2 += thisSumEt;
776  else if(thisEta<3.0) sumEt3 += thisSumEt;
777  else if(thisEta<4.0) sumEt4 += thisSumEt;
778  else sumEt5 += thisSumEt;
779 
780  }
781  }
782 
783  if(sumEt>0.)
784  _sumEt->Fill(sumEt,weight);
785  if(sumEt1>0.)
786  _sumEt1->Fill(sumEt1,weight);
787  if(sumEt2>0.)
788  _sumEt2->Fill(sumEt2,weight);
789  if(sumEt3>0.)
790  _sumEt3->Fill(sumEt3,weight);
791  if(sumEt4>0.)
792  _sumEt4->Fill(sumEt4,weight);
793  if(sumEt5>0.)
794  _sumEt5->Fill(sumEt5,weight);
795 
796  delete myGenEvent;
797 }//analyze
798 
800 
801  bool status = false;
802  if ( hepmcGPCollection.size() < i+1 ) { return status; }
803  else { status = (hepmcCharge[i] != 0. && hepmcCharge[i] != -999.); }
804  return status;
805 
806 }
807 
809 
810  bool status = false;
811  int pdgId = std::abs(hepmcGPCollection[i]->pdg_id());
812  if ( hepmcGPCollection.size() < i+1 ) { return status; }
813  else { status = (hepmcCharge[i] == 0. && pdgId != 12 && pdgId != 14 && pdgId != 16) ; }
814  return status;
815 
816 }
817 
819 
820  bool status = false;
821  int pdgId = std::abs(hepmcGPCollection[i]->pdg_id());
822  if ( hepmcGPCollection.size() < i+1 ) { return status; }
823  else { status = (pdgId == 12 || pdgId == 14 || pdgId == 16) ; }
824  return status;
825 
826 }
827 
828 unsigned int MBUEandQCDValidation::getHFbin(double eta) {
829 
830  unsigned int iBin = 999;
831 
832  std::vector<double> theEtaRanges(theCalo->getEtaRanges());
833 
836  if ( std::fabs(eta) >= theEtaRanges[i] && std::fabs(eta) < theEtaRanges[i+1] )
838  }
839 
840  return iBin;
841 
842 }
843 
844 const unsigned int MBUEandQCDValidation::nphiBin = 36;
845 const unsigned int MBUEandQCDValidation::initSize = 1000;
bool isCharged(unsigned int i)
MonitorElement * ncnobquark
int theIndex
Definition: mps_update.py:66
double getThetaCell()
Definition: CaloCellId.cc:47
MonitorElement * nbquark
static const unsigned int nphiBin
std::vector< const HepMC::GenParticle * > hepmcGPCollection
status 1 GenParticle collection
MonitorElement * sptDenLpt
MonitorElement * leadTracketa
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:157
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
static const unsigned int nForwardEta
MonitorElement * leadTrackpt
MBUEandQCDValidation(const edm::ParameterSet &)
static const unsigned int nBarrelCell
MonitorElement * dSptdphi
MonitorElement * dNchdpt1
MonitorElement * dNchdSpt
MonitorElement * _JM80njets
Definition: weight.py:1
void allStatus1(const HepMC::GenEvent *all, std::vector< const HepMC::GenParticle * > &status1)
MonitorElement * dNchjdeta
CaloCellManager * theCalo
manager of calorimetric cell structure
MonitorElement * dNchdeta1
static const unsigned int nEndcapEta
MonitorElement * book1dHisto(std::string name, std::string title, int n, double xmin, double xmax, std::string xaxis, std::string yaxis)
Definition: DQMHelper.cc:12
edm::InputTag genjetCollection_
double getEtaMin() const
Definition: CaloCellId.h:24
MonitorElement * pt1pt2Dphi
MonitorElement * dNchdeta2
void getData(T &iHolder) const
Definition: EventSetup.h:79
void Fill(long long x)
MonitorElement * _JM25njets
std::vector< double > hepmcCharge
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:230
void removeIsolatedLeptons(const HepMC::GenEvent *all, double deltaR, double sumPt, std::vector< const HepMC::GenParticle * > &pruned)
MonitorElement * eneHFmSel
MonitorElement * nSaFwdTrig
MonitorElement * pt1pt2optot
MonitorElement * pt1pt2optotch
static const unsigned int nCaloCell
MonitorElement * leadChjpt
T sqrt(T t)
Definition: SSEVec.h:18
virtual 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
System getSubSys() const
Definition: CaloCellId.h:28
MonitorElement * dNchdphi
TH1 * getTH1(void) const
virtual void dqmBeginRun(const edm::Run &r, const edm::EventSetup &c) override
MonitorElement * dEdetaHFdj
std::vector< double > eneInCell
static const unsigned int nEndcapCell
MonitorElement * pt1pt2balance
edm::InputTag hepmcCollection_
HepPDT::ParticleData ParticleData
static const unsigned int nBarrelEta
edm::InputTag genchjetCollection_
MonitorElement * leadChjeta
edm::EDGetTokenT< reco::GenJetCollection > genchjetCollectionToken_
MonitorElement * nNoFwdTrig
edm::EDGetTokenT< reco::GenJetCollection > genjetCollectionToken_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:38
edm::EDGetTokenT< edm::HepMCProduct > hepmcCollectionToken_
MonitorElement * ncandbquark
unsigned int getHFbin(double eta)
bool isNeutral(unsigned int i)
T perp() const
Magnitude of transverse component.
HLT enums.
MonitorElement * dEdetaHFmb
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * nChaDenLpt
unsigned int getCellIndexFromAngle(double eta, double phi)
double weight(const edm::Event &)
static const unsigned int initSize
Definition: Run.h:42
MonitorElement * missEtosumJEt