#include #include #include #include #include #include #include using namespace std; #include #include double PI_CHARGED_MASS = 0.139568; double PROTON_MASS = 0.938; double MESON_MASS = 0.770; uint MAX_EVENTS=10000; int NUM_TO_GEN=2; double E_BEAM_MIN=4.0*PI_CHARGED_MASS; double E_BEAM_MAX=1.0; int RUN_NUMBER=100; string OUTPUT_FILENAME="genpiX.ascii"; double gINTEGRAL_FRACTION; #define GAMMA_TYPE 1 #define PI_PLUS_TYPE 8 #define PI_MINUS_TYPE 9 #define _DBG_ cout<<__FILE__<<":"<<__LINE__<<" " #define _DBG__ _DBG_<2.0*M_PI)pi2_phi-=2.0*M_PI; double pi_E = MESON_MASS/2.0; double pi_mom = sqrt(pow(pi_E,2.0) - pow(PI_CHARGED_MASS,2.0)); TLorentzVector pi1( pi_mom*sin(pi1_theta)*cos(pi1_phi) , pi_mom*sin(pi1_theta)*sin(pi1_phi) , pi_mom*cos(pi1_theta) , pi_E); TLorentzVector pi2( pi_mom*sin(pi2_theta)*cos(pi2_phi) , pi_mom*sin(pi2_theta)*sin(pi2_phi) , pi_mom*cos(pi2_theta) , pi_E); // Boost the pions into the lab frame TVector3 beta = (1.0/sqrt(rho_p.Mag2() + pow(MESON_MASS,2.0)))*rho_p; pi1.Boost(beta); pi2.Boost(beta); // Generate piXs vector piXs; piX p; p.E = pi1.E(); p.px = pi1.Px(); p.py = pi1.Py(); p.pz = pi1.Pz(); piXs.push_back(p); p.E = pi2.E(); p.px = pi2.Px(); p.py = pi2.Py(); p.pz = pi2.Pz(); piXs.push_back(p); // Write event to file uint type = PI_PLUS_TYPE; of<