10 #include "Pythia8/Pythia.h"
11 #include "Pythia8Plugins/HepMC2.h"
15 #include "HepMCEvent.H"
19 #include "Photos/Photos.h"
20 #include "Photos/PhotosHepMCEvent.h"
21 #include "Photos/Log.h"
24 #include "Tauola/Tauola.h"
25 #include "Tauola/TauolaHepMCEvent.h"
28 using namespace Pythia8;
29 using namespace Photospp;
30 using namespace Tauolapp;
32 unsigned long NumberOfEvents = 10000;
33 unsigned int EventsToCheck=20;
43 double px=0.0,py=0.0,pz=0.0,e=0.0;
48 if( (*p)->status() == 1 )
59 cout.setf(ios_base::floatfield);
60 cout<<endl<<
"Vector Sum: "<<px<<
" "<<py<<
" "<<pz<<
" "<<e<<endl;
63 int main(
int argc,
char **argv)
69 Event&
event = pythia.event;
71 pythia.readFile(
"tauola_photos_pythia_example.conf");
78 Photos::setInfraredCutOff(0.01/91.187);
83 cout.setf(ios::fixed);
116 for (
unsigned long iEvent = 0; iEvent < NumberOfEvents; ++iEvent)
118 if(iEvent%1000==0) Log::Info()<<
"Event: "<<iEvent<<
"\t("<<iEvent*(100./NumberOfEvents)<<
"%)"<<endl;
119 if(!pythia.next())
continue;
123 ToHepMC.fill_next_event(event, HepMCEvt);
135 if(iEvent<EventsToCheck)
138 cout<<
"Momentum conservation chceck BEFORE/AFTER Photos"<<endl;
139 checkMomentumConservationInEvent(HepMCEvt);
146 if(iEvent<EventsToCheck)
148 checkMomentumConservationInEvent(HepMCEvt);
152 HepMCEvent temp_event(*HepMCEvt,
false);
153 MC_Analyze(&temp_event);
156 if(iEvent>=NumberOfEvents-5)
158 Log::RedirectOutput(Log::Info());
168 Log::RedirectOutput(Log::Info());
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
void print(std::ostream &ostr=std::cout) const
dumps to ostr
particle_const_iterator particles_end() const
end particle iteration
FourVector is a simple representation of a physics 4 vector.
double py() const
return py