EvtGen 2.2.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
Loading...
Searching...
No Matches
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
24
25#include <assert.h>
26#include <cmath>
27#include <iostream>
28#include <memory>
29using std::endl;
30using std::ostream;
31
32// Default ctor can sometimes be useful
33
37
38EvtTwoBodyVertex::EvtTwoBodyVertex( double mA, double mB, double mAB, int L ) :
39 m_kine(), m_LL( L ), m_p0( 0 )
40{
41 // Kinematics is initialized only if the decay is above threshold
42
43 if ( mAB > mA + mB ) {
45 m_p0 = m_kine.p();
46 }
47}
48
50 m_kine( other.m_kine ),
51 m_LL( other.m_LL ),
52 m_p0( other.m_p0 ),
53 m_f( ( other.m_f ) ? new EvtBlattWeisskopf( *other.m_f ) : nullptr )
54{
55}
56
58{
59 m_kine = other.m_kine;
60 m_LL = other.m_LL;
61 m_p0 = other.m_p0;
62 m_f.reset( other.m_f ? new EvtBlattWeisskopf( *other.m_f ) : nullptr );
63 return *this;
64}
65
67{
68 m_f = std::make_unique<EvtBlattWeisskopf>( m_LL, R, m_p0 );
69}
70
72{
73 assert( m_p0 > 0. );
74
75 double p1 = x.p();
76 double ff = formFactor( x );
77 double factor = pow( p1 / m_p0, 2 * m_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, m_LL );
87 return factor;
88}
89
91{
92 double ff = 1.;
93
94 if ( m_f ) {
95 double p1 = x.p();
96 ff = ( *m_f )( p1 );
97 }
98
99 return ff;
100}
101
102void EvtTwoBodyVertex::print( ostream& os ) const
103{
104 os << " mA = " << mA() << endl;
105 os << " mB = " << mB() << endl;
106 os << "mAB = " << mAB() << endl;
107 os << " L = " << m_LL << endl;
108 os << " p0 = " << m_p0 << endl;
109}
110
111ostream& operator<<( ostream& os, const EvtTwoBodyVertex& v )
112{
113 v.print( os );
114 return os;
115}
ostream & operator<<(ostream &os, const EvtTwoBodyVertex &v)
double mAB() const
double p(Index i=AB) const
EvtTwoBodyKine m_kine
double mAB() const
EvtTwoBodyVertex & operator=(const EvtTwoBodyVertex &other)
double formFactor(EvtTwoBodyKine x) const
void print(std::ostream &os) const
void set_f(double R)
double widthFactor(EvtTwoBodyKine x) const
double mA() const
double mB() const
std::unique_ptr< EvtBlattWeisskopf > m_f
double phaseSpaceFactor(EvtTwoBodyKine x, EvtTwoBodyKine::Index) const