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 549 of file KineUtils.cxx.

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

Referenced by Inelq2Lim().

551 {
552 // Computes Q2 (>0) limits irrespective of W for inelastic em interactions
553 
554  Range1D_t Q2;
555  Q2.min = -1;
556  Q2.max = -1;
557 
559  if(W.min<0) return Q2;
560 
562  return Q2;
563 }
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:991
Range1D_t InelWLim(double Ev, double M, double ml)
Definition: KineUtils.cxx:288
A simple [min,max] interval for doubles.
Definition: Range1.h:43
Range1D_t InelQ2Lim_W(double Ev, double M, double ml, double W, double Q2min_cut=controls::kMinQ2Limit)
Definition: KineUtils.cxx:309
double max
Definition: Range1.h:54
double min
Definition: Range1.h:53
#define W(x)
Range1D_t genie::utils::kinematics::electromagnetic::Inelq2Lim ( double  El,
double  ml,
double  M 
)

Definition at line 565 of file KineUtils.cxx.

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

567 {
568 // Computes Q2 (>0) limits irrespective of W for inelastic em interactions
569 
571  Range1D_t q2;
572  q2.min = - Q2.max;
573  q2.max = - Q2.min;
574  return q2;
575 }
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:991
A simple [min,max] interval for doubles.
Definition: Range1.h:43
Range1D_t InelQ2Lim(double Ev, double M, double ml, double Q2min_cut=controls::kMinQ2Limit)
Definition: KineUtils.cxx:359
Double_t q2[12][num]
Definition: f2_nu.C:137
double max
Definition: Range1.h:54
double min
Definition: Range1.h:53
Range1D_t genie::utils::kinematics::electromagnetic::InelQ2Lim_W ( double  El,
double  ml,
double  M,
double  W 
)

Definition at line 499 of file KineUtils.cxx.

References ana::assert(), kMinQ2Limit, genie::Range1D_t::max, genie::Range1D_t::min, pDEBUG, genie::utils::kinematics::Q2(), SLOG, and ana::Sqrt().

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

501 {
502 // Computes Q2 limits (>0) @ the input W for inelastic em interactions
503 
504  Range1D_t Q2;
505  Q2.min = -1;
506  Q2.max = -1;
507 
508  double M2 = TMath::Power(M, 2.);
509  double ml2 = TMath::Power(ml, 2.);
510  double W2 = TMath::Power(W, 2.);
511  double s = M2 + 2*M*El + ml2; // added lepton mass squared to be used in s calculation (non-negligible mass for em interactions)
512 
513  SLOG("KineLimits", pDEBUG) << "s = " << s;
514  SLOG("KineLimits", pDEBUG) << "El = " << El;
515  assert (s>0);
516 
517  double auxC = 0.5*(s - M2 - ml2)/s; // subtract ml2 to account for the non-negligible mass of the incoming lepton
518  double aux1 = s + ml2 - W2;
519  double aux2 = aux1*aux1 - 4*s*ml2;
520 
521  (aux2 < 0) ? ( aux2 = 0 ) : ( aux2 = TMath::Sqrt(aux2) );
522 
523  Q2.max = -ml2 + auxC * (aux1 + aux2); // => 0
524  Q2.min = -ml2 + auxC * (aux1 - aux2); // => 0
525 
526  // guard against overflows
527  Q2.max = TMath::Max(0., Q2.max);
528  Q2.min = TMath::Max(0., Q2.min);
529 
530  // limit the minimum Q2
531  if(Q2.min < utils::kinematics::electromagnetic::kMinQ2Limit) {Q2.min = utils::kinematics::electromagnetic::kMinQ2Limit; } // use the relevant threshold for em scattering
532  if(Q2.max < Q2.min ) {Q2.min = -1; Q2.max = -1;}
533 
534  return Q2;
535 }
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:991
A simple [min,max] interval for doubles.
Definition: Range1.h:43
static const double kMinQ2Limit
Definition: Controls.h:41
const XML_Char * s
Definition: expat.h:262
double max
Definition: Range1.h:54
Var Sqrt(const Var &v)
Use to take sqrt of a var.
Definition: Var.cxx:324
assert(nhit_max >=nhit_nbins)
double min
Definition: Range1.h:53
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition: Messenger.h:85
#define W(x)
#define pDEBUG
Definition: Messenger.h:64
Range1D_t genie::utils::kinematics::electromagnetic::Inelq2Lim_W ( double  El,
double  ml,
double  M,
double  W 
)

