11 #include "HepMCInterface.h" 
   19 using namespace Pythia8;
 
   20 using namespace Photospp;
 
   29         for(HepMC::GenEvent::particle_const_iterator 
p=evt->particles_begin();
p!=evt->particles_end(); 
p++)
 
   32                 if( (*p)->pdg_id() != 23 ) 
continue;
 
   35                 if( !(*p)->end_vertex() || (*p)->end_vertex()->particles_out_size() < 2 ) 
continue;
 
   39                 for(HepMC::GenVertex::particle_iterator pp = (*p)->end_vertex()->particles_begin(HepMC::children);
 
   40                     pp != (*p)->end_vertex()->particles_end(HepMC::children);
 
   44                    if( (*pp)->pdg_id() != 22 ) sum += (*pp)->momentum().e();
 
   48                 ratio    = sum     /   (*p)->momentum().e();
 
   49                 *ratio_2 = sum*sum / ( (*p)->momentum().e() * (*p)->momentum().e() );
 
   57 int main(
int argc,
char **argv)
 
   60         HepMC::I_Pythia8 ToHepMC;
 
   62         Event& 
event = pythia.event;
 
   68                 pythia.readString(
"HadronLevel:Hadronize = off");
 
   69                 pythia.readString(
"SpaceShower:QEDshower = off");
 
   70                 pythia.readString(
"SpaceShower:QEDshowerByL = off");
 
   71                 pythia.readString(
"SpaceShower:QEDshowerByQ = off");
 
   73         pythia.readString(
"PartonLevel:ISR = on");
 
   74         pythia.readString(
"PartonLevel:FSR = off");
 
   76         pythia.readString(
"WeakSingleBoson:ffbar2gmZ = on");
 
   77         pythia.readString(
"23:onMode = off");
 
   78         pythia.readString(
"23:onIfAny = 13");
 
   80         pythia.init( 11, -11, 91.187);                           
 
   91         cout.setf(ios::fixed);
 
   93         double ratio_exp   = 0.0, ratio_alpha   = 0.0;
 
   94         double ratio_exp_2 = 0.0, ratio_alpha_2 = 0.0;
 
   97         Photos::setDoubleBrem(
true);
 
   98         Photos::setExponentiation(
true);
 
   99         Photos::setInfraredCutOff(0.000001);
 
  101         Log::Info() << 
"---------------- First run - EXP ----------------" <<endl;
 
  106                 if(iEvent%10000==0) Log::Info()<<
"Event: "<<iEvent<<
"\t("<<iEvent*(100./
NumberOfEvents)<<
"%)"<<endl;
 
  107                 if (!pythia.next()) 
continue;
 
  109                 HepMC::GenEvent * HepMCEvt = 
new HepMC::GenEvent();
 
  110                 ToHepMC.fill_next_event(event, HepMCEvt);
 
  128         Photos::setDoubleBrem(
false);
 
  129         Photos::setExponentiation(
false);
 
  130         Photos::setInfraredCutOff(1./91.187);  
 
  133         Log::Info() << 
"---------------- Second run - ALPHA ORDER ----------------" <<endl;
 
  138                 if(iEvent%10000==0) Log::Info()<<
"Event: "<<iEvent<<
"\t("<<iEvent*(100./
NumberOfEvents)<<
"%)"<<endl;
 
  139                 if (!pythia.next()) 
continue;
 
  141                 HepMC::GenEvent * HepMCEvt = 
new HepMC::GenEvent();
 
  142                 ToHepMC.fill_next_event(event, HepMCEvt);
 
  152                 ratio_alpha_2 += buf;
 
  162         ratio_exp   = ratio_exp   / (double)NumberOfEvents;
 
  163         ratio_exp_2 = ratio_exp_2 / (double)NumberOfEvents;
 
  165         ratio_alpha   = ratio_alpha   / (double)NumberOfEvents;
 
  166         ratio_alpha_2 = ratio_alpha_2 / (double)NumberOfEvents;
 
  168         double err_exp   = 
sqrt( (ratio_exp_2   - ratio_exp   * ratio_exp  ) / (
double)NumberOfEvents );
 
  169         double err_alpha = 
sqrt( (ratio_alpha_2 - ratio_alpha * ratio_alpha) / (
double)NumberOfEvents );
 
  172         cout.setf(ios::fixed);
 
  173         cout << 
"********************************************************" << endl;
 
  174         cout << 
"* Z -> l + bar_l + gammas                              *" << endl;
 
  175         cout << 
"* E(l + bar_l) / E(l + bar_l + gammas) ratio           *" << endl;
 
  176         cout << 
"*                                                      *" << endl;
 
  177         cout << 
"* PHOTOS - EXP:          " << ratio_exp   <<
" +/- "<<err_exp  <<
"      *" << endl;
 
  178         cout << 
"* PHOTOS - ALPHA ORDER:  " << ratio_alpha <<
" +/- "<<err_alpha<<
"      *" << endl;
 
  179         cout << 
"********************************************************" << endl;
 
int main(int argc, char **argv)
friend F32vec4 sqrt(const F32vec4 &a)
double calculate_ratio(HepMC::GenEvent *evt, double *ratio_2)