Commit c28b7f94 authored by Lynn Garren's avatar Lynn Garren
Browse files

isNucleus will recognize a proton (2212) as a valid nucleus

parent 85178cbd
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.
......
// $Id: isNucleus.cc,v 1.1.1.1 2003/07/15 20:15:05 garren Exp $
// $Id: isNucleus.cc,v 1.1.1.1.2.1 2005/03/16 01:36:02 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;
......
// $Id: testPID.cc,v 1.4 2003/08/13 20:00:12 garren Exp $
// $Id: testPID.cc,v 1.4.2.1 2005/03/16 01:36:03 garren Exp $
// ----------------------------------------------------------------------
// TestPID.cc
//
......@@ -19,13 +19,13 @@ using std::setw;
int main()
{
int id[15] = { 5, 25, 15, 213, -3214, 10213, 9050225, -200543, 129050225,
2000025, 3101, 3301, 1004002003, -1012006001, 555 };
int id[16] = { 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 < 15; it++ ) {
for( it=0; it < 16; 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();
......
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment