GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Attributes | List of all members
genie::utils::gsl::dXSec_dEDNu_E Class Reference

#include <GSLXSecFunc.h>

Inheritance diagram for genie::utils::gsl::dXSec_dEDNu_E:
Inheritance graph
[legend]
Collaboration diagram for genie::utils::gsl::dXSec_dEDNu_E:
Collaboration graph
[legend]

Public Member Functions

 dXSec_dEDNu_E (const XSecAlgorithmI *m, const Interaction *i, double DNuMass, double scale=1.)
 
 ~dXSec_dEDNu_E ()
 
unsigned int NDim (void) const
 
double DoEval (double xin) const
 
ROOT::Math::IBaseFunctionOneDim * Clone (void) const
 
Range1D_t IntegrationRange (void) const
 

Private Attributes

const XSecAlgorithmIfModel
 
const InteractionfInteraction
 
double fDNuMass
 
double fScale
 

Detailed Description

Definition at line 84 of file GSLXSecFunc.h.

Constructor & Destructor Documentation

genie::utils::gsl::dXSec_dEDNu_E::dXSec_dEDNu_E ( const XSecAlgorithmI m,
const Interaction i,
double  DNuMass,
double  scale = 1. 
)

Definition at line 114 of file GSLXSecFunc.cxx.

116  :
117  ROOT::Math::IBaseFunctionOneDim(),
118  fModel(m),
119  fInteraction(i),
120  fDNuMass(DNuMass),
121  fScale(scale)
122 {
123 
124 }
const Interaction * fInteraction
Definition: GSLXSecFunc.h:99
const XSecAlgorithmI * fModel
Definition: GSLXSecFunc.h:98
genie::utils::gsl::dXSec_dEDNu_E::~dXSec_dEDNu_E ( )

Definition at line 125 of file GSLXSecFunc.cxx.

126 {
127 
128 }

Member Function Documentation

ROOT::Math::IBaseFunctionOneDim * genie::utils::gsl::dXSec_dEDNu_E::Clone ( void  ) const

Definition at line 175 of file GSLXSecFunc.cxx.

double genie::utils::gsl::dXSec_dEDNu_E::DoEval ( double  xin) const

Definition at line 133 of file GSLXSecFunc.cxx.

References genie::units::cm2, genie::kPSEDNufE, genie::kRfLab, LOG, pDEBUG, genie::Kinematics::SetFSLeptonP4(), genie::Kinematics::SetHadSystP4(), and genie::Kinematics::SetQ2().

134 {
135 // inputs:
136 // DNuEnergy [GeV]
137 // outputs:
138 // differential cross section [10^-38 cm^2 / GeV]
139 //
140 
141  double DNuEnergy = xin;
142  double fDNuMass2 = fDNuMass*fDNuMass;
143 
144  Kinematics * kinematics = fInteraction->KinePtr();
145  const TLorentzVector * P4_nu = fInteraction->InitStatePtr()->GetProbeP4(kRfLab);
146  double E_nu = P4_nu->E();
147  double M_target = fInteraction->InitState().Tgt().Mass();
148 
149  double ETimesM = E_nu * M_target;
150  double EPlusM = E_nu + M_target;
151 
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);
158  kinematics->SetFSLeptonP4(P4_DNu);
159 
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);
163  kinematics->SetHadSystP4(P4_target);
164  kinematics->SetQ2(2.*M_target*(E_target-M_target));
165 
166  delete P4_nu;
167  double xsec = fModel->XSec(fInteraction, kPSEDNufE);
168 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
169  LOG("GSLXSecFunc", pDEBUG) << "xsec(DNuEnergy = " << DNuEnergy << ") = " << xsec;
170 #endif
171 
172  return fScale*xsec/(1E-38 * units::cm2);
173 }
const Interaction * fInteraction
Definition: GSLXSecFunc.h:99
void SetQ2(double Q2, bool selected=false)
Definition: Kinematics.cxx:255
Kinematics * KinePtr(void) const
Definition: Interaction.h:76
Generated/set kinematical variables for an event.
Definition: Kinematics.h:39
double Mass(void) const
Definition: Target.cxx:224
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
void SetFSLeptonP4(const TLorentzVector &p4)
Definition: Kinematics.cxx:297
static constexpr double cm2
Definition: Units.h:69
virtual double XSec(const Interaction *i, KinePhaseSpace_t k=kPSfE) const =0
Compute the cross section for the input interaction.
const XSecAlgorithmI * fModel
Definition: GSLXSecFunc.h:98
void SetHadSystP4(const TLorentzVector &p4)
Definition: Kinematics.cxx:307
InitialState * InitStatePtr(void) const
Definition: Interaction.h:74
const InitialState & InitState(void) const
Definition: Interaction.h:69
const Target & Tgt(void) const
Definition: InitialState.h:66
TLorentzVector * GetProbeP4(RefFrame_t rf=kRfHitNucRest) const
#define pDEBUG
Definition: Messenger.h:63
Range1D_t genie::utils::gsl::dXSec_dEDNu_E::IntegrationRange ( void  ) const

Definition at line 180 of file GSLXSecFunc.cxx.

References genie::units::A, and genie::kRfLab.

Referenced by genie::COHDNuEventGenerator::GenerateKinematics(), and genie::COHDNuXSec::Integrate().

181 {
182  // look at valid angles section at tech note
183  const double E = fInteraction->InitState().ProbeE(kRfLab);
184  const double M = fInteraction->InitState().Tgt().Mass();
185  const double M2 = M * M;
186  double fDNuMass2 = fDNuMass*fDNuMass;
187 
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);
192 
193  Range1D_t DNuEnergy((B - D)/A, (B + D)/A);
194  return DNuEnergy;
195 
196 }
const Interaction * fInteraction
Definition: GSLXSecFunc.h:99
A simple [min,max] interval for doubles.
Definition: Range1.h:42
double Mass(void) const
Definition: Target.cxx:224
static constexpr double A
Definition: Units.h:74
const InitialState & InitState(void) const
Definition: Interaction.h:69
const Target & Tgt(void) const
Definition: InitialState.h:66
double ProbeE(RefFrame_t rf) const
unsigned int genie::utils::gsl::dXSec_dEDNu_E::NDim ( void  ) const

Definition at line 129 of file GSLXSecFunc.cxx.

130 {
131  return 1;
132 }

Member Data Documentation

double genie::utils::gsl::dXSec_dEDNu_E::fDNuMass
private

Definition at line 100 of file GSLXSecFunc.h.

const Interaction* genie::utils::gsl::dXSec_dEDNu_E::fInteraction
private

Definition at line 99 of file GSLXSecFunc.h.

const XSecAlgorithmI* genie::utils::gsl::dXSec_dEDNu_E::fModel
private

Definition at line 98 of file GSLXSecFunc.h.

double genie::utils::gsl::dXSec_dEDNu_E::fScale
private

Definition at line 101 of file GSLXSecFunc.h.


The documentation for this class was generated from the following files: