Hammer  1.0.0
Helicity Amplitude Module for Matrix Element Reweighting
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RateTau3PiNu.cc
Go to the documentation of this file.
1 ///
2 /// @file RateTau3PiNu.cc
3 /// @brief \f$ \tau \rightarrow 3\pi \nu \f$ total rate
4 ///
5 
6 //**** This file is a part of the HAMMER library
7 //**** Copyright (C) 2016 - 2020 The HAMMER Collaboration
8 //**** HAMMER is licensed under version 3 of the GPL; see COPYING for details
9 //**** Please note the MCnet academic guidelines; see GUIDELINES for details
10 
11 // -*- C++ -*-
13 #include "Hammer/IndexLabels.hh"
14 #include "Hammer/Math/Constants.hh"
15 #include "Hammer/Particle.hh"
16 #include "Hammer/Tools/Pdg.hh"
18 #include <cmath>
19 
20 using namespace std;
21 
22 namespace Hammer {
23 
24  namespace PS {
25 
26  inline BoundaryFunction makeS1Function(double Mp) {
27  return ([Mp](const vector<double>& vals) -> pair<double, double> {
28  return make_pair(4.*Mp*Mp, pow(sqrt(vals[0]) - Mp,2.) );
29  });
30  }
31 
32  inline BoundaryFunction makeS2Function(double Mp) {
33  return ([Mp](const vector<double>& vals) -> pair<double, double> {
34  double Mp2 = Mp*Mp;
35  double E12 = (vals[0] - Mp2 - vals[1])/(2*sqrt(vals[1]));
36  double sqTerm = (vals[0] - vals[1])/2. + 3.*Mp2/2.;
37  double cosTerm = 2.*sqrt(E12*E12 - Mp2)*sqrt(vals[1]/4. - Mp2);
38  return make_pair(sqTerm - cosTerm, sqTerm + cosTerm);
39  });
40  }
41  }
42 
43  namespace MD = MultiDimensional;
44 
45  RateTau3PiNu::RateTau3PiNu() {
46  // Create tensor rank and dimensions
47  string name{"RateTau3PiInt"};
48  IndexType totNumPoints = static_cast<IndexType>(_nPoints * _nPoints * _nPoints);
49  vector<IndexType> dims{{3, 3, totNumPoints}};
50  auto& pdg = PID::instance();
51  //Ordering is piminus then piplus as anti-tau parent has pdg < 0
52  addProcessSignature(PID::ANTITAU, {PID::PIMINUS, PID::PIPLUS, PID::PIPLUS, PID::NU_TAUBAR});
53  addIntegrationBoundaries({PS::makeQ2Function(3. * pdg.getMass(PID::PIPLUS), pdg.getMass(PID::TAU)),
54  PS::makeS1Function(pdg.getMass(PID::PIPLUS)),
55  PS::makeS2Function(pdg.getMass(PID::PIPLUS))});
57 
58  setSignatureIndex();
59  }
60 
61  Tensor RateTau3PiNu::evalAtPSPoint(const vector<double>& point) {
62  auto labs = getTensor().labels();
63  labs.pop_back();
64  auto dimensions = getTensor().dims();
65  dimensions.pop_back();
66  Tensor result{"RateTau3Pi", MD::makeEmptySparse(dimensions, labs)};
67 
68  const double Mt = masses()[0];
69  const double Mp = masses()[1];
70  const double Mt2 = Mt*Mt;
71  const double Mp2 = Mp*Mp;
72 
73  const double Sqp = point[0];
74  const double s1 = point[1];
75  const double s2 = point[2];
76 
77  const double Ep1 = (Sqp - s1 + Mp2)/(2*sqrt(Sqp));
78  const double Ep2 = (Sqp - s2 + Mp2)/(2*sqrt(Sqp));
79  const double Kp12 = Ep1*Ep1 - Mp2;
80  // const double Kp1 = sqrt(Kp12);
81  const double Kp22 = Ep2*Ep2 - Mp2;
82  // const double Kp2 = sqrt(Kp22);
83 
84  const double Kp1Kp2CosTp12 = (2*Ep1*Ep2 + Mp2 - 2*(Ep1 + Ep2)*sqrt(Sqp) + Sqp)/2.;
85 
86  double RateNorm = pow(GFermi,2.)*pow(Mt2 - Sqp,2.)/(4096.*pow(Mt,3.)*pow(pi,5.)*Sqp);
87 
88  // set non-zero tensor elements
89  result.element({0, 0}) = ((Mt2 + 2.*Sqp)*(4.*Kp12 + Kp22 + 4.*Kp1Kp2CosTp12))/(3.*Sqp);
90  result.element({0, 1}) = ((Mt2 + 2.*Sqp)*(2.*(Kp12 + Kp22) + 5.*Kp1Kp2CosTp12))/(3.*Sqp);
91  result.element({1, 0}) = ((Mt2 + 2.*Sqp)*(2.*(Kp12 + Kp22) + 5.*Kp1Kp2CosTp12))/(3.*Sqp);
92  result.element({1, 1}) = ((Mt2 + 2.*Sqp)*(Kp12 + 4.*Kp22 + 4.*Kp1Kp2CosTp12))/(3.*Sqp);
93  result.element({2, 2}) = Mt2;
94 
95  //Include extra 1/2 factor following tauola code (origin to be understood)
96  result *= 0.5*(RateNorm);
97 
98  return result;
99  }
100 
101 } // namespace Hammer
102 
103 
104 // inline BoundaryFunction makeS1Function(double Mpi) {
105 // return ([Mpi](const vector<double>& vals) -> pair<double, double> {
106 // return make_pair(pow(2. * Mpi, 2.), pow(sqrt(vals[0]) - Mpi, 2.));
107 // });
108 // }
109 //
110 // inline BoundaryFunction makeS2Function(double Mpi) {
111 // double Mpi2 = pow(Mpi, 2.);
112 // return ([Mpi2](const vector<double>& vals) -> pair<double, double> {
113 // double lambda1 = sqrt(vals[0] * vals[0] + vals[1] * vals[1] + Mpi2 * Mpi2 -
114 // 2. * (vals[0] * vals[1] + vals[1] * Mpi2 + vals[0] * Mpi2));
115 // double lambda2 = sqrt(vals[1] * vals[1] - 4. * vals[1] * Mpi2);
116 // double coeff = 1. / (4. * vals[1]);
117 // double a = pow(vals[0] - Mpi2, 2.);
118 // return make_pair(coeff * (a - pow(lambda1 + lambda2, 2.)), coeff * (a - pow(lambda1 - lambda2, 2.)));
119 // });
120 // }
TensorData makeEmptySparse(const IndexList &dimensions, const LabelsList &labels)
LabelsList labels() const
get the labels of all the indices at once
Definition: Tensor.cc:83
static constexpr double GFermi
Definition: Constants.hh:29
Tensor indices label definitions.
std::function< std::pair< double, double >(const std::vector< double > &)> BoundaryFunction
Definition: Integrator.fhh:24
uint16_t IndexType
total rate
BoundaryFunction makeS2Function(double Mp)
Definition: RateTau3PiNu.cc:32
Sparse tensor data container.
Multidimensional tensor class with complex numbers as elements.
Definition: Tensor.hh:33
Various numerical constants.
BoundaryFunction makeS1Function(double Mp)
Definition: RateTau3PiNu.cc:26
Hammer particle data class.
BoundaryFunction makeQ2Function(double qmin, double qmax)
Definition: RateBase.hh:122
Hammer particle class.
static constexpr double pi
Definition: Constants.hh:21