Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Geant4/G4Paraboloid.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 // G4Paraboloid
0027 //
0028 // Class description:
0029 //
0030 //   A G4Paraboloid represents a solid with parabolic profile with possible
0031 //   cuts along the Z axis.
0032 //
0033 //   Member Data:
0034 //
0035 //      dz              z half lenght
0036 //      r1              radius at -dz
0037 //      r2              radius at  dz
0038 //      r2  > r1
0039 //
0040 //      Equation for the solid:
0041 //        rho^2 <= k1 * z + k2;
0042 //        -dz <= z <= dz
0043 //        r1^2 = k1 * (-dz) + k2
0044 //        r2^2 = k1 * ( dz) + k2
0045 
0046 // 10.07.2007, L.Lindroos (CERN) - First implementation
0047 // --------------------------------------------------------------------
0048 #ifndef G4PARABOLOID_HH
0049 #define G4PARABOLOID_HH
0050 
0051 #include "G4GeomTypes.hh"
0052 
0053 #if defined(G4GEOM_USE_USOLIDS)
0054 #define G4GEOM_USE_UPARABOLOID 1
0055 #endif
0056 
0057 #if (defined(G4GEOM_USE_UPARABOLOID) && defined(G4GEOM_USE_SYS_USOLIDS))
0058   #define G4UParaboloid G4Paraboloid
0059   #include "G4UParaboloid.hh"
0060 #else
0061 
0062 #include <CLHEP/Units/PhysicalConstants.h>
0063 
0064 #include "G4VSolid.hh"
0065 #include "G4Polyhedron.hh"
0066 
0067 class G4Paraboloid : public G4VSolid
0068 {
0069   public:
0070 
0071     G4Paraboloid(const G4String& pName,
0072                        G4double  pDz,
0073                        G4double  pR1,
0074                        G4double  pR2);
0075 
0076     ~G4Paraboloid() override;
0077 
0078     // Access functions
0079 
0080     inline G4double GetZHalfLength() const;
0081     inline G4double GetRadiusMinusZ() const;
0082     inline G4double GetRadiusPlusZ() const;
0083 
0084     inline G4double GetCubicVolume() override;
0085     inline G4double GetSurfaceArea() override;
0086     inline G4double CalculateSurfaceArea() const;
0087 
0088     // Modifiers functions
0089 
0090     inline void SetZHalfLength(G4double dz);
0091     inline void SetRadiusMinusZ(G4double R1);
0092     inline void SetRadiusPlusZ(G4double R2);
0093 
0094     // Solid standard methods
0095 
0096     void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const override;
0097     G4bool CalculateExtent(const EAxis pAxis,
0098                            const G4VoxelLimits& pVoxelLimit,
0099                            const G4AffineTransform& pTransform,
0100                                  G4double& pmin, G4double& pmax) const override;
0101     EInside Inside(const G4ThreeVector& p) const override;
0102     G4ThreeVector SurfaceNormal( const G4ThreeVector& p) const override;
0103     G4double DistanceToIn(const G4ThreeVector& p,
0104                           const G4ThreeVector& v) const override;
0105     G4double DistanceToIn(const G4ThreeVector& p) const override;
0106     G4double DistanceToOut(const G4ThreeVector& p,
0107                            const G4ThreeVector& v,
0108                            const G4bool calcNorm = false,
0109                                  G4bool* validNorm = nullptr,
0110                                  G4ThreeVector* n = nullptr) const override;
0111     G4double DistanceToOut(const G4ThreeVector& p) const override;
0112 
0113     G4GeometryType GetEntityType() const override;
0114 
0115     G4VSolid* Clone() const override;
0116 
0117     std::ostream& StreamInfo(std::ostream& os) const override;
0118 
0119     G4ThreeVector GetPointOnSurface() const override;
0120 
0121     // Visualisation functions
0122 
0123     void DescribeYourselfTo(G4VGraphicsScene& scene) const override;
0124     G4Polyhedron* CreatePolyhedron() const override;
0125     G4Polyhedron* GetPolyhedron () const override;
0126 
0127     G4Paraboloid(__void__&);
0128       // Fake default constructor for usage restricted to direct object
0129       // persistency for clients requiring preallocation of memory for
0130       // persistifiable objects.
0131 
0132     G4Paraboloid(const G4Paraboloid& rhs);
0133     G4Paraboloid& operator=(const G4Paraboloid& rhs);
0134       // Copy constructor and assignment operator.
0135 
0136   protected:
0137 
0138     mutable G4bool fRebuildPolyhedron = false;
0139     mutable G4Polyhedron* fpPolyhedron = nullptr;
0140 
0141   private:
0142 
0143     // Making this mutable to allow GetPointOnSurface to have access to
0144     // area function.
0145     mutable G4double fSurfaceArea = 0.0;
0146     G4double fCubicVolume = 0.0;
0147 
0148     G4double dz, r1, r2;
0149     G4double k1, k2;
0150     // Defined to make some calculations easier to follow
0151 };
0152 
0153 #include "G4Paraboloid.icc"
0154 
0155 #endif  // defined(G4GEOM_USE_UPARABOLOID) && defined(G4GEOM_USE_SYS_USOLIDS)
0156 
0157 #endif // G4Paraboloid_HH