evtgen is hosted by Hepforge, IPPP Durham
EvtGen  2.0.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
EvtFlatte.cpp
Go to the documentation of this file.
1 
2 /***********************************************************************
3 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
4 * *
5 * This file is part of EvtGen. *
6 * *
7 * EvtGen is free software: you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation, either version 3 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * EvtGen is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
19 ***********************************************************************/
20 
21 #include "EvtGenBase/EvtFlatte.hh"
22 
23 #include "EvtGenBase/EvtComplex.hh"
24 #include "EvtGenBase/EvtConst.hh"
25 #include "EvtGenBase/EvtKine.hh"
26 #include "EvtGenBase/EvtPatches.hh"
27 #include "EvtGenBase/EvtReport.hh"
29 
30 #include <math.h>
31 
32 //operator
33 
35 {
36  if ( &n == this )
37  return *this;
38  _p4_p = n._p4_p;
39  _p4_d1 = n._p4_d1;
40  _p4_d2 = n._p4_d2;
41  _ampl = n._ampl;
42  _theta = n._theta;
43  _mass = n._mass;
44  _params = n._params;
45  // _m1a = n._m1a;
46  // _m1b = n._m1b;
47  // _g1 = n._g1;
48  // _m2a = n._m2a;
49  // _m2b = n._m2b;
50  // _g2 = n._g2;
51  return *this;
52 }
53 
54 //constructor
55 
56 EvtFlatte::EvtFlatte( const EvtVector4R& p4_p, const EvtVector4R& p4_d1,
57  const EvtVector4R& p4_d2, double ampl, double theta,
58  double mass, vector<EvtFlatteParam>& params
59  // double m1a, double m1b, double g1,
60  // double m2a, double m2b, double g2
61  ) :
62  _p4_p( p4_p ),
63  _p4_d1( p4_d1 ),
64  _p4_d2( p4_d2 ),
65  _ampl( ampl ),
66  _theta( theta ),
67  _mass( mass ),
68  _params( params )
69 // _m1a(m1a), _m1b(m1b), _g1(g1),
70 // _m2a(m2a), _m2b(m2b), _g2(g2)
71 {
72 }
73 
74 //amplitude function
75 
77 {
78  double pi180inv = 1.0 / EvtConst::radToDegrees;
79 
80  // EvtComplex ampl(cos(_theta*pi180inv), sin(_theta*pi180inv));
81  // ampl *= _ampl;
82 
83  // SCALARS ONLY
84  double mR = ( _p4_d1 + _p4_d2 ).mass();
85 
86  EvtComplex w;
87 
88  for ( vector<EvtFlatteParam>::const_iterator param = _params.begin();
89  param != _params.end(); ++param ) {
90  double m1 = ( *param ).m1();
91  double m2 = ( *param ).m2();
92  double g = ( *param ).g();
93  w += ( g * g *
94  sqrtCplx( ( 1 - ( ( m1 - m2 ) * ( m1 - m2 ) ) / ( mR * mR ) ) *
95  ( 1 - ( ( m1 + m2 ) * ( m1 + m2 ) ) / ( mR * mR ) ) ) );
96  // cout << m1 << " " << mR << " " << w << endl;
97  }
98 
99  EvtComplex denom = _mass * _mass - mR * mR - EvtComplex( 0, 1 ) * w;
100  EvtComplex ampl = _ampl *
101  EvtComplex( cos( _theta * pi180inv ),
102  sin( _theta * pi180inv ) ) /
103  denom;
104  // cout << abs(1/denom) << endl;
105  return ampl;
106 }
double _ampl
Definition: EvtFlatte.hh:91
double _mass
Definition: EvtFlatte.hh:91
EvtVector4R _p4_p
Definition: EvtFlatte.hh:90
EvtComplex sqrtCplx(double in)
Definition: EvtFlatte.hh:84
double _theta
Definition: EvtFlatte.hh:91
EvtVector4R _p4_d1
Definition: EvtFlatte.hh:90
EvtVector4R _p4_d2
Definition: EvtFlatte.hh:90
EvtComplex resAmpl()
Definition: EvtFlatte.cpp:76
static const double radToDegrees
Definition: EvtConst.hh:28
double mass()
Definition: EvtFlatte.hh:76
EvtFlatte(const EvtVector4R &p4_p, const EvtVector4R &p4_d1, const EvtVector4R &p4_d2, double ampl, double theta, double mass, vector< EvtFlatteParam > &params)
Definition: EvtFlatte.cpp:56
vector< EvtFlatteParam > _params
Definition: EvtFlatte.hh:92
EvtFlatte & operator=(const EvtFlatte &)
Definition: EvtFlatte.cpp:34