EvtGen
2.2.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
Toggle main menu visibility
Loading...
Searching...
No Matches
src
EvtGenBase
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
21
#include "
EvtGenBase/EvtTwoBodyVertex.hh
"
22
23
#include "
EvtGenBase/EvtMacros.hh
"
24
25
#include <assert.h>
26
#include <cmath>
27
#include <iostream>
28
#include <memory>
29
using
std::endl;
30
using
std::ostream;
31
32
// Default ctor can sometimes be useful
33
34
EvtTwoBodyVertex::EvtTwoBodyVertex
() :
m_LL
( 0 ),
m_p0
( 0 )
35
{
36
}
37
38
EvtTwoBodyVertex::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
) {
44
m_kine
=
EvtTwoBodyKine
(
mA
,
mB
,
mAB
);
45
m_p0
=
m_kine
.p();
46
}
47
}
48
49
EvtTwoBodyVertex::EvtTwoBodyVertex
(
const
EvtTwoBodyVertex
& other ) :
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
57
EvtTwoBodyVertex
&
EvtTwoBodyVertex::operator=
(
const
EvtTwoBodyVertex
& other )
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
66
void
EvtTwoBodyVertex::set_f
(
double
R )
67
{
68
m_f
= std::make_unique<EvtBlattWeisskopf>(
m_LL
, R,
m_p0
);
69
}
70
71
double
EvtTwoBodyVertex::widthFactor
(
EvtTwoBodyKine
x )
const
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
82
double
EvtTwoBodyVertex::phaseSpaceFactor
(
EvtTwoBodyKine
x,
83
EvtTwoBodyKine::Index
i )
const
84
{
85
double
p1 = x.
p
( i );
86
double
factor = pow( p1,
m_LL
);
87
return
factor;
88
}
89
90
double
EvtTwoBodyVertex::formFactor
(
EvtTwoBodyKine
x )
const
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
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 = "
<<
m_LL
<< endl;
108
os <<
" p0 = "
<<
m_p0
<< endl;
109
}
110
111
ostream&
operator<<
( ostream& os,
const
EvtTwoBodyVertex
& v )
112
{
113
v.
print
( os );
114
return
os;
115
}
EvtMacros.hh
operator<<
ostream & operator<<(ostream &os, const EvtTwoBodyVertex &v)
Definition
EvtTwoBodyVertex.cpp:111
EvtTwoBodyVertex.hh
EvtBlattWeisskopf
Definition
EvtBlattWeisskopf.hh:27
EvtTwoBodyKine
Definition
EvtTwoBodyKine.hh:28
EvtTwoBodyKine::Index
Index
Definition
EvtTwoBodyKine.hh:31
EvtTwoBodyKine::mAB
double mAB() const
Definition
EvtTwoBodyKine.hh:44
EvtTwoBodyKine::p
double p(Index i=AB) const
Definition
EvtTwoBodyKine.cpp:57
EvtTwoBodyVertex
Definition
EvtTwoBodyVertex.hh:32
EvtTwoBodyVertex::m_kine
EvtTwoBodyKine m_kine
Definition
EvtTwoBodyVertex.hh:53
EvtTwoBodyVertex::EvtTwoBodyVertex
EvtTwoBodyVertex()
Definition
EvtTwoBodyVertex.cpp:34
EvtTwoBodyVertex::mAB
double mAB() const
Definition
EvtTwoBodyVertex.hh:46
EvtTwoBodyVertex::operator=
EvtTwoBodyVertex & operator=(const EvtTwoBodyVertex &other)
Definition
EvtTwoBodyVertex.cpp:57
EvtTwoBodyVertex::m_p0
double m_p0
Definition
EvtTwoBodyVertex.hh:55
EvtTwoBodyVertex::formFactor
double formFactor(EvtTwoBodyKine x) const
Definition
EvtTwoBodyVertex.cpp:90
EvtTwoBodyVertex::L
int L() const
Definition
EvtTwoBodyVertex.hh:43
EvtTwoBodyVertex::print
void print(std::ostream &os) const
Definition
EvtTwoBodyVertex.cpp:102
EvtTwoBodyVertex::set_f
void set_f(double R)
Definition
EvtTwoBodyVertex.cpp:66
EvtTwoBodyVertex::widthFactor
double widthFactor(EvtTwoBodyKine x) const
Definition
EvtTwoBodyVertex.cpp:71
EvtTwoBodyVertex::mA
double mA() const
Definition
EvtTwoBodyVertex.hh:44
EvtTwoBodyVertex::m_LL
int m_LL
Definition
EvtTwoBodyVertex.hh:54
EvtTwoBodyVertex::mB
double mB() const
Definition
EvtTwoBodyVertex.hh:45
EvtTwoBodyVertex::m_f
std::unique_ptr< EvtBlattWeisskopf > m_f
Definition
EvtTwoBodyVertex.hh:56
EvtTwoBodyVertex::phaseSpaceFactor
double phaseSpaceFactor(EvtTwoBodyKine x, EvtTwoBodyKine::Index) const
Definition
EvtTwoBodyVertex.cpp:82
Generated by
1.17.0