23#include "Framework/Conventions/GBuild.h"
39ROOT::Math::IBaseFunctionOneDim(),
64#ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
65 LOG(
"GSLXSecFunc",
pDEBUG) <<
"xsec(Q2 = " << Q2 <<
") = " << xsec;
69ROOT::Math::IBaseFunctionOneDim *
78ROOT::Math::IBaseFunctionOneDim(),
102#ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
103 LOG(
"GXSecFunc",
pDEBUG) <<
"xsec(y = " << y <<
") = " << xsec;
107ROOT::Math::IBaseFunctionOneDim *
116 double DNuMass,
double scale) :
117 ROOT::Math::IBaseFunctionOneDim(),
141 double DNuEnergy = xin;
146 double E_nu = P4_nu->E();
147 double M_target =
fInteraction->InitState().Tgt().Mass();
149 double ETimesM = E_nu * M_target;
150 double EPlusM = E_nu + M_target;
152 double p_DNu = TMath::Sqrt(DNuEnergy*DNuEnergy - fDNuMass2);
153 double cos_theta_DNu = (DNuEnergy*(EPlusM) - ETimesM - 0.5*fDNuMass2) / (E_nu * p_DNu);
154 double theta_DNu = TMath::ACos(cos_theta_DNu);
155 TVector3 DNu_3vector = TVector3(0,0,0);
156 DNu_3vector.SetMagThetaPhi(p_DNu, theta_DNu, 0.);
157 TLorentzVector P4_DNu = TLorentzVector(DNu_3vector, DNuEnergy);
160 TVector3 target_3vector = P4_nu->Vect() - DNu_3vector;
161 double E_target = E_nu + M_target - DNuEnergy;
162 TLorentzVector P4_target = TLorentzVector(target_3vector , E_target);
164 kinematics->SetQ2(2.*M_target*(E_target-M_target));
168#ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
169 LOG(
"GSLXSecFunc",
pDEBUG) <<
"xsec(DNuEnergy = " << DNuEnergy <<
") = " << xsec;
174ROOT::Math::IBaseFunctionOneDim *
184 const double M =
fInteraction->InitState().Tgt().Mass();
185 const double M2 = M * M;
188 const double A = M2 + 2.*M*E;
189 const double B = (M+E) * (E*M + 0.5*fDNuMass2);
190 const double C = E*E *(M2 + fDNuMass2) + E*M*fDNuMass2 + 0.25*fDNuMass2*fDNuMass2;
191 const double D = sqrt(B*B - A*C);
195 const double Tmax = std::min(E - ((B - D) / A), (1. / (2 * M)));
196 Range1D_t DNuEnergy(E - Tmax, (B + D) / A);
202ROOT::Math::IBaseFunctionMultiDim(),
232ROOT::Math::IBaseFunctionMultiDim *
241ROOT::Math::IBaseFunctionMultiDim(),
271ROOT::Math::IBaseFunctionMultiDim *
280ROOT::Math::IBaseFunctionMultiDim(),
304 fInteraction->KinePtr()->SetQ2(TMath::Power(10,xin[1]));
309ROOT::Math::IBaseFunctionMultiDim *
318ROOT::Math::IBaseFunctionMultiDim(),
352ROOT::Math::IBaseFunctionMultiDim *
361ROOT::Math::IBaseFunctionMultiDim(),
394ROOT::Math::IBaseFunctionMultiDim *
403ROOT::Math::IBaseFunctionMultiDim(),
433 double M =
fInteraction->InitState().Tgt().HitNucP4Ptr()->M();
442ROOT::Math::IBaseFunctionMultiDim *
451ROOT::Math::IBaseFunctionOneDim(),
479ROOT::Math::IBaseFunctionOneDim *
488ROOT::Math::IBaseFunctionOneDim(),
516ROOT::Math::IBaseFunctionOneDim *
525ROOT::Math::IBaseFunctionOneDim(),
553ROOT::Math::IBaseFunctionOneDim *
562ROOT::Math::IBaseFunctionOneDim(),
590ROOT::Math::IBaseFunctionOneDim *
602ROOT::Math::IBaseFunctionMultiDim(),
628 double E_nu = P4_nu->E();
631 double theta_l = xin[1];
632 double phi_l = xin[2];
633 double theta_pi = xin[3];
634 double phi_pi = xin[4];
636 double E_pi= E_nu-E_l;
638 double y = E_pi/E_nu;
654 double p_l = TMath::Sqrt(E_l*E_l - m_l*m_l);
655 TVector3 lepton_3vector = TVector3(0,0,0);
656 lepton_3vector.SetMagThetaPhi(p_l,theta_l,phi_l);
657 TLorentzVector P4_lep = TLorentzVector(lepton_3vector , E_l );
659 double p_pi = TMath::Sqrt(E_pi*E_pi - m_pi*m_pi);
660 TVector3 pion_3vector = TVector3(0,0,0);
661 pion_3vector.SetMagThetaPhi(p_pi,theta_pi,phi_pi);
662 TLorentzVector P4_pion = TLorentzVector(pion_3vector , E_pi);
664 double Q2 = -(*P4_nu-P4_lep).Mag2();
670 if ( x < xlim.min || x > xlim.
max ) {
682 if (xsec>0 &&
flip) {
690ROOT::Math::IBaseFunctionMultiDim *
703ROOT::Math::IBaseFunctionMultiDim(),
727 double E_nu = P4_nu->E();
730 double theta_l = xin[1];
731 double phi_l = xin[2];
732 double theta_pi = xin[3];
733 double phi_pi = xin[4];
735 double E_pi= E_nu-E_l;
737 double y = E_pi/E_nu;
752 double p_l = TMath::Sqrt(E_l*E_l - m_l*m_l);
753 TVector3 lepton_3vector = TVector3(0,0,0);
754 lepton_3vector.SetMagThetaPhi(p_l,theta_l,phi_l);
755 TLorentzVector P4_lep = TLorentzVector(lepton_3vector , E_l );
757 double p_pi = TMath::Sqrt(E_pi*E_pi - m_pi*m_pi);
758 TVector3 pion_3vector = TVector3(0,0,0);
759 pion_3vector.SetMagThetaPhi(p_pi,theta_pi,phi_pi);
760 TLorentzVector P4_pion = TLorentzVector(pion_3vector , E_pi);
762 double Q2 = -(*P4_nu-P4_lep).Mag2();
768 if ( x < xlim.min || x > xlim.
max ) {
785ROOT::Math::IBaseFunctionMultiDim *
800ROOT::Math::IBaseFunctionMultiDim(),
826 double E_nu = P4_nu->E();
829 double theta_l = xin[1];
831 double theta_pi = xin[2];
832 double phi_pi = xin[3];
834 double sin_theta_l = TMath::Sin(theta_l);
835 double sin_theta_pi = TMath::Sin(theta_pi);
837 double E_pi= E_nu-E_l;
839 double y = E_pi/E_nu;
854 double p_l = TMath::Sqrt(E_l*E_l - m_l*m_l);
855 TVector3 lepton_3vector = TVector3(0,0,0);
856 lepton_3vector.SetMagThetaPhi(p_l,theta_l,phi_l);
857 TLorentzVector P4_lep = TLorentzVector(lepton_3vector , E_l );
859 double p_pi = TMath::Sqrt(E_pi*E_pi - m_pi*m_pi);
860 TVector3 pion_3vector = TVector3(0,0,0);
861 pion_3vector.SetMagThetaPhi(p_pi,theta_pi,phi_pi);
862 TLorentzVector P4_pion = TLorentzVector(pion_3vector , E_pi);
864 double Q2 = -(*P4_nu-P4_lep).Mag2();
870 if ( x < xlim.min || x > xlim.
max ) {
886ROOT::Math::IBaseFunctionMultiDim *
903ROOT::Math::IBaseFunctionMultiDim(),
929 double E_nu = P4_nu->E();
933 double theta_l = xin[0];
934 double phi_l = xin[1];
935 double theta_pi = xin[2];
938 double sin_theta_l = TMath::Sin(theta_l);
939 double sin_theta_pi = TMath::Sin(theta_pi);
941 double E_pi= E_nu-E_l;
943 double y = E_pi/E_nu;
958 double p_l = TMath::Sqrt(E_l*E_l - m_l*m_l);
959 TVector3 lepton_3vector = TVector3(0,0,0);
960 lepton_3vector.SetMagThetaPhi(p_l,theta_l,phi_l);
961 TLorentzVector P4_lep = TLorentzVector(lepton_3vector , E_l );
963 double p_pi = TMath::Sqrt(E_pi*E_pi - m_pi*m_pi);
964 TVector3 pion_3vector = TVector3(0,0,0);
965 pion_3vector.SetMagThetaPhi(p_pi,theta_pi,phi_pi);
966 TLorentzVector P4_pion = TLorentzVector(pion_3vector , E_pi);
968 double Q2 = -(*P4_nu-P4_lep).Mag2();
974 if ( x < xlim.min || x > xlim.
max ) {
1005 string gsl_nd_integrator_type,
double gsl_relative_tolerance,
1006 unsigned int max_n_calls) :
1007ROOT::Math::IBaseFunctionOneDim(),
1017 integrator.SetRelTolerance(gsl_relative_tolerance);
1032 func->SetE_lep(Elep);
1034 LOG(
"GSLXSecFunc",
pINFO) <<
"dXSec_dElep_AR >> "<<
func->NDim()<<
"d integral done. (Elep = " <<Elep<<
" , dxsec/dElep = "<<xsec <<
")";
1045 const ROOT::Math::IBaseFunctionMultiDim * fn,
1046 bool * ifLog,
double * mins,
double * maxes) :
1066 double * toEval =
new double[this->
NDim()];
1068 for (
unsigned int i = 0 ; i < this->
NDim() ; i++ )
1080 double val = (*fFn)(toEval);
1092ROOT::Math::IBaseFunctionMultiDim(),
1130ROOT::Math::IBaseFunctionMultiDim *
1139ROOT::Math::IBaseFunctionMultiDim(),
1180ROOT::Math::IBaseFunctionMultiDim *
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Summary information for an interaction.
Generated/set kinematical variables for an event.
A simple [min,max] interval for doubles.
Cross Section Calculation Interface.
ROOT::Math::IBaseFunctionMultiDim * Clone(void) const
d2XSec_dQ2dy_E(const XSecAlgorithmI *m, const Interaction *i)
const Interaction * fInteraction
unsigned int NDim(void) const
double DoEval(const double *xin) const
const XSecAlgorithmI * fModel
const Interaction * fInteraction
double DoEval(const double *xin) const
unsigned int NDim(void) const
d2XSec_dQ2dydt_E(const XSecAlgorithmI *m, const Interaction *i)
const XSecAlgorithmI * fModel
ROOT::Math::IBaseFunctionMultiDim * Clone(void) const
unsigned int NDim(void) const
d2XSec_dWdQ2_EQ2(const XSecAlgorithmI *m, const Interaction *i, double Q2)
ROOT::Math::IBaseFunctionOneDim * Clone(void) const
double DoEval(double xin) const
const XSecAlgorithmI * fModel
const Interaction * fInteraction
double DoEval(double xin) const
ROOT::Math::IBaseFunctionOneDim * Clone(void) const
d2XSec_dWdQ2_EW(const XSecAlgorithmI *m, const Interaction *i, double W)
const XSecAlgorithmI * fModel
const Interaction * fInteraction
unsigned int NDim(void) const
const XSecAlgorithmI * fModel
const Interaction * fInteraction
ROOT::Math::IBaseFunctionMultiDim * Clone(void) const
double DoEval(const double *xin) const
unsigned int NDim(void) const
d2XSec_dWdQ2_E(const XSecAlgorithmI *m, const Interaction *i)
~d2XSec_dlog10xdlog10Q2_E()
ROOT::Math::IBaseFunctionMultiDim * Clone(void) const
const XSecAlgorithmI * fModel
double DoEval(const double *xin) const
unsigned int NDim(void) const
const Interaction * fInteraction
d2XSec_dlog10xdlog10Q2_E(const XSecAlgorithmI *m, const Interaction *i, double scale=1.)
d2XSec_dxdy_E(const XSecAlgorithmI *m, const Interaction *i)
const Interaction * fInteraction
double DoEval(const double *xin) const
ROOT::Math::IBaseFunctionMultiDim * Clone(void) const
unsigned int NDim(void) const
const XSecAlgorithmI * fModel
unsigned int NDim(void) const
double DoEval(double xin) const
ROOT::Math::IBaseFunctionOneDim * Clone(void) const
const Interaction * fInteraction
const XSecAlgorithmI * fModel
d2XSec_dxdy_Ex(const XSecAlgorithmI *m, const Interaction *i, double x)
unsigned int NDim(void) const
const Interaction * fInteraction
ROOT::Math::IBaseFunctionOneDim * Clone(void) const
const XSecAlgorithmI * fModel
double DoEval(double xin) const
d2XSec_dxdy_Ey(const XSecAlgorithmI *m, const Interaction *i, double x)
double DoEval(const double *xin) const
const Interaction * fInteraction
d2Xsec_dn1dn2_E(const XSecAlgorithmI *m, const Interaction *i, double scale=1.)
unsigned int NDim(void) const
const XSecAlgorithmI * fModel
ROOT::Math::IBaseFunctionMultiDim * Clone(void) const
unsigned int NDim(void) const
const XSecAlgorithmI * fModel
double DoEval(const double *xin) const
d2Xsec_dn1dn2dn3_E(const XSecAlgorithmI *m, const Interaction *i, double scale=1.)
const Interaction * fInteraction
ROOT::Math::IBaseFunctionMultiDim * Clone(void) const
ROOT::Math::IBaseFunctionMultiDim * Clone(void) const
unsigned int NDim(void) const
double DoEval(const double *xin) const
const XSecAlgorithmI * fModel
const Interaction * fInteraction
d3XSec_dxdydt_E(const XSecAlgorithmI *m, const Interaction *i)
const XSecAlgorithmI * fModel
double DoEval(const double *xin) const
d3Xsec_dOmegaldThetapi(const XSecAlgorithmI *m, const Interaction *i)
unsigned int NDim(void) const
void SetE_lep(double E_lepton) const
~d3Xsec_dOmegaldThetapi()
const Interaction * fInteraction
d3Xsec_dOmegaldThetapi * Clone(void) const
double DoEval(const double *xin) const
ROOT::Math::IBaseFunctionMultiDim * Clone(void) const
const Interaction * fInteraction
const XSecAlgorithmI * fModel
void SetFactor(double factor)
d4Xsec_dEldThetaldOmegapi(const XSecAlgorithmI *m, const Interaction *i)
~d4Xsec_dEldThetaldOmegapi()
unsigned int NDim(void) const
ROOT::Math::IBaseFunctionMultiDim * Clone(void) const
double DoEval(const double *xin) const
const Interaction * fInteraction
d5XSecAR(const XSecAlgorithmI *m, const Interaction *i)
unsigned int NDim(void) const
const XSecAlgorithmI * fModel
~d5Xsec_dEldOmegaldOmegapi()
const XSecAlgorithmI * fModel
double DoEval(const double *xin) const
const Interaction * fInteraction
d5Xsec_dEldOmegaldOmegapi(const XSecAlgorithmI *m, const Interaction *i)
ROOT::Math::IBaseFunctionMultiDim * Clone(void) const
unsigned int NDim(void) const
ROOT::Math::IBaseFunctionMultiDim * Clone(void) const
const ROOT::Math::IBaseFunctionMultiDim * fFn
dXSec_Log_Wrapper(const ROOT::Math::IBaseFunctionMultiDim *fn, bool *ifLog, double *min, double *maxes)
double DoEval(const double *xin) const
unsigned int NDim(void) const
ROOT::Math::IBaseFunctionOneDim * Clone(void) const
Range1D_t IntegrationRange(void) const
const Interaction * fInteraction
const XSecAlgorithmI * fModel
dXSec_dEDNu_E(const XSecAlgorithmI *m, const Interaction *i, double DNuMass, double scale=1.)
double DoEval(double xin) const
unsigned int NDim(void) const
const genie::utils::gsl::d3Xsec_dOmegaldThetapi * func
dXSec_dElep_AR * Clone(void) const
const XSecAlgorithmI * fModel
unsigned int fGSLMaxCalls
string fGSLIntegratorType
double DoEval(double xin) const
const Interaction * fInteraction
ROOT::Math::IntegratorMultiDim integrator
dXSec_dQ2_E(const XSecAlgorithmI *m, const Interaction *i, double scale=1.)
double DoEval(double xin) const
const Interaction * fInteraction
unsigned int NDim(void) const
const XSecAlgorithmI * fModel
ROOT::Math::IBaseFunctionOneDim * Clone(void) const
dXSec_dy_E(const XSecAlgorithmI *m, const Interaction *i)
const Interaction * fInteraction
const XSecAlgorithmI * fModel
ROOT::Math::IBaseFunctionOneDim * Clone(void) const
double DoEval(double xin) const
unsigned int NDim(void) const
static const double kNucleonMass
static const double kPionMass
static const double kPi0Mass
static const double kNapierConst
static const double kASmallNum
static constexpr double cm2
Simple utilities for integrating GSL in the GENIE framework.
ROOT::Math::IntegrationMultiDim::Type IntegrationNDimTypeFromString(string type)
void UpdateWQ2FromXY(const Interaction *in)
void WQ2toXY(double Ev, double M, double W, double Q2, double &x, double &y)
void UpdateWYFromXQ2(const Interaction *in)
void UpdateXFromQ2Y(const Interaction *in)
Root of GENIE utility namespaces.
THE MAIN GENIE PROJECT NAMESPACE