Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:18:03

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: PHG4GDMLWriteSolids.hh 81843 2014-06-06 09:11:11Z gcosmo $
0028 //
0029 //
0030 // class PHG4GDMLWriteSolids
0031 //
0032 // Class description:
0033 //
0034 // GDML class for writing solids.
0035 
0036 // History:
0037 // - Created.                                  Zoltan Torzsok, November 2007
0038 // -------------------------------------------------------------------------
0039 
0040 #ifndef _PHG4GDMLWRITESOLIDS_INCLUDED_
0041 #define _PHG4GDMLWRITESOLIDS_INCLUDED_
0042 
0043 #include <Geant4/G4Types.hh>
0044 #include <Geant4/G4MultiUnion.hh>
0045 
0046 #include "PHG4GDMLWriteMaterials.hh"
0047 
0048 class G4BooleanSolid;
0049 class G4Box;
0050 class G4Cons;
0051 class G4EllipticalCone;
0052 class G4Ellipsoid;
0053 class G4EllipticalTube;
0054 class G4ExtrudedSolid;
0055 class G4Hype;
0056 class G4Orb;
0057 class G4Para;
0058 class G4Paraboloid;
0059 class G4Polycone;
0060 class G4GenericPolycone;
0061 class G4Polyhedra;
0062 class G4Sphere;
0063 class G4TessellatedSolid;
0064 class G4Tet;
0065 class G4Torus;
0066 class G4GenericTrap;
0067 class G4Trap;
0068 class G4Trd;
0069 class G4Tubs;
0070 class G4CutTubs;
0071 class G4TwistedBox;
0072 class G4TwistedTrap;
0073 class G4TwistedTrd;
0074 class G4TwistedTubs;
0075 class G4VSolid;
0076 class G4OpticalSurface;
0077 
0078 class PHG4GDMLWriteSolids : public PHG4GDMLWriteMaterials
0079 {
0080   class G4ThreeVectorCompare
0081   {
0082     public:
0083 
0084     G4bool operator()(const G4ThreeVector& t1, const G4ThreeVector& t2 ) const
0085     {
0086       if(t1.x() < t2.x())
0087         return true;
0088 
0089       if(t1.y() < t2.y())
0090         return true;
0091 
0092       if(t1.z() < t2.z())
0093         return true;
0094 
0095       return false;
0096     }
0097   };
0098 
0099   public:
0100 
0101    virtual void AddSolid(const G4VSolid* const);
0102    virtual void SolidsWrite(xercesc::DOMElement*);
0103 
0104   protected:
0105 
0106    PHG4GDMLWriteSolids();
0107    virtual ~PHG4GDMLWriteSolids();
0108 
0109    void MultiUnionWrite(xercesc::DOMElement* solElement, const G4MultiUnion* const);
0110    void BooleanWrite(xercesc::DOMElement*, const G4BooleanSolid* const);
0111    void BoxWrite(xercesc::DOMElement*, const G4Box* const);
0112    void ConeWrite(xercesc::DOMElement*, const G4Cons* const);
0113    void ElconeWrite(xercesc::DOMElement*, const G4EllipticalCone* const);
0114    void EllipsoidWrite(xercesc::DOMElement*, const G4Ellipsoid* const);
0115    void EltubeWrite(xercesc::DOMElement*, const G4EllipticalTube* const);
0116    void XtruWrite(xercesc::DOMElement*, const G4ExtrudedSolid* const);
0117    void HypeWrite(xercesc::DOMElement*, const G4Hype* const);
0118    void OrbWrite(xercesc::DOMElement*, const G4Orb* const);
0119    void ParaWrite(xercesc::DOMElement*, const G4Para* const);
0120    void ParaboloidWrite(xercesc::DOMElement*, const G4Paraboloid* const);
0121    void PolyconeWrite(xercesc::DOMElement*, const G4Polycone* const);
0122    void GenericPolyconeWrite(xercesc::DOMElement*, const G4GenericPolycone* const);
0123    void PolyhedraWrite(xercesc::DOMElement*, const G4Polyhedra* const);
0124    void SphereWrite(xercesc::DOMElement*, const G4Sphere* const);
0125    void TessellatedWrite(xercesc::DOMElement*, const G4TessellatedSolid* const);
0126    void TetWrite(xercesc::DOMElement*, const G4Tet* const);
0127    void TorusWrite(xercesc::DOMElement*, const G4Torus* const);
0128    void GenTrapWrite(xercesc::DOMElement*, const G4GenericTrap* const);
0129    void TrapWrite(xercesc::DOMElement*, const G4Trap* const);
0130    void TrdWrite(xercesc::DOMElement*, const G4Trd* const);
0131    void TubeWrite(xercesc::DOMElement*, const G4Tubs* const);
0132    void CutTubeWrite(xercesc::DOMElement*, const G4CutTubs* const);
0133    void TwistedboxWrite(xercesc::DOMElement*, const G4TwistedBox* const);
0134    void TwistedtrapWrite(xercesc::DOMElement*, const G4TwistedTrap* const);
0135    void TwistedtrdWrite(xercesc::DOMElement*, const G4TwistedTrd* const);
0136    void TwistedtubsWrite(xercesc::DOMElement*, const G4TwistedTubs* const);
0137    void ZplaneWrite(xercesc::DOMElement*, const G4double&,
0138                     const G4double&, const G4double&);
0139    void RZPointWrite(xercesc::DOMElement*, const G4double&,const G4double&);
0140    void OpticalSurfaceWrite(xercesc::DOMElement*,
0141                     const G4OpticalSurface* const);
0142 
0143   protected:
0144 
0145    std::vector<const G4VSolid*> solidList;
0146    xercesc::DOMElement* solidsElement;
0147    static const G4int maxTransforms = 8; // Constant for limiting the number
0148                                          // of displacements/reflections
0149                                          // applied to a single solid
0150 };
0151 
0152 #endif