10 #include "Pythia8/Pythia.h"
11 #include "Pythia8Plugins/HepMC2.h"
15 #include "HepMCEvent.H"
19 #include "Photos/Photos.h"
20 #include "Photos/forZ-MEc.h"
21 #include "Photos/PhotosHepMCEvent.h"
22 #include "Photos/Log.h"
25 #include "Tauola/Tauola.h"
26 #include "Tauola/TauolaHepMCEvent.h"
29 using namespace Pythia8;
30 using namespace Photospp;
31 using namespace Tauolapp;
33 unsigned long NumberOfEvents = 10000;
34 unsigned int EventsToCheck=20;
40 void checkMomentumConservationInEvent(HepMC::GenEvent *evt)
44 double px=0.0,py=0.0,pz=0.0,e=0.0;
46 for ( HepMC::GenEvent::particle_const_iterator p = evt->particles_begin();
47 p != evt->particles_end(); ++p )
49 if( (*p)->status() == 1 )
51 HepMC::FourVector m = (*p)->momentum();
60 cout.setf(ios_base::scientific, ios_base::floatfield);
61 cout<<endl<<
"Vector Sum: "<<px<<
" "<<py<<
" "<<pz<<
" "<<e<<endl;
66 double exampleAnmalousCouplingsZNLO(
double qp[4],
double qm[4],
double ph[4],
double pp[4],
double pm[4],
int IDE,
int IDF)
71 int main(
int argc,
char **argv)
73 HepMC::Pythia8ToHepMC ToHepMC;
77 Event&
event = pythia.event;
79 pythia.readFile(
"tauola_photos_pythia_example.conf");
86 Photos::setInfraredCutOff(0.01/91.187);
91 cout.setf(ios_base::fixed, ios_base::floatfield);
128 for (
unsigned long iEvent = 0; iEvent < NumberOfEvents; ++iEvent)
130 if(iEvent%1000==0) Log::Info()<<
"Event: "<<iEvent<<
"\t("<<iEvent*(100./NumberOfEvents)<<
"%)"<<endl;
131 if(!pythia.next())
continue;
134 HepMC::GenEvent * HepMCEvt =
new HepMC::GenEvent();
135 ToHepMC.fill_next_event(event, HepMCEvt);
138 TauolaHepMCEvent * t_event =
new TauolaHepMCEvent(HepMCEvt);
142 t_event->decayTaus();
147 if(iEvent<EventsToCheck)
150 cout<<
"Momentum conservation chceck BEFORE/AFTER Photos"<<endl;
151 checkMomentumConservationInEvent(HepMCEvt);
158 if(iEvent<EventsToCheck)
160 checkMomentumConservationInEvent(HepMCEvt);
164 HepMCEvent temp_event(*HepMCEvt,
false);
165 MC_Analyze(&temp_event);
168 if(iEvent>=NumberOfEvents-5)
170 Log::RedirectOutput(Log::Info());
180 Log::RedirectOutput(Log::Info());