Definition at line 537 of file KineUtils.cxx.

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

539 {
540 // Computes q2 (<0) limits @ the input W for inelastic em interactions
541 
543  Range1D_t q2;
544  q2.min = - Q2.max;
545  q2.max = - Q2.min;
546  return q2;
547 }
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:991
A simple [min,max] interval for doubles.
Definition: Range1.h:43
Range1D_t InelQ2Lim_W(double Ev, double M, double ml, double W, double Q2min_cut=controls::kMinQ2Limit)
Definition: KineUtils.cxx:309
Double_t q2[12][num]
Definition: f2_nu.C:137
double max
Definition: Range1.h:54
double min
Definition: Range1.h:53
#define W(x)
Range1D_t genie::utils::kinematics::electromagnetic::InelWLim ( double  El,
double  ml,
double  M 
)

Definition at line 477 of file KineUtils.cxx.

References ana::assert(), genie::controls::kASmallNum, genie::constants::kNeutronMass, genie::constants::kPhotontest, genie::Range1D_t::max, genie::Range1D_t::min, ana::Sqrt(), and W.

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

478 {
479 // Computes W limits for inelastic em interactions
480 //
481  double M2 = TMath::Power(M,2);
482  double ml2 = TMath::Power(ml,2); // added lepton mass squared to be used in s calculation
483  double s = M2 + 2*M*El + ml2; // non-negligible mass for em interactions
484  assert (s>0);
485 
486  Range1D_t W;
488  W.max = TMath::Sqrt(s) - ml;
489  if(W.max<=W.min) {
490  W.min = -1;
491  W.max = -1;
492  return W;
493  }
496  return W;
497 }
A simple [min,max] interval for doubles.
Definition: Range1.h:43
static const double kPhotontest
Definition: Constants.h:80
const XML_Char * s
Definition: expat.h:262
static const double kNeutronMass
Definition: Constants.h:77
static const double kASmallNum
Definition: Controls.h:40
double max
Definition: Range1.h:54
Var Sqrt(const Var &v)
Use to take sqrt of a var.
Definition: Var.cxx:324
assert(nhit_max >=nhit_nbins)
double min
Definition: Range1.h:53
#define W(x)
Range1D_t genie::utils::kinematics::electromagnetic::InelXLim ( double  El,
double  ml,
double  M 
)

Definition at line 577 of file KineUtils.cxx.

References ana::assert(), genie::controls::kASmallNum, genie::Range1D_t::max, genie::Range1D_t::min, pDEBUG, SLOG, and submit_syst::x.

579 {
580 // Computes Bjorken x limits for inelastic em interactions
581 
582  double M2 = TMath::Power(M, 2.);
583  double ml2 = TMath::Power(ml,2.);
584  double s = M2 + 2*M*El + ml2; // added lepton mass squared to be used in s calculation (non-negligible mass for em interactions)
585 
586  SLOG("KineLimits", pDEBUG) << "s = " << s;
587  SLOG("KineLimits", pDEBUG) << "El = " << El;
588  assert (s > M2 + ml2); // added lepton mass squared to be used in s calculation (non-negligible mass for em interactions)
589 
590  Range1D_t x;
591  x.min = ml2/(s - M2 - ml2) + controls::kASmallNum; // subtracted lepton mass squared to be used in s calculation (non-negligible mass for em interactions)
592  x.max = 1. - controls::kASmallNum;
593 
594  return x;
595 }
A simple [min,max] interval for doubles.
Definition: Range1.h:43
const XML_Char * s
Definition: expat.h:262
static const double kASmallNum
Definition: Controls.h:40
double max
Definition: Range1.h:54
assert(nhit_max >=nhit_nbins)
double min
Definition: Range1.h:53
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition: Messenger.h:85
#define pDEBUG
Definition: Messenger.h:64
Range1D_t genie::utils::kinematics::electromagnetic::InelYLim ( double  El,
double  ml,
double  M 
)

Definition at line 597 of file KineUtils.cxx.

