Skip to content
Snippets Groups Projects
Commit 0bcbf163 authored by Alex Jentsch's avatar Alex Jentsch
Browse files

Add crossing angle to gen_particle script.

parent 2b677af9
No related branches found
No related tags found
No related merge requests found
......@@ -21,11 +21,13 @@ void gen_forward_protons(int n_events = 1000,
const char* out_fname = "forward_protons.hepmc")
{
double crossingAngle = -0.025; //radiansc
// generate protons in B0 acceptance - roughly 5 - 20 mrad
double cos_theta_min = 0.005; //std::cos(0.005*(M_PI/180.0));
double cos_theta_max = 0.020; //std::cos(0.020*(M_PI/180.0));
double partEnergyMin = 270.0; // xL 0.98
double partEnergyMax = 275.0; // top beam energy
......@@ -62,6 +64,10 @@ void gen_forward_protons(int n_events = 1000,
// sphere of given radius, in this case momentum.
// r1->Sphere(px, py, pz, p);
//rotate vector by crossing angle
pz = pz*std::cos(crossingAngle) - px*std::sin(crossingAngle);
px = pz*std::sin(crossingAngle) + px*std::cos(crossingAngle);
//std::cout << std::sqrt(px*px + py*py + pz*pz) - p << " is zero? \n";
// type 1 is final state
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment