NarrowWidthApproximation.cc
1 /*
2  * MoMEMta: a modular implementation of the Matrix Element Method
3  * Copyright (C) 2016 Universite catholique de Louvain (UCL), Belgium
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
69 #include <momemta/ParameterSet.h>
70 #include <momemta/Module.h>
71 
72 #include <cmath>
73 
75  public:
76 
77  NarrowWidthApproximation(PoolPtr pool, const ParameterSet& parameters): Module(pool, parameters.getModuleName())
78  {
79  double mass = parameters.get<double>("mass");
80  double width = parameters.get<double>("width");
81 
82  *jacobian = M_PI;
83  if(parameters.get<bool>("propagator_in_me", true))
84  *jacobian *= mass*width;
85  else
86  *jacobian /= mass*width;
87 
88  *s = mass*mass;
89  }
90 
91  private:
92 
93  std::shared_ptr<double> s = produce<double>("s");
94  std::shared_ptr<double> jacobian = produce<double>("jacobian");
95 };
96 
97 REGISTER_MODULE(NarrowWidthApproximation)
98  .Output("s")
99  .Output("jacobian")
100  .Attr("mass:double")
101  .Attr("width:double")
102  .Attr("propagator_in_me:bool=true");
Use the Narrow Width Approximation (NWA) to reduce the dimensionality of the integration.
Parent class for all the modules.
Definition: Module.h:37
A class encapsulating a lua table.
Definition: ParameterSet.h:82
Module(PoolPtr pool, const std::string &name)
Constructor.
Definition: Module.h:61