#include #include #include #include #include #include #include using namespace std; #include #include //BCAL Geometry constants const double BCAL_LENGTH = 390.; const double BCAL_CENTER = 212.; const double TARGET_CENTER = 65.; const double BCAL_INNER_RAD = 64.3; 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; double Z_MIN = BCAL_CENTER - BCAL_LENGTH/2.0; double Z_MAX = BCAL_CENTER + BCAL_LENGTH/2.0; bool IS_POSITIVE = true; bool FILL_BCAL = false; int RUN_NUMBER=100; string OUTPUT_FILENAME="genphoton.ascii"; #define GAMMA_TYPE 1 #define _DBG_ cout<<__FILE__<<":"<<__LINE__<<" " #define _DBG__ _DBG_< photonXs; photonX 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; if (!FILL_BCAL) { theta = (double)random()/(double)RAND_MAX*(THETA_MAX-THETA_MIN) + THETA_MIN; } else { double z = (double)random()/(double)RAND_MAX*(Z_MAX-Z_MIN)+Z_MIN; theta = atan2(BCAL_INNER_RAD,(z-TARGET_CENTER)); } p.E = mom; p.px = mom*sin(theta)*cos(phi); p.py = mom*sin(theta)*sin(phi); p.pz = mom*cos(theta); photonXs.push_back(p); // Write event to file unsigned int type = GAMMA_TYPE; of<