13 #include "Tauola/Log.h"
14 #include "Tauola/Plots.h"
15 #include "Tauola/Tauola.h"
16 #include "Tauola/TauolaHepMCEvent.h"
19 #ifdef PYTHIA8180_OR_LATER
20 #include "Pythia8/Pythia.h"
21 #include "Pythia8/Pythia8ToHepMC.h"
24 #include "HepMCInterface.h"
27 #include "HepMC/IO_AsciiParticles.h"
29 #include "tauola_print_parameters.h"
31 using namespace Pythia8;
32 using namespace Tauolapp;
35 int NumberOfEvents = 1000;
39 double rat=0., rat2=0.;
45 if(abs((*p)->pdg_id()) == 15 && (*p)->end_vertex() )
50 des!=(*p)->end_vertex()->particles_end(HepMC::children);
53 if(abs((*des)->pdg_id()) == 20213 ||
54 abs((*des)->pdg_id()) == 213 ||
55 abs((*des)->pdg_id()) == 211 ||
56 abs((*des)->pdg_id()) == 321 )
58 ehadr += (*des)->momentum().e();
62 rat += ehadr / (*p)->momentum().e();
63 rat2 += ehadr*ehadr / ( (*p)->momentum().e()*(*p)->momentum().e() );
64 nhadrmode += ihadrmode;
69 rat = rat / (double)nhadrmode;
70 rat2 = rat2 / (double)nhadrmode;
76 int main(
int argc,
char **argv)
83 #ifdef PYTHIA8180_OR_LATER
95 pythia.readString(
"HadronLevel:Hadronize = off");
96 pythia.readString(
"SpaceShower:QEDshower = off");
97 pythia.readString(
"SpaceShower:QEDshowerByL = off");
98 pythia.readString(
"SpaceShower:QEDshowerByQ = off");
99 pythia.readString(
"PartonLevel:ISR = off");
100 pythia.readString(
"PartonLevel:FSR = off");
105 pythia.readString(
"WeakDoubleBoson:ffbar2ZW = on");
112 pythia.readString(
"23:onMode = off");
113 pythia.readString(
"23:onIfAny = 15");
114 pythia.readString(
"24:onMode = off");
115 pythia.readString(
"24:onIfAny = 15");
117 pythia.init( 2212, 2212, 14000.0);
123 Tauola::initialize();
125 tauola_print_parameters();
133 Tauola::setEtaK0sPi(0,0,0);
140 Log::Info()<<
"FIRST LOOP: Pythia only" << endl;
142 double rats=0., rats2=0.;
144 for(
int iEvent = 0; iEvent < NumberOfEvents; ++iEvent)
146 if(iEvent%100==0) Log::Info()<<
"Event: "<<iEvent<<endl;
147 if(!pythia.next())
continue;
156 ToHepMC.fill_next_event(pythia, HepMCEvt);
159 rats += hratio(HepMCEvt, &rat2);
166 rats = rats / (double)NumberOfEvents;
167 rats2 = rats2 / (double)NumberOfEvents;
170 double erpyt = sqrt( (rats2 - rats*rats)/ (
double)NumberOfEvents );
173 Log::Info()<<
"SECOND LOOP: Pythia + Tauola" << endl;
175 pythia.particleData.readString(
"15:mayDecay = off");
179 for (
int iEvent = 0; iEvent < NumberOfEvents; ++iEvent)
181 if(iEvent%100==0) Log::Info()<<
"Event: "<<iEvent<<endl;
182 if (!pythia.next())
continue;
189 HepMCEvt->
use_units(HepMC::Units::GEV,HepMC::Units::MM);
191 ToHepMC.fill_next_event(pythia, HepMCEvt);
196 cout << endl <<
"Event record before tauola:" << endl << endl;
197 ascii_io1 << HepMCEvt;
211 cout << endl <<
"Event record after tauola:" << endl << endl;
212 ascii_io1 << HepMCEvt;
216 Log::Debug(5) <<
"helicites = " << Tauola::getHelPlus() <<
" "
217 << Tauola::getHelMinus()
218 <<
" electroweak wt= " << Tauola::getEWwt() << endl;
221 rats += hratio(HepMCEvt, &rat2);
228 rats = rats / (double)NumberOfEvents;
229 rats2 = rats2 / (double)NumberOfEvents;
230 double ertau = sqrt( (rats2 - rats*rats)/ (
double)NumberOfEvents );
233 cout <<
"******************************************************" << endl;
234 cout <<
"* f + fbar -> Z0 + W+/- *" << endl;
235 cout <<
"* with Z0 -> tau+ tau- and W+/- -> tau+/- nutau *" << endl;
236 cout <<
"* E(PI+- + K+- + A1+-) / E(TAU) ratio *" << endl;
237 cout <<
"* pythia = " << rpyt <<
" tauola = " << rats
239 cout <<
"* erpythia = " << erpyt <<
" ertauola = " << ertau
241 cout <<
"******************************************************" << endl;
243 Log::RedirectOutput(Log::Info());
particle_const_iterator particles_begin() const
begin particle iteration
non-const particle iterator
The GenEvent class is the core of HepMC.
particle_const_iterator particles_end() const
end particle iteration
event input/output in ascii format for eye and machine reading
void use_units(Units::MomentumUnit, Units::LengthUnit)