55 HepMC::I_Pythia8 ToHepMC;
57 Event&
event = pythia.event;
58 pythia.readString(
"WeakSingleBoson:ffbar2gmZ = on");
59 pythia.readString(
"23:onMode = off");
60 pythia.readString(
"23:onIfAny = 15");
61 pythia.readString(
"HadronLevel:Hadronize = off");
62 pythia.readString(
"SpaceShower:QEDshower = off");
63 pythia.readString(
"SpaceShower:QEDshowerByL = off");
64 pythia.readString(
"SpaceShower:QEDshowerByQ = off");
65 pythia.readString(
"PartonLevel:ISR = off");
66 pythia.readString(
"PartonLevel:FSR = off");
67 pythia.init( 11, -11, 92.);
70 Photos::setInfraredCutOff(0.001/200);
73 if(argc>1) NumberOfEvents=atoi(argv[1]);
75 int photonAdded=0,twoAdded=0,moreAdded=0,tauCount=0;
80 if(iEvent%(NumberOfEvents/10)==0) Log::Info()<<iEvent<<endl;
81 if(!pythia.next())
continue;
83 HepMC::GenEvent * HepMCEvt =
new HepMC::GenEvent();
84 ToHepMC.fill_next_event(event, HepMCEvt);
89 cout<<
"Momentum conservation chceck BEFORE/AFTER Photos"<<endl;
94 HepMC::GenParticle *tau=0;
95 for(HepMC::GenEvent::vertex_const_iterator
i = HepMCEvt->vertices_begin();
i!=HepMCEvt->vertices_end();
i++)
97 for(HepMC::GenVertex::particles_in_const_iterator
p=(*i)->particles_in_const_begin();
p!=(*i)->particles_in_const_end();
p++)
99 if((*p)->pdg_id()==15) tau=*
p;
107 int buf = -HepMCEvt->particles_size();
112 buf+=HepMCEvt->particles_size();
113 if(buf==1) photonAdded++;
114 else if(buf==2) twoAdded++;
115 else if(buf>2) moreAdded++;
130 cout.setf(ios::fixed);
134 cout<<
"Something went wrong with pythia generation."<<endl;
135 cout<<
"No taus were processed."<<endl<<endl;
138 cout<<
"Summary (single tau decay processing):"<<endl;
139 cout<<tauCount <<
"\ttaus processed"<<endl;
140 cout<<photonAdded<<
"\ttimes one photon added to the decay \t("<<(photonAdded*100./tauCount)<<
"%)"<<endl;
141 cout<<twoAdded <<
"\ttimes two photons added to the decay \t("<<(twoAdded*100./tauCount)<<
"%)"<<endl;
142 cout<<moreAdded <<
"\ttimes more than two photons added to the decay\t("<<(moreAdded*100./tauCount)<<
"%)"<<endl<<endl;
143 cout<<
"(Contrary to results from MC-Tester, these values are technical and infrared unstable)"<<endl<<endl;
144 cout<<
"To proccess different number of events use:"<<endl<<
" ./single_photos_gun_example <number_of_events>"<<endl<<endl;
void checkMomentumConservationInEvent(PhotosHEPEVTEvent *evt)