GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions | Variables
genie::utils::kinematics::electromagnetic Namespace Reference

Functions

Range1D_t InelWLim (double El, double ml, double M)
 
Range1D_t InelQ2Lim_W (double El, double ml, double M, double W)
 
Range1D_t Inelq2Lim_W (double El, double ml, double M, double W)
 
Range1D_t InelQ2Lim (double El, double ml, double M)
 
Range1D_t Inelq2Lim (double El, double ml, double M)
 
Range1D_t InelXLim (double El, double ml, double M)
 
Range1D_t InelYLim (double El, double ml, double M)
 
Range1D_t InelYLim_X (double El, double ml, double M, double x)
 

Variables

static const double kMinQ2Limit = 0.02
 

Function Documentation

Range1D_t genie::utils::kinematics::electromagnetic::InelQ2Lim ( double  El,
double  ml,
double  M 
)

Definition at line 619 of file KineUtils.cxx.

References InelQ2Lim_W(), InelWLim(), genie::Range1D_t::max, genie::Range1D_t::min, genie::utils::kinematics::Q2(), and genie::utils::kinematics::W().

Referenced by Inelq2Lim().

621 {
622 // Computes Q2 (>0) limits irrespective of W for inelastic em interactions
623 
624  Range1D_t Q2;
625  Q2.min = -1;
626  Q2.max = -1;
627 
629  if(W.min<0) return Q2;
630 
632  return Q2;
633 }
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:1077
Range1D_t InelWLim(double Ev, double M, double ml)
Definition: KineUtils.cxx:358
A simple [min,max] interval for doubles.
Definition: Range1.h:42
Range1D_t InelQ2Lim_W(double Ev, double M, double ml, double W, double Q2min_cut=controls::kMinQ2Limit)
Definition: KineUtils.cxx:379
double W(const Interaction *const i)
Definition: KineUtils.cxx:1101
double max
Definition: Range1.h:53
double min
Definition: Range1.h:52
Range1D_t genie::utils::kinematics::electromagnetic::Inelq2Lim ( double  El,
double  ml,
double  M 
)

Definition at line 635 of file KineUtils.cxx.

References InelQ2Lim(), genie::Range1D_t::max, genie::Range1D_t::min, and genie::utils::kinematics::Q2().

637 {
638 // Computes Q2 (>0) limits irrespective of W for inelastic em interactions
639 
641  Range1D_t q2;
642  q2.min = - Q2.max;
643  q2.max = - Q2.min;
644  return q2;
645 }
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:1077
A simple [min,max] interval for doubles.
Definition: Range1.h:42
Range1D_t InelQ2Lim(double Ev, double M, double ml, double Q2min_cut=controls::kMinQ2Limit)
Definition: KineUtils.cxx:429
double max
Definition: Range1.h:53
double min
Definition: Range1.h:52
Range1D_t genie::utils::kinematics::electromagnetic::InelQ2Lim_W ( double  El,
double  ml,
double  M,
double  W 
)

Definition at line 569 of file KineUtils.cxx.

References kMinQ2Limit, genie::Range1D_t::max, genie::Range1D_t::min, pDEBUG, genie::utils::kinematics::Q2(), genie::units::s, and SLOG.

Referenced by InelQ2Lim(), Inelq2Lim_W(), and genie::EmpiricalMECPXSec2015::XSec().

571 {
572 // Computes Q2 limits (>0) @ the input W for inelastic em interactions
573 
574  Range1D_t Q2;
575  Q2.min = -1;
576  Q2.max = -1;
577 
578  double M2 = TMath::Power(M, 2.);
579  double ml2 = TMath::Power(ml, 2.);
580  double W2 = TMath::Power(W, 2.);
581  double s = M2 + 2*M*El + ml2; // added lepton mass squared to be used in s calculation (non-negligible mass for em interactions)
582 
583  SLOG("KineLimits", pDEBUG) << "s = " << s;
584  SLOG("KineLimits", pDEBUG) << "El = " << El;
585  assert (s>0);
586 
587  double auxC = 0.5*(s - M2 - ml2)/s; // subtract ml2 to account for the non-negligible mass of the incoming lepton
588  double aux1 = s + ml2 - W2;
589  double aux2 = aux1*aux1 - 4*s*ml2;
590 
591  (aux2 < 0) ? ( aux2 = 0 ) : ( aux2 = TMath::Sqrt(aux2) );
592 
593  Q2.max = -ml2 + auxC * (aux1 + aux2); // => 0
594  Q2.min = -ml2 + auxC * (aux1 - aux2); // => 0
595 
596  // guard against overflows
597  Q2.max = TMath::Max(0., Q2.max);
598  Q2.min = TMath::Max(0., Q2.min);
599 
600  // limit the minimum Q2
601  if(Q2.min < utils::kinematics::electromagnetic::kMinQ2Limit) {Q2.min = utils::kinematics::electromagnetic::kMinQ2Limit; } // use the relevant threshold for em scattering
602  if(Q2.max < Q2.min ) {Q2.min = -1; Q2.max = -1;}
603 
604  return Q2;
605 }
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:1077
A simple [min,max] interval for doubles.
Definition: Range1.h:42
static constexpr double s
Definition: Units.h:95
static const double kMinQ2Limit
Definition: Controls.h:41
double W(const Interaction *const i)
Definition: KineUtils.cxx:1101
double max
Definition: Range1.h:53
double min
Definition: Range1.h:52
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition: Messenger.h:84
#define pDEBUG
Definition: Messenger.h:63
Range1D_t genie::utils::kinematics::electromagnetic::Inelq2Lim_W ( double  El,
double  ml,
double  M,
double  W 
)

