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"
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  DQMHelper dqm(&i); i.setCurrentFolder("Generator/Particles");
31 
32  // Number of analyzed events
33  nEvt = dqm.book1dHisto("nEvt", "n analyzed Events", 1, 0., 1.);
34 
37  uNumber = dqm.book1dHisto("uNumber", "No. u", 20, 0, 20);
38  dNumber = dqm.book1dHisto("dNumber", "No. d", 20, 0, 20);
39  sNumber = dqm.book1dHisto("sNumber", "No. s", 20, 0, 20);
40  cNumber = dqm.book1dHisto("cNumber", "No. c", 20, 0, 20);
41  bNumber = dqm.book1dHisto("bNumber", "No. b", 20, 0, 20);
42  tNumber = dqm.book1dHisto("tNumber", "No. t", 20, 0, 20);
43  //
44  ubarNumber = dqm.book1dHisto("ubarNumber", "No. ubar", 20, 0, 20);
45  dbarNumber = dqm.book1dHisto("dbarNumber", "No. dbar", 20, 0, 20);
46  sbarNumber = dqm.book1dHisto("sbarNumber", "No. sbar", 20, 0, 20);
47  cbarNumber = dqm.book1dHisto("cbarNumber", "No. cbar", 20, 0, 20);
48  bbarNumber = dqm.book1dHisto("bbarNumber", "No. bbar", 20, 0, 20);
49  tbarNumber = dqm.book1dHisto("tbarNumber", "No. tbar", 20, 0, 20);
50  //
51  eminusNumber = dqm.book1dHisto("eminusNumber", "No. e-", 20, 0, 20);
52  nueNumber = dqm.book1dHisto("nueNumber", "No. nu_e", 20, 0, 20);
53  muminusNumber = dqm.book1dHisto("muminusNumber", "No. mu-", 20, 0, 20);
54  numuNumber = dqm.book1dHisto("numuNumber", "No. nu_mu", 20, 0, 20);
55  tauminusNumber = dqm.book1dHisto("tauminusNumber", "No. tau-", 20, 0, 20);
56  nutauNumber = dqm.book1dHisto("nutauNumber", "No. nu_tau", 20, 0, 20);
57  //
58  eplusNumber = dqm.book1dHisto("eplusNumber", "No. e+", 20, 0, 20);
59  nuebarNumber = dqm.book1dHisto("nuebarNumber", "No. nu_e_bar", 20, 0, 20);
60  muplusNumber = dqm.book1dHisto("muplusNumber", "No. mu+", 20, 0, 20);
61  numubarNumber = dqm.book1dHisto("numubarNumber", "No. nu_mu_bar", 20, 0, 20);
62  tauplusNumber = dqm.book1dHisto("tauplusNumber", "No. tau+", 20, 0, 20);
63  nutaubarNumber = dqm.book1dHisto("nutaubarNumber", "No. nu_tau_bar", 20, 0, 20);
64  //
65  WplusNumber = dqm.book1dHisto("WplusNumber", "No. W+", 20, 0, 20);
66  WminusNumber = dqm.book1dHisto("WminusNumber", "No. W-", 20, 0, 20);
67  ZNumber = dqm.book1dHisto("ZNumber", "No. Z", 20, 0, 20);
68  gammaNumber = dqm.book1dHisto("gammaNumber", "Log10(No. gamma)", 60, -1, 5); //Log
69  gluNumber = dqm.book1dHisto("gluonNumber", "Log10(No. gluons)", 60, -1, 5); //Log
70  //
71  piplusNumber = dqm.book1dHisto("piplusNumber", "Log10(No. pi+)", 60, -1, 5); //Log
72  piminusNumber = dqm.book1dHisto("piminusNumber", "Log10(No. pi-)", 60, -1, 5); //Log
73  pizeroNumber = dqm.book1dHisto("pizeroNumber", "Log10(No. pi_0)", 60, -1, 5); //Log
74  KplusNumber = dqm.book1dHisto("KplusNumber", "No. K+", 100, 0, 100);
75  KminusNumber = dqm.book1dHisto("KminusNumber", "No. K-", 100, 0, 100);
76  KlzeroNumber = dqm.book1dHisto("KlzeroNumber", "No. K_l^0", 100, 0, 100);
77  KszeroNumber = dqm.book1dHisto("KszeroNumber", "No. K_s^0", 100, 0, 100);
78  //
79  pNumber = dqm.book1dHisto("pNumber", "No. p", 100, 0, 100);
80  pbarNumber = dqm.book1dHisto("pbarNumber", "No. pbar", 100, 0, 100);
81  nNumber = dqm.book1dHisto("nNumber", "No. n", 100, 0, 100);
82  nbarNumber = dqm.book1dHisto("nbarNumber", "No. nbar", 100, 0, 100);
83  l0Number = dqm.book1dHisto("l0Number", "No. Lambda0", 100, 0, 100);
84  l0barNumber = dqm.book1dHisto("l0barNumber", "No. Lambda0bar", 100, 0, 100);
85  //
86  DplusNumber = dqm.book1dHisto("DplusNumber", "No. D+", 20, 0, 20);
87  DminusNumber = dqm.book1dHisto("DminusNumber", "No. D-", 20, 0, 20);
88  DzeroNumber = dqm.book1dHisto("DzeroNumber", "No. D^0", 20, 0, 20);
89  //
90  BplusNumber = dqm.book1dHisto("BplusNumber", "No. B+", 20, 0, 20);
91  BminusNumber = dqm.book1dHisto("BminusNumber", "No. B-", 20, 0, 20);
92  BzeroNumber = dqm.book1dHisto("BzeroNumber", "No. B^0", 20, 0, 20);
93  BszeroNumber = dqm.book1dHisto("BszeroNumber", "No. B^0_s", 20, 0, 20);
94  //
95  otherPtclNumber = dqm.book1dHisto("otherPtclNumber", "Log10(No. other ptcls)", 60, -1, 5); //Log
96 
97  //Momentum
98  uMomentum = dqm.book1dHisto("uMomentum", "Log10(p) u", 60, -2, 4);
99  dMomentum = dqm.book1dHisto("dMomentum", "Log10(p) d", 60, -2, 4);
100  sMomentum = dqm.book1dHisto("sMomentum", "Log10(p) s", 60, -2, 4);
101  cMomentum = dqm.book1dHisto("cMomentum", "Log10(p) c", 60, -2, 4);
102  bMomentum = dqm.book1dHisto("bMomentum", "Log10(p) b", 60, -2, 4);
103  tMomentum = dqm.book1dHisto("tMomentum", "Log10(p) t", 60, -2, 4);
104  //
105  ubarMomentum = dqm.book1dHisto("ubarMomentum", "Log10(p) ubar", 60, -2, 4);
106  dbarMomentum = dqm.book1dHisto("dbarMomentum", "Log10(p) dbar", 60, -2, 4);
107  sbarMomentum = dqm.book1dHisto("sbarMomentum", "Log10(p) sbar", 60, -2, 4);
108  cbarMomentum = dqm.book1dHisto("cbarMomentum", "Log10(p) cbar", 60, -2, 4);
109  bbarMomentum = dqm.book1dHisto("bbarMomentum", "Log10(p) bbar", 60, -2, 4);
110  tbarMomentum = dqm.book1dHisto("tbarMomentum", "Log10(p) tbar", 60, -2, 4);
111  //
112  eminusMomentum = dqm.book1dHisto("eminusMomentum", "Log10(p) e-", 60, -2, 4);
113  nueMomentum = dqm.book1dHisto("nueMomentum", "Log10(Momentum) nue", 60, -2, 4);
114  muminusMomentum = dqm.book1dHisto("muminusMomentum", "Log10(p) mu-", 60, -2, 4);
115  numuMomentum = dqm.book1dHisto("numuMomentum", "Log10(p) numu", 60, -2, 4);
116  tauminusMomentum = dqm.book1dHisto("tauminusMomentum", "Log10(p) tau-", 60, -2, 4);
117  nutauMomentum = dqm.book1dHisto("nutauMomentum", "Log10(p) nutau", 60, -2, 4);
118  //
119  eplusMomentum = dqm.book1dHisto("eplusMomentum", "Log10(p) e+", 60, -2, 4);
120  nuebarMomentum = dqm.book1dHisto("nuebarMomentum", "Log10(p) nuebar", 60, -2, 4);
121  muplusMomentum = dqm.book1dHisto("muplusMomentum", "Log10(p) mu+", 60, -2, 4);
122  numubarMomentum = dqm.book1dHisto("numubarMomentum", "Log10(p) numubar", 60, -2, 4);
123  tauplusMomentum = dqm.book1dHisto("tauplusMomentum", "Log10(p) tau+", 60, -2, 4);
124  nutaubarMomentum = dqm.book1dHisto("nutaubarMomentum", "Log10(p) nutaubar", 60, -2, 4);
125  //
126  gluMomentum = dqm.book1dHisto("gluonMomentum", "Log10(p) gluons", 70, -3, 4);
127  WplusMomentum = dqm.book1dHisto("WplusMomentum", "Log10(p) W+", 60, -2, 4);
128  WminusMomentum = dqm.book1dHisto("WminusMomentum", "Log10(p) W-", 60, -2, 4);
129  ZMomentum = dqm.book1dHisto("ZMomentum", "Log10(p) Z", 60, -2, 4);
130  gammaMomentum = dqm.book1dHisto("gammaMomentum", "Log10(p) gamma", 70, -3, 4);
131  //
132  piplusMomentum = dqm.book1dHisto("piplusMomentum", "Log10(p) pi+", 60, -2, 4);
133  piminusMomentum = dqm.book1dHisto("piminusMomentum", "Log10(p) pi-", 60, -2, 4);
134  pizeroMomentum = dqm.book1dHisto("pizeroMomentum", "Log10(p) pi_0", 60, -2, 4);
135  KplusMomentum = dqm.book1dHisto("KplusMomentum", "Log10(p) K+", 60, -2, 4);
136  KminusMomentum = dqm.book1dHisto("KminusMomentum", "Log10(p) K-", 60, -2, 4);
137  KlzeroMomentum = dqm.book1dHisto("KlzeroMomentum", "Log10(p) K_l^0", 60, -2, 4);
138  KszeroMomentum = dqm.book1dHisto("KszeroMomentum", "Log10(p) K_s^0", 60, -2, 4);
139  //
140  pMomentum = dqm.book1dHisto("pMomentum", "Log10(p) p", 60, -2, 4);
141  pbarMomentum = dqm.book1dHisto("pbarMomentum", "Log10(p) pbar", 60, -2, 4);
142  nMomentum = dqm.book1dHisto("nMomentum", "Log10(p) n", 60, -2, 4);
143  nbarMomentum = dqm.book1dHisto("nbarMomentum", "Log10(p) nbar", 60, -2, 4);
144  l0Momentum = dqm.book1dHisto("l0Momentum", "Log10(p) Lambda0", 60, -2, 4);
145  l0barMomentum = dqm.book1dHisto("l0barMomentum", "Log10(p) Lambda0bar", 60, -2, 4);
146  //
147  DplusMomentum = dqm.book1dHisto("DplusMomentum", "Log10(p) D+", 60, -2, 4);
148  DminusMomentum = dqm.book1dHisto("DminusMomentum", "Log10(p) D-", 60, -2, 4);
149  DzeroMomentum = dqm.book1dHisto("DzeroMomentum", "Log10(p) D^0", 60, -2, 4);
150  //
151  BplusMomentum = dqm.book1dHisto("BplusMomentum", "Log10(p) B+", 60, -2, 4);
152  BminusMomentum = dqm.book1dHisto("BminusMomentum", "Log10(p) B-", 60, -2, 4);
153  BzeroMomentum = dqm.book1dHisto("BzeroMomentum", "Log10(p) B^0", 60, -2, 4);
154  BszeroMomentum = dqm.book1dHisto("BszeroMomentum", "Log10(p) B^0_s", 60, -2, 4);
155  //
156  otherPtclMomentum = dqm.book1dHisto("otherPtclMomentum", "Log10(p) other ptcls", 60, -2, 4);
157 
159  genPtclNumber = dqm.book1dHisto("genPtclNumber", "Log10(No. all particles)", 60, -1, 5); //Log
160  genVrtxNumber = dqm.book1dHisto("genVrtxNumber", "Log10(No. all vertexs)", 60, -1, 5); //Log
161  //
162  stablePtclNumber= dqm.book1dHisto("stablePtclNumber", "Log10(No. stable particles)", 50, 0, 5); //Log
163  stablePtclPhi = dqm.book1dHisto("stablePtclPhi", "stable Ptcl Phi", 360, -180, 180);
164  stablePtclEta = dqm.book1dHisto("stablePtclEta", "stable Ptcl Eta (pseudo rapidity)", 220, -11, 11);
165  stablePtclCharge = dqm.book1dHisto("stablePtclCharge", "stablePtclCharge", 5, -2, 2);
166  stableChaNumber= dqm.book1dHisto("stableChaNumber", "Log10(No. stable charged particles)", 50, 0, 5); //Log
167  stablePtclp = dqm.book1dHisto("stablePtclp", "Log10(p) stable ptcl p", 80, -4, 4); //Log
168  stablePtclpT = dqm.book1dHisto("stablePtclpT", "Log10(pT) stable ptcl pT", 80, -4, 4); //Log
169  partonNumber = dqm.book1dHisto("partonNumber", "number of partons", 100, 0, 100);
170  partonpT = dqm.book1dHisto("partonpT", "Log10(pT) parton pT", 80, -4, 4); //Log
171  outVrtxStablePtclNumber = dqm.book1dHisto("outVrtxStablePtclNumber", "No. outgoing stable ptcls from vrtx", 10, 0, 10);
172  //
173  outVrtxPtclNumber = dqm.book1dHisto("outVrtxPtclNumber", "No. outgoing ptcls from vrtx", 30, 0, 30);
174  vrtxZ = dqm.book1dHisto("VrtxZ", "VrtxZ", 50 , -250, 250);
175  vrtxRadius = dqm.book1dHisto("vrtxRadius", "vrtxRadius", 50, 0, 50);
176  //
177  unknownPDTNumber = dqm.book1dHisto("unknownPDTNumber", "Log10(No. unknown ptcls PDT)", 60, -1, 5); //Log
178  genPtclStatus = dqm.book1dHisto("genPtclStatus", "Status of genParticle", 200,0,200.);
179  //
180  Bjorken_x = dqm.book1dHisto("Bjorken_x", "Bjorken_x", 1000, 0.0, 1.0);
181  //
182  status1ShortLived = dqm.book1dHisto("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 = dqm.book1dHisto("DeltaEcms1","deviation from nominal Ecms", 200,-1., 1.);
196  DeltaPx = dqm.book1dHisto("DeltaPx1","deviation from nominal Px", 200,-1., 1.);
197  DeltaPy = dqm.book1dHisto("DeltaPy1","deviation from nominal Py", 200,-1., 1.);
198  DeltaPz = dqm.book1dHisto("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:457
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
MonitorElement * gluMomentum
MonitorElement * gammaMomentum
void getData(T &iHolder) const
Definition: EventSetup.h:78
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
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 * book1dHisto(const std::string &name, const std::string &title, int n, double xmin, double xmax)
Definition: DQMHelper.cc:12
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