Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G3PartTable Class Reference

#include <G3PartTable.hh>

Public Member Functions

 G3PartTable ()
 
virtual ~G3PartTable ()
 
G4ParticleDefinitionGet (G4int partid)
 
void Put (G4int partid, G4ParticleDefinition *partpt)
 
void PrintAll ()
 

Detailed Description

Definition at line 43 of file G3PartTable.hh.

Constructor & Destructor Documentation

◆ G3PartTable()

G3PartTable::G3PartTable ( )

Definition at line 38 of file G3PartTable.cc.

38 {
39}

◆ ~G3PartTable()

G3PartTable::~G3PartTable ( )
virtual

Definition at line 41 of file G3PartTable.cc.

41 {
42 if (PTD.size()>0){
43 // G4cout << "Deleting PTD" << G4endl;
44 for (PTDiterator i=PTD.begin(); i != PTD.end(); i++) {
45 delete (*i).second;
46 }
47 PTD.clear();
48 }
49}
std::map< G4String, G4ParticleDefinition *, std::less< G4String > >::iterator PTDiterator
Definition: G3PartTable.cc:36

Member Function Documentation

◆ Get()

G4ParticleDefinition * G3PartTable::Get ( G4int  partid)

Definition at line 52 of file G3PartTable.cc.

52 {
53 G4String ShashID; // static
54 HashID(partid, ShashID);
55 PTDiterator i = PTD.find(ShashID);
56 return (*i).second;
57}

◆ PrintAll()

void G3PartTable::PrintAll ( )

Definition at line 79 of file G3PartTable.cc.

79 {
80 if (PTD.size()>0){
81 G4int count=0;
82 G4cout << "Dump of PTD - " << PTD.size() << " entries: " << G4endl;
83 for (PTDiterator i=PTD.begin(); i != PTD.end(); i++) {
84 count++;
85 G4ParticleDefinition* aPTD = (*i).second;
86 G4cout << "PTD entry " << std::setw(3) << count << " particle name: "
87 << aPTD->GetParticleName() << G4endl;
88 }
89 }
90}
int G4int
Definition: G4Types.hh:66
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
const G4String & GetParticleName() const

Referenced by G4BuildGeom().

◆ Put()

void G3PartTable::Put ( G4int  partid,
G4ParticleDefinition partpt 
)

Definition at line 60 of file G3PartTable.cc.

60 {
61 G4String ShashID; // static
62 HashID(partid, ShashID);
63 PTD[ShashID]=partpt;
64}

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