Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
PoPI::ParseIntidInfo Class Reference

#include <PoPI.hpp>

Public Member Functions

 ParseIntidInfo (int a_intid, bool a_GRIN_mode=false)
int intid ()
Particle_class family ()
bool isAnti ()
bool isNuclear ()
int AAA ()
int ZZZ ()
int III ()
bool isNuclearMetaStable ()
int metaStableIndex ()
int generation ()
bool isNeutrino ()
int baryonGroup ()
int baryonId ()
int familyId ()
std::string id ()

Detailed Description

This class represents PoPs nucleus instance.

Definition at line 208 of file PoPI.hpp.

Constructor & Destructor Documentation

◆ ParseIntidInfo()

PoPI::ParseIntidInfo::ParseIntidInfo ( int a_intid,
bool a_GRIN_mode = false )

Constructor that parses a_intid into its components and sets members per a_intid. If m_III, m_ZZZ, m_AAA and m_metaStableIndex are positive (greater than or equal to 0), then the particle is a nuclear particle and m_isNuclear is true, otherwise the particle is not a nuclear particle and m_isNuclear is false. Note, even if m_metaStableIndex > 0 (i.e., particle is a nuclear meta-stable), m_III is as expected. For example, for intid = 481095242, m_metaStableIndex is 1 and m_III is 481.

If m_family is Particle_class::unknown then all other members are undefined.

Parameters
a_intid[in] The intid for the particle to parse.
a_GRIN_mode[in] For the GRIN project, nuclear levels go beyond 499, so this flag causes III >= 500 to be treated as a nuclide.

Definition at line 76 of file PoPI_intId.cc.

76 :
77 m_intid( a_intid ),
78 m_family( Particle_class::unknown ),
79 m_isAnti( a_intid < 0 ),
80 m_isNuclear( false ),
81 m_AAA( -1 ),
82 m_ZZZ( -1 ),
83 m_III( -1 ),
84 m_nuclearLevelIndex( -1 ),
85 m_metaStableIndex( -1 ),
86 m_generation( -1 ),
87 m_isNeutrino( false ),
88 m_baryonGroup( -1 ),
89 m_baryonId( -1 ),
90 m_familyId( -1 ) {
91
92 int intidAbs = std::abs( a_intid );
93
94 bool nuclearLike = intidAbs / 1000000000 == 0;
95 int family = (intidAbs / 10000000) % 100;
96 int SSSSSSS = intidAbs % 10000000;
97
98 if( nuclearLike ) {
99 m_AAA = intidAbs % 1000;
100 m_ZZZ = intidAbs % 1000000 / 1000;
101 m_III = intidAbs % 1000000000 / 1000000;
102
103 m_nuclearLevelIndex = m_III;
104 if( ( m_III < 500 ) || a_GRIN_mode ) {
105 m_family = Particle_class::nuclide; }
106 else {
107 m_nuclearLevelIndex -= 500;
108 m_family = Particle_class::nucleus;
109 } }
110 else {
111 int topFamilyDigid = family / 10;
112 if( ( topFamilyDigid == 5 ) || ( topFamilyDigid == 6 ) ) {
114 m_AAA = intidAbs % 1000;
115 m_ZZZ = intidAbs % 1000000 / 1000;
116 m_metaStableIndex = intidAbs % 100000000 / 1000000; }
117 else {
118 m_familyId = SSSSSSS;
119 if( family == 0 ) {
120 m_family = Particle_class::gaugeBoson; }
121 else if( family == 1 ) {
122 int neutronoFlag = ( SSSSSSS % 100 ) / 10;
123 if( neutronoFlag > 1 ) return; // Invalid particle.
124
125 m_family = Particle_class::lepton;
126 m_generation = SSSSSSS % 10;
127 m_isNeutrino = neutronoFlag != 0; }
128 else if( family == 2 ) {
129 m_family = Particle_class::baryon;
130 m_baryonGroup = SSSSSSS / 1000000;
131 m_baryonId = SSSSSSS % 1000000; }
132 else if( family == 98 ) {
133 m_family = Particle_class::TNSL; }
134 else if( family == 99 ) {
136 }
137 }
138 }
139}
Particle_class family()
Definition PoPI.hpp:234

Member Function Documentation

◆ AAA()

int PoPI::ParseIntidInfo::AAA ( )
inline

Returns the value of the m_AAA member.

Definition at line 238 of file PoPI.hpp.

Referenced by G4GIDI_target::getFinalState().

◆ baryonGroup()

int PoPI::ParseIntidInfo::baryonGroup ( )
inline

Returns the value of the m_baryonGroup member.

Definition at line 248 of file PoPI.hpp.

◆ baryonId()

int PoPI::ParseIntidInfo::baryonId ( )
inline

Returns the value of the *m_baryonId * member.

Definition at line 249 of file PoPI.hpp.

◆ family()

Particle_class PoPI::ParseIntidInfo::family ( )
inline

Returns the value of the m_family member.

Definition at line 234 of file PoPI.hpp.

