Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-14 09:08:55

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 // G4UParaboloid
0027 //
0028 // Class description:
0029 //
0030 // Wrapper class for G4Paraboloid to make use of VecGeom Paraboloid.
0031 
0032 // Author: Guilherme Lima (FNAL), 19.08.2015
0033 // --------------------------------------------------------------------
0034 #ifndef G4UPARABOLOID_HH
0035 #define G4UPARABOLOID_HH
0036 
0037 #include "G4UAdapter.hh"
0038 
0039 #if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
0040 
0041 #include <VecGeom/volumes/UnplacedParaboloid.h>
0042 
0043 #include "G4Polyhedron.hh"
0044 
0045 /**
0046  * @brief G4UParaboloid is a wrapper class for G4Paraboloid
0047  * to make use of VecGeom Paraboloid.
0048  */
0049 
0050 class G4UParaboloid : public G4UAdapter<vecgeom::UnplacedParaboloid>
0051 {
0052   using Shape_t = vecgeom::UnplacedParaboloid;
0053   using Base_t  = G4UAdapter<vecgeom::UnplacedParaboloid>;
0054 
0055   public:
0056 
0057     /**
0058      * Constructs a paraboloid, given its parameters.
0059      *  @param[in] name The solid name.
0060      *  @param[in] dz Half length in Z.
0061      *  @param[in] rlo Radius at -Dz.
0062      *  @param[in] rhi Radius at +Dz greater than pR1.
0063      */
0064     G4UParaboloid(const G4String& name,
0065                         G4double dz,
0066                         G4double rlo,
0067                         G4double rhi);
0068 
0069     /**
0070      * Default destructor.
0071      */
0072     ~G4UParaboloid() override = default;
0073 
0074     /**
0075      * Makes a clone of the object for use in multi-treading.
0076      *  @returns A pointer to the new cloned allocated solid.
0077      */
0078     G4VSolid* Clone() const override;
0079 
0080     /**
0081      * Accessors.
0082      */
0083     G4double GetZHalfLength() const;
0084     G4double GetRadiusMinusZ() const;
0085     G4double GetRadiusPlusZ() const;
0086 
0087     /**
0088      * Modifiers.
0089      */
0090     void SetZHalfLength(G4double dz);
0091     void SetRadiusMinusZ(G4double r1);
0092     void SetRadiusPlusZ(G4double r2);
0093 
0094     /**
0095      * Returns the type ID, "G4Paraboloid" of the solid.
0096      */
0097     inline G4GeometryType GetEntityType() const override;
0098 
0099     /**
0100      * Computes the bounding limits of the solid.
0101      *  @param[out] pMin The minimum bounding limit point.
0102      *  @param[out] pMax The maximum bounding limit point.
0103      */
0104     void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const override;
0105 
0106     /**
0107      * Calculates the minimum and maximum extent of the solid, when under the
0108      * specified transform, and within the specified limits.
0109      *  @param[in] pAxis The axis along which compute the extent.
0110      *  @param[in] pVoxelLimit The limiting space dictated by voxels.
0111      *  @param[in] pTransform The internal transformation applied to the solid.
0112      *  @param[out] pMin The minimum extent value.
0113      *  @param[out] pMax The maximum extent value.
0114      *  @returns True if the solid is intersected by the extent region.
0115      */
0116     G4bool CalculateExtent(const EAxis pAxis,
0117                            const G4VoxelLimits& pVoxelLimit,
0118                            const G4AffineTransform& pTransform,
0119                            G4double& pmin, G4double& pmax) const override;
0120 
0121     /**
0122      * Returns a generated polyhedron as graphical representations.
0123      */
0124     G4Polyhedron* CreatePolyhedron() const override;
0125 
0126     /**
0127      * Copy constructor and assignment operator.
0128      */
0129     G4UParaboloid( const G4UParaboloid& source );
0130     G4UParaboloid& operator=( const G4UParaboloid& source );
0131 };
0132 
0133 // --------------------------------------------------------------------
0134 // Inline methods
0135 // --------------------------------------------------------------------
0136 
0137 inline G4GeometryType G4UParaboloid::GetEntityType() const
0138 {
0139   return "G4Paraboloid";
0140 }
0141 
0142 #endif  // G4GEOM_USE_USOLIDS
0143 
0144 #endif