Definition at line 607 of file KineUtils.cxx.

References InelQ2Lim_W(), genie::Range1D_t::max, genie::Range1D_t::min, and genie::utils::kinematics::Q2().

609 {
610 // Computes q2 (<0) limits @ the input W for inelastic em interactions
611 
613  Range1D_t q2;
614  q2.min = - Q2.max;
615  q2.max = - Q2.min;
616  return q2;
617 }
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:1077
A simple [min,max] interval for doubles.
Definition: Range1.h:42
Range1D_t InelQ2Lim_W(double Ev, double M, double ml, double W, double Q2min_cut=controls::kMinQ2Limit)
Definition: KineUtils.cxx:379
double W(const Interaction *const i)
Definition: KineUtils.cxx:1101
double max
Definition: Range1.h:53
double min
Definition: Range1.h:52
Range1D_t genie::utils::kinematics::electromagnetic::InelWLim ( double  El,
double  ml,
double  M 
)

Definition at line 547 of file KineUtils.cxx.

References genie::controls::kASmallNum, genie::constants::kNeutronMass, genie::constants::kPhotontest, genie::Range1D_t::max, genie::Range1D_t::min, genie::units::s, and genie::utils::kinematics::W().

Referenced by InelQ2Lim(), and genie::EmpiricalMECPXSec2015::XSec().

548 {
549 // Computes W limits for inelastic em interactions
550 //
551  double M2 = TMath::Power(M,2);
552  double ml2 = TMath::Power(ml,2); // added lepton mass squared to be used in s calculation
553  double s = M2 + 2*M*El + ml2; // non-negligible mass for em interactions
554  assert (s>0);
555 
556  Range1D_t W;
558  W.max = TMath::Sqrt(s) - ml;
559  if(W.max<=W.min) {
560  W.min = -1;
561  W.max = -1;
562  return W;
563  }
566  return W;
567 }
A simple [min,max] interval for doubles.
Definition: Range1.h:42
static constexpr double s
Definition: Units.h:95
double W(const Interaction *const i)
Definition: KineUtils.cxx:1101
static const double kNeutronMass
static const double kASmallNum
Definition: Controls.h:40
double max
Definition: Range1.h:53
double min
Definition: Range1.h:52
Range1D_t genie::utils::kinematics::electromagnetic::InelXLim ( double  El,
double  ml,
double  M 
)

Definition at line 647 of file KineUtils.cxx.

References genie::controls::kASmallNum, genie::Range1D_t::max, genie::Range1D_t::min, pDEBUG, genie::units::s, and SLOG.

649 {
650 // Computes Bjorken x limits for inelastic em interactions
651 
652  double M2 = TMath::Power(M, 2.);
653  double ml2 = TMath::Power(ml,2.);
654  double s = M2 + 2*M*El + ml2; // added lepton mass squared to be used in s calculation (non-negligible mass for em interactions)
655 
656  SLOG("KineLimits", pDEBUG) << "s = " << s;
657  SLOG("KineLimits", pDEBUG) << "El = " << El;
658  assert (s > M2 + ml2); // added lepton mass squared to be used in s calculation (non-negligible mass for em interactions)
659 
660  Range1D_t x;
661  x.min = ml2/(s - M2 - ml2) + controls::kASmallNum; // subtracted lepton mass squared to be used in s calculation (non-negligible mass for em interactions)
662  x.max = 1. - controls::kASmallNum;
663 
664  return x;
665 }
A simple [min,max] interval for doubles.
Definition: Range1.h:42
static constexpr double s
Definition: Units.h:95
static const double kASmallNum
Definition: Controls.h:40
double max
Definition: Range1.h:53
double min
Definition: Range1.h:52
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition: Messenger.h:84
#define pDEBUG
Definition: Messenger.h:63
Range1D_t genie::utils::kinematics::electromagnetic::InelYLim ( double  El,
double  ml,
double  M 
)

