Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-25 09:14:07

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 // G4TwistedBox
0027 //
0028 // Class description:
0029 //
0030 // A G4TwistedBox is a twisted cuboid of given half lengths pDx,pDy,pDz
0031 // and twist angle pPhiTwist.
0032 // The Box is centred on the origin with sides parallel to the x/y/z axes.
0033 //
0034 // Member Data:
0035 //
0036 //   pDx    Half-length along x axis
0037 //   pDy    Half-length along y asis
0038 //   pDz    Half-length along z axis
0039 //   pPhiTwist Twist angle
0040 
0041 // Author: Oliver Link (CERN), 27.10.2004 - Created
0042 // --------------------------------------------------------------------
0043 #ifndef G4TWISTEDBOX_HH
0044 #define G4TWISTEDBOX_HH
0045 
0046 #include "G4VTwistedFaceted.hh"
0047 
0048 /**
0049  * @brief G4TwistedBox is a twisted cuboid of given half lengths and twist
0050  * angle. The box is centred on the origin with sides parallel to the
0051  * Cartesian axes.
0052  */
0053 
0054 class G4TwistedBox : public G4VTwistedFaceted
0055 {
0056   public:
0057 
0058     /**
0059      * Constructs a twisted box, given its parameters.
0060      *  @param[in] pName The solid name.
0061      *  @param[in] pPhiTwist Twist angle.
0062      *  @param[in] pDx Half-length along X axis.
0063      *  @param[in] pDy Half-length along Y axis.
0064      *  @param[in] pDz Half-length along Z axis.
0065      */
0066     G4TwistedBox(const G4String& pName,
0067                        G4double  pPhiTwist,
0068                        G4double  pDx,
0069                        G4double  pDy,
0070                        G4double  pDz );
0071 
0072     /**
0073      * Default destructor.
0074      */
0075     ~G4TwistedBox() override = default;
0076 
0077     /**
0078      * Accessors.
0079      */
0080     inline G4double GetXHalfLength() const { return GetDx1() ; }
0081     inline G4double GetYHalfLength() const { return GetDy1() ; }
0082     inline G4double GetZHalfLength() const { return GetDz()  ; }
0083     inline G4double GetPhiTwist()    const { return GetTwistAngle() ; }
0084 
0085     /**
0086      * Returns the type ID, "G4TwistedBox" of the solid.
0087      */
0088     G4GeometryType GetEntityType() const override;
0089 
0090     /**
0091      * Returning an estimation of the solid volume (capacity) and
0092      * surface area, in internal units.
0093      */
0094     G4double GetCubicVolume() override;
0095     G4double GetSurfaceArea() override;
0096 
0097     /**
0098      * Makes a clone of the object for use in multi-treading.
0099      *  @returns A pointer to the new cloned allocated solid.
0100      */
0101     G4VSolid* Clone() const override;
0102 
0103     /**
0104      * Streams the object contents to an output stream.
0105      */
0106     std::ostream& StreamInfo(std::ostream& os) const override;
0107 
0108     /**
0109      * Fake default constructor for usage restricted to direct object
0110      * persistency for clients requiring preallocation of memory for
0111      * persistifiable objects.
0112      */
0113     G4TwistedBox(__void__&);
0114 
0115     /**
0116      * Copy constructor and assignment operator.
0117      */
0118     G4TwistedBox(const G4TwistedBox& rhs);
0119     G4TwistedBox& operator=(const G4TwistedBox& rhs);
0120 };
0121 
0122 #endif