Referenced by ParseIntidInfo().

◆ familyId()

int PoPI::ParseIntidInfo::familyId ( )
inline

Returns the value of the m_familyId member.

Definition at line 251 of file PoPI.hpp.

◆ generation()

int PoPI::ParseIntidInfo::generation ( )
inline

Returns the value of the m_generation member.

Definition at line 245 of file PoPI.hpp.

◆ id()

std::string PoPI::ParseIntidInfo::id ( )

Returns the GNDS PoPs id for this. If particles is unknown, an empty string is returned.

Definition at line 146 of file PoPI_intId.cc.

146 {
147
148 std::string pid;
149
150 if( ( m_family == Particle_class::nuclide ) || ( m_family == Particle_class::nucleus ) || ( m_family == Particle_class::nuclideMetaStable ) ||
151 ( m_family == Particle_class::nucleusMetaStable ) ) {
152 bool isNucleus = ( m_family == Particle_class::nucleus ) || ( m_family == Particle_class::nucleusMetaStable );
153 pid = chemicalElementInfoFromZ( m_ZZZ, true, isNucleus );
154 if( pid != "" ) {
155 pid += LUPI::Misc::argumentsToString( "%d", m_AAA );
156
157 if( ( m_family == Particle_class::nuclideMetaStable ) || ( m_family == Particle_class::nucleusMetaStable ) ) {
158 pid += LUPI::Misc::argumentsToString( "_m%d", m_metaStableIndex ); }
159 else {
160 int III = m_III;
161 if( m_family == Particle_class::nucleus ) III -= 500;
162 if( III != 0 ) pid += LUPI::Misc::argumentsToString( "_e%d", III );
163 }
164 } }
165 else if( m_family == Particle_class::gaugeBoson ) {
166 if( m_familyId == 0 ) pid = IDs::photon; }
167 else if( m_family == Particle_class::lepton ) {
168 if( m_generation == 0 ) {
169 if( !m_isNeutrino ) pid = IDs::electron;
170 } }
171 else if( m_family == Particle_class::baryon ) {
172 if( m_baryonGroup == 0 ) {
173 switch( m_baryonId ) {
174 case 0:
175 pid = IDs::neutron;
176 break;
177 case 1:
178 pid = IDs::proton;
179 break;
180 default:
181 break;
182 }
183 } }
184 else if( m_family == Particle_class::ENDL_fissionProduct ) {
185 if( m_familyId == 99120 ) {
187 else if( m_familyId == 99125 ) {
189 }
190 }
191
192 if( ( pid.size( ) > 0 ) && m_isAnti ) pid += IDs::anti;
193
194 return( pid );
195}
std::string argumentsToString(char const *a_format,...)
Definition LUPI_misc.cc:305
std::string chemicalElementInfoFromZ(int a_Z, bool a_wantSymbol, bool a_asNucleus=false)
static std::string const anti
Definition PoPI.hpp:173
static std::string const photon
Definition PoPI.hpp:162
static std::string const neutron
Definition PoPI.hpp:164
static std::string const FissionProductENDL99125
Definition PoPI.hpp:172
static std::string const FissionProductENDL99120
Definition PoPI.hpp:171
static std::string const proton
Definition PoPI.hpp:165
static std::string const electron
Definition PoPI.hpp:163

◆ III()

int PoPI::ParseIntidInfo::III ( )
inline

Returns the value of the m_III member.

Definition at line 240 of file PoPI.hpp.

Referenced by id().

◆ intid()

int PoPI::ParseIntidInfo::intid ( )
inline

Returns the value of the m_intid member.

Definition at line 233 of file PoPI.hpp.

◆ isAnti()

bool PoPI::ParseIntidInfo::isAnti ( )
inline

Returns the value of the *m_isAnti * member.

Definition at line 235 of file PoPI.hpp.

◆ isNeutrino()

bool PoPI::ParseIntidInfo::isNeutrino ( )
inline

Returns the value of the m_isNeutrino member.

Definition at line 246 of file PoPI.hpp.

◆ isNuclear()

bool PoPI::ParseIntidInfo::isNuclear ( )
inline

Returns the value of the m_isNuclear member.

Definition at line 237 of file PoPI.hpp.

◆ isNuclearMetaStable()

bool PoPI::ParseIntidInfo::isNuclearMetaStable ( )
inline

Returns true if particle is a nuclear meta-stable alias.

Definition at line 241 of file PoPI.hpp.

◆ metaStableIndex()

int PoPI::ParseIntidInfo::metaStableIndex ( )
inline

Returns the value of the m_metaStableIndex member.

Definition at line 243 of file PoPI.hpp.

Referenced by G4GIDI_target::getFinalState().

◆ ZZZ()

int PoPI::ParseIntidInfo::ZZZ ( )
inline

Returns the value of the m_ZZZ member.

Definition at line 239 of file PoPI.hpp.

Referenced by G4GIDI_target::getFinalState().


The documentation for this class was generated from the following files: