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