Import Geant4 2.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:42:07 +02:00
parent 103bda00c8
commit e7d7193284
3106 changed files with 171117 additions and 90550 deletions
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ShortLivedTable.cc,v 1.7.4.1.2.5 1999/12/14 09:16:48 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4ShortLivedTable.cc,v 1.9 2000/02/25 07:36:24 kurasige Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// --------------------------------------------------------------
@@ -37,15 +37,11 @@ G4ShortLivedTable::~G4ShortLivedTable()
{
if (fShortLivedList ==0) return;
// remove all contents in the short lived List and delete all particles
#ifdef G4USE_STL
G4ShortLivedList::iterator i;
for (i = fShortLivedList->begin(); i!= fShortLivedList->end(); ++i) {
delete (*i);
}
fShortLivedList->clear();
#else
fShortLivedList->clearAndDestroy();
#endif
delete fShortLivedList;
fShortLivedList =0;
}
@@ -63,35 +59,19 @@ G4bool G4ShortLivedTable::IsShortLived(G4ParticleDefinition* particle) const
void G4ShortLivedTable::Insert(G4ParticleDefinition* particle)
{
if (IsShortLived(particle)) {
#ifdef G4USE_STL
fShortLivedList->push_back(particle);
#else
fShortLivedList->insert(particle);
#endif
} else {
//#ifdef G4VERBOSE
//if (GetVerboseLevel()>0) {
// G4cout << "G4ShortLivedTable::Insert :" << particle->GetParticleName() ;
// G4cout << " is not short lived" << G4endl;
//}
//#endif
}
}
}
void G4ShortLivedTable::Remove(G4ParticleDefinition* particle)
{
if (IsShortLived(particle)) {
#ifdef G4USE_STL
G4ShortLivedList::iterator idx;
for (idx = fShortLivedList->begin(); idx!= fShortLivedList->end(); ++idx) {
if ( particle == *idx) {
fShortLivedList->erase(idx);
}
}
#else
fShortLivedList->remove(particle);
#endif
} else {
#ifdef G4VERBOSE
if (GetVerboseLevel()>0) {
@@ -107,15 +87,9 @@ void G4ShortLivedTable::DumpTable(const G4String &particle_name) const
{
G4ParticleDefinition* particle;
#ifdef G4USE_STL
G4ShortLivedList::iterator idx;
for (idx = fShortLivedList->begin(); idx!= fShortLivedList->end(); ++idx) {
particle = *idx;
#else
for (G4int idx= 0; idx < fShortLivedList->entries() ; idx++) {
particle = (*fShortLivedList)(idx);
#endif
if (( particle_name == "ALL" ) || (particle_name == "all")){
particle->DumpTable();
} else if ( particle_name == particle->GetParticleName() ) {