GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
KineUtils.h
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*!
3 
4 \namespace genie::utils::kinematics
5 
6 \brief Kinematical utilities
7 
8 \author Costas Andreopoulos <c.andreopoulos \at cern.ch>
9  University of Liverpool
10 
11  Changes required to implement the GENIE Boosted Dark Matter module
12  were installed by Josh Berger (Univ. of Wisconsin)
13 
14 \created November 26, 2004
15 
16 \cpright Copyright (c) 2003-2024, The GENIE Collaboration
17  For the full text of the license visit http://copyright.genie-mc.org
18 */
19 //____________________________________________________________________________
20 
21 #ifndef _KINE_UTILS_H_
22 #define _KINE_UTILS_H_
23 
28 #include "Framework/Utils/Range1.h"
29 
30 namespace genie {
31 namespace utils {
32 
33 namespace kinematics
34 {
35  //-- methods used for computing phase space volumes
36  double PhaseSpaceVolume (const Interaction * const i, KinePhaseSpace_t ps);
37 
38  //-- methods used for computing the Jacobians associated with phase space transformations
39  double Jacobian (const Interaction * const i, KinePhaseSpace_t f, KinePhaseSpace_t t);
41  KinePhaseSpace_t a, KinePhaseSpace_t b, bool & fwd);
42 
43  //-- kinematical limits
44  Range1D_t InelWLim (double Ev, double M, double ml);
45  Range1D_t InelQ2Lim_W (double Ev, double M, double ml, double W, double Q2min_cut = controls::kMinQ2Limit);
46  Range1D_t Inelq2Lim_W (double Ev, double M, double ml, double W, double q2min_cut = -1*controls::kMinQ2Limit);
47  Range1D_t InelQ2Lim (double Ev, double M, double ml, double Q2min_cut = controls::kMinQ2Limit);
48  Range1D_t Inelq2Lim (double Ev, double M, double ml, double q2min_cut = -1*controls::kMinQ2Limit);
49  Range1D_t InelXLim (double Ev, double M, double ml);
50  Range1D_t InelYLim (double Ev, double M, double ml);
51  Range1D_t InelYLim_X (double Ev, double M, double ml, double x);
52  Range1D_t CohW2Lim (double Mn, double m_produced, double mlep, double Ev, double Q2);
53  Range1D_t CohNuLim (double W2min, double W2max, double Q2, double Mn, double xsi);
54  Range1D_t CohYLim (double Mn, double m_produced, double mlep, double Ev, double Q2, double xsi);
55  Range1D_t CohYLim (double EvL, double ml);
56  Range1D_t CohXLim (void);
57  Range1D_t CohQ2Lim (double Mn, double m_produced, double mlep, double Ev);
58  Range1D_t Cohq2Lim (double Mn, double m_produced, double mlep, double Ev);
59  Range1D_t CEvNSQ2Lim (double Ev);
60  Range1D_t DarkWLim (double Ev, double M, double ml);
61  Range1D_t DarkQ2Lim_W (double Ev, double M, double ml, double W, double Q2min_cut = controls::kMinQ2Limit);
62  Range1D_t Darkq2Lim_W (double Ev, double M, double ml, double W, double q2min_cut = -1*controls::kMinQ2Limit);
63  Range1D_t DarkQ2Lim (double Ev, double M, double ml, double Q2min_cut = controls::kMinQ2Limit);
64  Range1D_t Darkq2Lim (double Ev, double M, double ml, double q2min_cut = -1*controls::kMinQ2Limit);
65  Range1D_t DarkXLim (double Ev, double M, double ml);
66  Range1D_t DarkYLim (double Ev, double M, double ml);
67  Range1D_t DarkYLim_X (double Ev, double M, double ml, double x);
68 
69  //-- helpers for kinematic limits
70  double CohW2Min(double Mn, double m_produced);
71 
72  //-- kinematical variable transforms
73  double QD2toQ2 (double QD2);
74  double Q2toQD2 (double Q2);
75  void WQ2toXY (double Ev, double M, double W, double Q2, double & x, double & y);
76  void XYtoWQ2 (double Ev, double M, double & W, double & Q2, double x, double y);
77  void XQ2toWY (double Ev, double M, double & W, double Q2, double x, double & y);
78  double XYtoW (double Ev, double M, double x, double y);
79  double XYtoQ2 (double Ev, double M, double x, double y);
80  double Q2YtoX (double Ev, double M, double Q2, double y);
81 
82  void UpdateWQ2FromXY(const Interaction * in);
83  void UpdateXYFromWQ2(const Interaction * in);
84  void UpdateWYFromXQ2(const Interaction * in);
85  void UpdateXFromQ2Y(const Interaction * in);
86 
87  //-- methods used to apply cuts to kinematical limits
88  void ApplyCutsToKineLimits (Range1D_t & r, double min, double max);
89 
90  double Q2 (const Interaction * const i);
91  double W (const Interaction * const i);
92 
93  //-- charm threshold and slow rescaling variable
94  bool IsAboveCharmThreshold (double x, double Q2, double M, double mc);
95  double SlowRescalingVar (double x, double Q2, double M, double mc);
96 
97  //-- Functions used to define differential cross section distribution envelopes
98  //-- for importance sampling in kinematical selection modules
99  double RESImportanceSamplingEnvelope(double * x, double * par);
100  double DISImportanceSamplingEnvelope(double * x, double * par);
101  double COHImportanceSamplingEnvelope(double * x, double * par);
102 
103  namespace electromagnetic
104  {
105  Range1D_t InelWLim (double El, double ml, double M);
106  Range1D_t InelQ2Lim_W (double El, double ml, double M, double W);
107  Range1D_t Inelq2Lim_W (double El, double ml, double M, double W);
108  Range1D_t InelQ2Lim (double El, double ml, double M);
109  Range1D_t Inelq2Lim (double El, double ml, double M);
110  Range1D_t InelXLim (double El, double ml, double M);
111  Range1D_t InelYLim (double El, double ml, double M);
112  Range1D_t InelYLim_X (double El, double ml, double M, double x);
113 
114  static const double kMinQ2Limit = 0.02; // GeV^2 // Q2 threshold relevant for em scattering events
115  }
116 
117 } // kinematics namespace
118 } // utils namespace
119 } // genie namespace
120 
121 #endif // _KINE_UTILS_H_
double COHImportanceSamplingEnvelope(double *x, double *par)
Definition: KineUtils.cxx:1466
bool TransformMatched(KinePhaseSpace_t ia, KinePhaseSpace_t ib, KinePhaseSpace_t a, KinePhaseSpace_t b, bool &fwd)
Definition: KineUtils.cxx:341
Range1D_t InelXLim(double El, double ml, double M)
Definition: KineUtils.cxx:647
Range1D_t InelWLim(double El, double ml, double M)
Definition: KineUtils.cxx:547
void XQ2toWY(double Ev, double M, double &W, double Q2, double x, double &y)
Definition: KineUtils.cxx:1173
void UpdateXYFromWQ2(const Interaction *in)
Definition: KineUtils.cxx:1308
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:1077
Range1D_t Inelq2Lim_W(double El, double ml, double M, double W)
Definition: KineUtils.cxx:607
double DISImportanceSamplingEnvelope(double *x, double *par)
Definition: KineUtils.cxx:1434
Range1D_t CohW2Lim(double Mn, double m_produced, double mlep, double Ev, double Q2)
Definition: KineUtils.cxx:794
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 Darkq2Lim(double Ev, double M, double ml, double q2min_cut=-1 *controls::kMinQ2Limit)
Definition: KineUtils.cxx:989
Range1D_t DarkQ2Lim_W(double Ev, double M, double ml, double W, double Q2min_cut=controls::kMinQ2Limit)
Definition: KineUtils.cxx:915
Range1D_t CEvNSQ2Lim(double Ev)
Definition: KineUtils.cxx:886
Range1D_t InelQ2Lim(double Ev, double M, double ml, double Q2min_cut=controls::kMinQ2Limit)
Definition: KineUtils.cxx:429
enum genie::EKinePhaseSpace KinePhaseSpace_t
void UpdateWYFromXQ2(const Interaction *in)
Definition: KineUtils.cxx:1326
double XYtoW(double Ev, double M, double x, double y)
Definition: KineUtils.cxx:1192
static const double kMinQ2Limit
Definition: Controls.h:41
double PhaseSpaceVolume(const Interaction *const i, KinePhaseSpace_t ps)
Definition: KineUtils.cxx:36
Range1D_t InelQ2Lim_W(double Ev, double M, double ml, double W, double Q2min_cut=controls::kMinQ2Limit)
Definition: KineUtils.cxx:379
static constexpr double b
Definition: Units.h:78
double W(const Interaction *const i)
Definition: KineUtils.cxx:1101
double SlowRescalingVar(double x, double Q2, double M, double mc)
Definition: KineUtils.cxx:1257
Range1D_t InelXLim(double Ev, double M, double ml)
Definition: KineUtils.cxx:457
Range1D_t DarkQ2Lim(double Ev, double M, double ml, double Q2min_cut=controls::kMinQ2Limit)
Definition: KineUtils.cxx:973
Range1D_t Inelq2Lim_W(double Ev, double M, double ml, double W, double q2min_cut=-1 *controls::kMinQ2Limit)
Definition: KineUtils.cxx:417
Range1D_t CohNuLim(double W2min, double W2max, double Q2, double Mn, double xsi)
Definition: KineUtils.cxx:823
double QD2toQ2(double QD2)
Definition: KineUtils.cxx:1071
Range1D_t Darkq2Lim_W(double Ev, double M, double ml, double W, double q2min_cut=-1 *controls::kMinQ2Limit)
Definition: KineUtils.cxx:961
const double a
double XYtoQ2(double Ev, double M, double x, double y)
Definition: KineUtils.cxx:1208
void XYtoWQ2(double Ev, double M, double &W, double &Q2, double x, double y)
Definition: KineUtils.cxx:1155
void WQ2toXY(double Ev, double M, double W, double Q2, double &x, double &y)
Definition: KineUtils.cxx:1132
Range1D_t Cohq2Lim(double Mn, double m_produced, double mlep, double Ev)
Definition: KineUtils.cxx:785
Range1D_t CohXLim(void)
Definition: KineUtils.cxx:735
bool IsAboveCharmThreshold(double x, double Q2, double M, double mc)
Definition: KineUtils.cxx:1238
static constexpr double ps
Definition: Units.h:99
double Q2toQD2(double Q2)
Definition: KineUtils.cxx:1061
Range1D_t InelQ2Lim(double El, double ml, double M)
Definition: KineUtils.cxx:619
Range1D_t Inelq2Lim(double El, double ml, double M)
Definition: KineUtils.cxx:635
void UpdateWQ2FromXY(const Interaction *in)
Definition: KineUtils.cxx:1290
Range1D_t InelYLim(double El, double ml, double M)
Definition: KineUtils.cxx:667
Range1D_t InelQ2Lim_W(double El, double ml, double M, double W)
Definition: KineUtils.cxx:569
double CohW2Min(double Mn, double m_produced)
Definition: KineUtils.cxx:874
Range1D_t InelYLim_X(double Ev, double M, double ml, double x)
Definition: KineUtils.cxx:512
double Q2YtoX(double Ev, double M, double Q2, double y)
Definition: KineUtils.cxx:1222
Range1D_t CohYLim(double Mn, double m_produced, double mlep, double Ev, double Q2, double xsi)
Definition: KineUtils.cxx:840
Range1D_t DarkYLim(double Ev, double M, double ml)
Definition: KineUtils.cxx:1021
void UpdateXFromQ2Y(const Interaction *in)
Definition: KineUtils.cxx:1344
Range1D_t InelYLim_X(double El, double ml, double M, double x)
Definition: KineUtils.cxx:702
Range1D_t CohQ2Lim(double Mn, double m_produced, double mlep, double Ev)
Definition: KineUtils.cxx:743
double Jacobian(const Interaction *const i, KinePhaseSpace_t f, KinePhaseSpace_t t)
Definition: KineUtils.cxx:130
Range1D_t DarkYLim_X(double Ev, double M, double ml, double x)
Definition: KineUtils.cxx:1037
Range1D_t Inelq2Lim(double Ev, double M, double ml, double q2min_cut=-1 *controls::kMinQ2Limit)
Definition: KineUtils.cxx:445
Range1D_t InelYLim(double Ev, double M, double ml)
Definition: KineUtils.cxx:477
Range1D_t DarkXLim(double Ev, double M, double ml)
Definition: KineUtils.cxx:1001
void ApplyCutsToKineLimits(Range1D_t &r, double min, double max)
Definition: KineUtils.cxx:1271
Range1D_t DarkWLim(double Ev, double M, double ml)
Definition: KineUtils.cxx:892
double RESImportanceSamplingEnvelope(double *x, double *par)
Definition: KineUtils.cxx:1372