Geant4 10.7.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 59 of file G3VolTable.hh.

Constructor & Destructor Documentation

◆ G3VolTable()

G3VolTable::G3VolTable ( )

Definition at line 38 of file G3VolTable.cc.

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

◆ ~G3VolTable()

G3VolTable::~G3VolTable ( )
virtual

Definition at line 42 of file G3VolTable.cc.

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

Member Function Documentation

◆ Clear()

void G3VolTable::Clear ( )

Definition at line 118 of file G3VolTable.cc.

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

◆ CountG3Pos()

void G3VolTable::CountG3Pos ( )

Definition at line 91 of file G3VolTable.cc.

91 {
92 _NG3Pos++;
93}

Referenced by G3VolTableEntry::AddG3Pos().

◆ GetFirstVTE()

G3VolTableEntry * G3VolTable::GetFirstVTE ( )

Definition at line 106 of file G3VolTable.cc.

106 {
107 return G3toG4TopVTE;
108}

Referenced by G4BuildGeom().

◆ GetG3toG4Mother()

G4LogicalVolume * G3VolTable::GetG3toG4Mother ( )

◆ GetVTE()

G3VolTableEntry * G3VolTable::GetVTE ( const G4String Vname)

Definition at line 53 of file G3VolTable.cc.

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

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

◆ PrintAll()

void G3VolTable::PrintAll ( )

Definition at line 60 of file G3VolTable.cc.

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

Referenced by G4BuildGeom().

◆ PutVTE()

G3VolTableEntry * G3VolTable::PutVTE ( G3VolTableEntry aVTE)

Definition at line 75 of file G3VolTable.cc.

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

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

◆ SetFirstVTE()

void G3VolTable::SetFirstVTE ( )

Definition at line 96 of file G3VolTable.cc.

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

Referenced by G4ggclos(), and SetFirstVTE().

◆ VTEStat()

void G3VolTable::VTEStat ( )

Definition at line 111 of file G3VolTable.cc.

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

Referenced by PrintAll().


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