/** * Example of photos usage. * Events are loaded from pre-generated set featuring Z0 -> tau+ tau- decays * and processed by photos. * * @author Tomasz Przedzinski * @date 17 July 2010 */ //HepMC header files #include "HepMC/IO_GenEvent.h" //PHOTOS header files #include "Photos/Photos.h" #include "Photos/PhotosHepMCEvent.h" #include "Photos/Log.h" using namespace std; 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<particles_size(); //cout << "BEFORE:"<print(); if(evtCountparticles_size(); if(buf==1) photonAdded++; else if(buf==2) twoAdded++; else if(buf>2) moreAdded++; //cout << "AFTER:"<print(); //clean up delete HepMCEvt; } // Print results cout.precision(2); cout.setf(ios::fixed); cout<