Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:19:15

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 //
0027 // $Id: PHG4GDMLWriteStructure.hh 68053 2013-03-13 14:39:51Z gcosmo $
0028 //
0029 //
0030 // class PHG4GDMLWriteStructure
0031 //
0032 // Class description:
0033 //
0034 // GDML class for export of structures.
0035 
0036 // History:
0037 // - Created.                                  Zoltan Torzsok, November 2007
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:  // cache for optical surfaces...
0097 
0098    std::vector<const G4OpticalSurface*> opt_vec;
0099    G4ReflectionFactory* reflFactory;
0100    G4bool cexport;  // Flag for optional export of energy cuts per volume
0101 
0102    //! configuration of export exlcusion volumes
0103    const PHG4GDMLConfig * config;
0104 };
0105 
0106 #endif