#include #include #include #include #include #include #include using namespace std; #include #include double PI_CHARGED_MASS = 0.139568; unsigned int MAX_EVENTS=10000; double P_MIN=0.100; double P_MAX=6.000; double PHI_MIN = 0.0; double PHI_MAX = 2.0*M_PI; double THETA_MIN = 0.0; double THETA_MAX = M_PI; bool IS_POSITIVE = true; int RUN_NUMBER=100; string OUTPUT_FILENAME="genpi.ascii"; #define GAMMA_TYPE 1 #define PI_PLUS_TYPE 8 #define PI_MINUS_TYPE 9 #define _DBG_ cout<<__FILE__<<":"<<__LINE__<<" " #define _DBG__ _DBG_< piXs; piX p; // Randomly sample the energy and angles of the pion double mom = (double)random()/(double)RAND_MAX*(P_MAX-P_MIN) + P_MIN; double phi = (double)random()/(double)RAND_MAX*(PHI_MAX-PHI_MIN) + PHI_MIN; double theta = (double)random()/(double)RAND_MAX*(THETA_MAX-THETA_MIN) + THETA_MIN; p.E = sqrt(mom*mom + PI_CHARGED_MASS*PI_CHARGED_MASS); p.px = mom*sin(theta)*cos(phi); p.py = mom*sin(theta)*sin(phi); p.pz = mom*cos(theta); piXs.push_back(p); // Write event to file unsigned int type = PI_PLUS_TYPE; of<