GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MKSPPPXSec2020.h
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*!
3 
4 \class genie::MKSPPPXSec2020
5 
6 \brief
7 Class calculate differental cross-sections
8 \f[
9 \frac{d^4\sigma}{dQ^2dWd\cos\theta_\pi d\phi_\pi}
10 \f]
11 or
12 \f[
13 \frac{d^3\sigma}{dQ^2dWd\cos\theta_\pi}
14 \f]
15 for specific neutrino energy (in lab frame), where:
16 
17 Variable | Description
18 ---------------------|-----------------------------------------------------
19 \f$W\f$ | Invariant mass
20 \f$Q^2\f$ | Sqaured 4-momentum transfer
21 \f$\cos\theta_\pi\f$ | Cosine of pion polar angle in \f$\pi\f$N rest frame
22 \f$\phi_\pi\f$ | Pion azimuthal angle in \f$\pi\f$N rest frame
23 for the following channels:
24 -# \f$\nu + p \to \ell^- + p + \pi^+\f$
25 -# \f$\nu + n \to \ell^- + p + \pi^0\f$
26 -# \f$\nu + n \to \ell^- + n + \pi^+\f$
27 -# \f$\overline{\nu} + n \to \ell^+ + n + \pi^-\f$
28 -# \f$\overline{\nu} + p \to \ell^+ + n + \pi^0\f$
29 -# \f$\overline{\nu} + p \to \ell^+ + p + \pi^-\f$
30 -# \f$\nu + p \to \nu + p + \pi^0\f$
31 -# \f$\nu + p \to \nu + n + \pi^+\f$
32 -# \f$\nu + n \to \nu + n + \pi^0\f$
33 -# \f$\nu + n \to \nu + p + \pi^-\f$
34 -# \f$\overline{\nu} + p \to \overline{\nu} + p + \pi^0\f$
35 -# \f$\overline{\nu} + p \to \overline{\nu} + n + \pi^+\f$
36 -# \f$\overline{\nu} + n \to \overline{\nu} + n + \pi^0\f$
37 -# \f$\overline{\nu} + n \to \overline{\nu} + p + \pi^-\f$
38 
39 \ref
40  1. Kabirnezhad M., Phys.Rev.D 97 (2018) 013002 (Erratim: arXiv:1711.02403)
41  2. Kabirnezhad M., Ph. D. Thesis (https://www.ncbj.gov.pl/sites/default/files/m.kabirnezhad_thesis_0.pdf ,
42  https://www.ncbj.gov.pl/sites/default/files/m.kabirnezhad-thesis_final_0.pdf)
43  3. Rein D., Sehgal L., Ann. of Phys. 133 (1981) 79-153
44  4. Rein D., Z.Phys.C 35 (1987) 43-64
45  5. Adler S.L., Ann. Phys. 50 (1968) 189
46  6. Graczyk K., Sobczyk J., Phys.Rev.D 77 (2008) 053001 [Erratum: ibid.D 79 (2009) 079903]
47  7. Jacob M., Wick G.C., Ann. of Phys. 7 (1959) 404-428
48  8. Hernandez E., Nieves J., Valverde M., Phys.Rev.D 76 (2007) 033005
49  9. Adler S.L., Nussinov S., Paschos E.A., Phys. Rev. D 9 (1974) 2125-2143 [Erratum: ibid D 10 (1974) 1669]
50  10. Paschos E.A., Yu J.Y., Sakuda M., Phys. Rev. D 69 (2004) 014013 [arXiv: hep-ph/0308130]
51  11. Yu J.Y., "Neutrino interactions and nuclear effects in oscillation experiments and the
52  nonperturbative dispersive sector in strong (quasi-)abelian fields", Ph. D.Thesis, Dortmund U., Dortmund, 2002 (unpublished)
53  12. Kakorin I., Kuzmin K., Naumov V. "Report on implementation of the MK-model for resonance single-pion production into GENIE"
54  (https://genie-docdb.pp.rl.ac.uk/cgi-bin/private/ShowDocument?docid=181,
55  http://theor.jinr.ru/NeutrinoOscillations/Papers/Report_MK_implementation_GENIE.pdf)
56 
57 \authors Igor Kakorin <kakorin@jinr.ru>, Joint Institute for Nuclear Research \n
58  Vadim Naumov <vnaumov@theor.jinr.ru>, Joint Institute for Nuclear Research \n
59  adapted from code provided by \n
60  Minoo Kabirnezhad <minoo.kabirnezhad@physics.ox.ac.uk>
61  University of Oxford, Department of Physics \n
62  based on code of \n
63  Costas Andreopoulos <c.andreopoulos@cern.ch>
64  University of Liverpool
65 
66 \created Nov 12, 2019
67 
68 \cpright Copyright (c) 2003-2024, The GENIE Collaboration
69  For the full text of the license visit http://copyright.genie-mc.org
70  or see $GENIE/LICENSE
71 */
72 //____________________________________________________________________________
73 
74 #ifndef _MK_SPP_PXSEC2020_H_
75 #define _MK_SPP_PXSEC2020_H_
76 
77 #include <vector>
78 #include <complex>
79 #include <functional>
80 #include <algorithm>
81 #include <type_traits>
82 
93 
94 namespace genie {
95 
96 
97  class XSecIntegratorI;
98 
100 
101 
102  public:
103  MKSPPPXSec2020();
104  MKSPPPXSec2020(string config);
105  virtual ~MKSPPPXSec2020();
106 
107  // implement the XSecAlgorithmI interface
108  double XSec (const Interaction * i, KinePhaseSpace_t k) const;
109  double Integral (const Interaction * i) const;
110  bool ValidProcess (const Interaction * i) const;
111  bool ValidKinematics(const Interaction * interaction) const;
112 
113  // overload the Algorithm::Configure() methods to load private data
114  // members from configuration options
115  void Configure(const Registry & config);
116  void Configure(string config);
117 
118  private:
119 
120  // Helicities \~{F}^{\lambda_k}_{\lambda_2 \lambda_1} or \~{G}^{\lambda_k}_{\lambda_2 \lambda_1}
121  // Definition are given in eq. 16 from ref. 1
122  // The structure:
123  // Number of resonance
124  // F(Vector) or G(Axial)
125  // \lambda_k (boson polarization eL(M), eR(P), e-(OM), e+(OP))
126  // \lambda_2 (final nucleon polarization -1/2(M), +1/2(P)
127  // \lambda_1 (initial nucleon polarization -1/2(M), +1/2(P)
128  enum Current { VECTOR, AXIAL };
131 
132  //#ifndef DOXYGEN_SHOULD_SKIP_THIS
133  template < typename C, C beginVal, C endVal>
134  class Iterator {
135  typedef typename std::underlying_type<C>::type val_t;
136  int val;
137  public:
138  Iterator(const C & f) : val(static_cast<val_t>(f)) {}
139  Iterator() : val(static_cast<val_t>(beginVal)) {}
141  ++val;
142  return *this;
143  }
144  C operator*() { return static_cast<C>(val); }
145  Iterator begin() { return *this; } //default ctor is good
147  static const Iterator endIter=++Iterator(endVal); // cache it
148  return endIter;
149  }
150  bool operator!=(const Iterator& i) { return val != i.val; }
151  };
152 
156 
157  template<typename T>
158  struct is_complex : std::false_type {};
159 
160  template<typename T>
161  struct is_complex<std::complex<T>> : std::true_type {};
162 
163  template<bool C, typename T = void>
164  using enable_if_t = typename std::enable_if<C, T>::type;
165 
166  template <typename T>
168 
169  public:
170 
173  {
174  array = ha.array;
175  }
178  {
179  int indx = 2*(2*(4*hatype+lambda_k)+lambda_2)+lambda_1;
180  return array[indx];
181  }
182  template<typename S = T, enable_if_t<is_complex<S>{}>* = nullptr>
183  auto Re(Current hatype, BosonPolarization lambda_k, NucleonPolarization lambda_2, NucleonPolarization lambda_1) -> typename S::value_type
184  {
185  return this->operator()(hatype, lambda_k, lambda_2, lambda_1).real();
186  }
187  template<typename S = T, enable_if_t<is_complex<S>{}>* = nullptr>
188  auto Im(Current hatype, BosonPolarization lambda_k, NucleonPolarization lambda_2, NucleonPolarization lambda_1) -> typename S::value_type
189  {
190  return this->operator()(hatype, lambda_k, lambda_2, lambda_1).imag();
191  }
192  template<typename S = T, enable_if_t<!is_complex<S>{}>* = nullptr>
193  auto Re(Current hatype, BosonPolarization lambda_k, NucleonPolarization lambda_2, NucleonPolarization lambda_1) -> S
194  {
195  return this->operator()(hatype, lambda_k, lambda_2, lambda_1);
196  }
197  template<typename S = T, enable_if_t<!is_complex<S>{}>* = nullptr>
198  auto Im(Current hatype, BosonPolarization lambda_k, NucleonPolarization lambda_2, NucleonPolarization lambda_1) -> S
199  {
200  return 0;
201  }
202  HelicityBkgAmp& operator*= (double factor)
203  {
204  std::transform(array.begin(), array.end(), array.begin(), std::bind(std::multiplies<T>(), std::placeholders::_1, factor));
205  return *this;
206  }
207 
208  HelicityBkgAmp& operator/= (double factor)
209  {
210  std::transform(array.begin(), array.end(), array.begin(), std::bind(std::multiplies<T>(), std::placeholders::_1, 1./factor));
211  return *this;
212  }
213 
215  {
216  std::transform(ha.array.begin(), ha.array.end(), array.begin(), array.begin(), std::bind(std::plus<T>(), std::placeholders::_1, std::placeholders::_2));
217  return *this;
218  }
219 
221  {
222  std::transform(ha.array.begin(), ha.array.end(), array.begin(), array.begin(), std::bind(std::minus<T>(), std::placeholders::_2, std::placeholders::_1));
223  return *this;
224  }
225 
227  {
228  if (this != &ha)
229  array = ha.array;
230  return *this;
231  }
232 
234  {
235  lhs += rhs;
236  return lhs;
237  }
238 
240  {
241  lhs -= rhs;
242  return lhs;
243  }
244 
245  friend HelicityBkgAmp operator*(HelicityBkgAmp ha, double factor)
246  {
247  ha *= factor;
248  return ha;
249  }
250 
251  friend HelicityBkgAmp operator*(double factor, HelicityBkgAmp ha)
252  {
253  ha *= factor;
254  return ha;
255  }
256 
257  friend HelicityBkgAmp operator/(HelicityBkgAmp ha, double factor)
258  {
259  ha /= factor;
260  return ha;
261  }
262 
263  friend HelicityBkgAmp operator/(double factor, HelicityBkgAmp ha)
264  {
265  ha /= factor;
266  return ha;
267  }
268 
269  private:
270  std::vector<T> array; //2*4*2*2;
271 
272  };
273 
274  template <typename T>
276 
277  public:
278 
280  {
281  array.reserve(288);
282  }
285  {
286  if (res == kNoResonance)
287  {
288  // meaningless to return anything
289  gAbortingInErr = true;
290  LOG("MKSPPPXSec2020", pFATAL) << "Unknown resonance " << res;
291  exit(1);
292  }
293  int indx = 2*(2*(4*res+lambda_k)+lambda_2)+lambda_1;
294  return array[indx];
295  }
296 
297  template<typename S = T, enable_if_t<is_complex<S>{}>* = nullptr>
298  auto Re(Resonance_t res, BosonPolarization lambda_k, NucleonPolarization lambda_2, NucleonPolarization lambda_1) -> typename S::value_type
299  {
300  return this->operator()(res, lambda_k, lambda_2, lambda_1).real();
301  }
302  template<typename S = T, enable_if_t<is_complex<S>{}>* = nullptr>
303  auto Im(Resonance_t res, BosonPolarization lambda_k, NucleonPolarization lambda_2, NucleonPolarization lambda_1) -> typename S::value_type
304  {
305  return this->operator()(res, lambda_k, lambda_2, lambda_1).imag();
306  }
307  template<typename S = T, enable_if_t<!is_complex<S>{}>* = nullptr>
308  auto Re(Resonance_t res, BosonPolarization lambda_k, NucleonPolarization lambda_2, NucleonPolarization lambda_1) -> S
309  {
310  return this->operator()(res, lambda_k, lambda_2, lambda_1);
311  }
312  template<typename S = T, enable_if_t<!is_complex<S>{}>* = nullptr>
313  auto Im(Resonance_t res, BosonPolarization lambda_k, NucleonPolarization lambda_2, NucleonPolarization lambda_1) -> S
314  {
315  return 0;
316  }
317 
318  private:
319  std::vector<T> array; //nres*4*2*2, nres=18
320 
321  };
322 
323  template <typename T>
325 
326  public:
327 
331  {
332  int indx = 2*(2*lambda_k+lambda_2)+lambda_1;
333  return array[indx];
334  }
335 
336  template<typename S = T, enable_if_t<is_complex<S>{}>* = nullptr>
337  auto Re(BosonPolarization lambda_k, NucleonPolarization lambda_2, NucleonPolarization lambda_1) -> typename S::value_type
338  {
339  return this->operator()(lambda_k, lambda_2, lambda_1).real();
340  }
341  template<typename S = T, enable_if_t<is_complex<S>{}>* = nullptr>
342  auto Im(BosonPolarization lambda_k, NucleonPolarization lambda_2, NucleonPolarization lambda_1) -> typename S::value_type
343  {
344  return this->operator()(lambda_k, lambda_2, lambda_1).imag();
345  }
346  template<typename S = T, enable_if_t<!is_complex<S>{}>* = nullptr>
347  auto Re(BosonPolarization lambda_k, NucleonPolarization lambda_2, NucleonPolarization lambda_1) -> S
348  {
349  return this->operator()(lambda_k, lambda_2, lambda_1);
350  }
351  template<typename S = T, enable_if_t<!is_complex<S>{}>* = nullptr>
352  auto Im(BosonPolarization lambda_k, NucleonPolarization lambda_2, NucleonPolarization lambda_1) -> S
353  {
354  return 0;
355  }
356 
357  private:
358  std::vector<T> array; //4*2*2
359 
360  };
361 
362  //#endif
363  int Lambda (NucleonPolarization l) const;
364  int Lambda (BosonPolarization l) const;
366 
367  void LoadConfig (void);
368  mutable FKR fFKR;
372 
373 
374  // configuration data
375  double fFermiConstant ;
376  double fCA50; ///< FKR parameter Zeta
377  double fOmega; ///< FKR parameter Omega
378  double fMa2; ///< (axial mass)^2
379  double fMv2; ///< (vector mass)^2
380  double fCv3; ///< GV calculation coeffs
381  double fCv4;
382  double fCv51;
383  double fCv52;
384  double fSin2Wein; ///< sin^2(Weingberg angle)
385  double fVud; ///< |Vud| (magnitude ud-element of CKM-matrix)
386  double fXSecScaleCC; ///< External CC xsec scaling factor
387  double fXSecScaleNC; ///< External NC xsec scaling factor
388  const ELFormFactorsModelI * fElFFModel; ///< Elastic form facors model for background contribution
389  const QELFormFactorsModelI * fFormFactorsModel; ///< Quasielastic form facors model for background contribution
390  const QELFormFactorsModelI * fEMFormFactorsModel; ///< Electromagnetic form factors model for background contribution
391 
392  string fKFTable; ///< Table of Fermi momentum (kF) constants for various nuclei
393  bool fUseRFGParametrization; ///< Use parametrization for fermi momentum insted of table?
394  bool fUsePauliBlocking; ///< Account for Pauli blocking?
395 
396  mutable QELFormFactors fFormFactors; ///< Quasielastic form facors for background contribution
397  mutable QELFormFactors fEMFormFactors; ///< Electromagnetic form facors for background contribution
398  double f_pi; ///< Constant for pion-nucleon interaction
399  double FA0; ///< Axial coupling (value of axial form factor at Q2=0)
400  double Frho0; ///< Value of form factor F_rho at t=0
401  /// Parameters for vector virtual form factor
402  /// for background contribution, which equal to:
403  /// 1, W<VWmin
404  /// V3*W^3+V2*W^2+V1*W+V0 VWmin<W<VWmax
405  /// 0 W>VWmax
406  double fBkgVWmin;
407  double fBkgVWmax;
408  double fBkgV3;
409  double fBkgV2;
410  double fBkgV1;
411  double fBkgV0;
412  double fRho770Mass; ///< Mass of rho(770) meson
413  double fWmax; ///< The value above which the partial cross section is set to zero (if negative then not appliciable)
414 
415  bool fUseAuthorCode; ///< Use author code?
416 
418 
420 
421  };
422 
423 
424 } // genie namespace
425 
426 #endif // _MK_SPP_PXSEC2020_H_
auto Re(Current hatype, BosonPolarization lambda_k, NucleonPolarization lambda_2, NucleonPolarization lambda_1) -> typename S::value_type
Cross Section Calculation Interface.
HelicityBkgAmp & operator+=(const HelicityBkgAmp &ha)
A class holding Quasi Elastic (QEL) Form Factors.
const XSecIntegratorI * fXSecIntegrator
Cross Section Integrator Interface.
auto Re(Resonance_t res, BosonPolarization lambda_k, NucleonPolarization lambda_2, NucleonPolarization lambda_1) -> S
#define pFATAL
Definition: Messenger.h:56
Simple struct-like class holding the Feynmann-Kislinger-Ravndall (FKR) baryon excitation model parame...
Definition: FKR.h:31
friend HelicityBkgAmp operator/(HelicityBkgAmp ha, double factor)
T & operator()(Resonance_t res, BosonPolarization lambda_k, NucleonPolarization lambda_2, NucleonPolarization lambda_1)
double fSin2Wein
sin^2(Weingberg angle)
friend HelicityBkgAmp operator-(HelicityBkgAmp lhs, const HelicityBkgAmp &rhs)
Encapsulates a list of baryon resonances.
Definition: BaryonResList.h:37
const RSHelicityAmplModelI * fHAmplModelCC
auto Re(BosonPolarization lambda_k, NucleonPolarization lambda_2, NucleonPolarization lambda_1) -> S
HelicityBkgAmp & operator/=(double factor)
enum genie::EKinePhaseSpace KinePhaseSpace_t
bool fUseRFGParametrization
Use parametrization for fermi momentum insted of table?
double fWmax
The value above which the partial cross section is set to zero (if negative then not appliciable) ...
double fMa2
(axial mass)^2
double fXSecScaleNC
External NC xsec scaling factor.
enum genie::EResonance Resonance_t
auto Im(BosonPolarization lambda_k, NucleonPolarization lambda_2, NucleonPolarization lambda_1) -> typename S::value_type
double Integral(const Interaction *i) const
double fCA50
FKR parameter Zeta.
friend HelicityBkgAmp operator+(HelicityBkgAmp lhs, const HelicityBkgAmp &rhs)
Summary information for an interaction.
Definition: Interaction.h:56
auto Re(Current hatype, BosonPolarization lambda_k, NucleonPolarization lambda_2, NucleonPolarization lambda_1) -> S
BaryonResList fResList
Class calculate differental cross-sections or for specific neutrino energy (in lab frame)...
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
Pure abstract base class. Defines the QELFormFactorsModelI interface to be implemented by any algorit...
double XSec(const Interaction *i, KinePhaseSpace_t k) const
Compute the cross section for the input interaction.
Pure abstract base class. Defines the ELFormFactorsModelI interface to be implemented by any algorith...
friend HelicityBkgAmp operator*(double factor, HelicityBkgAmp ha)
int Lambda(NucleonPolarization l) const
const RSHelicityAmplModelI * fHAmplModelNCp
double fRho770Mass
Mass of rho(770) meson.
double fMv2
(vector mass)^2
bool operator!=(const Iterator &i)
const RSHelicityAmplModelI * fHAmplModelNCn
typename std::enable_if< C, T >::type enable_if_t
double FA0
Axial coupling (value of axial form factor at Q2=0)
const QELFormFactorsModelI * fEMFormFactorsModel
Electromagnetic form factors model for background contribution.
HelicityBkgAmp & operator-=(const HelicityBkgAmp &ha)
double f_pi
Constant for pion-nucleon interaction.
Pure abstract base class. Defines the RSHelicityAmplModelI interface.
void Configure(const Registry &config)
string fKFTable
Table of Fermi momentum (kF) constants for various nuclei.
const ELFormFactorsModelI * fElFFModel
Elastic form facors model for background contribution.
HelicityBkgAmp(const HelicityBkgAmp &ha)
friend HelicityBkgAmp operator*(HelicityBkgAmp ha, double factor)
double fCv3
GV calculation coeffs.
bool fUsePauliBlocking
Account for Pauli blocking?
auto Re(Resonance_t res, BosonPolarization lambda_k, NucleonPolarization lambda_2, NucleonPolarization lambda_1) -> typename S::value_type
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:65
T & operator()(Current hatype, BosonPolarization lambda_k, NucleonPolarization lambda_2, NucleonPolarization lambda_1)
double fOmega
FKR parameter Omega.
double fVud
|Vud| (magnitude ud-element of CKM-matrix)
auto Im(BosonPolarization lambda_k, NucleonPolarization lambda_2, NucleonPolarization lambda_1) -> S
int PhaseFactor(BosonPolarization lk, NucleonPolarization l1, NucleonPolarization l2) const
std::underlying_type< C >::type val_t
T & operator()(BosonPolarization lambda_k, NucleonPolarization lambda_2, NucleonPolarization lambda_1)
bool fUseAuthorCode
Use author code?
auto Im(Resonance_t res, BosonPolarization lambda_k, NucleonPolarization lambda_2, NucleonPolarization lambda_1) -> S
HelicityBkgAmp & operator=(const HelicityBkgAmp &ha)
auto Im(Current hatype, BosonPolarization lambda_k, NucleonPolarization lambda_2, NucleonPolarization lambda_1) -> S
QELFormFactors fFormFactors
Quasielastic form facors for background contribution.
double fXSecScaleCC
External CC xsec scaling factor.
auto Re(BosonPolarization lambda_k, NucleonPolarization lambda_2, NucleonPolarization lambda_1) -> typename S::value_type
QELFormFactors fEMFormFactors
Electromagnetic form facors for background contribution.
HelicityBkgAmp & operator*=(double factor)
bool ValidProcess(const Interaction *i) const
Can this cross section algorithm handle the input process?
bool gAbortingInErr
Definition: Messenger.cxx:34
const QELFormFactorsModelI * fFormFactorsModel
Quasielastic form facors model for background contribution.
bool ValidKinematics(const Interaction *interaction) const
Is the input kinematical point a physically allowed one?
auto Im(Current hatype, BosonPolarization lambda_k, NucleonPolarization lambda_2, NucleonPolarization lambda_1) -> typename S::value_type
friend HelicityBkgAmp operator/(double factor, HelicityBkgAmp ha)
auto Im(Resonance_t res, BosonPolarization lambda_k, NucleonPolarization lambda_2, NucleonPolarization lambda_1) -> typename S::value_type