/** * Example of use of photos C++ interface. Pythia events are * generated first and photos used for FSR. * * @author Nadia Davidson * @date 6 July 2009 */ //pythia header files #include "Pythia.h" #include "HepMCInterface.h" //MC-TESTER header files #include "Generate.h" #include "HepMCEvent.H" #include "Setup.H" //PHOTOS header files #include "Photos/Photos.h" #include "Photos/PhotosHepMCEvent.h" #include "Photos/Log.h" //TAUOLA header files #include "Tauola/Tauola.h" #include "Tauola/TauolaHepMCEvent.h" using namespace std; using namespace Pythia8; using namespace Photospp; using namespace Tauolapp; unsigned long NumberOfEvents = 10000; unsigned int EventsToCheck=20; // elementary test of HepMC typically executed before // detector simulation based on http://home.fnal.gov/~mrenna/HCPSS/HCPSShepmc.html // similar test was performed in Fortran // we perform it before and after Photos (for the first several events) void checkMomentumConservationInEvent(HepMC::GenEvent *evt) { //cout<<"List of stable particles: "<particles_begin(); p != evt->particles_end(); ++p ) { if( (*p)->status() == 1 ) { HepMC::FourVector m = (*p)->momentum(); px+=m.px(); py+=m.py(); pz+=m.pz(); e +=m.e(); //(*p)->print(); } } cout.precision(6); cout.setf(ios_base::floatfield); cout< tau+ tau- decay and whole branch starting // from tau- to be processed //Photos::suppressBremForBranch(0,23); //Photos::forceBremForDecay (2,23,15,-15); //Photos::forceBremForBranch(0,15); // Force mass of electron and positron to be 0.000511 //Photos::forceMass(11,0.000511); // Force mass of electron and positron to be taken // from event record instead of being calculated from 4-vector //Photos::forceMassFromEventRecord(11); // Exclude particles with given status code from being processed // or taken into account during momentum conservation calculation //Photos::ignoreParticlesWithStatus(3); // Remove status code from the list of ignored status codes //Photos::DeIgnoreParticlesWithStatus(3); // Force writing history decay products for vertices // modified i.e. with added photons. These particles will // have the provided status code. Photos will ignore // all particles with this status code. //Photos::createHistoryEntries(true,3); MC_Initialize(); // Begin event loop for (unsigned long iEvent = 0; iEvent < NumberOfEvents; ++iEvent) { if(iEvent%1000==0) Log::Info()<<"Event: "<undecayTaus(); t_event->decayTaus(); delete t_event; //Log::LogPhlupa(2,4); if(iEvent=NumberOfEvents-5) { Log::RedirectOutput(Log::Info()); //pythia.event.list(); HepMCEvt->print(); Log::RevertOutput(); } // Clean up delete HepMCEvt; } Log::RedirectOutput(Log::Info()); pythia.statistics(); Log::RevertOutput(); MC_Finalize(); }