Back to home page

EIC code displayed by LXR

 
 

    


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

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 // G4Orb
0027 //
0028 // Class description:
0029 //
0030 //   A G4Orb is a simple case of G4Sphere. It has only:
0031 //   fRmax  outer radius
0032 
0033 // 20.08.03 V.Grichine - created
0034 // 08.08.17 E.Tcherniaev - revised
0035 // --------------------------------------------------------------------
0036 #ifndef G4ORB_HH
0037 #define G4ORB_HH
0038 
0039 #include "G4GeomTypes.hh"
0040 
0041 #if defined(G4GEOM_USE_USOLIDS)
0042 #define G4GEOM_USE_UORB 1
0043 #endif
0044 
0045 #if defined(G4GEOM_USE_UORB)
0046   #define G4UOrb G4Orb
0047   #include "G4UOrb.hh"
0048 #else
0049 
0050 #include <CLHEP/Units/PhysicalConstants.h>
0051 
0052 #include "G4CSGSolid.hh"
0053 #include "G4Polyhedron.hh"
0054 
0055 class G4Orb : public G4CSGSolid
0056 {
0057   public:
0058 
0059     G4Orb(const G4String& pName, G4double pRmax);
0060 
0061     ~G4Orb() override;
0062 
0063   // Accessors and modifiers
0064 
0065     inline G4double GetRadius() const;
0066     inline G4double GetRadialTolerance() const;
0067 
0068     inline void SetRadius(G4double newRmax);
0069 
0070   // Methods for solid
0071 
0072     inline G4double GetCubicVolume() override;
0073     inline G4double GetSurfaceArea() override;
0074 
0075     void ComputeDimensions(      G4VPVParameterisation* p,
0076                            const G4int n,
0077                            const G4VPhysicalVolume* pRep) override;
0078 
0079     void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const override;
0080 
0081     G4bool CalculateExtent(const EAxis pAxis,
0082                            const G4VoxelLimits& pVoxelLimit,
0083                            const G4AffineTransform& pTransform,
0084                                  G4double& pmin, G4double& pmax) const override;
0085 
0086     EInside Inside(const G4ThreeVector& p) const override;
0087 
0088     G4ThreeVector SurfaceNormal( const G4ThreeVector& p) const override;
0089 
0090     G4double DistanceToIn(const G4ThreeVector& p,
0091                           const G4ThreeVector& v) const override;
0092 
0093     G4double DistanceToIn(const G4ThreeVector& p) const override;
0094 
0095     G4double DistanceToOut(const G4ThreeVector& p,
0096                            const G4ThreeVector& v,
0097                            const G4bool calcNorm = false,
0098                                  G4bool* validNorm = nullptr,
0099                                  G4ThreeVector* n = nullptr) const override;
0100 
0101     G4double DistanceToOut(const G4ThreeVector& p) const override;
0102 
0103     G4GeometryType GetEntityType() const override;
0104 
0105     G4ThreeVector GetPointOnSurface() const override;
0106 
0107     G4VSolid* Clone() const override;
0108 
0109     std::ostream& StreamInfo(std::ostream& os) const override;
0110 
0111     // Visualisation functions
0112 
0113     void          DescribeYourselfTo (G4VGraphicsScene& scene) const override;
0114     G4VisExtent   GetExtent          () const override;
0115     G4Polyhedron* CreatePolyhedron   () const override;
0116 
0117     G4Orb(__void__&);
0118       // Fake default constructor for usage restricted to direct object
0119       // persistency for clients requiring preallocation of memory for
0120       // persistifiable objects
0121 
0122     G4Orb(const G4Orb& rhs);
0123     G4Orb& operator=(const G4Orb& rhs);
0124       // Copy constructor and assignment operator
0125 
0126   protected:
0127 
0128     void Initialize();
0129 
0130   private:
0131 
0132     G4double fRmax = 0.0;
0133     G4double halfRmaxTol = 0.0;
0134     G4double sqrRmaxPlusTol = 0.0, sqrRmaxMinusTol = 0.0;
0135 };
0136 
0137 #include "G4Orb.icc"
0138 
0139 #endif
0140 
0141 #endif