CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BasicHepMCValidation.cc
Go to the documentation of this file.
1 /*class BasicHepMCValidation
2  *
3  * Class to fill dqm monitor elements from existing EDM file
4  *
5  */
6 
8 
9 #include "CLHEP/Units/defs.h"
10 #include "CLHEP/Units/PhysicalConstants.h"
11 
12 using namespace edm;
13 
15  wmanager_(iPSet,consumesCollector()),
16  hepmcCollection_(iPSet.getParameter<edm::InputTag>("hepmcCollection"))
17 {
18  hepmcCollectionToken_=consumes<HepMCProduct>(hepmcCollection_);
19 }
20 
22 
24  c.getData( fPDGTable );
25 }
26 
28 
30  i.setCurrentFolder("Generator/Particles");
31 
32  // Number of analyzed events
33  nEvt = i.book1D("nEvt", "n analyzed Events", 1, 0., 1.);
34 
37  uNumber = i.book1D("uNumber", "No. u", 20, 0, 20);
38  dNumber = i.book1D("dNumber", "No. d", 20, 0, 20);
39  sNumber = i.book1D("sNumber", "No. s", 20, 0, 20);
40  cNumber = i.book1D("cNumber", "No. c", 20, 0, 20);
41  bNumber = i.book1D("bNumber", "No. b", 20, 0, 20);
42  tNumber = i.book1D("tNumber", "No. t", 20, 0, 20);
43  //
44  ubarNumber = i.book1D("ubarNumber", "No. ubar", 20, 0, 20);
45  dbarNumber = i.book1D("dbarNumber", "No. dbar", 20, 0, 20);
46  sbarNumber = i.book1D("sbarNumber", "No. sbar", 20, 0, 20);
47  cbarNumber = i.book1D("cbarNumber", "No. cbar", 20, 0, 20);
48  bbarNumber = i.book1D("bbarNumber", "No. bbar", 20, 0, 20);
49  tbarNumber = i.book1D("tbarNumber", "No. tbar", 20, 0, 20);
50  //
51  eminusNumber = i.book1D("eminusNumber", "No. e-", 20, 0, 20);
52  nueNumber = i.book1D("nueNumber", "No. nu_e", 20, 0, 20);
53  muminusNumber = i.book1D("muminusNumber", "No. mu-", 20, 0, 20);
54  numuNumber = i.book1D("numuNumber", "No. nu_mu", 20, 0, 20);
55  tauminusNumber = i.book1D("tauminusNumber", "No. tau-", 20, 0, 20);
56  nutauNumber = i.book1D("nutauNumber", "No. nu_tau", 20, 0, 20);
57  //
58  eplusNumber = i.book1D("eplusNumber", "No. e+", 20, 0, 20);
59  nuebarNumber = i.book1D("nuebarNumber", "No. nu_e_bar", 20, 0, 20);
60  muplusNumber = i.book1D("muplusNumber", "No. mu+", 20, 0, 20);
61  numubarNumber = i.book1D("numuNumber", "No. nu_mu_bar", 20, 0, 20);
62  tauplusNumber = i.book1D("tauplusNumber", "No. tau+", 20, 0, 20);
63  nutaubarNumber = i.book1D("nutauNumber", "No. nu_tau_bar", 20, 0, 20);
64  //
65  WplusNumber = i.book1D("WplusNumber", "No. W+", 20, 0, 20);
66  WminusNumber = i.book1D("WminusNumber", "No. W-", 20, 0, 20);
67  ZNumber = i.book1D("ZNumber", "No. Z", 20, 0, 20);
68  gammaNumber = i.book1D("gammaNumber", "Log10(No. gamma)", 60, -1, 5); //Log
69  gluNumber = i.book1D("gluonNumber", "Log10(No. gluons)", 60, -1, 5); //Log
70  //
71  piplusNumber = i.book1D("piplusNumber", "Log10(No. pi+)", 60, -1, 5); //Log
72  piminusNumber = i.book1D("piminusNumber", "Log10(No. pi-)", 60, -1, 5); //Log
73  pizeroNumber = i.book1D("pizeroNumber", "Log10(No. pi_0)", 60, -1, 5); //Log
74  KplusNumber = i.book1D("KplusNumber", "No. K+", 100, 0, 100);
75  KminusNumber = i.book1D("KminusNumber", "No. K-", 100, 0, 100);
76  KlzeroNumber = i.book1D("KlzeroNumber", "No. K_l^0", 100, 0, 100);
77  KszeroNumber = i.book1D("KszeroNumber", "No. K_s^0", 100, 0, 100);
78  //
79  pNumber = i.book1D("pNumber", "No. p", 100, 0, 100);
80  pbarNumber = i.book1D("pbarNumber", "No. pbar", 100, 0, 100);
81  nNumber = i.book1D("nNumber", "No. n", 100, 0, 100);
82  nbarNumber = i.book1D("nbarNumber", "No. nbar", 100, 0, 100);
83  l0Number = i.book1D("l0Number", "No. Lambda0", 100, 0, 100);
84  l0barNumber = i.book1D("l0barNumber", "No. Lambda0bar", 100, 0, 100);
85  //
86  DplusNumber = i.book1D("DplusNumber", "No. D+", 20, 0, 20);
87  DminusNumber = i.book1D("DminusNumber", "No. D-", 20, 0, 20);
88  DzeroNumber = i.book1D("DzeroNumber", "No. D^0", 20, 0, 20);
89  //
90  BplusNumber = i.book1D("BplusNumber", "No. B+", 20, 0, 20);
91  BminusNumber = i.book1D("BminusNumber", "No. B-", 20, 0, 20);
92  BzeroNumber = i.book1D("BzeroNumber", "No. B^0", 20, 0, 20);
93  BszeroNumber = i.book1D("BszeroNumber", "No. B^0_s", 20, 0, 20);
94  //
95  otherPtclNumber = i.book1D("otherPtclNumber", "Log10(No. other ptcls)", 60, -1, 5); //Log
96 
97  //Momentum
98  uMomentum = i.book1D("uMomentum", "Log10(p) u", 60, -2, 4);
99  dMomentum = i.book1D("dMomentum", "Log10(p) d", 60, -2, 4);
100  sMomentum = i.book1D("sMomentum", "Log10(p) s", 60, -2, 4);
101  cMomentum = i.book1D("cMomentum", "Log10(p) c", 60, -2, 4);
102  bMomentum = i.book1D("bMomentum", "Log10(p) b", 60, -2, 4);
103  tMomentum = i.book1D("tMomentum", "Log10(p) t", 60, -2, 4);
104  //
105  ubarMomentum = i.book1D("ubarMomentum", "Log10(p) ubar", 60, -2, 4);
106  dbarMomentum = i.book1D("dbarMomentum", "Log10(p) dbar", 60, -2, 4);
107  sbarMomentum = i.book1D("sbarMomentum", "Log10(p) sbar", 60, -2, 4);
108  cbarMomentum = i.book1D("cbarMomentum", "Log10(p) cbar", 60, -2, 4);
109  bbarMomentum = i.book1D("bbarMomentum", "Log10(p) bbar", 60, -2, 4);
110  tbarMomentum = i.book1D("tbarMomentum", "Log10(p) tbar", 60, -2, 4);
111  //
112  eminusMomentum = i.book1D("eminusMomentum", "Log10(p) e-", 60, -2, 4);
113  nueMomentum = i.book1D("nueMomentum", "Log10(Momentum) nue", 60, -2, 4);
114  muminusMomentum = i.book1D("muminusMomentum", "Log10(p) mu-", 60, -2, 4);
115  numuMomentum = i.book1D("numuMomentum", "Log10(p) numu", 60, -2, 4);
116  tauminusMomentum = i.book1D("tauminusMomentum", "Log10(p) tau-", 60, -2, 4);
117  nutauMomentum = i.book1D("nutauMomentum", "Log10(p) nutau", 60, -2, 4);
118  //
119  eplusMomentum = i.book1D("eplusMomentum", "Log10(p) e+", 60, -2, 4);
120  nuebarMomentum = i.book1D("nuebarMomentum", "Log10(p) nuebar", 60, -2, 4);
121  muplusMomentum = i.book1D("muplusMomentum", "Log10(p) mu+", 60, -2, 4);
122  numubarMomentum = i.book1D("numuMomentum", "Log10(p) numubar", 60, -2, 4);
123  tauplusMomentum = i.book1D("tauplusMomentum", "Log10(p) tau+", 60, -2, 4);
124  nutaubarMomentum = i.book1D("nutauMomentum", "Log10(p) nutaubar", 60, -2, 4);
125  //
126  gluMomentum = i.book1D("gluonMomentum", "Log10(p) gluons", 70, -3, 4);
127  WplusMomentum = i.book1D("WplusMomentum", "Log10(p) W+", 60, -2, 4);
128  WminusMomentum = i.book1D("WminusMomentum", "Log10(p) W-", 60, -2, 4);
129  ZMomentum = i.book1D("ZMomentum", "Log10(p) Z", 60, -2, 4);
130  gammaMomentum = i.book1D("gammaMomentum", "Log10(p) gamma", 70, -3, 4);
131  //
132  piplusMomentum = i.book1D("piplusMomentum", "Log10(p) pi+", 60, -2, 4);
133  piminusMomentum = i.book1D("piminusMomentum", "Log10(p) pi-", 60, -2, 4);
134  pizeroMomentum = i.book1D("pizeroMomentum", "Log10(p) pi_0", 60, -2, 4);
135  KplusMomentum = i.book1D("KplusMomentum", "Log10(p) K+", 60, -2, 4);
136  KminusMomentum = i.book1D("KminusMomentum", "Log10(p) K-", 60, -2, 4);
137  KlzeroMomentum = i.book1D("KlzeroMomentum", "Log10(p) K_l^0", 60, -2, 4);
138  KszeroMomentum = i.book1D("KszeroMomentum", "Log10(p) K_s^0", 60, -2, 4);
139  //
140  pMomentum = i.book1D("pMomentum", "Log10(p) p", 60, -2, 4);
141  pbarMomentum = i.book1D("pbarMomentum", "Log10(p) pbar", 60, -2, 4);
142  nMomentum = i.book1D("nMomentum", "Log10(p) n", 60, -2, 4);
143  nbarMomentum = i.book1D("nbarMomentum", "Log10(p) nbar", 60, -2, 4);
144  l0Momentum = i.book1D("l0Momentum", "Log10(p) Lambda0", 60, -2, 4);
145  l0barMomentum = i.book1D("l0barMomentum", "Log10(p) Lambda0bar", 60, -2, 4);
146  //
147  DplusMomentum = i.book1D("DplusMomentum", "Log10(p) D+", 60, -2, 4);
148  DminusMomentum = i.book1D("DminusMomentum", "Log10(p) D-", 60, -2, 4);
149  DzeroMomentum = i.book1D("DzeroMomentum", "Log10(p) D^0", 60, -2, 4);
150  //
151  BplusMomentum = i.book1D("BplusMomentum", "Log10(p) B+", 60, -2, 4);
152  BminusMomentum = i.book1D("BminusMomentum", "Log10(p) B-", 60, -2, 4);
153  BzeroMomentum = i.book1D("BzeroMomentum", "Log10(p) B^0", 60, -2, 4);
154  BszeroMomentum = i.book1D("BszeroMomentum", "Log10(p) B^0_s", 60, -2, 4);
155  //
156  otherPtclMomentum = i.book1D("otherPtclMomentum", "Log10(p) other ptcls", 60, -2, 4);
157 
159  genPtclNumber = i.book1D("genPtclNumber", "Log10(No. all particles)", 60, -1, 5); //Log
160  genVrtxNumber = i.book1D("genVrtxNumber", "Log10(No. all vertexs)", 60, -1, 5); //Log
161  //
162  stablePtclNumber= i.book1D("stablePtclNumber", "Log10(No. stable particles)", 50, 0, 5); //Log
163  stablePtclPhi = i.book1D("stablePtclPhi", "stable Ptcl Phi", 360, -180, 180);
164  stablePtclEta = i.book1D("stablePtclEta", "stable Ptcl Eta (pseudo rapidity)", 220, -11, 11);
165  stablePtclCharge = i.book1D("stablePtclCharge", "stablePtclCharge", 5, -2, 2);
166  stableChaNumber= i.book1D("stableChaNumber", "Log10(No. stable charged particles)", 50, 0, 5); //Log
167  stablePtclp = i.book1D("stablePtclp", "Log10(p) stable ptcl p", 80, -4, 4); //Log
168  stablePtclpT = i.book1D("stablePtclpT", "Log10(pT) stable ptcl pT", 80, -4, 4); //Log
169  partonNumber = i.book1D("partonNumber", "number of partons", 100, 0, 100);
170  partonpT = i.book1D("partonpT", "Log10(pT) parton pT", 80, -4, 4); //Log
171  outVrtxStablePtclNumber = i.book1D("outVrtxStablePtclNumber", "No. outgoing stable ptcls from vrtx", 10, 0, 10);
172  //
173  outVrtxPtclNumber = i.book1D("outVrtxPtclNumber", "No. outgoing ptcls from vrtx", 30, 0, 30);
174  vrtxZ = i.book1D("VrtxZ", "VrtxZ", 50 , -250, 250);
175  vrtxRadius = i.book1D("vrtxRadius", "vrtxRadius", 50, 0, 50);
176  //
177  unknownPDTNumber = i.book1D("unknownPDTNumber", "Log10(No. unknown ptcls PDT)", 60, -1, 5); //Log
178  genPtclStatus = i.book1D("genPtclStatus", "Status of genParticle", 200,0,200.);
179  //
180  Bjorken_x = i.book1D("Bjorken_x", "Bjorken_x", 1000, 0.0, 1.0);
181  //
182  status1ShortLived = i.book1D("status1ShortLived","Status 1 short lived", 11, 0, 11);
183  status1ShortLived->setBinLabel(1,"d/dbar");
184  status1ShortLived->setBinLabel(2,"u/ubar");
185  status1ShortLived->setBinLabel(3,"s/sbar");
186  status1ShortLived->setBinLabel(4,"c/cbar");
187  status1ShortLived->setBinLabel(5,"b/bbar");
188  status1ShortLived->setBinLabel(6,"t/tbar");
190  status1ShortLived->setBinLabel(8,"tau-/tau+");
192  status1ShortLived->setBinLabel(10,"W-/W+");
193  status1ShortLived->setBinLabel(11,"PDG = 7,8,17,25-99");
194 
195  DeltaEcms = i.book1D("DeltaEcms1","deviation from nominal Ecms", 200,-1., 1.);
196  DeltaPx = i.book1D("DeltaPx1","deviation from nominal Px", 200,-1., 1.);
197  DeltaPy = i.book1D("DeltaPy1","deviation from nominal Py", 200,-1., 1.);
198  DeltaPz = i.book1D("DeltaPz1","deviation from nominal Pz", 200,-1., 1.);
199 
200  return;
201 }
202 
204 {
206  int uNum = 0; int dNum = 0; int sNum = 0; int cNum = 0; int bNum = 0; int tNum = 0;
207  int ubarNum = 0; int dbarNum = 0; int sbarNum = 0; int cbarNum = 0; int bbarNum = 0; int tbarNum = 0;
208  int partonNum = 0;
209  //
210  int eminusNum = 0; int nueNum = 0; int muminusNum = 0; int numuNum = 0; int tauminusNum = 0; int nutauNum = 0;
211  int eplusNum = 0; int nuebarNum = 0; int muplusNum = 0; int numubarNum = 0; int tauplusNum = 0; int nutaubarNum = 0;
212  //
213  int gluNum = 0; int WplusNum = 0; int WminusNum = 0; int ZNum = 0; int gammaNum = 0;
214  //
215  int piplusNum = 0; int piminusNum = 0; int pizeroNum = 0; int KplusNum = 0; int KminusNum = 0; int KlzeroNum = 0; int KszeroNum = 0;
216  //
217  int pNum = 0; int pbarNum = 0; int nNum = 0; int nbarNum = 0; int l0Num = 0; int l0barNum = 0;
218  //
219  int DplusNum = 0; int DminusNum = 0; int DzeroNum = 0; int BplusNum = 0; int BminusNum = 0; int BzeroNum = 0; int BszeroNum = 0;
220  //
221  int outVrtxStablePtclNum = 0; int stablePtclNum = 0; int otherPtclNum = 0; int unknownPDTNum = 0; int stableChaNum = 0;
222  //
223  double bjorken = 0.;
224  //
225  double etotal = 0. ; double pxtotal = 0.; double pytotal = 0.; double pztotal = 0.;
226 
229  iEvent.getByToken(hepmcCollectionToken_, evt);
230 
231  //Get EVENT
232  HepMC::GenEvent *myGenEvent = new HepMC::GenEvent(*(evt->GetEvent()));
233 
234  double weight = wmanager_.weight(iEvent);
235 
236  nEvt->Fill(0.5,weight);
237 
238  genPtclNumber->Fill(log10(myGenEvent->particles_size()),weight);
239  genVrtxNumber->Fill(log10(myGenEvent->vertices_size()),weight);
240 
242  HepMC::PdfInfo *pdf = myGenEvent->pdf_info();
243  if(pdf){
244  bjorken = ((pdf->x1())/((pdf->x1())+(pdf->x2())));
245  }
246  Bjorken_x->Fill(bjorken,weight);
247 
248  //Looping through the VERTICES in the event
249  HepMC::GenEvent::vertex_const_iterator vrtxBegin = myGenEvent->vertices_begin();
250  HepMC::GenEvent::vertex_const_iterator vrtxEnd = myGenEvent->vertices_end();
251  for(HepMC::GenEvent::vertex_const_iterator vrtxIt = vrtxBegin; vrtxIt!=vrtxEnd; ++vrtxIt)
252  {
254  HepMC::GenVertex *vrtx = *vrtxIt;
255  outVrtxPtclNumber->Fill(vrtx->particles_out_size(),weight); //std::cout << "all " << vrtx->particles_out_size() << '\n';
256  vrtxZ->Fill(vrtx->point3d().z(),weight);
257  vrtxRadius->Fill(vrtx->point3d().perp(),weight);
258 
260  HepMC::GenVertex::particles_out_const_iterator vrtxPtclBegin = vrtx->particles_out_const_begin();
261  HepMC::GenVertex::particles_out_const_iterator vrtxPtclEnd = vrtx->particles_out_const_end();
262  outVrtxStablePtclNum = 0;
263  for(HepMC::GenVertex::particles_out_const_iterator vrtxPtclIt = vrtxPtclBegin; vrtxPtclIt != vrtxPtclEnd; ++vrtxPtclIt)
264  {
265  HepMC::GenParticle *vrtxPtcl = *vrtxPtclIt;
266  if (vrtxPtcl->status() == 1){
267  ++outVrtxStablePtclNum; //std::cout << "stable " << outVrtxStablePtclNum << '\n';
268  }
269  }
270  outVrtxStablePtclNumber->Fill(outVrtxStablePtclNum,weight);
271  }//vertices
272 
273 
275  HepMC::GenEvent::particle_const_iterator ptclBegin = myGenEvent->particles_begin();
276  HepMC::GenEvent::particle_const_iterator ptclEnd = myGenEvent->particles_end();
277  for(HepMC::GenEvent::particle_const_iterator ptclIt = ptclBegin; ptclIt!=ptclEnd; ++ptclIt)
278  {
279 
281  HepMC::GenParticle *ptcl = *ptclIt;
282  int Id = ptcl->pdg_id(); // std::cout << Id << '\n';
283  float Log_p = log10( ptcl->momentum().rho() );
284  double charge = 999.; // for the charge it's needed a HepPDT method
285  int status = ptcl->status();
286  const HepPDT::ParticleData* PData = fPDGTable->particle(HepPDT::ParticleID(Id));
287  if(PData==0) {
288  // std::cout << "Unknown id = " << Id << '\n';
289  ++unknownPDTNum;
290  }
291  else
292  charge = PData->charge();
293 
295  genPtclStatus->Fill((float)status,weight);
296 
298  if(ptcl->status() == 1){
299  ++stablePtclNum;
300  stablePtclPhi->Fill(ptcl->momentum().phi()/CLHEP::degree,weight); //std::cout << ptcl->polarization().phi() << '\n';
301  stablePtclEta->Fill(ptcl->momentum().pseudoRapidity(),weight);
302  stablePtclCharge->Fill(charge,weight); // std::cout << ptclData.charge() << '\n';
303  stablePtclp->Fill(Log_p,weight);
304  stablePtclpT->Fill(log10(ptcl->momentum().perp()),weight);
305  if (charge != 0. && charge != 999.) ++stableChaNum;
306  if ( std::abs(Id) == 1 ) status1ShortLived->Fill(1,weight);
307  if ( std::abs(Id) == 2 ) status1ShortLived->Fill(2,weight);
308  if ( std::abs(Id) == 3 ) status1ShortLived->Fill(3,weight);
309  if ( std::abs(Id) == 4 ) status1ShortLived->Fill(4,weight);
310  if ( std::abs(Id) == 5 ) status1ShortLived->Fill(5,weight);
311  if ( std::abs(Id) == 6 ) status1ShortLived->Fill(6,weight);
312  if ( Id == 21 ) status1ShortLived->Fill(7,weight);
313  if ( std::abs(Id) == 15 ) status1ShortLived->Fill(8,weight);
314  if ( Id == 23 ) status1ShortLived->Fill(9,weight);
315  if ( std::abs(Id) == 24 ) status1ShortLived->Fill(10,weight);
316  if ( std::abs(Id) == 7 || std::abs(Id) == 8 || std::abs(Id) == 17 || (std::abs(Id) >= 25 && std::abs(Id) <= 99) ) status1ShortLived->Fill(11,weight);
317  etotal += ptcl->momentum().e();
318  pxtotal += ptcl->momentum().px();
319  pytotal += ptcl->momentum().py();
320  pztotal += ptcl->momentum().pz();
321  }
322 
323  if (abs(Id) < 6 || abs(Id) == 22){
324  ++partonNum; partonpT->Fill(Log_p,weight);
325  }
326 
328  switch(abs(Id)){
329 
330  case 1 : {
331  if(Id > 0) {
332  ++dNum; dMomentum->Fill(Log_p,weight);}
333  else{
334  ++dbarNum; dbarMomentum->Fill(Log_p,weight);}
335  }
336  break;
337  //
338  case 2 : {
339  if(Id > 0) {
340  ++uNum; uMomentum->Fill(Log_p,weight);}
341  else{
342  ++ubarNum; ubarMomentum->Fill(Log_p,weight);}
343  }
344  break;
345  //
346  case 3 : {
347  if(Id > 0) {
348  ++sNum; sMomentum->Fill(Log_p,weight);}
349  else{
350  ++sbarNum; sbarMomentum->Fill(Log_p,weight);}
351  }
352  break;
353  //
354  case 4 : {
355  if(Id > 0) {
356  ++cNum; cMomentum->Fill(Log_p,weight);}
357  else{
358  ++cbarNum; cbarMomentum->Fill(Log_p,weight);}
359  }
360  break;
361  //
362  case 5 : {
363  if(Id > 0) {
364  ++bNum; bMomentum->Fill(Log_p,weight);}
365  else{
366  ++bbarNum; bbarMomentum->Fill(Log_p,weight);}
367  }
368  break;
369  //
370  case 6 : {
371  if(Id > 0) {
372  ++tNum; tMomentum->Fill(Log_p,weight);}
373  else{
374  ++tbarNum; tbarMomentum->Fill(Log_p,weight);}
375  }
376  break;
377  //
378  case 11 : {
379  if(Id > 0) {
380  ++eminusNum; eminusMomentum->Fill(Log_p,weight);}
381  else{
382  ++eplusNum; eplusMomentum->Fill(Log_p,weight);}
383  }
384  break;
385  //
386  case 12 : {
387  if(Id > 0) {
388  ++nueNum; nueMomentum->Fill(Log_p, weight);}
389  else{
390  ++nuebarNum; nuebarMomentum->Fill(Log_p,weight);}
391  }
392  break;
393  //
394  case 13 : {
395  if(Id > 0) {
396  ++muminusNum; muminusMomentum->Fill(Log_p,weight);}
397  else{
398  ++muplusNum; muplusMomentum->Fill(Log_p,weight);}
399  }
400  break;
401  //
402  case 14 : {
403  if(Id > 0) {
404  ++numuNum; numuMomentum->Fill(Log_p,weight);}
405  else{
406  ++numubarNum; numubarMomentum->Fill(Log_p,weight);}
407  }
408  break;
409  //
410  case 15 : {
411  if(Id > 0) {
412  ++tauminusNum; tauminusMomentum->Fill(Log_p,weight);}
413  else{
414  ++tauplusNum; tauplusMomentum->Fill(Log_p,weight);}
415  }
416  break;
417  //
418  case 16 : {
419  if(Id > 0) {
420  ++nutauNum; nutauMomentum->Fill(Log_p,weight);}
421  else{
422  ++nutaubarNum; nutaubarMomentum->Fill(Log_p,weight);}
423  }
424  break;
425  //
426  //
427  case 21 : {
428  ++gluNum; gluMomentum->Fill(Log_p,weight);
429  }
430  break;
431  //
432  case 22 : {
433  ++gammaNum; gammaMomentum->Fill(Log_p,weight);
434  }
435  break;
436  //
437  case 23 : {
438  ++ZNum; ZMomentum->Fill(Log_p,weight);
439  }
440  break;
441  case 24 : {
442  if(Id > 0) {
443  ++WplusNum; WplusMomentum->Fill(Log_p,weight);}
444  else{
445  ++WminusNum; WminusMomentum->Fill(Log_p,weight);}
446  }
447  break;
448  //
449  //
450  case 211 : {
451  if(Id > 0) {
452  ++piplusNum; piplusMomentum->Fill(Log_p,weight);}
453  else{
454  ++piminusNum; piminusMomentum->Fill(Log_p,weight);}
455  }
456  break;
457  //
458  case 111 : {
459  ++pizeroNum; pizeroMomentum->Fill(Log_p,weight);
460  }
461  break;
462  //
463  case 321 : {
464  if(Id > 0) {
465  ++KplusNum; KplusMomentum->Fill(Log_p,weight);}
466  else{
467  ++KminusNum; KminusMomentum->Fill(Log_p,weight);}
468  }
469  break;
470  //
471  case 130 : {
472  ++KlzeroNum; KlzeroMomentum->Fill(Log_p,weight);
473  }
474  break;
475  //
476  case 310 : {
477  ++KszeroNum; KszeroMomentum->Fill(Log_p,weight);
478  }
479  break;
480  //
481  //
482  case 2212 : {
483  if(Id > 0) {
484  ++pNum; pMomentum->Fill(Log_p,weight);}
485  else{
486  ++pbarNum; pbarMomentum->Fill(Log_p,weight);}
487  }
488  break;
489  //
490  case 2112 : {
491  if(Id > 0) {
492  ++nNum; nMomentum->Fill(Log_p,weight);}
493  else{
494  ++nbarNum; nbarMomentum->Fill(Log_p,weight);}
495  }
496  break;
497  //
498  //
499  case 3122 : {
500  if(Id > 0) {
501  ++l0Num; l0Momentum->Fill(Log_p,weight);}
502  else{
503  ++l0barNum; l0barMomentum->Fill(Log_p,weight);}
504  }
505  break;
506  //
507  //
508  case 411 : {
509  if(Id > 0) {
510  ++DplusNum; DplusMomentum->Fill(Log_p,weight);}
511  else{
512  ++DminusNum; DminusMomentum->Fill(Log_p,weight);}
513  }
514  break;
515  //
516  case 421 : {
517  ++DzeroNum; DzeroMomentum->Fill(Log_p,weight);
518  }
519  break;
520  //
521  case 521 : {
522  if(Id > 0) {
523  ++BplusNum; BplusMomentum->Fill(Log_p,weight);}
524  else{
525  ++BminusNum; BminusMomentum->Fill(Log_p,weight);}
526  }
527  break;
528  //
529  case 511 : {
530  ++BzeroNum; BzeroMomentum->Fill(Log_p,weight);
531  }
532  break;
533  //
534  case 531 : {
535  ++BszeroNum; BszeroMomentum->Fill(Log_p,weight);
536  }
537  break;
538  //
539  default : {
540  ++otherPtclNum; otherPtclMomentum->Fill(Log_p,weight);
541  }
542  }//switch
543  // if( 0 < Id && 100 > Id) ++part_counter[Id];
544  }//event particles
545 
546 
547  // set a default sqrt(s) and then check in the event
548  double ecms = 7000.;
549  if ( myGenEvent->valid_beam_particles() ) {
550  ecms = myGenEvent->beam_particles().first->momentum().e()+myGenEvent->beam_particles().second->momentum().e();
551  }
552  DeltaEcms->Fill(etotal-ecms,weight);
553  DeltaPx->Fill(pxtotal,weight);
554  DeltaPy->Fill(pytotal,weight);
555  DeltaPz->Fill(pztotal,weight);
556 
557 
559  stablePtclNumber->Fill(log10(stablePtclNum+0.1),weight);
560  stableChaNumber->Fill(log10(stableChaNum+0.1),weight);
561  otherPtclNumber->Fill(log10(otherPtclNum+0.1),weight);
562  unknownPDTNumber->Fill(log10(unknownPDTNum+0.1),weight);
563  //
564  dNumber->Fill(dNum,weight); uNumber->Fill(uNum,weight); sNumber->Fill(sNum,weight); cNumber->Fill(cNum,weight); bNumber->Fill(bNum,weight); tNumber->Fill(tNum,weight);
565  dbarNumber->Fill(dbarNum,weight); ubarNumber->Fill(ubarNum,weight); sbarNumber->Fill(sbarNum,weight); cbarNumber->Fill(cbarNum,weight); bbarNumber->Fill(bbarNum,weight); tbarNumber->Fill(tbarNum,weight);
566  partonNumber->Fill(partonNum,weight);
567  //
568  eminusNumber->Fill(eminusNum,weight); nueNumber->Fill(nueNum,weight); muminusNumber->Fill(muminusNum,weight); numuNumber->Fill(numuNum,weight); tauminusNumber->Fill(tauminusNum,weight); nutauNumber->Fill(nutauNum,weight);
569  eplusNumber->Fill(eplusNum,weight); nuebarNumber->Fill(nuebarNum,weight); muplusNumber->Fill(muplusNum,weight); numubarNumber->Fill(numubarNum,weight); tauplusNumber->Fill(tauplusNum,weight); nutaubarNumber->Fill(nutaubarNum,weight);
570  //
571  ZNumber->Fill(ZNum,weight); WminusNumber->Fill(WminusNum,weight); WplusNumber->Fill(WplusNum,weight);
572  gammaNumber->Fill(log10(gammaNum+0.1),weight);
573  gluNumber->Fill(log10(gluNum+0.1),weight);
574  //
575  piplusNumber->Fill(log10(piplusNum+0.1),weight);
576  piminusNumber->Fill(log10(piminusNum+0.1),weight);
577  pizeroNumber->Fill(log10(pizeroNum+0.1),weight);
578  KplusNumber->Fill(KplusNum,weight); KminusNumber->Fill(KminusNum,weight); KlzeroNumber->Fill(KlzeroNum,weight); KszeroNumber->Fill(KszeroNum,weight);
579  //
580  pNumber->Fill(pNum,weight); pbarNumber->Fill(pbarNum,weight); nNumber->Fill(nNum,weight); nbarNumber->Fill(nbarNum,weight); l0Number->Fill(l0Num); l0barNumber->Fill(l0barNum,weight);
581  //
582  DplusNumber->Fill(DplusNum,weight); DminusNumber->Fill(DminusNum,weight); DzeroNumber->Fill(DzeroNum,weight); BplusNumber->Fill(BplusNum,weight); BminusNumber->Fill(BminusNum,weight); BzeroNumber->Fill(BzeroNum,weight); BszeroNumber->Fill(BszeroNum,weight);
583 
584  delete myGenEvent;
585 }//analyze
MonitorElement * sbarMomentum
MonitorElement * WplusNumber
MonitorElement * genPtclStatus
MonitorElement * DeltaEcms
int i
Definition: DBlmapReader.cc:9
MonitorElement * BzeroMomentum
MonitorElement * pizeroMomentum
MonitorElement * muplusMomentum
MonitorElement * genVrtxNumber
MonitorElement * nueMomentum
MonitorElement * BplusNumber
MonitorElement * pbarNumber
MonitorElement * pizeroNumber
MonitorElement * KlzeroMomentum
MonitorElement * KplusMomentum
MonitorElement * pbarMomentum
MonitorElement * unknownPDTNumber
MonitorElement * gammaNumber
MonitorElement * uNumber
multiplicity ME&#39;s
MonitorElement * numubarNumber
MonitorElement * dbarNumber
MonitorElement * cMomentum
MonitorElement * outVrtxPtclNumber
MonitorElement * BszeroMomentum
MonitorElement * muminusNumber
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
MonitorElement * KlzeroNumber
MonitorElement * Bjorken_x
MonitorElement * otherPtclNumber
MonitorElement * ubarMomentum
MonitorElement * DminusNumber
MonitorElement * tauminusNumber
virtual void dqmBeginRun(const edm::Run &r, const edm::EventSetup &c) override
MonitorElement * eplusMomentum
MonitorElement * tauplusNumber
MonitorElement * piplusMomentum
BasicHepMCValidation(const edm::ParameterSet &)
MonitorElement * tNumber
MonitorElement * bbarMomentum
MonitorElement * sbarNumber
MonitorElement * otherPtclMomentum
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * stablePtclCharge
MonitorElement * pMomentum
MonitorElement * ZNumber
MonitorElement * dbarMomentum
MonitorElement * partonNumber
MonitorElement * nuebarMomentum
MonitorElement * KminusNumber
MonitorElement * eminusMomentum
edm::EDGetTokenT< edm::HepMCProduct > hepmcCollectionToken_
MonitorElement * tauplusMomentum
double charge(const std::vector< uint8_t > &Ampls)
MonitorElement * gluMomentum
MonitorElement * gammaMomentum
void getData(T &iHolder) const
Definition: EventSetup.h:67
MonitorElement * BszeroNumber
MonitorElement * tbarNumber
MonitorElement * nMomentum
MonitorElement * piplusNumber
MonitorElement * nbarNumber
MonitorElement * BminusNumber
void Fill(long long x)
MonitorElement * cbarNumber
MonitorElement * dMomentum
int iEvent
Definition: GenABIO.cc:230
MonitorElement * vrtxRadius
MonitorElement * ZMomentum
MonitorElement * l0Number
MonitorElement * tbarMomentum
MonitorElement * BplusMomentum
MonitorElement * eminusNumber
MonitorElement * DminusMomentum
MonitorElement * nuebarNumber
edm::ESHandle< HepPDT::ParticleDataTable > fPDGTable
PDT table.
virtual void bookHistograms(DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override
MonitorElement * nNumber
MonitorElement * numubarMomentum
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:113
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
MonitorElement * eplusNumber
MonitorElement * WminusMomentum
MonitorElement * stablePtclPhi
MonitorElement * WplusMomentum
MonitorElement * stablePtclEta
MonitorElement * DzeroNumber
MonitorElement * KplusNumber
HepPDT::ParticleData ParticleData
MonitorElement * KminusMomentum
MonitorElement * pNumber
MonitorElement * cbarMomentum
MonitorElement * muminusMomentum
virtual void analyze(edm::Event const &, edm::EventSetup const &) override
MonitorElement * cNumber
MonitorElement * l0barNumber
MonitorElement * nbarMomentum
MonitorElement * stablePtclp
MonitorElement * status1ShortLived
MonitorElement * stablePtclpT
MonitorElement * tauminusMomentum
MonitorElement * muplusNumber
MonitorElement * nueNumber
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * stableChaNumber
MonitorElement * nutaubarMomentum
MonitorElement * DplusNumber
MonitorElement * stablePtclNumber
MonitorElement * bbarNumber
MonitorElement * sMomentum
MonitorElement * BzeroNumber
MonitorElement * dNumber
MonitorElement * piminusNumber
MonitorElement * uMomentum
Momentum ME&#39;s.
MonitorElement * tMomentum
MonitorElement * KszeroMomentum
MonitorElement * numuMomentum
MonitorElement * genPtclNumber
other ME&#39;s
edm::InputTag hepmcCollection_
MonitorElement * nutaubarNumber
MonitorElement * gluNumber
MonitorElement * sNumber
MonitorElement * outVrtxStablePtclNumber
MonitorElement * KszeroNumber
MonitorElement * piminusMomentum
int weight
Definition: histoStyle.py:50
tuple status
Definition: ntuplemaker.py:245
double weight(const edm::Event &)
MonitorElement * numuNumber
MonitorElement * l0barMomentum
MonitorElement * DzeroMomentum
MonitorElement * DplusMomentum
MonitorElement * WminusNumber
MonitorElement * nutauMomentum
MonitorElement * nutauNumber
MonitorElement * ubarNumber
MonitorElement * bNumber
MonitorElement * bMomentum
Definition: Run.h:41
MonitorElement * l0Momentum
MonitorElement * BminusMomentum