Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CLHEP
CLHEP
Commits
c28b7f94
Commit
c28b7f94
authored
Mar 16, 2005
by
Lynn Garren
Browse files
isNucleus will recognize a proton (2212) as a valid nucleus
parent
85178cbd
Changes
4
Hide whitespace changes
Inline
Side-by-side
HepPDT/ChangeLog
View file @
c28b7f94
2005-03-15 Lynn Garren <garren@fnal.gov>
* ParticleID: The isNucleus method will recognize a proton (2212)
as a nuclear fragment.
* The translation free functions are now in ParticleIDTranslations.hh
which is included in ParticleID.hh.
...
...
HepPDT/src/isNucleus.cc
View file @
c28b7f94
// $Id: isNucleus.cc,v 1.1.1.1 200
3
/0
7
/1
5 20:15
:0
5
garren Exp $
// $Id: isNucleus.cc,v 1.1.1.1
.2.1
200
5
/0
3
/1
6 01:36
:0
2
garren Exp $
// ----------------------------------------------------------------------
//
// isNucleus.cc
...
...
@@ -18,6 +18,9 @@ namespace HepPDT {
bool
ParticleID
::
isNucleus
(
)
const
{
// a proton can also be a Hydrogen nucleus
if
(
abspid
()
==
2212
)
{
return
true
;
}
// ad-hoc nuclear fragment numbering
if
(
(
digit
(
n10
)
==
1
)
&&
(
digit
(
nq2
)
==
0
)
&&
(
digit
(
nq3
)
==
0
)
)
{
return
true
;
}
return
false
;
...
...
HepPDT/test/testPID.cc
View file @
c28b7f94
// $Id: testPID.cc,v 1.4 200
3
/0
8
/1
3 20:00:12
garren Exp $
// $Id: testPID.cc,v 1.4
.2.1
200
5
/0
3
/1
6 01:36:03
garren Exp $
// ----------------------------------------------------------------------
// TestPID.cc
//
...
...
@@ -19,13 +19,13 @@ using std::setw;
int
main
()
{
int
id
[
1
5
]
=
{
5
,
25
,
15
,
213
,
-
3214
,
10213
,
9050225
,
-
200543
,
129050225
,
2000025
,
3101
,
3301
,
1004002003
,
-
1012006001
,
555
};
int
id
[
1
6
]
=
{
5
,
25
,
15
,
213
,
-
3214
,
10213
,
9050225
,
-
200543
,
129050225
,
2000025
,
3101
,
3301
,
-
2212
,
1004002003
,
-
1012006001
,
555
};
int
it
;
int
nr
,
nx
;
int
chg
,
sid
,
extra
;
int
js
,
ls
;
for
(
it
=
0
;
it
<
1
5
;
it
++
)
{
for
(
it
=
0
;
it
<
1
6
;
it
++
)
{
HepPDT
::
ParticleID
pid
(
id
[
it
]
);
nx
=
pid
.
digit
(
HepPDT
::
n
);
nr
=
pid
.
digit
(
HepPDT
::
nr
);
...
...
@@ -44,7 +44,8 @@ int main()
chg
=
pid
.
threeCharge
();
if
(
!
pid
.
isValid
()
)
{
cout
<<
"**** Invalid PID: "
<<
pid
.
pid
()
<<
" ****"
<<
endl
;
}
else
if
(
pid
.
isHadron
()
)
{
}
else
{
if
(
pid
.
isHadron
()
)
{
if
(
pid
.
isMeson
()
)
{
cout
<<
"meson "
<<
setw
(
10
)
<<
id
[
it
]
<<
": "
<<
nx
<<
" "
<<
nr
<<
" "
<<
ls
<<
" "
...
...
@@ -61,32 +62,38 @@ int main()
cout
<<
"**** undefined hadron: "
<<
pid
.
pid
()
<<
" ****"
<<
endl
;
}
}
else
if
(
pid
.
isLepton
()
)
{
}
if
(
pid
.
isLepton
()
)
{
cout
<<
"lepton "
<<
setw
(
10
)
<<
id
[
it
]
<<
": "
<<
nx
<<
" "
<<
nr
<<
" "
<<
ls
<<
" "
<<
cqks
.
nq1
<<
" "
<<
cqks
.
nq2
<<
" "
<<
cqks
.
nq3
<<
" "
<<
js
<<
" "
<<
sid
<<
" "
<<
chg
<<
" extra bits "
<<
extra
<<
endl
;
}
else
if
(
pid
.
isDiQuark
()
)
{
}
if
(
pid
.
isDiQuark
()
)
{
cout
<<
"diquark "
<<
setw
(
10
)
<<
id
[
it
]
<<
": "
<<
nx
<<
" "
<<
nr
<<
" "
<<
ls
<<
" "
<<
cqks
.
nq1
<<
" "
<<
cqks
.
nq2
<<
" "
<<
cqks
.
nq3
<<
" "
<<
js
<<
" "
<<
sid
<<
" "
<<
chg
<<
" extra bits "
<<
extra
<<
endl
;
}
else
if
(
pid
.
isNucleus
()
)
{
}
if
(
pid
.
isNucleus
()
)
{
cout
<<
"ion "
<<
setw
(
11
)
<<
id
[
it
]
<<
": "
<<
pid
.
digit
(
HepPDT
::
n10
)
<<
" "
<<
setw
(
3
)
<<
pid
.
A
()
<<
" "
<<
setw
(
3
)
<<
pid
.
Z
()
<<
" "
<<
js
<<
" "
<<
sid
<<
" "
<<
chg
<<
" extra bits "
<<
extra
<<
endl
;
}
else
{
}
if
(
pid
.
isHadron
()
||
pid
.
isLepton
()
||
pid
.
isDiQuark
()
||
pid
.
isNucleus
()
)
{
}
else
{
cout
<<
"unknown "
<<
setw
(
10
)
<<
id
[
it
]
<<
": "
<<
nx
<<
" "
<<
nr
<<
" "
<<
ls
<<
" "
<<
cqks
.
nq1
<<
" "
<<
cqks
.
nq2
<<
" "
<<
cqks
.
nq3
<<
" "
<<
js
<<
" "
<<
sid
<<
" "
<<
chg
<<
" extra bits "
<<
extra
<<
endl
;
}
}
}
if
(
pid
.
isValid
()
)
{
js
=
pid
.
jSpin
();
chg
=
pid
.
threeCharge
();
...
...
HepPDT/test/testPID.output
View file @
c28b7f94
...
...
@@ -55,6 +55,12 @@ quarks: 3 1 0
3301: 0 0 0 3 3 0 1 extra bits 0
**** Invalid PID: 3301 ****
-2212: 0 0 0 2 2 1 2 extra bits 0
baryon -2212: 0 0 0 -2 -2 -1 2 0 -3 extra bits 0
ion -2212: 0 0 2 2 0 -3 extra bits 0
total spin: 2 0.5 orbital angular momentum: 0 spin: 0 charge: -3 -1
quarks: -2 -2 -1
1004002003: 4 0 0 2 0 0 3 extra bits 100
ion 1004002003: 1 4 2 3 0 0 extra bits 100
total spin: 3 1 orbital angular momentum: 0 spin: 0 charge: 0 0
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment