11 #include "HepMC/IO_GenEvent.h"
14 #include "Photos/Photos.h"
15 #include "Photos/PhotosHepMCEvent.h"
16 #include "Photos/Log.h"
19 using namespace Photospp;
31 double px=0.0,py=0.0,pz=0.0,e=0.0;
36 if( (*p)->status() == 1 )
47 cout.setf(ios_base::floatfield);
48 cout<<endl<<
"Vector Sum: "<<px<<
" "<<py<<
" "<<pz<<
" "<<e<<endl;
56 Photos::setInfraredCutOff(0.001/200);
58 int photonAdded=0,twoAdded=0,moreAdded=0,evtCount=0;
64 file.fill_next_event(HepMCEvt);
65 if(file.rdstate())
break;
72 if(evtCount<EventsToCheck)
75 cout<<
"Momentum conservation chceck BEFORE/AFTER Photos"<<endl;
76 checkMomentumConservationInEvent(HepMCEvt);
83 if(evtCount<EventsToCheck)
85 checkMomentumConservationInEvent(HepMCEvt);
89 if(buf==1) photonAdded++;
90 else if(buf==2) twoAdded++;
91 else if(buf>2) moreAdded++;
102 cout.setf(ios::fixed);
106 cout<<
"Something went wrong with the input file: photos_standalone_example.dat"<<endl;
107 cout<<
"No events were processed."<<endl<<endl;
110 cout<<
"Summary (whole event processing):"<<endl;
111 cout<<evtCount <<
"\tevents processed"<<endl;
112 cout<<photonAdded<<
"\ttimes one photon added to the event \t("<<(photonAdded*100./evtCount)<<
"%)"<<endl;
113 cout<<twoAdded <<
"\ttimes two photons added to the event \t("<<(twoAdded*100./evtCount)<<
"%)"<<endl;
114 cout<<moreAdded <<
"\ttimes more than two photons added to the event\t("<<(moreAdded*100./evtCount)<<
"%)"<<endl<<endl;
115 cout<<
"(Contrary to results from MC-Tester, these values are technical and infrared unstable)"<<endl<<endl;
int particles_size() const
how many particle barcodes exist?
particle_const_iterator particles_begin() const
begin particle iteration
double e() const
return E
double px() const
return px
The GenEvent class is the core of HepMC.
double pz() const
return pz
IO_GenEvent also deals with HeavyIon and PdfInfo.
particle_const_iterator particles_end() const
end particle iteration
FourVector is a simple representation of a physics 4 vector.
double py() const
return py