References ana::assert(), MECModelEnuComparisons::i, genie::utils::kinematics::InelXLim(), genie::utils::kinematics::InelYLim_X(), genie::controls::kASmallNum, genie::Range1D_t::max, genie::Range1D_t::min, pDEBUG, SLOG, submit_syst::x, and submit_syst::y.

598 {
599 // Computes y limits for inelastic v interactions
600 
601  Range1D_t y;
602  y.min = 999;
603  y.max = -999;
604 
606  assert(xl.min>0 && xl.max>0);
607 
608  const unsigned int N=100;
609  const double logxmin = TMath::Log10(xl.min);
610  const double logxmax = TMath::Log10(xl.max);
611  const double dlogx = (logxmax-logxmin) / (double)(N-1);
612 
613  for(unsigned int i=0; i<N; i++) {
614  double x = TMath::Power(10, logxmin + i*dlogx);
615 
617  if(y_x.min>=0 && y_x.min<=1) y.min = TMath::Min(y.min, y_x.min);
618  if(y_x.max>=0 && y_x.max<=1) y.max = TMath::Max(y.max, y_x.max);
619  }
620 
621  if(y.max >= 0 && y.max <= 1 && y.min >= 0 && y.min <= 1) {
622  y.min = TMath::Max(y.min, controls::kASmallNum);
623  y.max = TMath::Min(y.max, 1 - controls::kASmallNum);
624  } else {
625  y.min = -1;
626  y.max = -1;
627  }
628  SLOG("KineLimits", pDEBUG) << "y = [" << y.min << ", " << y.max << "]";
629  return y;
630 }
A simple [min,max] interval for doubles.
Definition: Range1.h:43
Range1D_t InelXLim(double Ev, double M, double ml)
Definition: KineUtils.cxx:387
static const double kASmallNum
Definition: Controls.h:40
double max
Definition: Range1.h:54
Range1D_t InelYLim_X(double Ev, double M, double ml, double x)
Definition: KineUtils.cxx:442
assert(nhit_max >=nhit_nbins)
double min
Definition: Range1.h:53
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition: Messenger.h:85
#define pDEBUG
Definition: Messenger.h:64
Range1D_t genie::utils::kinematics::electromagnetic::InelYLim_X ( double  El,
double  ml,
double  M,
double  x 
)

Definition at line 632 of file KineUtils.cxx.

References genie::units::A, a, ana::assert(), b, make_syst_table_plots::c, d, genie::controls::kASmallNum, genie::Range1D_t::max, genie::Range1D_t::min, pDEBUG, SLOG, ana::Sqrt(), submit_syst::x, and submit_syst::y.

635 {
636 // Computes y limits @ the input x for inelastic em interactions
637 
638  Range1D_t y;
639  y.min = -1;
640  y.max = -1;
641 
642  double El2 = TMath::Power(El,2);
643  double ml2 = TMath::Power(ml,2);
644 
645  SLOG("KineLimits", pDEBUG) << "x = " << x;
646  SLOG("KineLimits", pDEBUG) << "El = " << El;
647 
648  assert (El>0);
649  assert (x>0&&x<1);
650 
651  double a = 0.5 * ml2/(M*El*x);
652  double b = ml2/El2;
653  double c = 1 + 0.5*x*M/El;
654  double d = TMath::Max(0., TMath::Power(1-a,2.) - b);
655 
656  double A = 0.5 * (1-a-0.5*b)/c;
657  double B = 0.5 * TMath::Sqrt(d)/c;
658 
659  y.min = TMath::Max(0., A-B) + controls::kASmallNum;
660  y.max = TMath::Min(1., A+B) - controls::kASmallNum;
661 
662  return y;
663 }
A simple [min,max] interval for doubles.
Definition: Range1.h:43
const double a
Float_t d
Definition: plot.C:236
static const double kASmallNum
Definition: Controls.h:40
static const double A
Definition: Units.h:82
double max
Definition: Range1.h:54
Var Sqrt(const Var &v)
Use to take sqrt of a var.
Definition: Var.cxx:324
const hit & b
Definition: hits.cxx:21
assert(nhit_max >=nhit_nbins)
double min
Definition: Range1.h:53
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition: Messenger.h:85
#define pDEBUG
Definition: Messenger.h:64

Variable Documentation

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

Definition at line 112 of file KineUtils.h.

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