Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Geant4/G4GDMLWriteStructure.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 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // G4GDMLWriteStructure
0027 //
0028 // Class description:
0029 //
0030 // GDML class for export of structures.
0031 
0032 // Author: Zoltan Torzsok, November 2007
0033 // --------------------------------------------------------------------
0034 #ifndef G4GDMLWRITESTRUCTURE_HH
0035 #define G4GDMLWRITESTRUCTURE_HH 1
0036 
0037 #include "G4Types.hh"
0038 #include "G4Transform3D.hh"
0039 #include "G4GDMLWriteParamvol.hh"
0040 
0041 class G4LogicalVolume;
0042 class G4VPhysicalVolume;
0043 class G4PVDivision;
0044 class G4LogicalBorderSurface;
0045 class G4LogicalSkinSurface;
0046 class G4OpticalSurface;
0047 class G4SurfaceProperty;
0048 class G4ReflectionFactory;
0049 class G4AssemblyTriplet;
0050 
0051 class G4GDMLWriteStructure : public G4GDMLWriteParamvol
0052 {
0053   public:
0054 
0055     G4GDMLWriteStructure();
0056     virtual ~G4GDMLWriteStructure();
0057 
0058     virtual void StructureWrite(xercesc::DOMElement*);
0059     void AddVolumeAuxiliary(G4GDMLAuxStructType myaux,
0060                             const G4LogicalVolume* const);
0061 
0062     void SetEnergyCutsExport(G4bool);
0063     void SetSDExport(G4bool);
0064 
0065     G4int GetMaxExportLevel() const;
0066     void SetMaxExportLevel(G4int);
0067 
0068   protected:
0069 
0070     void DivisionvolWrite(xercesc::DOMElement*, const G4PVDivision* const);
0071     void PhysvolWrite(xercesc::DOMElement*,
0072                       const G4VPhysicalVolume* const topVol,
0073                       const G4Transform3D& transform,
0074                       const G4String& moduleName);
0075     void ReplicavolWrite(xercesc::DOMElement*, const G4VPhysicalVolume* const);
0076     void AssemblyWrite(xercesc::DOMElement*, const int assemblyID);
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(
0083                           const G4VPhysicalVolume* const);
0084     const G4LogicalSkinSurface* GetSkinSurface(const G4LogicalVolume* const);
0085     G4bool FindOpticalSurface(const G4SurfaceProperty*);
0086     void ExportEnergyCuts(const G4LogicalVolume* const);
0087     void ExportSD(const G4LogicalVolume* const);
0088 
0089   protected:
0090 
0091     xercesc::DOMElement* structureElement = nullptr;
0092     std::vector<xercesc::DOMElement*> borderElementVec;
0093     std::vector<xercesc::DOMElement*> skinElementVec;
0094     std::map<const G4LogicalVolume*, G4GDMLAuxListType> auxmap;
0095 
0096   private:  // cache for optical surfaces...
0097 
0098     std::vector<const G4OpticalSurface*> opt_vec;
0099 
0100     G4ReflectionFactory* reflFactory = nullptr;
0101 
0102     G4bool cexport = false;
0103       // Flag for optional export of energy cuts per volume
0104     G4bool sdexport= false;
0105       // Flag for optional export of SD per volume
0106     G4int maxLevel = 0;
0107       // Maximum number of levels to export
0108     static G4int levelNo;
0109       // Counter for level being exported
0110 
0111     std::map<const G4VPhysicalVolume*, G4int> assemblyVolMap;
0112       // Map of phys volumes to assembly IDs
0113     std::map<const G4VPhysicalVolume*, G4int> imprintsMap;
0114       // Map of phys volumes to imprints IDs
0115     std::vector<G4int> addedAssemblies;
0116       // Vector of assemblies IDs already added to the structure
0117 };
0118 
0119 #endif