Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-02 09:05:46

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 // G4TwistedTrap
0027 //
0028 // Class description:
0029 //
0030 // A G4TwistedTrap is a general twisted trapezoid: The faces perpendicular to the
0031 // z planes are trapezia, and their centres are not necessarily on
0032 // a line parallel to the z axis.
0033 //
0034 //     pDz     Half-length along the z-axis
0035 //     pTheta  Polar angle of the line joining the centres of the faces
0036 //             at -/+pDz
0037 //     pPhi    Azimuthal angle of the line joining the centre of the face at
0038 //             -pDz to the centre of the face at +pDz
0039 //     pDy1    Half-length along y of the face at -pDz
0040 //     pDx1    Half-length along x of the side at y=-pDy1 of the face at -pDz
0041 //     pDx2    Half-length along x of the side at y=+pDy1 of the face at -pDz
0042 //
0043 //     pDy2    Half-length along y of the face at +pDz
0044 //     pDx3    Half-length along x of the side at y=-pDy2 of the face at +pDz
0045 //     pDx4    Half-length along x of the side at y=+pDy2 of the face at +pDz
0046 //     pAlph   Angle with respect to the y axis from the centre of the side
0047 //
0048 //
0049 // A special regular case of a trapezoid with equal endcaps is available, 
0050 // with polar,azimuthal and tilt angles set to zero.
0051 //
0052  
0053 // Author: Oliver Link (CERN), 27.10.2004 - Created
0054 // --------------------------------------------------------------------
0055 #ifndef G4TWISTEDTRAP_HH
0056 #define G4TWISTEDTRAP_HH
0057 
0058 #include "G4VTwistedFaceted.hh"
0059 
0060 /**
0061  * @brief G4TwistedTrap is a general twisted trapezoid. The faces perpendicular
0062  * to the Z planes are trapezia, and their centres are not necessarily on
0063  * a line parallel to the Z axis.
0064  */
0065 
0066 class G4TwistedTrap : public G4VTwistedFaceted
0067 {
0068   public:
0069 
0070     /**
0071      * Constructs a twisted trapezoid, given its parameters.
0072      *  @param[in] pName The solid name.
0073      *  @param[in] pPhiTwist The twist angle.
0074      *  @param[in] pDx1 Half X length at -pDz,-pDy.
0075      *  @param[in] pDx2 Half X length at -pDz,+pDy.
0076      *  @param[in] pDy Half-length along the Y axis.
0077      *  @param[in] pDz Half-length along the Z axis.
0078      */
0079     G4TwistedTrap(const G4String& pName,
0080                         G4double  pPhiTwist,
0081                         G4double  pDx1,  // half x length at -pDz,-pDy
0082                         G4double  pDx2,  // half x length at -pDz,+pDy
0083                         G4double  pDy,
0084                         G4double  pDz);
0085 
0086     /**
0087      * Alternative construct of a twisted trapezoid, given its parameters.
0088      *  @param[in] pName The solid name.
0089      *  @param[in] pPhiTwist The twist angle.
0090      *  @param[in] pDz Half-length along the Z axis.
0091      *  @param[in] pTheta Polar angle of the line joining the centres of the
0092      *             faces at -/+pDz.
0093      *  @param[in] pPhi Azimuthal angle of the line joining the centres of the
0094      *             faces at -/+pDz.
0095      *  @param[in] pDy1 Half Y length at -pDz.
0096      *  @param[in] pDx1 Half X length at -pDz, y=-pDy1.
0097      *  @param[in] pDx2 Half X length at -pDz, y=+pDy1.
0098      *  @param[in] pDy2 Half Y length at +pDz.
0099      *  @param[in] pDx3 Half X length at +pDz, y=-pDy2.
0100      *  @param[in] pDx4 Half X length at +pDz, y=+pDy2.
0101      *  @param[in] pAlph Angle with respect to the Y axis from centre of side.
0102      */
0103     G4TwistedTrap(const G4String& pName,       // Name of instance
0104                         G4double  pPhiTwist,   // twist angle
0105                         G4double  pDz,     // half z length
0106                         G4double  pTheta,  // direction between end planes
0107                         G4double  pPhi,    // defined by polar and azim. angles
0108                         G4double  pDy1,    // half y length at -pDz
0109                         G4double  pDx1,    // half x length at -pDz,-pDy
0110                         G4double  pDx2,    // half x length at -pDz,+pDy
0111                         G4double  pDy2,    // half y length at +pDz
0112                         G4double  pDx3,    // half x length at +pDz,-pDy
0113                         G4double  pDx4,    // half x length at +pDz,+pDy
0114                         G4double  pAlph    // tilt angle
0115                   );
0116  
0117     /**
0118      * Default destructor.
0119      */
0120     ~G4TwistedTrap() override = default;
0121 
0122     /**
0123      * Accessors.
0124      */
0125     inline G4double GetY1HalfLength() const { return GetDy1() ; }
0126     inline G4double GetX1HalfLength() const { return GetDx1() ; }
0127     inline G4double GetX2HalfLength() const { return GetDx2() ; }
0128     inline G4double GetY2HalfLength() const { return GetDy2() ; }
0129     inline G4double GetX3HalfLength() const { return GetDx3() ; }
0130     inline G4double GetX4HalfLength() const { return GetDx4() ; }
0131     inline G4double GetZHalfLength()  const { return GetDz()  ; }
0132     inline G4double GetPhiTwist()     const { return GetTwistAngle() ; }
0133     inline G4double GetTiltAngleAlpha()    const { return GetAlpha() ; }
0134     inline G4double GetPolarAngleTheta()   const { return GetTheta() ; }
0135     inline G4double GetAzimuthalAnglePhi() const { return GetPhi()   ; }
0136 
0137     /**
0138      * Returns the type ID, "G4TwistedTrap" of the solid.
0139      */
0140     G4GeometryType GetEntityType() const override;
0141 
0142     /**
0143      * Makes a clone of the object for use in multi-treading.
0144      *  @returns A pointer to the new cloned allocated solid.
0145      */
0146     G4VSolid* Clone() const override;
0147 
0148     /**
0149      * Streams the object contents to an output stream.
0150      */
0151     std::ostream &StreamInfo(std::ostream& os) const override;
0152 
0153     /**
0154      * Fake default constructor for usage restricted to direct object
0155      * persistency for clients requiring preallocation of memory for
0156      * persistifiable objects.
0157      */
0158     G4TwistedTrap(__void__&);
0159 
0160     /**
0161      * Copy constructor and assignment operator.
0162      */
0163     G4TwistedTrap(const G4TwistedTrap& rhs);
0164     G4TwistedTrap& operator=(const G4TwistedTrap& rhs); 
0165 } ;
0166 
0167 #endif