Geant4 11.2.2
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 42 of file G3PartTable.hh.

Constructor & Destructor Documentation

◆ G3PartTable()

G3PartTable::G3PartTable ( )

Definition at line 37 of file G3PartTable.cc.

37 {
38}

◆ ~G3PartTable()

G3PartTable::~G3PartTable ( )
virtual

Definition at line 40 of file G3PartTable.cc.

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

Member Function Documentation

◆ Get()

G4ParticleDefinition * G3PartTable::Get ( G4int partid)

Definition at line 51 of file G3PartTable.cc.

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

◆ PrintAll()

void G3PartTable::PrintAll ( )

Definition at line 78 of file G3PartTable.cc.

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

Referenced by G4BuildGeom().

◆ Put()

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

Definition at line 59 of file G3PartTable.cc.

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

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