Warning, file /include/Geant4/G4tgbVolumeMgr.hh was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 #ifndef G4tgbVolumeMgr_hh
0036 #define G4tgbVolumeMgr_hh 1
0037
0038 #include "globals.hh"
0039
0040 #include <string>
0041 #include <vector>
0042 #include <map>
0043
0044 #include "G4VSolid.hh"
0045 #include "G4LogicalVolume.hh"
0046 #include "G4VPhysicalVolume.hh"
0047
0048 class G4tgbVolume;
0049 class G4tgrVolume;
0050 class G4tgbDetectorBuilder;
0051
0052 using G4mssvol = std::map<G4String, G4tgbVolume*>;
0053 using G4mmssol = std::multimap<G4String, G4VSolid*>;
0054 using G4mmslv = std::multimap<G4String, G4LogicalVolume*>;
0055 using G4mmspv = std::multimap<G4String, G4VPhysicalVolume*>;
0056 using G4mlvlv = std::map<G4LogicalVolume*, G4LogicalVolume*>;
0057 using G4mpvpv = std::map<G4VPhysicalVolume*, G4VPhysicalVolume*>;
0058
0059 class G4tgbVolumeMgr
0060 {
0061 public:
0062
0063 G4tgbVolumeMgr();
0064 ~G4tgbVolumeMgr();
0065
0066 static G4tgbVolumeMgr* GetInstance();
0067
0068
0069 void AddTextFile(const G4String& fname);
0070 G4VPhysicalVolume* ReadAndConstructDetector();
0071
0072 void CopyVolumes();
0073
0074
0075 G4tgbVolume* FindVolume(const G4String& volname);
0076
0077
0078 void RegisterMe(const G4tgbVolume* vol);
0079
0080 void RegisterMe(const G4VSolid* solid);
0081
0082 void RegisterMe(const G4LogicalVolume* lv);
0083
0084 void RegisterMe(const G4VPhysicalVolume* pv);
0085
0086 void RegisterChildParentLVs(const G4LogicalVolume* logvol,
0087 const G4LogicalVolume* parentLV);
0088
0089
0090 G4VSolid* FindG4Solid(const G4String& name);
0091
0092
0093
0094
0095
0096 G4LogicalVolume* FindG4LogVol(const G4String& theName,
0097 const G4bool bExists = false);
0098
0099
0100 G4VPhysicalVolume* FindG4PhysVol(const G4String& theName,
0101 const G4bool bExists = false);
0102
0103
0104 G4VPhysicalVolume* GetTopPhysVol();
0105
0106
0107
0108 G4LogicalVolume* GetTopLogVol();
0109
0110
0111 void BuildPhysVolTree();
0112
0113
0114
0115 void DumpSummary();
0116 void DumpG4LogVolTree();
0117 void DumpG4LogVolLeaf(const G4LogicalVolume* lv, unsigned int leafDepth);
0118 void DumpG4PhysVolTree();
0119 void DumpG4PhysVolLeaf(const G4VPhysicalVolume* pv, unsigned int leafDepth);
0120 void DumpG4SolidList();
0121
0122 const std::multimap<G4String, G4VSolid*>& GetSolids() const
0123 {
0124 return theSolids;
0125 }
0126 void SetDetectorBuilder(G4tgbDetectorBuilder* db)
0127 {
0128 theDetectorBuilder = db;
0129 }
0130 G4tgbDetectorBuilder* GetDetectorBuilder() const
0131 {
0132 return theDetectorBuilder;
0133 }
0134
0135 private:
0136
0137 static G4ThreadLocal G4tgbVolumeMgr* theInstance;
0138
0139 G4mssvol theVolumeList;
0140
0141
0142
0143 G4mmssol theSolids;
0144
0145
0146 G4mmslv theLVs;
0147
0148 G4mmspv thePVs;
0149
0150
0151 G4mlvlv theLVTree;
0152
0153
0154 G4mlvlv theLVInvTree;
0155
0156
0157
0158 G4mpvpv thePVTree;
0159
0160
0161 G4mpvpv thePVInvTree;
0162
0163
0164
0165 G4tgbDetectorBuilder* theDetectorBuilder = nullptr;
0166 };
0167
0168 #endif