CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/Validation/EventGenerator/plugins/BasicHepMCValidation.cc

Go to the documentation of this file.
00001 /*class BasicHepMCValidation
00002  *  
00003  *  Class to fill dqm monitor elements from existing EDM file
00004  *
00005  *  $Date: 2010/07/02 13:34:23 $
00006  *  $Revision: 1.2 $
00007  */
00008  
00009 #include "Validation/EventGenerator/interface/BasicHepMCValidation.h"
00010 
00011 #include "CLHEP/Units/defs.h"
00012 #include "CLHEP/Units/PhysicalConstants.h"
00013 
00014 using namespace edm;
00015 
00016 BasicHepMCValidation::BasicHepMCValidation(const edm::ParameterSet& iPSet):  
00017   hepmcCollection_(iPSet.getParameter<edm::InputTag>("hepmcCollection"))
00018 {    
00019   dbe = 0;
00020   dbe = edm::Service<DQMStore>().operator->();
00021 }
00022 
00023 BasicHepMCValidation::~BasicHepMCValidation() {}
00024 
00025 void BasicHepMCValidation::beginJob()
00026 {
00027   if(dbe){
00029         dbe->setCurrentFolder("Generator/Particles");
00030     
00031     // Number of analyzed events
00032     nEvt = dbe->book1D("nEvt", "n analyzed Events", 1, 0., 1.);
00033         
00036         uNumber = dbe->book1D("uNumber", "No. u", 20, 0, 20);
00037         dNumber = dbe->book1D("dNumber", "No. d", 20, 0, 20);
00038         sNumber = dbe->book1D("sNumber", "No. s", 20, 0, 20);
00039     cNumber = dbe->book1D("cNumber", "No. c", 20, 0, 20);
00040         bNumber = dbe->book1D("bNumber", "No. b", 20, 0, 20);
00041         tNumber = dbe->book1D("tNumber", "No. t", 20, 0, 20);
00042         //
00043         ubarNumber = dbe->book1D("ubarNumber", "No. ubar", 20, 0, 20);
00044         dbarNumber = dbe->book1D("dbarNumber", "No. dbar", 20, 0, 20);
00045         sbarNumber = dbe->book1D("sbarNumber", "No. sbar", 20, 0, 20);
00046     cbarNumber = dbe->book1D("cbarNumber", "No. cbar", 20, 0, 20);
00047         bbarNumber = dbe->book1D("bbarNumber", "No. bbar", 20, 0, 20);
00048         tbarNumber = dbe->book1D("tbarNumber", "No. tbar", 20, 0, 20);
00049         //
00050         eminusNumber = dbe->book1D("eminusNumber", "No. e-", 20, 0, 20);
00051         nueNumber = dbe->book1D("nueNumber", "No. nu_e", 20, 0, 20);
00052         muminusNumber = dbe->book1D("muminusNumber", "No. mu-", 20, 0, 20);
00053         numuNumber = dbe->book1D("numuNumber", "No. nu_mu", 20, 0, 20);
00054         tauminusNumber = dbe->book1D("tauminusNumber", "No. tau-", 20, 0, 20);
00055         nutauNumber = dbe->book1D("nutauNumber", "No. nu_tau", 20, 0, 20);
00056         //
00057         eplusNumber = dbe->book1D("eplusNumber", "No. e+", 20, 0, 20);
00058         nuebarNumber = dbe->book1D("nuebarNumber", "No. nu_e_bar", 20, 0, 20);
00059         muplusNumber = dbe->book1D("muplusNumber", "No. mu+", 20, 0, 20);
00060         numubarNumber = dbe->book1D("numuNumber", "No. nu_mu_bar", 20, 0, 20);
00061         tauplusNumber = dbe->book1D("tauplusNumber", "No. tau+", 20, 0, 20);
00062         nutaubarNumber = dbe->book1D("nutauNumber", "No. nu_tau_bar", 20, 0, 20);
00063         //
00064         WplusNumber = dbe->book1D("WplusNumber", "No. W+", 20, 0, 20);
00065         WminusNumber = dbe->book1D("WminusNumber", "No. W-", 20, 0, 20);
00066         ZNumber = dbe->book1D("ZNumber", "No. Z", 20, 0, 20);
00067         gammaNumber = dbe->book1D("gammaNumber", "Log10(No. gamma)", 60, -1, 5); //Log
00068         gluNumber = dbe->book1D("gluonNumber", "Log10(No. gluons)", 60, -1, 5); //Log
00069         //
00070         piplusNumber = dbe->book1D("piplusNumber", "Log10(No. pi+)", 60, -1, 5); //Log
00071         piminusNumber = dbe->book1D("piminusNumber", "Log10(No. pi-)", 60, -1, 5); //Log
00072         pizeroNumber = dbe->book1D("pizeroNumber", "Log10(No. pi_0)", 60, -1, 5); //Log
00073         KplusNumber = dbe->book1D("KplusNumber", "No. K+", 100, 0, 100);
00074         KminusNumber = dbe->book1D("KminusNumber", "No. K-", 100, 0, 100);
00075         KlzeroNumber = dbe->book1D("KlzeroNumber", "No. K_l^0", 100, 0, 100);
00076         KszeroNumber = dbe->book1D("KszeroNumber", "No. K_s^0", 100, 0, 100);
00077         //
00078         pNumber = dbe->book1D("pNumber", "No. p", 100, 0, 100);
00079         pbarNumber = dbe->book1D("pbarNumber", "No. pbar", 100, 0, 100);
00080         nNumber = dbe->book1D("nNumber", "No. n", 100, 0, 100);
00081         nbarNumber = dbe->book1D("nbarNumber", "No. nbar", 100, 0, 100);
00082         l0Number = dbe->book1D("l0Number", "No. Lambda0", 100, 0, 100);
00083         l0barNumber = dbe->book1D("l0barNumber", "No. Lambda0bar", 100, 0, 100);
00084         //
00085         DplusNumber = dbe->book1D("DplusNumber", "No. D+", 20, 0, 20);
00086         DminusNumber = dbe->book1D("DminusNumber", "No. D-", 20, 0, 20);
00087         DzeroNumber = dbe->book1D("DzeroNumber", "No. D^0", 20, 0, 20);
00088         //
00089         BplusNumber = dbe->book1D("BplusNumber", "No. B+", 20, 0, 20);
00090         BminusNumber = dbe->book1D("BminusNumber", "No. B-", 20, 0, 20);
00091         BzeroNumber = dbe->book1D("BzeroNumber", "No. B^0", 20, 0, 20);
00092         BszeroNumber = dbe->book1D("BszeroNumber", "No. B^0_s", 20, 0, 20);
00093         //
00094         otherPtclNumber = dbe->book1D("otherPtclNumber", "Log10(No. other ptcls)", 60, -1, 5); //Log
00095 
00096         //Momentum 
00097         uMomentum = dbe->book1D("uMomentum", "Log10(p) u", 60, -2, 4);
00098         dMomentum = dbe->book1D("dMomentum", "Log10(p) d", 60, -2, 4);
00099         sMomentum = dbe->book1D("sMomentum", "Log10(p) s", 60, -2, 4);
00100     cMomentum = dbe->book1D("cMomentum", "Log10(p) c", 60, -2, 4);
00101         bMomentum = dbe->book1D("bMomentum", "Log10(p) b", 60, -2, 4);
00102         tMomentum = dbe->book1D("tMomentum", "Log10(p) t", 60, -2, 4);
00103         //
00104         ubarMomentum = dbe->book1D("ubarMomentum", "Log10(p) ubar", 60, -2, 4);
00105         dbarMomentum = dbe->book1D("dbarMomentum", "Log10(p) dbar", 60, -2, 4);
00106         sbarMomentum = dbe->book1D("sbarMomentum", "Log10(p) sbar", 60, -2, 4);
00107     cbarMomentum = dbe->book1D("cbarMomentum", "Log10(p) cbar", 60, -2, 4);
00108         bbarMomentum = dbe->book1D("bbarMomentum", "Log10(p) bbar", 60, -2, 4);
00109         tbarMomentum = dbe->book1D("tbarMomentum", "Log10(p) tbar", 60, -2, 4);
00110         //
00111         eminusMomentum = dbe->book1D("eminusMomentum", "Log10(p) e-", 60, -2, 4);
00112         nueMomentum = dbe->book1D("nueMomentum", "Log10(Momentum) nue", 60, -2, 4);
00113         muminusMomentum = dbe->book1D("muminusMomentum", "Log10(p) mu-", 60, -2, 4);
00114         numuMomentum = dbe->book1D("numuMomentum", "Log10(p) numu", 60, -2, 4);
00115         tauminusMomentum = dbe->book1D("tauminusMomentum", "Log10(p) tau-", 60, -2, 4);
00116         nutauMomentum = dbe->book1D("nutauMomentum", "Log10(p) nutau", 60, -2, 4);
00117         //
00118         eplusMomentum = dbe->book1D("eplusMomentum", "Log10(p) e+", 60, -2, 4);
00119         nuebarMomentum = dbe->book1D("nuebarMomentum", "Log10(p) nuebar", 60, -2, 4);
00120         muplusMomentum = dbe->book1D("muplusMomentum", "Log10(p) mu+", 60, -2, 4);
00121         numubarMomentum = dbe->book1D("numuMomentum", "Log10(p) numubar", 60, -2, 4);
00122         tauplusMomentum = dbe->book1D("tauplusMomentum", "Log10(p) tau+", 60, -2, 4);
00123         nutaubarMomentum = dbe->book1D("nutauMomentum", "Log10(p) nutaubar", 60, -2, 4);
00124         //
00125         gluMomentum = dbe->book1D("gluonMomentum", "Log10(p) gluons", 70, -3, 4);
00126         WplusMomentum = dbe->book1D("WplusMomentum", "Log10(p) W+", 60, -2, 4);
00127         WminusMomentum = dbe->book1D("WminusMomentum", "Log10(p) W-", 60, -2, 4);
00128         ZMomentum = dbe->book1D("ZMomentum", "Log10(p) Z", 60, -2, 4);
00129         gammaMomentum = dbe->book1D("gammaMomentum", "Log10(p) gamma", 70, -3, 4);
00130         //
00131         piplusMomentum = dbe->book1D("piplusMomentum", "Log10(p) pi+", 60, -2, 4);
00132         piminusMomentum = dbe->book1D("piminusMomentum", "Log10(p) pi-", 60, -2, 4);
00133         pizeroMomentum = dbe->book1D("pizeroMomentum", "Log10(p) pi_0", 60, -2, 4);
00134         KplusMomentum = dbe->book1D("KplusMomentum", "Log10(p) K+", 60, -2, 4);
00135         KminusMomentum = dbe->book1D("KminusMomentum", "Log10(p) K-", 60, -2, 4);
00136         KlzeroMomentum = dbe->book1D("KlzeroMomentum", "Log10(p) K_l^0", 60, -2, 4);
00137         KszeroMomentum = dbe->book1D("KszeroMomentum", "Log10(p) K_s^0", 60, -2, 4);
00138         //
00139         pMomentum = dbe->book1D("pMomentum", "Log10(p) p", 60, -2, 4);
00140         pbarMomentum = dbe->book1D("pbarMomentum", "Log10(p) pbar", 60, -2, 4);
00141         nMomentum = dbe->book1D("nMomentum", "Log10(p) n", 60, -2, 4);
00142         nbarMomentum = dbe->book1D("nbarMomentum", "Log10(p) nbar", 60, -2, 4);
00143         l0Momentum = dbe->book1D("l0Momentum", "Log10(p) Lambda0", 60, -2, 4);
00144         l0barMomentum = dbe->book1D("l0barMomentum", "Log10(p) Lambda0bar", 60, -2, 4);
00145         //
00146         DplusMomentum = dbe->book1D("DplusMomentum", "Log10(p) D+", 60, -2, 4);
00147         DminusMomentum = dbe->book1D("DminusMomentum", "Log10(p) D-", 60, -2, 4);
00148         DzeroMomentum = dbe->book1D("DzeroMomentum", "Log10(p) D^0", 60, -2, 4);
00149         //
00150         BplusMomentum = dbe->book1D("BplusMomentum", "Log10(p) B+", 60, -2, 4);
00151         BminusMomentum = dbe->book1D("BminusMomentum", "Log10(p) B-", 60, -2, 4);
00152         BzeroMomentum = dbe->book1D("BzeroMomentum", "Log10(p) B^0", 60, -2, 4);
00153         BszeroMomentum = dbe->book1D("BszeroMomentum", "Log10(p) B^0_s", 60, -2, 4);
00154         //
00155         otherPtclMomentum = dbe->book1D("otherPtclMomentum", "Log10(p) other ptcls", 60, -2, 4);
00156 
00158         genPtclNumber = dbe->book1D("genPtclNumber", "Log10(No. all particles)", 60, -1, 5); //Log
00159         genVrtxNumber = dbe->book1D("genVrtxNumber", "Log10(No. all vertexs)", 60, -1, 5); //Log
00160         //
00161         stablePtclNumber= dbe->book1D("stablePtclNumber", "Log10(No. stable particles)", 50, 0, 5); //Log
00162         stablePtclPhi = dbe->book1D("stablePtclPhi", "stable Ptcl Phi", 360, -180, 180);
00163         stablePtclEta = dbe->book1D("stablePtclEta", "stable Ptcl Eta (pseudo rapidity)", 220, -11, 11);
00164         stablePtclCharge = dbe->book1D("stablePtclCharge", "stablePtclCharge", 5, -2, 2);
00165         stableChaNumber= dbe->book1D("stableChaNumber", "Log10(No. stable charged particles)", 50, 0, 5); //Log
00166         stablePtclp = dbe->book1D("stablePtclp", "Log10(p) stable ptcl p", 80, -4, 4); //Log
00167         stablePtclpT = dbe->book1D("stablePtclpT", "Log10(pT) stable ptcl pT", 80, -4, 4); //Log
00168         outVrtxStablePtclNumber = dbe->book1D("outVrtxStablePtclNumber", "No. outgoing stable ptcls from vrtx", 10, 0, 10); 
00169         //
00170         outVrtxPtclNumber = dbe->book1D("outVrtxPtclNumber", "No. outgoing ptcls from vrtx", 30, 0, 30);
00171         vrtxZ = dbe->book1D("VrtxZ", "VrtxZ", 50 , -250, 250);
00172         vrtxRadius = dbe->book1D("vrtxRadius", "vrtxRadius", 50, 0, 50);
00173         //
00174         unknownPDTNumber = dbe->book1D("unknownPDTNumber", "Log10(No. unknown ptcls PDT)", 60, -1, 5); //Log
00175     genPtclStatus = dbe->book1D("genPtclStatus", "Status of genParticle", 200,0,200.);
00176         //
00177     Bjorken_x = dbe->book1D("Bjorken_x", "Bjorken_x", 1000, 0.0, 1.0);
00178   }
00179   return;
00180 }
00181 
00182 void BasicHepMCValidation::endJob(){return;}
00183 void BasicHepMCValidation::beginRun(const edm::Run& iRun,const edm::EventSetup& iSetup)
00184 {
00186   iSetup.getData( fPDGTable );
00187   return;
00188 }
00189 void BasicHepMCValidation::endRun(const edm::Run& iRun,const edm::EventSetup& iSetup){return;}
00190 void BasicHepMCValidation::analyze(const edm::Event& iEvent,const edm::EventSetup& iSetup)
00191 { 
00193   int uNum = 0; int dNum = 0; int sNum = 0; int cNum = 0; int bNum = 0; int tNum = 0;
00194   int ubarNum = 0; int dbarNum = 0; int sbarNum = 0; int cbarNum = 0; int bbarNum = 0; int tbarNum = 0;
00195   //
00196   int eminusNum = 0; int nueNum = 0; int muminusNum = 0; int numuNum = 0; int tauminusNum = 0; int nutauNum = 0;
00197   int eplusNum = 0; int nuebarNum = 0; int muplusNum = 0; int numubarNum = 0; int tauplusNum = 0; int nutaubarNum = 0;
00198   //
00199   int gluNum = 0; int WplusNum = 0; int WminusNum = 0; int ZNum = 0; int gammaNum = 0;
00200   //
00201   int piplusNum = 0; int piminusNum = 0; int pizeroNum = 0; int KplusNum = 0; int KminusNum = 0; int KlzeroNum = 0; int KszeroNum = 0;  
00202   //
00203   int pNum = 0; int pbarNum = 0; int nNum = 0; int nbarNum = 0; int l0Num = 0; int l0barNum = 0;
00204   //
00205   int DplusNum = 0; int DminusNum = 0; int DzeroNum = 0; int BplusNum = 0; int BminusNum = 0; int BzeroNum = 0; int BszeroNum = 0;
00206   //
00207   int outVrtxStablePtclNum = 0; int stablePtclNum = 0; int otherPtclNum = 0; int unknownPDTNum = 0; int stableChaNum = 0;
00208   //
00209   double bjorken = 0.;
00210 
00212   edm::Handle<HepMCProduct> evt;
00213   iEvent.getByLabel(hepmcCollection_, evt);
00214 
00215   //Get EVENT
00216   HepMC::GenEvent *myGenEvent = new HepMC::GenEvent(*(evt->GetEvent()));
00217 
00218   nEvt->Fill(0.5);
00219 
00220   genPtclNumber->Fill(log10(myGenEvent->particles_size()));     
00221   genVrtxNumber->Fill(log10(myGenEvent->vertices_size()));
00222 
00224   HepMC::PdfInfo *pdf = myGenEvent->pdf_info();    
00225   if(pdf){
00226     bjorken = ((pdf->x1())/((pdf->x1())+(pdf->x2())));
00227   }
00228   Bjorken_x->Fill(bjorken);
00229 
00230   //Looping through the VERTICES in the event
00231   HepMC::GenEvent::vertex_const_iterator vrtxBegin = myGenEvent->vertices_begin();
00232   HepMC::GenEvent::vertex_const_iterator vrtxEnd = myGenEvent->vertices_end();
00233   for(HepMC::GenEvent::vertex_const_iterator vrtxIt = vrtxBegin; vrtxIt!=vrtxEnd; ++vrtxIt)
00234     {
00236       HepMC::GenVertex *vrtx = *vrtxIt;
00237       outVrtxPtclNumber->Fill(vrtx->particles_out_size()); //std::cout << "all " << vrtx->particles_out_size() << '\n';
00238       vrtxZ->Fill(vrtx->point3d().z());
00239       vrtxRadius->Fill(vrtx->point3d().perp());
00240         
00242       HepMC::GenVertex::particles_out_const_iterator vrtxPtclBegin = vrtx->particles_out_const_begin();
00243       HepMC::GenVertex::particles_out_const_iterator vrtxPtclEnd = vrtx->particles_out_const_end();
00244       outVrtxStablePtclNum = 0;
00245       for(HepMC::GenVertex::particles_out_const_iterator vrtxPtclIt = vrtxPtclBegin; vrtxPtclIt != vrtxPtclEnd; ++vrtxPtclIt)
00246         {
00247           HepMC::GenParticle *vrtxPtcl = *vrtxPtclIt;
00248           if (vrtxPtcl->status() == 1){
00249             ++outVrtxStablePtclNum; //std::cout << "stable " << outVrtxStablePtclNum << '\n';
00250           }
00251         }
00252       outVrtxStablePtclNumber->Fill(outVrtxStablePtclNum);
00253     }//vertices
00254 
00255     
00257   HepMC::GenEvent::particle_const_iterator ptclBegin = myGenEvent->particles_begin();
00258   HepMC::GenEvent::particle_const_iterator ptclEnd = myGenEvent->particles_end();
00259   for(HepMC::GenEvent::particle_const_iterator ptclIt = ptclBegin; ptclIt!=ptclEnd; ++ptclIt)
00260     {
00261     
00263       HepMC::GenParticle *ptcl = *ptclIt;
00264       int Id = ptcl->pdg_id(); // std::cout << Id << '\n'; 
00265       float Log_p = log10( ptcl->momentum().rho() );
00266       double charge = 999.;     // for the charge it's needed a HepPDT method
00267       int status = ptcl->status();
00268       const HepPDT::ParticleData* PData = fPDGTable->particle(HepPDT::ParticleID(Id));
00269       if(PData==0) {
00270         //          std::cout << "Unknown id = " << Id << '\n';
00271             ++unknownPDTNum;
00272       }
00273       else
00274             charge = PData->charge();
00275 
00277       genPtclStatus->Fill((float)status);
00278 
00280       if(ptcl->status() == 1){
00281             ++stablePtclNum;
00282             stablePtclPhi->Fill(ptcl->momentum().phi()/CLHEP::degree); //std::cout << ptcl->polarization().phi() << '\n';
00283             stablePtclEta->Fill(ptcl->momentum().pseudoRapidity());
00284             stablePtclCharge->Fill(charge); // std::cout << ptclData.charge() << '\n';
00285             stablePtclp->Fill(Log_p);
00286             stablePtclpT->Fill(log10(ptcl->momentum().perp()));
00287         if (charge != 0. && charge != 999.) ++stableChaNum;
00288       }
00289         
00291       switch(abs(Id)){
00292 
00293       case 1 : {
00294                 if(Id > 0) {
00295           ++dNum; dMomentum->Fill(Log_p);}
00296                 else{
00297           ++dbarNum; dbarMomentum->Fill(Log_p);}
00298       }
00299                 break;
00300                 //
00301       case 2 : {
00302                 if(Id > 0) {
00303           ++uNum; uMomentum->Fill(Log_p);}
00304                 else{
00305           ++ubarNum; ubarMomentum->Fill(Log_p);}
00306       }
00307                 break;
00308                 //
00309       case 3 :  {
00310                 if(Id > 0) {
00311           ++sNum; sMomentum->Fill(Log_p);}
00312                 else{
00313           ++sbarNum; sbarMomentum->Fill(Log_p);}
00314       }
00315                 break;
00316                 //
00317       case 4 : {
00318                 if(Id > 0) {
00319           ++cNum; cMomentum->Fill(Log_p);}
00320                 else{
00321           ++cbarNum; cbarMomentum->Fill(Log_p);}
00322       }
00323                 break;
00324                 //
00325       case 5 : {
00326                 if(Id > 0) {
00327           ++bNum; bMomentum->Fill(Log_p);}
00328                 else{
00329           ++bbarNum; bbarMomentum->Fill(Log_p);}
00330       }
00331                 break;
00332                 //
00333       case 6 : {
00334                 if(Id > 0) {
00335           ++tNum; tMomentum->Fill(Log_p);}
00336                 else{
00337           ++tbarNum; tbarMomentum->Fill(Log_p);}
00338       }
00339                 break;
00340                 //
00341       case 11 : {
00342                 if(Id > 0) {
00343           ++eminusNum; eminusMomentum->Fill(Log_p);}
00344                 else{
00345           ++eplusNum; eplusMomentum->Fill(Log_p);}
00346       }
00347                 break;
00348                 //
00349       case 12 : {
00350                 if(Id > 0) {
00351           ++nueNum; nueMomentum->Fill(Log_p);}
00352                 else{
00353           ++nuebarNum; nuebarMomentum->Fill(Log_p);}
00354       }
00355                 break;
00356                 //
00357       case 13 : {
00358                 if(Id > 0) {
00359           ++muminusNum; muminusMomentum->Fill(Log_p);}
00360                 else{
00361           ++muplusNum; muplusMomentum->Fill(Log_p);}
00362       }
00363                 break;
00364                 //
00365       case 14 : {
00366                 if(Id > 0) {
00367           ++numuNum; numuMomentum->Fill(Log_p);}
00368                 else{
00369           ++numubarNum; numubarMomentum->Fill(Log_p);}
00370       }
00371                 break;
00372                 //
00373       case 15 : {
00374                 if(Id > 0) {
00375           ++tauminusNum; tauminusMomentum->Fill(Log_p);}
00376                 else{
00377           ++tauplusNum; tauplusMomentum->Fill(Log_p);}
00378       }
00379                 break;
00380                 //
00381       case 16 : {
00382                 if(Id > 0) {
00383           ++nutauNum; nutauMomentum->Fill(Log_p);}
00384                 else{
00385           ++nutaubarNum; nutaubarMomentum->Fill(Log_p);}
00386       }
00387                 break;
00388                 //
00389                 //
00390       case 21 : {
00391                 ++gluNum; gluMomentum->Fill(Log_p); 
00392       }
00393                 break;
00394                 //
00395       case 22 : {
00396                 ++gammaNum; gammaMomentum->Fill(Log_p);
00397       }
00398                 break;
00399                 //
00400       case 23 : {
00401                 ++ZNum; ZMomentum->Fill(Log_p);
00402       }
00403                 break;
00404       case 24 : {
00405                 if(Id > 0) {
00406           ++WplusNum; WplusMomentum->Fill(Log_p);}
00407                 else{
00408           ++WminusNum; WminusMomentum->Fill(Log_p);}
00409       }
00410                 break;
00411                 //
00412                 //
00413       case 211 : {
00414                 if(Id > 0) {
00415           ++piplusNum; piplusMomentum->Fill(Log_p);}
00416                 else{
00417           ++piminusNum; piminusMomentum->Fill(Log_p);}
00418       }
00419                 break;
00420                 //
00421       case 111 : {
00422                 ++pizeroNum; pizeroMomentum->Fill(Log_p);
00423       }
00424                 break;
00425                 //
00426       case 321 : {
00427                 if(Id > 0) {
00428           ++KplusNum; KplusMomentum->Fill(Log_p);}
00429                 else{
00430           ++KminusNum; KminusMomentum->Fill(Log_p);}
00431       }
00432                 break;
00433                 //
00434       case 130 : {
00435         ++KlzeroNum; KlzeroMomentum->Fill(Log_p);
00436       }
00437                 break;
00438                 //
00439       case 310 : {
00440                 ++KszeroNum; KszeroMomentum->Fill(Log_p);
00441       }
00442                 break;
00443                 //
00444                 //
00445       case 2212 : {
00446                 if(Id > 0) {
00447           ++pNum; pMomentum->Fill(Log_p);}
00448                 else{
00449           ++pbarNum; pbarMomentum->Fill(Log_p);}
00450       }
00451                 break;
00452                 //
00453       case 2112 : {
00454                 if(Id > 0) {
00455           ++nNum; nMomentum->Fill(Log_p);}
00456                 else{
00457           ++nbarNum; nbarMomentum->Fill(Log_p);}
00458       }
00459                 break;
00460                 //
00461                 //
00462       case 3122 : {
00463                 if(Id > 0) {
00464           ++l0Num; l0Momentum->Fill(Log_p);}
00465                 else{
00466           ++l0barNum; l0barMomentum->Fill(Log_p);}
00467       }
00468         break;
00469         //
00470         //
00471       case 411 : {
00472                 if(Id > 0) {
00473           ++DplusNum; DplusMomentum->Fill(Log_p);}
00474                 else{
00475           ++DminusNum; DminusMomentum->Fill(Log_p);}
00476       }
00477                 break;
00478                 //
00479       case 421 : {
00480                 ++DzeroNum; DzeroMomentum->Fill(Log_p);
00481       }
00482                 break;
00483                 //
00484       case 521 : {
00485                 if(Id > 0) {
00486           ++BplusNum; BplusMomentum->Fill(Log_p);}
00487                 else{
00488           ++BminusNum; BminusMomentum->Fill(Log_p);}
00489       }
00490                 break;
00491                 //
00492       case 511 : {
00493         ++BzeroNum; BzeroMomentum->Fill(Log_p);
00494       }
00495                 break;
00496                 //
00497       case 531 : {
00498                 ++BszeroNum; BszeroMomentum->Fill(Log_p);
00499       }
00500                 break;
00501                 //
00502       default : {
00503                 ++otherPtclNum; otherPtclMomentum->Fill(Log_p);
00504       }
00505       }//switch
00506       //        if( 0 < Id && 100 > Id) ++part_counter[Id];
00507     }//event particles
00508 
00509 
00511   stablePtclNumber->Fill(log10(stablePtclNum+0.1)); 
00512   stableChaNumber->Fill(log10(stableChaNum+0.1)); 
00513   otherPtclNumber->Fill(log10(otherPtclNum+0.1));
00514   unknownPDTNumber->Fill(log10(unknownPDTNum+0.1));
00515   //
00516   dNumber->Fill(dNum); uNumber->Fill(uNum); sNumber->Fill(sNum); cNumber->Fill(cNum); bNumber->Fill(bNum); tNumber->Fill(tNum);  
00517   dbarNumber->Fill(dbarNum); ubarNumber->Fill(ubarNum); sbarNumber->Fill(sbarNum); cbarNumber->Fill(cbarNum); bbarNumber->Fill(bbarNum); tbarNumber->Fill(tbarNum);  
00518   //
00519   eminusNumber->Fill(eminusNum); nueNumber->Fill(nueNum); muminusNumber->Fill(muminusNum); numuNumber->Fill(numuNum); tauminusNumber->Fill(tauminusNum); nutauNumber->Fill(nutauNum);  
00520   eplusNumber->Fill(eplusNum); nuebarNumber->Fill(nuebarNum); muplusNumber->Fill(muplusNum); numubarNumber->Fill(numubarNum); tauplusNumber->Fill(tauplusNum); nutaubarNumber->Fill(nutaubarNum);  
00521   //
00522   ZNumber->Fill(ZNum); WminusNumber->Fill(WminusNum); WplusNumber->Fill(WplusNum); 
00523   gammaNumber->Fill(log10(gammaNum+0.1));
00524   gluNumber->Fill(log10(gluNum+0.1));
00525   //
00526   piplusNumber->Fill(log10(piplusNum+0.1));
00527   piminusNumber->Fill(log10(piminusNum+0.1));
00528   pizeroNumber->Fill(log10(pizeroNum+0.1));
00529   KplusNumber->Fill(KplusNum); KminusNumber->Fill(KminusNum); KlzeroNumber->Fill(KlzeroNum); KszeroNumber->Fill(KszeroNum); 
00530   //
00531   pNumber->Fill(pNum); pbarNumber->Fill(pbarNum); nNumber->Fill(nNum); nbarNumber->Fill(nbarNum); l0Number->Fill(l0Num); l0barNumber->Fill(l0barNum);    
00532   //
00533   DplusNumber->Fill(DplusNum); DminusNumber->Fill(DminusNum); DzeroNumber->Fill(DzeroNum); BplusNumber->Fill(BplusNum); BminusNumber->Fill(BminusNum); BzeroNumber->Fill(BzeroNum); BszeroNumber->Fill(BszeroNum); 
00534 
00535   delete myGenEvent;
00536 }//analyze