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
src
EvtGenBase
EvtTwoBodyKine.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/EvtTwoBodyKine.hh
"
22
23
#include "
EvtGenBase/EvtReport.hh
"
24
25
#include <assert.h>
26
#include <iostream>
27
#include <math.h>
28
using
std::endl;
29
using
std::ostream;
30
31
EvtTwoBodyKine::EvtTwoBodyKine
() :
m_mA
( 0. ),
m_mB
( 0. ),
m_mAB
( 0. )
32
{
33
}
34
35
EvtTwoBodyKine::EvtTwoBodyKine
(
const
double
mA
,
const
double
mB
,
36
const
double
mAB
) :
37
m_mA
(
mA
),
m_mB
(
mB
),
m_mAB
(
mAB
)
38
{
39
if
(
mAB
<
mA
+
mB
) {
40
EvtGenReport
(
EVTGEN_INFO
,
"EvtGen"
)
41
<<
mAB
<<
" < "
<<
mA
<<
" + "
<<
mB
<< endl;
42
assert( 0 );
43
}
44
}
45
46
double
EvtTwoBodyKine::m
(
Index
i )
const
47
{
48
double
ret =
m_mAB
;
49
if
(
A
== i )
50
ret =
m_mA
;
51
else
if
(
B
== i )
52
ret =
m_mB
;
53
54
return
ret;
55
}
56
57
double
EvtTwoBodyKine::p
(
Index
i )
const
58
{
59
double
p0 = 0.;
60
61
if
( i ==
AB
) {
62
double
x =
m_mAB
*
m_mAB
-
m_mA
*
m_mA
-
m_mB
*
m_mB
;
63
double
y = 2 *
m_mA
*
m_mB
;
64
p0 = sqrt( x * x - y * y ) / 2. /
m_mAB
;
65
}
else
if
( i ==
A
) {
66
double
x =
m_mA
*
m_mA
-
m_mAB
*
m_mAB
-
m_mB
*
m_mB
;
67
double
y = 2 *
m_mAB
*
m_mB
;
68
p0 = sqrt( x * x - y * y ) / 2. /
m_mA
;
69
}
else
{
70
double
x =
m_mB
*
m_mB
-
m_mAB
*
m_mAB
-
m_mA
*
m_mA
;
71
double
y = 2 *
m_mAB
*
m_mA
;
72
p0 = sqrt( x * x - y * y ) / 2. /
m_mB
;
73
}
74
75
return
p0;
76
}
77
78
double
EvtTwoBodyKine::e
(
Index
i,
Index
j )
const
79
{
80
double
ret =
m
( i );
81
if
( i != j ) {
82
double
pD =
p
( j );
83
ret = sqrt( ret * ret + pD * pD );
84
}
85
return
ret;
86
}
87
88
void
EvtTwoBodyKine::print
( ostream& os )
const
89
{
90
os <<
" mA = "
<<
m_mA
<< endl;
91
os <<
" mB = "
<<
m_mB
<< endl;
92
os <<
"mAB = "
<<
m_mAB
<< endl;
93
}
94
95
ostream&
operator<<
( ostream& os,
const
EvtTwoBodyKine
& p )
96
{
97
p.
print
( os );
98
return
os;
99
}
EvtReport.hh
EvtGenReport
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=nullptr)
Definition
EvtReport.cpp:32
EVTGEN_INFO
@ EVTGEN_INFO
Definition
EvtReport.hh:52
operator<<
ostream & operator<<(ostream &os, const EvtTwoBodyKine &p)
Definition
EvtTwoBodyKine.cpp:95
EvtTwoBodyKine.hh
EvtTwoBodyKine
Definition
EvtTwoBodyKine.hh:28
EvtTwoBodyKine::mB
double mB() const
Definition
EvtTwoBodyKine.hh:43
EvtTwoBodyKine::m
double m(Index i=AB) const
Definition
EvtTwoBodyKine.cpp:46
EvtTwoBodyKine::m_mB
double m_mB
Definition
EvtTwoBodyKine.hh:60
EvtTwoBodyKine::m_mAB
double m_mAB
Definition
EvtTwoBodyKine.hh:61
EvtTwoBodyKine::Index
Index
Definition
EvtTwoBodyKine.hh:31
EvtTwoBodyKine::A
@ A
Definition
EvtTwoBodyKine.hh:32
EvtTwoBodyKine::AB
@ AB
Definition
EvtTwoBodyKine.hh:34
EvtTwoBodyKine::B
@ B
Definition
EvtTwoBodyKine.hh:33
EvtTwoBodyKine::mAB
double mAB() const
Definition
EvtTwoBodyKine.hh:44
EvtTwoBodyKine::print
void print(std::ostream &os) const
Definition
EvtTwoBodyKine.cpp:88
EvtTwoBodyKine::EvtTwoBodyKine
EvtTwoBodyKine()
Definition
EvtTwoBodyKine.cpp:31
EvtTwoBodyKine::p
double p(Index i=AB) const
Definition
EvtTwoBodyKine.cpp:57
EvtTwoBodyKine::mA
double mA() const
Definition
EvtTwoBodyKine.hh:42
EvtTwoBodyKine::e
double e(Index i, Index j) const
Definition
EvtTwoBodyKine.cpp:78
EvtTwoBodyKine::m_mA
double m_mA
Definition
EvtTwoBodyKine.hh:59
Generated by
1.16.1