Geant4  10.02.p03
G3PartTable Class Reference

#include <G3PartTable.hh>

Collaboration diagram for G3PartTable:

Public Member Functions

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

Private Member Functions

void HashID (G4int partid, G4String *_HID)
 
void HashID (G4int partid, G4String &_HID)
 

Private Attributes

std::map< G4String, G4ParticleDefinition *, std::less< G4String > > PTD
 

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
std::map< G4String, G4ParticleDefinition *, std::less< G4String > > PTD
Definition: G3PartTable.hh:56

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 }
std::map< G4String, G4ParticleDefinition *, std::less< G4String > >::iterator PTDiterator
Definition: G3PartTable.cc:36
void HashID(G4int partid, G4String *_HID)
Definition: G3PartTable.cc:74
std::map< G4String, G4ParticleDefinition *, std::less< G4String > > PTD
Definition: G3PartTable.hh:56
Here is the call graph for this function:

◆ HashID() [1/2]

void G3PartTable::HashID ( G4int  partid,
G4String _HID 
)
private

Definition at line 74 of file G3PartTable.cc.

74  {
75  HashID(partid, *theHashID);
76 }
void HashID(G4int partid, G4String *_HID)
Definition: G3PartTable.cc:74
Here is the caller graph for this function:

◆ HashID() [2/2]

void G3PartTable::HashID ( G4int  partid,
G4String _HID 
)
private

Definition at line 67 of file G3PartTable.cc.

67  {
68  std::ostringstream ostr;
69  ostr << "Part" << partid << std::ends;
70  theHashID = ostr.str();
71 }

◆ PrintAll()

void G3PartTable::PrintAll ( void  )

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 }
std::map< G4String, G4ParticleDefinition *, std::less< G4String > >::iterator PTDiterator
Definition: G3PartTable.cc:36
int G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
std::map< G4String, G4ParticleDefinition *, std::less< G4String > > PTD
Definition: G3PartTable.hh:56
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 }
void HashID(G4int partid, G4String *_HID)
Definition: G3PartTable.cc:74
std::map< G4String, G4ParticleDefinition *, std::less< G4String > > PTD
Definition: G3PartTable.hh:56
Here is the call graph for this function:

Member Data Documentation

◆ PTD

std::map<G4String, G4ParticleDefinition*, std::less<G4String> > G3PartTable::PTD
private

Definition at line 56 of file G3PartTable.hh.


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