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.
EvtTwoBodyVertex.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 
22 
23 #include "EvtGenBase/EvtMacros.hh"
24 #include "EvtGenBase/EvtPatches.hh"
25 
26 #include <assert.h>
27 #include <iostream>
28 #include <math.h>
29 using std::endl;
30 using std::ostream;
31 
32 // Default ctor can sometimes be useful
33 
34 EvtTwoBodyVertex::EvtTwoBodyVertex() : _LL( 0 ), _p0( 0 )
35 {
36 }
37 
38 EvtTwoBodyVertex::EvtTwoBodyVertex( double mA, double mB, double mAB, int L ) :
39  _kine(), _LL( L ), _p0( 0 )
40 {
41  // Kinematics is initialized only if the decay is above threshold
42 
43  if ( mAB > mA + mB ) {
44  _kine = EvtTwoBodyKine( mA, mB, mAB );
45  _p0 = _kine.p();
46  }
47 }
48 
50  _kine( other._kine ),
51  _LL( other._LL ),
52  _p0( other._p0 ),
53  _f( ( other._f ) ? new EvtBlattWeisskopf( *other._f ) : nullptr )
54 {
55 }
56 
58 {
59  _kine = other._kine;
60  _LL = other._LL;
61  _p0 = other._p0;
62  _f.reset( other._f ? new EvtBlattWeisskopf( *other._f ) : nullptr );
63  return *this;
64 }
65 
66 void EvtTwoBodyVertex::set_f( double R )
67 {
68  _f = std::make_unique<EvtBlattWeisskopf>( _LL, R, _p0 );
69 }
70 
72 {
73  assert( _p0 > 0. );
74 
75  double p1 = x.p();
76  double ff = formFactor( x );
77  double factor = pow( p1 / _p0, 2 * _LL + 1 ) * mAB() / x.mAB() * ff * ff;
78 
79  return factor;
80 }
81 
83  EvtTwoBodyKine::Index i ) const
84 {
85  double p1 = x.p( i );
86  double factor = pow( p1, _LL );
87  return factor;
88 }
89 
91 {
92  double ff = 1.;
93 
94  if ( _f ) {
95  double p1 = x.p();
96  ff = ( *_f )( p1 );
97  }
98 
99  return ff;
100 }
101 
102 void EvtTwoBodyVertex::print( ostream& os ) const
103 {
104  os << " mA = " << mA() << endl;
105  os << " mB = " << mB() << endl;
106  os << "mAB = " << mAB() << endl;
107  os << " L = " << _LL << endl;
108  os << " p0 = " << _p0 << endl;
109 }
110 
111 ostream& operator<<( ostream& os, const EvtTwoBodyVertex& v )
112 {
113  v.print( os );
114  return os;
115 }
EvtTwoBodyKine _kine
void set_f(double R)
double mAB() const
double formFactor(EvtTwoBodyKine x) const
double widthFactor(EvtTwoBodyKine x) const
double mA() const
void print(std::ostream &os) const
double mAB() const
std::unique_ptr< EvtBlattWeisskopf > _f
ostream & operator<<(ostream &os, const EvtTwoBodyVertex &v)
double mB() const
double p(Index i=AB) const
EvtTwoBodyVertex & operator=(const EvtTwoBodyVertex &other)
Index other(Index i, Index j)
Definition: EvtCyclic3.cpp:156
double phaseSpaceFactor(EvtTwoBodyKine x, EvtTwoBodyKine::Index) const