Import Geant4 0.0.0 source tree
This commit is contained in:
@@ -0,0 +1,96 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4ShortLivedTable.cc,v 2.4 1998/11/13 17:04:52 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, IT Division, ASD Group
|
||||
// History: first implementation, based on object model of
|
||||
// 27 June 1998 H.Kurashige
|
||||
// ------------------------------------------------------------
|
||||
// added Remove() 06 Nov.,98 H.Kurashige
|
||||
|
||||
|
||||
#include "G4ShortLivedTable.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
|
||||
#include "G4ios.hh"
|
||||
|
||||
#ifdef WIN32
|
||||
# include <Strstrea.h>
|
||||
#else
|
||||
# include <strstream.h>
|
||||
#endif
|
||||
|
||||
|
||||
G4ShortLivedTable::G4ShortLivedTable()
|
||||
{
|
||||
fShortLivedList = new G4ShortLivedList();
|
||||
}
|
||||
|
||||
G4ShortLivedTable::~G4ShortLivedTable()
|
||||
{
|
||||
// remove all contents in the short lived List and delete all particles
|
||||
fShortLivedList->clearAndDestroy();
|
||||
delete fShortLivedList;
|
||||
}
|
||||
|
||||
G4int G4ShortLivedTable::GetVerboseLevel() const
|
||||
{
|
||||
return G4ParticleTable::GetParticleTable()->GetVerboseLevel();
|
||||
}
|
||||
|
||||
G4bool G4ShortLivedTable::IsShortLived(G4ParticleDefinition* particle) const
|
||||
{
|
||||
return particle->IsShortLived();
|
||||
}
|
||||
|
||||
void G4ShortLivedTable::Insert(G4ParticleDefinition* particle)
|
||||
{
|
||||
if (IsShortLived(particle)) {
|
||||
fShortLivedList->insert(particle);
|
||||
} else {
|
||||
//#ifdef G4VERBOSE
|
||||
//if (GetVerboseLevel()>0) {
|
||||
// G4cerr << "G4ShortLivedTable::Insert :" << particle->GetParticleName() ;
|
||||
// G4cerr << " is not short lived" << endl;
|
||||
//}
|
||||
//#endif
|
||||
}
|
||||
}
|
||||
|
||||
void G4ShortLivedTable::Remove(G4ParticleDefinition* particle)
|
||||
{
|
||||
if (IsShortLived(particle)) {
|
||||
fShortLivedList->remove(particle);
|
||||
} else {
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel()>0) {
|
||||
G4cerr << "G4ShortLivedTable::Remove :" << particle->GetParticleName() ;
|
||||
G4cerr << " is not short lived" << endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void G4ShortLivedTable::DumpTable(const G4String &particle_name) const
|
||||
{
|
||||
for (G4int idx= 0; idx < fShortLivedList->entries() ; idx++) {
|
||||
if (( particle_name == "ALL" ) || (particle_name == "all")){
|
||||
((*fShortLivedList)(idx))->DumpTable();
|
||||
} else if ( particle_name == ((*fShortLivedList)(idx))->GetParticleName() ) {
|
||||
((*fShortLivedList)(idx))->DumpTable();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user