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
EvtFlatLineShape.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/EvtFlatLineShape.hh
"
22
23
#include "
EvtGenBase/EvtBlattWeisskopf.hh
"
24
#include "
EvtGenBase/EvtPDL.hh
"
25
#include "
EvtGenBase/EvtPropBreitWigner.hh
"
26
#include "
EvtGenBase/EvtPropBreitWignerRel.hh
"
27
#include "
EvtGenBase/EvtRandom.hh
"
28
#include "
EvtGenBase/EvtSpinType.hh
"
29
#include "
EvtGenBase/EvtTwoBodyVertex.hh
"
30
31
EvtFlatLineShape::EvtFlatLineShape
(
double
mass,
double
width,
double
maxRange,
32
EvtSpinType::spintype
sp )
33
{
34
m_mass
= mass;
35
m_width
= width;
36
m_spin
= sp;
37
m_maxRange
= maxRange;
38
39
double
maxdelta = width;
40
41
m_massMax
= mass + maxdelta;
42
m_massMin
= mass - maxdelta;
43
44
if
(
m_massMin
< 0. )
45
m_massMin
= 0.;
46
}
47
48
EvtFlatLineShape::EvtFlatLineShape
(
const
EvtFlatLineShape
& x ) :
49
EvtAbsLineShape
( x )
50
{
51
m_mass
= x.
m_mass
;
52
m_width
= x.
m_width
;
53
m_spin
= x.
m_spin
;
54
m_massMax
= x.
m_massMax
;
55
m_massMin
= x.
m_massMin
;
56
m_maxRange
= x.
m_maxRange
;
57
}
58
59
EvtFlatLineShape
&
EvtFlatLineShape::operator=
(
const
EvtFlatLineShape
& x )
60
{
61
m_mass
= x.
m_mass
;
62
m_massMax
= x.
m_massMax
;
63
m_massMin
= x.
m_massMin
;
64
m_width
= x.
m_width
;
65
m_maxRange
= x.
m_maxRange
;
66
m_spin
= x.
m_spin
;
67
return
*
this
;
68
}
69
70
EvtAbsLineShape
*
EvtFlatLineShape::clone
()
71
{
72
return
new
EvtFlatLineShape
( *
this
);
73
}
74
75
double
EvtFlatLineShape::getMassProb
(
double
mass,
double
massPar,
int
nDaug,
76
double
* massDau )
77
{
78
double
dTotMass = 0.;
79
80
int
i;
81
for
( i = 0; i < nDaug; i++ ) {
82
dTotMass += massDau[i];
83
}
84
if
( ( mass < dTotMass ) )
85
return
0.;
86
87
if
( massPar > 0.0000000001 ) {
88
if
( mass > massPar )
89
return
0.;
90
}
91
92
return
1.;
93
}
94
95
double
EvtFlatLineShape::getRandMass
(
EvtId
*,
int
,
EvtId
*,
EvtId
*,
double
,
96
double
* )
97
{
98
return
EvtRandom::Flat
(
m_massMin
,
m_massMax
);
99
}
EvtBlattWeisskopf.hh
EvtFlatLineShape.hh
EvtPDL.hh
EvtPropBreitWignerRel.hh
EvtPropBreitWigner.hh
EvtRandom.hh
EvtSpinType.hh
EvtTwoBodyVertex.hh
EvtAbsLineShape::m_massMax
double m_massMax
Definition
EvtAbsLineShape.hh:79
EvtAbsLineShape::EvtAbsLineShape
EvtAbsLineShape()=default
EvtAbsLineShape::m_massMin
double m_massMin
Definition
EvtAbsLineShape.hh:78
EvtAbsLineShape::m_spin
EvtSpinType::spintype m_spin
Definition
EvtAbsLineShape.hh:94
EvtAbsLineShape::m_width
double m_width
Definition
EvtAbsLineShape.hh:80
EvtAbsLineShape::m_mass
double m_mass
Definition
EvtAbsLineShape.hh:77
EvtAbsLineShape::m_maxRange
double m_maxRange
Definition
EvtAbsLineShape.hh:81
EvtFlatLineShape::operator=
EvtFlatLineShape & operator=(const EvtFlatLineShape &x)
Definition
EvtFlatLineShape.cpp:59
EvtFlatLineShape::getMassProb
double getMassProb(double mass, double massPar, int nDaug, double *massDau) override
Definition
EvtFlatLineShape.cpp:75
EvtFlatLineShape::EvtFlatLineShape
EvtFlatLineShape()=default
EvtFlatLineShape::clone
EvtAbsLineShape * clone() override
Definition
EvtFlatLineShape.cpp:70
EvtFlatLineShape::getRandMass
double getRandMass(EvtId *parId, int nDaug, EvtId *dauId, EvtId *othDaugId, double maxMass, double *dauMasses) override
Definition
EvtFlatLineShape.cpp:95
EvtId
Definition
EvtId.hh:27
EvtRandom::Flat
static double Flat()
Definition
EvtRandom.cpp:95
EvtSpinType::spintype
spintype
Definition
EvtSpinType.hh:29
Generated by
1.16.1