MINT2
src
Mojito
DecayTrees
DecayTreeItem.cpp
Go to the documentation of this file.
1
// author: Jonas Rademacker (Jonas.Rademacker@bristol.ac.uk)
2
// status: Mon 9 Feb 2009 19:18:03 GMT
3
4
#include "
Mint/DecayTreeItem.h
"
5
#include "
Mint/ParticlePropertiesList.h
"
6
#include <cmath>
7
8
DecayTreeItem::DecayTreeItem
(
int
i)
9
: _pdg_id(i)
10
, _L_angMom(-9999)
11
{
12
}
13
DecayTreeItem::DecayTreeItem
(
const
DecayTreeItem
& other)
14
: _pdg_id(other._pdg_id)
15
, _L_angMom(other._L_angMom)
16
{}
17
DecayTreeItem
&
DecayTreeItem::operator=
(
const
DecayTreeItem
& other){
18
_pdg_id
= other.
_pdg_id
;
19
_L_angMom
= other.
_L_angMom
;
20
return
*
this
;
21
}
22
23
const
ParticleProperties
*
DecayTreeItem::props
()
const
{
24
const
ParticlePropertiesList
* ppl =
ParticlePropertiesList::getMe
();
25
if
(0 == ppl){
26
std::cout <<
"Error in DecayTreeItem::props(): "
27
<<
"can't find ParticlePropertiesList."
28
<< std::endl;
29
return
0;
30
}
31
return
ppl->
get
(
_pdg_id
);
32
}
33
std::string
DecayTreeItem::name
()
const
{
34
const
ParticleProperties
* pp =
props
();
35
if
(0 == pp){
36
return
""
;
37
}
38
return
pp->
name
();
39
}
40
std::string
DecayTreeItem::SVPAT
()
const
{
41
const
ParticleProperties
* pp =
props
();
42
if
(0 == pp){
43
return
"?"
;
44
}
45
return
pp->
SVPAT
();
46
}
47
double
DecayTreeItem::mass
()
const
{
48
const
ParticleProperties
* pp =
props
();
49
if
(0 == pp){
50
return
-1;
51
}
52
return
pp->
mass
();
53
}
54
bool
DecayTreeItem::isNonResonant
()
const
{
55
const
ParticleProperties
* pp =
props
();
56
if
(0 == pp){
57
return
false
;
58
}
59
return
pp->
isNonResonant
();
60
}
61
double
DecayTreeItem::width
()
const
{
62
const
ParticleProperties
* pp =
props
();
63
if
(0 == pp){
64
return
-1;
65
}
66
return
pp->
width
();
67
}
68
std::string
DecayTreeItem::charge
()
const
{
69
const
ParticleProperties
* pp =
props
();
70
if
(0 == pp){
71
return
"-9999"
;
72
}
73
return
pp->
charge
();
74
}
75
bool
DecayTreeItem::hasDistinctAnti
()
const
{
76
const
ParticleProperties
* pp =
props
();
77
if
(0 == pp){
78
return
-1;
79
}
80
return
pp->
hasDistinctAnti
();
81
}
82
int
DecayTreeItem::pdg
()
const
{
83
return
_pdg_id
;
84
}
85
86
std::string
DecayTreeItem::J
()
const
{
87
const
ParticleProperties
* pp =
props
();
88
if
(0 == pp){
89
return
""
;
90
}
91
return
pp->
J
();
92
}
93
94
95
bool
DecayTreeItem::ChargeConThis
(){
96
if
(!
hasDistinctAnti
())
return
false
;
97
_pdg_id
*= -1;
98
return
true
;
99
}
100
101
void
DecayTreeItem::setPDG
(
int
id
){
102
_pdg_id
= id;
103
}
104
char
DecayTreeItem::L_as_SPD
()
const
{
105
if
(
L
() < 0)
return
' '
;
106
107
if
(
L
()==0)
return
'S'
;
108
else
if
(
L
()==1)
return
'P'
;
109
else
if
(
L
()==2)
return
'D'
;
110
else
if
(
L
()==3)
return
'F'
;
111
else
if
(
L
()==4)
return
'G'
;
112
else
if
(
L
()==5)
return
'H'
;
113
else
if
(
L
()==6)
return
'I'
;
114
else
{
115
// J's missing, next (L=7) is K, then alphabetical
116
char
Kplus=
'K'
;
117
int
advanceK =
L
()-7;
118
for
(
int
i=0; i < advanceK; i++) Kplus++;
119
return
Kplus;
120
}
121
}
122
123
void
DecayTreeItem::print
(std::ostream& out)
const
{
124
const
ParticleProperties
* pp =
props
();
125
if
(0 == pp){
126
out <<
_pdg_id
;
127
}
else
{
128
out << pp->
name
()
129
<<
"("
<< pp->
SVPAT
() <<
")"
;
130
}
131
if
(
L
() > -9998){
132
out <<
L_as_SPD
() <<
"-wave"
;
133
}
134
}
135
void
DecayTreeItem::printShort
(std::ostream& out)
const
{
136
const
ParticleProperties
* pp =
props
();
137
if
(0 == pp){
138
out <<
_pdg_id
;
139
}
else
{
140
out << pp->
name
();
141
}
142
if
(
L
() > -9998){
143
out <<
"["
<<
L_as_SPD
() <<
"]"
;
144
}
145
}
146
DecayTreeItem
DecayTreeItem::operator-
()
const
{
147
DecayTreeItem
dt(*
this
);
148
dt.
antiThis
();
149
return
dt;
150
}
151
DecayTreeItem
DecayTreeItem::operator+
()
const
{
152
return
*
this
;
153
}
154
155
std::ostream&
operator<<
(std::ostream& os
156
,
const
DecayTreeItem
& dti){
157
dti.
print
(os);
158
return
os;
159
}
160
161
std::stringstream&
operator<<
(std::stringstream& seam
162
,
const
DecayTreeItem
& dti){
163
dti.
printShort
(seam);
164
return
seam;
165
}
166
167
std::stringstream&
operator<<
(std::stringstream& seam
168
,
int
i){
169
((std::ostream&) seam) << i;
170
return
seam;
171
}
172
173
174
//
ParticleProperties::mass
double mass() const
Definition:
ParticleProperties.h:47
ParticleProperties::SVPAT
std::string SVPAT() const
Definition:
ParticleProperties.h:87
DecayTreeItem::SVPAT
std::string SVPAT() const
Definition:
DecayTreeItem.cpp:40
DecayTreeItem::hasDistinctAnti
bool hasDistinctAnti() const
Definition:
DecayTreeItem.cpp:75
DecayTreeItem::L_as_SPD
char L_as_SPD() const
Definition:
DecayTreeItem.cpp:104
ParticleProperties::J
std::string J() const
Definition:
ParticleProperties.h:67
DecayTreeItem
Definition:
DecayTreeItem.h:11
DecayTreeItem::operator=
DecayTreeItem & operator=(const DecayTreeItem &other)
Definition:
DecayTreeItem.cpp:17
operator<<
std::ostream & operator<<(std::ostream &os, const DecayTreeItem &dti)
Definition:
DecayTreeItem.cpp:155
DecayTreeItem::charge
std::string charge() const
Definition:
DecayTreeItem.cpp:68
ParticleProperties::hasDistinctAnti
bool hasDistinctAnti() const
Definition:
ParticleProperties.cpp:218
DecayTreeItem::mass
double mass() const
Definition:
DecayTreeItem.cpp:47
ParticleProperties::charge
std::string charge() const
Definition:
ParticleProperties.h:71
ParticleProperties
Definition:
ParticleProperties.h:13
DecayTreeItem::print
virtual void print(std::ostream &out=std::cout) const
Definition:
DecayTreeItem.cpp:123
ParticlePropertiesList.h
DecayTreeItem::_L_angMom
int _L_angMom
Definition:
DecayTreeItem.h:42
DecayTreeItem::printShort
virtual void printShort(std::ostream &out=std::cout) const
Definition:
DecayTreeItem.cpp:135
DecayTreeItem::antiThis
bool antiThis()
Definition:
DecayTreeItem.h:78
ParticlePropertiesList::get
const ParticleProperties * get(const std::string &name) const
Definition:
ParticlePropertiesList.cpp:237
ParticleProperties::isNonResonant
bool isNonResonant() const
Definition:
ParticleProperties.cpp:284
DecayTreeItem::ChargeConThis
bool ChargeConThis()
Definition:
DecayTreeItem.cpp:95
DecayTreeItem::setPDG
void setPDG(int id)
Definition:
DecayTreeItem.cpp:101
DecayTreeItem::J
std::string J() const
Definition:
DecayTreeItem.cpp:86
DecayTreeItem::L
int L() const
Definition:
DecayTreeItem.h:59
ParticleProperties::name
std::string name() const
Definition:
ParticleProperties.cpp:236
DecayTreeItem::name
std::string name() const
Definition:
DecayTreeItem.cpp:33
ParticlePropertiesList::getMe
static const ParticlePropertiesList * getMe()
Definition:
ParticlePropertiesList.cpp:21
ParticlePropertiesList
Definition:
ParticlePropertiesList.h:14
DecayTreeItem::pdg
int pdg() const
Definition:
DecayTreeItem.cpp:82
DecayTreeItem::width
double width() const
Definition:
DecayTreeItem.cpp:61
DecayTreeItem::isNonResonant
bool isNonResonant() const
Definition:
DecayTreeItem.cpp:54
DecayTreeItem::props
const ParticleProperties * props() const
Definition:
DecayTreeItem.cpp:23
DecayTreeItem::DecayTreeItem
DecayTreeItem(int i=0)
Definition:
DecayTreeItem.cpp:8
DecayTreeItem::_pdg_id
int _pdg_id
Definition:
DecayTreeItem.h:41
DecayTreeItem.h
ParticleProperties::width
double width() const
Definition:
ParticleProperties.h:57
DecayTreeItem::operator+
DecayTreeItem operator+() const
Definition:
DecayTreeItem.cpp:151
DecayTreeItem::operator-
DecayTreeItem operator-() const
Definition:
DecayTreeItem.cpp:146
Generated by
1.8.15