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