00001 #include "alpgen_spec.h"
00002
00003 void fill_eweight(HepMC::GenEvent* evt)
00004 {
00005
00006
00007
00008
00009
00010
00011 evt->weights()["lumi"]=ahwgts_.totlum;
00012 }
00013
00014 void fill_exsec(HepMC::GenEvent* evt)
00015 {
00016
00017
00018 HepMC::GenCrossSection Hep_cross_section;
00019 evstat_.nvpass=evstat_.nvcall-evstat_.nvfail;
00020 double meff_est=(evstat_.nvpass*1.)/evstat_.nvcall;
00021
00022 double phys_xsec=meff_est*ahwgts_.avgwgt;
00023
00024
00025
00026 double meff_est_err=sqrt(meff_est*(1-meff_est)/evstat_.nvcall);
00027
00028 double mrelxs_est_err_2;
00029 if (meff_est==0.) mrelxs_est_err_2=99999.9;
00030 else mrelxs_est_err_2=std::min(((meff_est_err/meff_est)*(meff_est_err/meff_est)+(ahwgts_.errwgt/ahwgts_.avgwgt)*(ahwgts_.errwgt/ahwgts_.avgwgt)),99999.9);
00031
00032 Hep_cross_section.set_cross_section(phys_xsec,sqrt( mrelxs_est_err_2)*phys_xsec);
00033 evt->set_cross_section(Hep_cross_section);
00034
00035
00036
00037
00038
00039
00040 }
00041