Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:39

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 //
0028 //
0029 // John Allison  May 2021
0030 //
0031 // Class Description:
0032 // G4Mesh encapsulates and validates a nested parameterisation, which we
0033 // call a "mesh". If a valid mesh cannot be created out of this
0034 // G4VPhysicalVolume* (which will probably be most common), it will
0035 // have a type "invalid". Then, usually, it may simply be destroyed.
0036 // The overhead of an invalid attempt is expected to be small.
0037 // Class Description - End:
0038 
0039 #ifndef G4MESH_HH
0040 #define G4MESH_HH
0041 
0042 #include "G4Transform3D.hh"
0043 #include "geomdefs.hh"
0044 
0045 class G4VPhysicalVolume;
0046 
0047 class G4Mesh
0048 {
0049  public:
0050 
0051   enum MeshType {
0052     invalid
0053     , rectangle
0054     , nested3DRectangular
0055     , cylinder
0056     , sphere
0057     , tetrahedron
0058   };
0059 
0060   struct ThreeDRectangleParameters {
0061     EAxis fAxis1 = kUndefined, fAxis2 = kUndefined, fAxis3 = kUndefined;
0062     G4int fNreplica1 = 0, fNreplica2 = 0, fNreplica3 = 0;
0063     G4double fOffset1 = 0., fOffset2 = 0., fOffset3 = 0.;
0064     G4double fWidth1 = 0., fWidth2 = 0., fWidth3 = 0.;
0065     G4bool fConsuming1 = false, fConsuming2 = false, fConsuming3 = false;
0066     G4double fHalfX = 0., fHalfY = 0., fHalfZ = 0.;
0067   };
0068 
0069   G4Mesh(G4VPhysicalVolume* containerVolume, const G4Transform3D&);
0070   virtual ~G4Mesh();
0071 
0072   const std::map<G4int,G4String>& GetEnumMap() const {return fEnumMap;}
0073   G4VPhysicalVolume* GetContainerVolume() const {return fpContainerVolume;}
0074   G4VPhysicalVolume* GetParameterisedVolume() const {return fpParameterisedVolume;}
0075   MeshType GetMeshType() const {return fMeshType;}
0076   G4int GetMeshDepth() const {return fMeshDepth;}
0077   const G4Transform3D& GetTransform() const {return fTransform;}
0078   const ThreeDRectangleParameters& GetThreeDRectParameters() const {return f3DRPs;}
0079 
0080  private:
0081 
0082   static std::map<G4int,G4String> fEnumMap;
0083   G4VPhysicalVolume* fpContainerVolume;
0084   G4VPhysicalVolume* fpParameterisedVolume;
0085   MeshType fMeshType;
0086   G4int fMeshDepth;
0087   G4Transform3D fTransform;
0088   ThreeDRectangleParameters f3DRPs;
0089 };
0090 
0091 std::ostream& operator << (std::ostream& os, const G4Mesh& mesh);
0092 
0093 #endif