Import Geant4 1.0.0 source tree
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the 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.hh,v 1.1 1999/01/07 16:10:31 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4ShortLivedTable.hh,v 1.7.2.1 1999/12/07 20:49:52 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
@@ -23,20 +23,33 @@
|
||||
#define G4ShortLivedTable_h 1
|
||||
|
||||
#include "G4ios.hh"
|
||||
#include <rw/tpordvec.h>
|
||||
#include "globals.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include <rw/cstring.h>
|
||||
|
||||
|
||||
#ifdef G4USE_STL
|
||||
#include "g4std/vector"
|
||||
#else
|
||||
#include "g4rw/tpordvec.h"
|
||||
#endif
|
||||
|
||||
class G4ParticleTable;
|
||||
|
||||
class G4ShortLivedTable
|
||||
{
|
||||
// Class Description
|
||||
// G4ShortLivedTable is the table of pointer to G4ParticleDefinition
|
||||
// In G4ShortLivedTable, each G4ParticleDefinition pointer is stored
|
||||
//
|
||||
|
||||
public:
|
||||
typedef RWTPtrOrderedVector<G4ParticleDefinition> G4ShortLivedList;
|
||||
#ifdef G4USE_STL
|
||||
// Use STL Vector as list of shortlives
|
||||
typedef G4std::vector<G4ParticleDefinition*> G4ShortLivedList;
|
||||
#else
|
||||
// Use G4RWTPtrOrderedVector as list of shortlives
|
||||
typedef G4RWTPtrOrderedVector<G4ParticleDefinition> G4ShortLivedList;
|
||||
#endif
|
||||
|
||||
public:
|
||||
G4ShortLivedTable();
|
||||
@@ -69,18 +82,34 @@ class G4ShortLivedTable
|
||||
|
||||
inline G4bool G4ShortLivedTable::Contains(const G4ParticleDefinition* particle) const
|
||||
{
|
||||
#ifdef G4USE_STL
|
||||
G4ShortLivedList::iterator i;
|
||||
for (i = fShortLivedList->begin(); i!= fShortLivedList->end(); ++i) {
|
||||
if (**i==*particle) return true;
|
||||
}
|
||||
return false;
|
||||
#else
|
||||
return fShortLivedList->contains(particle);
|
||||
#endif
|
||||
}
|
||||
|
||||
inline G4int G4ShortLivedTable::Entries() const
|
||||
{
|
||||
#ifdef G4USE_STL
|
||||
return fShortLivedList->size();
|
||||
#else
|
||||
return fShortLivedList->entries();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
inline G4ParticleDefinition* G4ShortLivedTable::GetParticle(G4int index) const
|
||||
{
|
||||
return (*fShortLivedList)[index];
|
||||
if ( (index >=0 ) && (index < Entries()) ) {
|
||||
return (*fShortLivedList)[index];
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user