File indexing completed on 2025-08-06 08:19:15
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
0036
0037
0038
0039
0040 #ifndef _PHG4GDMLWRITESTRUCTURE_INCLUDED_
0041 #define _PHG4GDMLWRITESTRUCTURE_INCLUDED_
0042
0043 #include <Geant4/G4Transform3D.hh>
0044 #include <Geant4/G4Types.hh>
0045
0046 #include "PHG4GDMLWriteParamvol.hh"
0047
0048 class G4LogicalVolume;
0049 class G4VPhysicalVolume;
0050 class G4PVDivision;
0051 class G4LogicalBorderSurface;
0052 class G4LogicalSkinSurface;
0053 class G4OpticalSurface;
0054 class G4SurfaceProperty;
0055 class G4ReflectionFactory;
0056 class PHG4GDMLConfig;
0057
0058 class PHG4GDMLWriteStructure : public PHG4GDMLWriteParamvol
0059 {
0060
0061 public:
0062
0063 PHG4GDMLWriteStructure(const PHG4GDMLConfig * config_input);
0064 virtual ~PHG4GDMLWriteStructure();
0065
0066 virtual void StructureWrite(xercesc::DOMElement*);
0067 void AddVolumeAuxiliary(PHG4GDMLAuxStructType myaux, const G4LogicalVolume* const);
0068
0069 void SetEnergyCutsExport(G4bool);
0070
0071 protected:
0072
0073 void DivisionvolWrite(xercesc::DOMElement*, const G4PVDivision* const);
0074 void PhysvolWrite(xercesc::DOMElement*,const G4VPhysicalVolume* const topVol,
0075 const G4Transform3D& transform, const G4String& moduleName);
0076 void ReplicavolWrite(xercesc::DOMElement*, const G4VPhysicalVolume* const);
0077 G4Transform3D TraverseVolumeTree(const G4LogicalVolume* const topVol,
0078 const G4int depth);
0079 void SurfacesWrite();
0080 void BorderSurfaceCache(const G4LogicalBorderSurface* const);
0081 void SkinSurfaceCache(const G4LogicalSkinSurface* const);
0082 const G4LogicalBorderSurface* GetBorderSurface(const G4VPhysicalVolume* const);
0083 const G4LogicalSkinSurface* GetSkinSurface(const G4LogicalVolume* const);
0084 G4bool FindOpticalSurface(const G4SurfaceProperty*);
0085 void ExportEnergyCuts(const G4LogicalVolume* const);
0086
0087 protected:
0088
0089 xercesc::DOMElement* structureElement;
0090 std::vector<xercesc::DOMElement*> borderElementVec;
0091 std::vector<xercesc::DOMElement*> skinElementVec;
0092 std::map<const G4LogicalVolume*, PHG4GDMLAuxListType> auxmap;
0093
0094 G4String ConvertToString(G4double dval);
0095
0096 private:
0097
0098 std::vector<const G4OpticalSurface*> opt_vec;
0099 G4ReflectionFactory* reflFactory;
0100 G4bool cexport;
0101
0102
0103 const PHG4GDMLConfig * config;
0104 };
0105
0106 #endif