/* * PndLmdDPMAngModel1D.cxx * * Created on: Mar 7, 2013 * Author: steve */ #include "PndLmdDPMAngModel1D.h" #include #include "TMath.h" PndLmdDPMAngModel1D::PndLmdDPMAngModel1D(std::string name_, dpm_elastic_parts elastic_type_) : PndLmdDPMMTModel1D(name_, elastic_type_) { // TODO Auto-generated constructor stub } PndLmdDPMAngModel1D::~PndLmdDPMAngModel1D() { // TODO Auto-generated destructor stub } double PndLmdDPMAngModel1D::getMomentumTransferFromTheta( const double theta) const { //double gtan = gamma->getValue() * TMath::Tan(theta / 1000.); // ultrarelativistic approximation (actually for protons this is would start at about 15GeV // or even higher so really bad approximation in our case) /* double thetacm = 2.0 * TMath::ATan(gtan); double tapprox = -2.0 * pcm2->getValue() * (1.0 - cos(thetacm)); //(this formula is exact just thetacm above is approx) // a * sin(x) / (a * cos(x) + b) == c where x=theta_cm, a = plab, b = v*Elab, c = gamma*tan(theta_lab) // solution is: x = acos([+-sqrt(a^4*c^2+a^4-(a*b*c)^2) - a*b*c^2]/[(a*c)^2 + a^2]) double sqrt_abc = sqrt( pow(p_lab->getValue(), 4.0) * (pow(gtan, 2.0) + 1.0) - pow( p_lab->getValue() * beta_lab_cms->getValue() * E_lab->getValue() * gtan, 2.0)); // ok at pi/2 there is sign switching so we need a case statement to extend our function to the full pi range double texact = 0.0; if (theta / 1000.0 < C_PI / 2) { texact = -2.0 * pcm2->getValue() * (1.0 - (sqrt_abc - p_lab->getValue() * beta_lab_cms->getValue() * E_lab->getValue() * pow(gtan, 2.0)) / (pow(p_lab->getValue() * gtan, 2.0) + pow(p_lab->getValue(), 2.0))); } else { texact = -2.0 * pcm2->getValue() * (1.0 - (-sqrt_abc - p_lab->getValue() * beta_lab_cms->getValue() * E_lab->getValue() * pow(gtan, 2.0)) / (pow(p_lab->getValue() * gtan, 2.0) + pow(p_lab->getValue(), 2.0))); }*/ double texact_old = -2.0 * pcm2->getValue() * (1.0 - cos( atan( p_lab->getValue() * sin(theta / 1000.0) / (gamma->getValue() * (p_lab->getValue() * cos(theta / 1000.0) - beta_lab_cms->getValue() * E_lab->getValue()))))); // std::cout<