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

#include <G3VolTable.hh>

Public Member Functions

G3VolTableEntryPutVTE (G3VolTableEntry *aVTE)
 
G3VolTableEntryGetVTE (const G4String &Vname)
 
void PrintAll ()
 
 G3VolTable ()
 
virtual ~G3VolTable ()
 
G4LogicalVolumeGetG3toG4Mother ()
 
G3VolTableEntryGetFirstVTE ()
 
void SetFirstVTE ()
 
void VTEStat ()
 
void CountG3Pos ()
 
void Clear ()
 

Detailed Description

Definition at line 60 of file G3VolTable.hh.

Constructor & Destructor Documentation

◆ G3VolTable()

G3VolTable::G3VolTable ( )

Definition at line 39 of file G3VolTable.cc.

40 : G3toG4TopVTE(0), _FirstKey("UnDefined"), _NG3Pos(0){
41}

◆ ~G3VolTable()

G3VolTable::~G3VolTable ( )
virtual

Definition at line 43 of file G3VolTable.cc.

43 {
44 if (VTD.size()>0){
45 // G4cout << "Deleting VTD" << G4endl;
46 for (VTDiterator i=VTD.begin(); i != VTD.end(); i++) {
47 delete (*i).second;
48 }
49 VTD.clear();
50 }
51}
std::map< G4String, G3VolTableEntry *, std::less< G4String > >::iterator VTDiterator
Definition: G3VolTable.cc:37

Member Function Documentation

◆ Clear()

void G3VolTable::Clear ( )

Definition at line 119 of file G3VolTable.cc.

119 {
120 if (VTD.size()>0){
121 for (VTDiterator i=VTD.begin(); i != VTD.end(); i++) {
122 delete (*i).second;
123 }
124 VTD.clear();
125 }
126 G3toG4TopVTE = 0;
127 _FirstKey = "UnDefined";
128 _NG3Pos = 0;
129}

◆ CountG3Pos()

void G3VolTable::CountG3Pos ( )

Definition at line 92 of file G3VolTable.cc.

92 {
93 _NG3Pos++;
94}

Referenced by G3VolTableEntry::AddG3Pos().

◆ GetFirstVTE()

G3VolTableEntry * G3VolTable::GetFirstVTE ( )

Definition at line 107 of file G3VolTable.cc.

107 {
108 return G3toG4TopVTE;
109}

Referenced by G4BuildGeom().

◆ GetG3toG4Mother()

G4LogicalVolume * G3VolTable::GetG3toG4Mother ( )

◆ GetVTE()

G3VolTableEntry * G3VolTable::GetVTE ( const G4String Vname)

Definition at line 54 of file G3VolTable.cc.

54 {
55 VTDiterator i = VTD.find(Vname);
56 if (i == VTD.end()) return 0;
57 else return (*i).second;
58}

Referenced by G4gsbool(), G4gsdvn(), G4gsdvn2(), G4gsdvt(), G4gsdvt2(), G4gspos(), G4gsposp(), G4gsvolu(), G3VolTableEntry::GetMasterClone(), and PutVTE().

◆ PrintAll()

void G3VolTable::PrintAll ( )

Definition at line 61 of file G3VolTable.cc.

61 {
62 if (VTD.size()){
63 G4int i=0;
64 G4cout << "Dump of VTD - " << VTD.size() << " entries:" << G4endl;
65 VTEStat();
66 for (VTDiterator v=VTD.begin(); v != VTD.end(); v++){
67 G3VolTableEntry* VTE = (*v).second;
68 G4cout << "G3VolTable element " << std::setw(3) << i++ << " name "
69 << VTE->GetName() << " has " << VTE->GetNoDaughters()
70 << " daughters" << G4endl;
71 }
72 }
73}
int G4int
Definition: G4Types.hh:66
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
void VTEStat()
Definition: G3VolTable.cc:112

Referenced by G4BuildGeom().

◆ PutVTE()

G3VolTableEntry * G3VolTable::PutVTE ( G3VolTableEntry aVTE)

Definition at line 76 of file G3VolTable.cc.

76 {
77
78 if (GetVTE(aG3VolTableEntry->GetName()) == 0 ){
79
80 // create a hash key
81 G4String HashID = aG3VolTableEntry->GetName();
82
83 if (_FirstKey == "UnDefined") _FirstKey = HashID;
84
85 // insert into dictionary
86 VTD[HashID] = aG3VolTableEntry;
87 }
88 return GetVTE(aG3VolTableEntry->GetName());
89}
G3VolTableEntry * GetVTE(const G4String &Vname)
Definition: G3VolTable.cc:54

Referenced by G4CloneDaughters(), G4CreateCloneVTE(), G4CreateCloneVTEWithDivision(), and G4CreateVTE().

◆ SetFirstVTE()

void G3VolTable::SetFirstVTE ( )

Definition at line 97 of file G3VolTable.cc.

97 {
98 G3toG4TopVTE = VTD[_FirstKey];
99
100 if (G3toG4TopVTE->NPCopies() > 0) {
101 _FirstKey = G3toG4TopVTE->GetMother()->GetName();
102 SetFirstVTE();
103 }
104}
G3VolTableEntry * GetMother(G4int i)
void SetFirstVTE()
Definition: G3VolTable.cc:97

Referenced by G4ggclos(), and SetFirstVTE().

◆ VTEStat()

void G3VolTable::VTEStat ( )

Definition at line 112 of file G3VolTable.cc.

112 {
113 G4cout << "Instantiated " << VTD.size() <<
114 " volume table entries \n"
115 << " " << _NG3Pos << " positions." << G4endl;
116}

Referenced by PrintAll().


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