Definition at line 667 of file KineUtils.cxx.

References genie::utils::kinematics::InelXLim(), genie::utils::kinematics::InelYLim_X(), genie::controls::kASmallNum, genie::Range1D_t::max, genie::Range1D_t::min, pDEBUG, and SLOG.

668 {
669 // Computes y limits for inelastic v interactions
670 
671  Range1D_t y;
672  y.min = 999;
673  y.max = -999;
674 
676  assert(xl.min>0 && xl.max>0);
677 
678  const unsigned int N=100;
679  const double logxmin = TMath::Log10(xl.min);
680  const double logxmax = TMath::Log10(xl.max);
681  const double dlogx = (logxmax-logxmin) / (double)(N-1);
682 
683  for(unsigned int i=0; i<N; i++) {
684  double x = TMath::Power(10, logxmin + i*dlogx);
685 
687  if(y_x.min>=0 && y_x.min<=1) y.min = TMath::Min(y.min, y_x.min);
688  if(y_x.max>=0 && y_x.max<=1) y.max = TMath::Max(y.max, y_x.max);
689  }
690 
691  if(y.max >= 0 && y.max <= 1 && y.min >= 0 && y.min <= 1) {
692  y.min = TMath::Max(y.min, controls::kASmallNum);
693  y.max = TMath::Min(y.max, 1 - controls::kASmallNum);
694  } else {
695  y.min = -1;
696  y.max = -1;
697  }
698  SLOG("KineLimits", pDEBUG) << "y = [" << y.min << ", " << y.max << "]";
699  return y;
700 }
A simple [min,max] interval for doubles.
Definition: Range1.h:42
Range1D_t InelXLim(double Ev, double M, double ml)
Definition: KineUtils.cxx:457
static const double kASmallNum
Definition: Controls.h:40
double max
Definition: Range1.h:53
Range1D_t InelYLim_X(double Ev, double M, double ml, double x)
Definition: KineUtils.cxx:512
double min
Definition: Range1.h:52
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition: Messenger.h:84
#define pDEBUG
Definition: Messenger.h:63
Range1D_t genie::utils::kinematics::electromagnetic::InelYLim_X ( double  El,
double  ml,
double  M,
double  x 
)

Definition at line 702 of file KineUtils.cxx.

References genie::units::A, a, genie::units::b, genie::controls::kASmallNum, genie::Range1D_t::max, genie::Range1D_t::min, pDEBUG, and SLOG.

705 {
706 // Computes y limits @ the input x for inelastic em interactions
707 
708  Range1D_t y;
709  y.min = -1;
710  y.max = -1;
711 
712  double El2 = TMath::Power(El,2);
713  double ml2 = TMath::Power(ml,2);
714 
715  SLOG("KineLimits", pDEBUG) << "x = " << x;
716  SLOG("KineLimits", pDEBUG) << "El = " << El;
717 
718  assert (El>0);
719  assert (x>0&&x<1);
720 
721  double a = 0.5 * ml2/(M*El*x);
722  double b = ml2/El2;
723  double c = 1 + 0.5*x*M/El;
724  double d = TMath::Max(0., TMath::Power(1-a,2.) - b);
725 
726  double A = 0.5 * (1-a-0.5*b)/c;
727  double B = 0.5 * TMath::Sqrt(d)/c;
728 
729  y.min = TMath::Max(0., A-B) + controls::kASmallNum;
730  y.max = TMath::Min(1., A+B) - controls::kASmallNum;
731 
732  return y;
733 }
A simple [min,max] interval for doubles.
Definition: Range1.h:42
static constexpr double b
Definition: Units.h:78
static constexpr double A
Definition: Units.h:74
const double a
static const double kASmallNum
Definition: Controls.h:40
double max
Definition: Range1.h:53
double min
Definition: Range1.h:52
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition: Messenger.h:84
#define pDEBUG
Definition: Messenger.h:63

Variable Documentation

const double genie::utils::kinematics::electromagnetic::kMinQ2Limit = 0.02
static

Definition at line 114 of file KineUtils.h.

Referenced by genie::RESKinematicsGenerator::ComputeMaxXSec(), and InelQ2Lim_W().