/** * Main program for testing photos C++ interface. * Pythia events are generated first, Tauola++ used for tau decays * and photos used for FSR. * * @author Nadia Davidson and Tomasz Przedzinski * @date 10 May 2011 */ //Pythia header files #include "Pythia.h" #include "HepMCInterface.h" //MC-TESTER header files #include "Generate.h" #include "HepMCEvent.H" #include "Setup.H" //TAUOLA header files #include "Tauola/Tauola.h" #include "Tauola/TauolaHepMCEvent.h" //PHOTOS header files #include "Photos/Photos.h" #include "Photos/PhotosHepMCParticle.h" #include "Photos/PhotosHepMCEvent.h" #include "Photos/Log.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< [ ]"<1) pythia.readFile(argv[1]); // 2. Initialize pythia to e+e-@91.17GeV or e+e-@500GeV collisions (argv[2], from console) if(atoi(argv[2])==1) pythia.init( 11, -11, 91.187); // e+ e- collisions else if(atoi(argv[2])==3) pythia.init( 11, -11, 500.); // e+ e- collisions else { cout<<"ERROR: Wrong Pythia mode ("<3) NumberOfEvents=atoi(argv[3]); // 4. Set Tauola decay mode (argv[4], from console) if(argc>4) { // argv[4]=3 (tau => pi nu_tau) for Ztautau // argv[4]=4 (tau => pi pi nu_tau) for Htautau Tauola::setSameParticleDecayMode(atoi(argv[4])); Tauola::setOppositeParticleDecayMode(atoi(argv[4])); } Tauola::initialize(); Photos::initialize(); Photos::setExponentiation(true); Photos::setInfraredCutOff(1.e-6); Photos::maxWtInterference(3.0); // 5. Check if we're using 1-photon mode if( argc>5 && atoi(argv[5]) ) { Photos::setDoubleBrem(false); Photos::setExponentiation(false); // Set infrared cutoff to 10MeV for scale M_Z=91.187GeV or 500 GeV if(atoi(argv[2])==1) Photos::setInfraredCutOff(0.01/91.187); else Photos::setInfraredCutOff(0.01/500.); Photos::maxWtInterference(2.0); } // 6. Check if we're in ScalarNLO mode if( argc>6 ) { Tauola::setEtaK0sPi(1,1,0); // Check if we are using NLO if(atoi(argv[6])) Photos::setMeCorrectionWtForScalar(true); } Log::SummaryAtExit(); cout.setf(ios::fixed); 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; // Run PHOTOS on the event PhotosHepMCEvent evt(HepMCEvt); evt.process(); if(iEvent