/** * Example of use of processParticle routine. * Pythia events are generated and photos used on first tau+ found. * * @author Tomasz Przedzinski * @date 17 July 2010 */ //pythia header files #include "Pythia.h" #include "HepMCInterface.h" //PHOTOS header files #include "Photos/Photos.h" #include "Photos/PhotosHepMCParticle.h" #include "Photos/Log.h" using namespace std; using namespace Pythia8; using namespace Photospp; int EventsToCheck=20; // elementary test of HepMC typically executed before // detector simulation based on http://home.fnal.gov/~mrenna/HCPSS/HCPSShepmc.html // similar test was performed in Fortran // we perform it before and after Photos (for the first several events) void checkMomentumConservationInEvent(HepMC::GenEvent *evt) { //cout<<"List of stable particles: "<particles_begin(); p != evt->particles_end(); ++p ) { if( (*p)->status() == 1 ) { HepMC::FourVector m = (*p)->momentum(); px+=m.px(); py+=m.py(); pz+=m.pz(); e +=m.e(); //(*p)->print(); } } cout.precision(6); cout.setf(ios_base::floatfield); cout<1) NumberOfEvents=atoi(argv[1]); int photonAdded=0,twoAdded=0,moreAdded=0,tauCount=0; // Begin event loop. Generate event. for (int iEvent = 0; iEvent < NumberOfEvents; ++iEvent) { if(iEvent%(NumberOfEvents/10)==0) Log::Info()<vertices_begin();i!=HepMCEvt->vertices_end();i++) { for(HepMC::GenVertex::particles_in_const_iterator p=(*i)->particles_in_const_begin();p!=(*i)->particles_in_const_end(); p++) { if((*p)->pdg_id()==15) tau=*p; break; } if(tau) break; } if(tau) { tauCount++; int buf = -HepMCEvt->particles_size(); // Call photos Photos::processParticle( new PhotosHepMCParticle(tau) ); buf+=HepMCEvt->particles_size(); if(buf==1) photonAdded++; else if(buf==2) twoAdded++; else if(buf>2) moreAdded++; } if(iEvent"<