cepgen is hosted by Hepforge, IPPP Durham
CepGen 1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
BreitWigner.cpp
Go to the documentation of this file.
1/*
2 * CepGen: a central exclusive processes event generator
3 * Copyright (C) 2013-2022 Laurent Forthomme
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 * 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
19#include <math.h>
20
22
23namespace cepgen {
24 BreitWigner::BreitWigner(double mean, double gamma, double emin, double emax)
25 : mean_(mean), gamma_(gamma), emin_(emin), emax_(emax) {}
26
27 double BreitWigner::operator()(double x) const {
28 const double val = mean_ + 0.5 * gamma_ * tan((2. * x - 1.) * M_PI_2);
29 if (emin_ >= 0. && val < emin_)
30 return -1.;
31 if (emax_ >= 0. && val > emax_)
32 return -1.;
33 return val;
34 }
35
36} // namespace cepgen
double operator()(double x) const
Shoot a value according to parameterisation.
BreitWigner(double mean=0., double gamma=0., double emin=-1., double emax=-1.)
Common namespace for this Monte Carlo generator.