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 <constantinos.andreopoulos \at cern.ch>
9  University of Liverpool & STFC Rutherford Appleton Laboratory
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-2020, 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:1453
bool TransformMatched(KinePhaseSpace_t ia, KinePhaseSpace_t ib, KinePhaseSpace_t a, KinePhaseSpace_t b, bool &fwd)
Definition: KineUtils.cxx:328
THE MAIN GENIE PROJECT NAMESPACE
Definition: AlgCmp.h:25
Range1D_t InelXLim(double El, double ml, double M)
Definition: KineUtils.cxx:634
Range1D_t InelWLim(double El, double ml, double M)
Definition: KineUtils.cxx:534
void XQ2toWY(double Ev, double M, double &W, double Q2, double x, double &y)
Definition: KineUtils.cxx:1160
void UpdateXYFromWQ2(const Interaction *in)
Definition: KineUtils.cxx:1295
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:1064
Range1D_t Inelq2Lim_W(double El, double ml, double M, double W)
Definition: KineUtils.cxx:594
double DISImportanceSamplingEnvelope(double *x, double *par)
Definition: KineUtils.cxx:1421
Range1D_t CohW2Lim(double Mn, double m_produced, double mlep, double Ev, double Q2)
Definition: KineUtils.cxx:781
Range1D_t InelWLim(double Ev, double M, double ml)
Definition: KineUtils.cxx:345
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:976
Range1D_t DarkQ2Lim_W(double Ev, double M, double ml, double W, double Q2min_cut=controls::kMinQ2Limit)
Definition: KineUtils.cxx:902
Range1D_t CEvNSQ2Lim(double Ev)
Definition: KineUtils.cxx:873
Range1D_t InelQ2Lim(double Ev, double M, double ml, double Q2min_cut=controls::kMinQ2Limit)
Definition: KineUtils.cxx:416
enum genie::EKinePhaseSpace KinePhaseSpace_t
void UpdateWYFromXQ2(const Interaction *in)
Definition: KineUtils.cxx:1313
double XYtoW(double Ev, double M, double x, double y)
Definition: KineUtils.cxx:1179
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:366
double W(const Interaction *const i)
Definition: KineUtils.cxx:1088
double SlowRescalingVar(double x, double Q2, double M, double mc)
Definition: KineUtils.cxx:1244
Range1D_t InelXLim(double Ev, double M, double ml)
Definition: KineUtils.cxx:444
Range1D_t DarkQ2Lim(double Ev, double M, double ml, double Q2min_cut=controls::kMinQ2Limit)
Definition: KineUtils.cxx:960
Range1D_t Inelq2Lim_W(double Ev, double M, double ml, double W, double q2min_cut=-1 *controls::kMinQ2Limit)
Definition: KineUtils.cxx:404
Range1D_t CohNuLim(double W2min, double W2max, double Q2, double Mn, double xsi)
Definition: KineUtils.cxx:810
double QD2toQ2(double QD2)
Definition: KineUtils.cxx:1058
Range1D_t Darkq2Lim_W(double Ev, double M, double ml, double W, double q2min_cut=-1 *controls::kMinQ2Limit)
Definition: KineUtils.cxx:948
const double a
double XYtoQ2(double Ev, double M, double x, double y)
Definition: KineUtils.cxx:1195
void XYtoWQ2(double Ev, double M, double &W, double &Q2, double x, double y)
Definition: KineUtils.cxx:1142
void WQ2toXY(double Ev, double M, double W, double Q2, double &x, double &y)
Definition: KineUtils.cxx:1119
Range1D_t Cohq2Lim(double Mn, double m_produced, double mlep, double Ev)
Definition: KineUtils.cxx:772
Range1D_t CohXLim(void)
Definition: KineUtils.cxx:722
bool IsAboveCharmThreshold(double x, double Q2, double M, double mc)
Definition: KineUtils.cxx:1225
static int max(int a, int b)
static constexpr double ps
Definition: Units.h:99
double Q2toQD2(double Q2)
Definition: KineUtils.cxx:1048
Range1D_t InelQ2Lim(double El, double ml, double M)
Definition: KineUtils.cxx:606
Range1D_t Inelq2Lim(double El, double ml, double M)
Definition: KineUtils.cxx:622
void UpdateWQ2FromXY(const Interaction *in)
Definition: KineUtils.cxx:1277
Range1D_t InelYLim(double El, double ml, double M)
Definition: KineUtils.cxx:654
Range1D_t InelQ2Lim_W(double El, double ml, double M, double W)
Definition: KineUtils.cxx:556
double CohW2Min(double Mn, double m_produced)
Definition: KineUtils.cxx:861
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
Range1D_t InelYLim_X(double Ev, double M, double ml, double x)
Definition: KineUtils.cxx:499
double Q2YtoX(double Ev, double M, double Q2, double y)
Definition: KineUtils.cxx:1209
Range1D_t CohYLim(double Mn, double m_produced, double mlep, double Ev, double Q2, double xsi)
Definition: KineUtils.cxx:827
Range1D_t DarkYLim(double Ev, double M, double ml)
Definition: KineUtils.cxx:1008
void UpdateXFromQ2Y(const Interaction *in)
Definition: KineUtils.cxx:1331
Definition: utils.py:1
Range1D_t InelYLim_X(double El, double ml, double M, double x)
Definition: KineUtils.cxx:689
Range1D_t CohQ2Lim(double Mn, double m_produced, double mlep, double Ev)
Definition: KineUtils.cxx:730
static bool * b
Definition: config.cpp:1043
double Jacobian(const Interaction *const i, KinePhaseSpace_t f, KinePhaseSpace_t t)
Definition: KineUtils.cxx:130
list x
Definition: train.py:276
Range1D_t DarkYLim_X(double Ev, double M, double ml, double x)
Definition: KineUtils.cxx:1024
Range1D_t Inelq2Lim(double Ev, double M, double ml, double q2min_cut=-1 *controls::kMinQ2Limit)
Definition: KineUtils.cxx:432
Range1D_t InelYLim(double Ev, double M, double ml)
Definition: KineUtils.cxx:464
Range1D_t DarkXLim(double Ev, double M, double ml)
Definition: KineUtils.cxx:988
void ApplyCutsToKineLimits(Range1D_t &r, double min, double max)
Definition: KineUtils.cxx:1258
Range1D_t DarkWLim(double Ev, double M, double ml)
Definition: KineUtils.cxx:879
double RESImportanceSamplingEnvelope(double *x, double *par)
Definition: KineUtils.cxx:1359