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 <costas.andreopoulos \at stfc.ac.uk>
9  University of Liverpool & STFC Rutherford Appleton Lab
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-2019, The GENIE Collaboration
17  For the full text of the license visit http://copyright.genie-mc.org
18  or see $GENIE/LICENSE
19 */
20 //____________________________________________________________________________
21 
22 #ifndef _KINE_UTILS_H_
23 #define _KINE_UTILS_H_
24 
29 #include "Framework/Utils/Range1.h"
30 
31 namespace genie {
32 namespace utils {
33 
34 namespace kinematics
35 {
36  //-- methods used for computing phase space volumes
37  double PhaseSpaceVolume (const Interaction * const i, KinePhaseSpace_t ps);
38 
39  //-- methods used for computing the Jacobians associated with phase space transformations
40  double Jacobian (const Interaction * const i, KinePhaseSpace_t f, KinePhaseSpace_t t);
42  KinePhaseSpace_t a, KinePhaseSpace_t b, bool & fwd);
43 
44  //-- kinematical limits
45  Range1D_t InelWLim (double Ev, double M, double ml);
46  Range1D_t InelQ2Lim_W (double Ev, double M, double ml, double W, double Q2min_cut = controls::kMinQ2Limit);
47  Range1D_t Inelq2Lim_W (double Ev, double M, double ml, double W, double q2min_cut = -1*controls::kMinQ2Limit);
48  Range1D_t InelQ2Lim (double Ev, double M, double ml, double Q2min_cut = controls::kMinQ2Limit);
49  Range1D_t Inelq2Lim (double Ev, double M, double ml, double q2min_cut = -1*controls::kMinQ2Limit);
50  Range1D_t InelXLim (double Ev, double M, double ml);
51  Range1D_t InelYLim (double Ev, double M, double ml);
52  Range1D_t InelYLim_X (double Ev, double M, double ml, double x);
53  Range1D_t CohW2Lim (double Mn, double mpi, double mlep, double Ev, double Q2);
54  Range1D_t CohNuLim (double W2min, double W2max, double Q2, double Mn, double xsi);
55  Range1D_t CohYLim (double Mn, double mpi, double mlep, double Ev, double Q2, double xsi);
56  Range1D_t CohYLim (double EvL, double ml);
57  Range1D_t CohXLim (void);
58  Range1D_t CohQ2Lim (double Mn, double mpi, double mlep, double Ev);
59  Range1D_t Cohq2Lim (double Mn, double mpi, double mlep, 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 mpi);
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  double XYtoW (double Ev, double M, double x, double y);
78  double XYtoQ2 (double Ev, double M, double x, double y);
79  double Q2YtoX (double Ev, double M, double Q2, double y);
80 
81  void UpdateWQ2FromXY(const Interaction * in);
82  void UpdateXYFromWQ2(const Interaction * in);
83  void UpdateXFromQ2Y(const Interaction * in);
84 
85  //-- methods used to apply cuts to kinematical limits
86  void ApplyCutsToKineLimits (Range1D_t & r, double min, double max);
87 
88  double Q2 (const Interaction * const i);
89  double W (const Interaction * const i);
90 
91  //-- charm threshold and slow rescaling variable
92  bool IsAboveCharmThreshold (double x, double Q2, double M, double mc);
93  double SlowRescalingVar (double x, double Q2, double M, double mc);
94 
95  //-- Functions used to define differential cross section distribution envelopes
96  //-- for importance sampling in kinematical selection modules
97  double RESImportanceSamplingEnvelope(double * x, double * par);
98  double DISImportanceSamplingEnvelope(double * x, double * par);
99  double COHImportanceSamplingEnvelope(double * x, double * par);
100 
101  namespace electromagnetic
102  {
103  Range1D_t InelWLim (double El, double ml, double M);
104  Range1D_t InelQ2Lim_W (double El, double ml, double M, double W);
105  Range1D_t Inelq2Lim_W (double El, double ml, double M, double W);
106  Range1D_t InelQ2Lim (double El, double ml, double M);
107  Range1D_t Inelq2Lim (double El, double ml, double M);
108  Range1D_t InelXLim (double El, double ml, double M);
109  Range1D_t InelYLim (double El, double ml, double M);
110  Range1D_t InelYLim_X (double El, double ml, double M, double x);
111 
112  static const double kMinQ2Limit = 0.02; // GeV^2 // Q2 threshold relevant for em scattering events
113  }
114 
115 } // kinematics namespace
116 } // utils namespace
117 } // genie namespace
118 
119 #endif // _KINE_UTILS_H_
double COHImportanceSamplingEnvelope(double *x, double *par)
Definition: KineUtils.cxx:1343
bool TransformMatched(KinePhaseSpace_t ia, KinePhaseSpace_t ib, KinePhaseSpace_t a, KinePhaseSpace_t b, bool &fwd)
Definition: KineUtils.cxx:271
THE MAIN GENIE PROJECT NAMESPACE
Definition: GeneratorBase.h:8
Range1D_t InelXLim(double El, double ml, double M)
Definition: KineUtils.cxx:577
Range1D_t InelWLim(double El, double ml, double M)
Definition: KineUtils.cxx:477
void UpdateXYFromWQ2(const Interaction *in)
Definition: KineUtils.cxx:1203
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:991
Range1D_t Inelq2Lim_W(double El, double ml, double M, double W)
Definition: KineUtils.cxx:537
double DISImportanceSamplingEnvelope(double *x, double *par)
Definition: KineUtils.cxx:1311
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 Darkq2Lim(double Ev, double M, double ml, double q2min_cut=-1 *controls::kMinQ2Limit)
Definition: KineUtils.cxx:903
Range1D_t DarkQ2Lim_W(double Ev, double M, double ml, double W, double Q2min_cut=controls::kMinQ2Limit)
Definition: KineUtils.cxx:829
Int_t par
Definition: SimpleIterate.C:24
Range1D_t CohYLim(double Mn, double mpi, double mlep, double Ev, double Q2, double xsi)
Definition: KineUtils.cxx:762
double CohW2Min(double Mn, double mpi)
Definition: KineUtils.cxx:798
Range1D_t InelQ2Lim(double Ev, double M, double ml, double Q2min_cut=controls::kMinQ2Limit)
Definition: KineUtils.cxx:359
enum genie::EKinePhaseSpace KinePhaseSpace_t
double XYtoW(double Ev, double M, double x, double y)
Definition: KineUtils.cxx:1087
static const double kMinQ2Limit
Definition: Controls.h:41
double PhaseSpaceVolume(const Interaction *const i, KinePhaseSpace_t ps)
Definition: KineUtils.cxx:34
Range1D_t InelQ2Lim_W(double Ev, double M, double ml, double W, double Q2min_cut=controls::kMinQ2Limit)
Definition: KineUtils.cxx:309
double W(const Interaction *const i)
Definition: KineUtils.cxx:1015
double SlowRescalingVar(double x, double Q2, double M, double mc)
Definition: KineUtils.cxx:1152
Range1D_t InelXLim(double Ev, double M, double ml)
Definition: KineUtils.cxx:387
Range1D_t DarkQ2Lim(double Ev, double M, double ml, double Q2min_cut=controls::kMinQ2Limit)
Definition: KineUtils.cxx:887
Range1D_t Inelq2Lim_W(double Ev, double M, double ml, double W, double q2min_cut=-1 *controls::kMinQ2Limit)
Definition: KineUtils.cxx:347
Range1D_t CohNuLim(double W2min, double W2max, double Q2, double Mn, double xsi)
Definition: KineUtils.cxx:745
double QD2toQ2(double QD2)
Definition: KineUtils.cxx:985
Range1D_t Darkq2Lim_W(double Ev, double M, double ml, double W, double q2min_cut=-1 *controls::kMinQ2Limit)
Definition: KineUtils.cxx:875
const double a
double XYtoQ2(double Ev, double M, double x, double y)
Definition: KineUtils.cxx:1103
void XYtoWQ2(double Ev, double M, double &W, double &Q2, double x, double y)
Definition: KineUtils.cxx:1069
void WQ2toXY(double Ev, double M, double W, double Q2, double &x, double &y)
Definition: KineUtils.cxx:1046
Range1D_t Cohq2Lim(double Mn, double mpi, double mlep, double Ev)
Definition: KineUtils.cxx:711
Range1D_t CohQ2Lim(double Mn, double mpi, double mlep, double Ev)
Definition: KineUtils.cxx:673
Range1D_t CohXLim(void)
Definition: KineUtils.cxx:665
bool IsAboveCharmThreshold(double x, double Q2, double M, double mc)
Definition: KineUtils.cxx:1133
double Q2toQD2(double Q2)
Definition: KineUtils.cxx:975
Range1D_t InelQ2Lim(double El, double ml, double M)
Definition: KineUtils.cxx:549
Range1D_t Inelq2Lim(double El, double ml, double M)
Definition: KineUtils.cxx:565
static float min(const float a, const float b, const float c)
Definition: absgeo.cxx:45
void UpdateWQ2FromXY(const Interaction *in)
Definition: KineUtils.cxx:1185
Range1D_t InelYLim(double El, double ml, double M)
Definition: KineUtils.cxx:597
ifstream in
Definition: comparison.C:7
Range1D_t InelQ2Lim_W(double El, double ml, double M, double W)
Definition: KineUtils.cxx:499
Range1D_t InelYLim_X(double Ev, double M, double ml, double x)
Definition: KineUtils.cxx:442
double Q2YtoX(double Ev, double M, double Q2, double y)
Definition: KineUtils.cxx:1117
Range1D_t DarkYLim(double Ev, double M, double ml)
Definition: KineUtils.cxx:935
void UpdateXFromQ2Y(const Interaction *in)
Definition: KineUtils.cxx:1221
Range1D_t InelYLim_X(double El, double ml, double M, double x)
Definition: KineUtils.cxx:632
const hit & b
Definition: hits.cxx:21
TRandom3 r(0)
double Jacobian(const Interaction *const i, KinePhaseSpace_t f, KinePhaseSpace_t t)
Definition: KineUtils.cxx:128
Range1D_t DarkYLim_X(double Ev, double M, double ml, double x)
Definition: KineUtils.cxx:951
Range1D_t Inelq2Lim(double Ev, double M, double ml, double q2min_cut=-1 *controls::kMinQ2Limit)
Definition: KineUtils.cxx:375
T max(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:66
void kinematics()
Definition: kinematics.C:10
Range1D_t InelYLim(double Ev, double M, double ml)
Definition: KineUtils.cxx:407
Range1D_t DarkXLim(double Ev, double M, double ml)
Definition: KineUtils.cxx:915
Range1D_t CohW2Lim(double Mn, double mpi, double mlep, double Ev, double Q2)
Definition: KineUtils.cxx:720
void ApplyCutsToKineLimits(Range1D_t &r, double min, double max)
Definition: KineUtils.cxx:1166
Range1D_t DarkWLim(double Ev, double M, double ml)
Definition: KineUtils.cxx:806
double RESImportanceSamplingEnvelope(double *x, double *par)
Definition: KineUtils.cxx:1249