Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:17

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 // G4UTrd
0027 //
0028 // Class description:
0029 //
0030 // Wrapper class for G4Trd to make use of VecGeom Trd.
0031 
0032 // 13.09.13 G.Cosmo, CERN/PH
0033 // --------------------------------------------------------------------
0034 #ifndef G4UTRD_HH
0035 #define G4UTRD_HH
0036 
0037 #include "G4UAdapter.hh"
0038 
0039 #if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
0040 
0041 #include <VecGeom/volumes/UnplacedTrd.h>
0042 
0043 #include "G4Polyhedron.hh"
0044 
0045 class G4UTrd : public G4UAdapter<vecgeom::GenericUnplacedTrd> 
0046 {
0047   using Shape_t = vecgeom::GenericUnplacedTrd;
0048   using Base_t  = G4UAdapter<vecgeom::GenericUnplacedTrd>;
0049 
0050   public:  // with description
0051 
0052     G4UTrd(const G4String& pName,
0053                  G4double pdx1, G4double pdx2,
0054                  G4double pdy1, G4double pdy2,
0055                  G4double pdz);
0056       // Constructs a trapezoid with name, and half lengths
0057 
0058    ~G4UTrd() override;
0059 
0060     void ComputeDimensions(      G4VPVParameterisation* p,
0061                            const G4int n,
0062                            const G4VPhysicalVolume* pRep) override;
0063 
0064     G4VSolid* Clone() const override;
0065 
0066     G4double GetXHalfLength1() const;
0067     G4double GetXHalfLength2() const;
0068     G4double GetYHalfLength1() const;
0069     G4double GetYHalfLength2() const;
0070     G4double GetZHalfLength()  const;
0071 
0072     void SetXHalfLength1(G4double val);
0073     void SetXHalfLength2(G4double val);
0074     void SetYHalfLength1(G4double val);
0075     void SetYHalfLength2(G4double val);
0076     void SetZHalfLength(G4double val);
0077 
0078     void SetAllParameters(G4double pdx1, G4double pdx2,
0079                           G4double pdy1, G4double pdy2, G4double pdz);
0080 
0081     inline G4GeometryType GetEntityType() const override;
0082 
0083     void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const override;
0084 
0085     G4bool CalculateExtent(const EAxis pAxis,
0086                            const G4VoxelLimits& pVoxelLimit,
0087                            const G4AffineTransform& pTransform,
0088                            G4double& pMin, G4double& pMax) const override;
0089 
0090     G4Polyhedron* CreatePolyhedron() const override;
0091 
0092   public:  // without description
0093 
0094     G4UTrd(__void__&);
0095       // Fake default constructor for usage restricted to direct object
0096       // persistency for clients requiring preallocation of memory for
0097       // persistifiable objects.
0098 
0099     G4UTrd(const G4UTrd& rhs);
0100     G4UTrd& operator=(const G4UTrd& rhs); 
0101       // Copy constructor and assignment operator.
0102 };
0103 
0104 // --------------------------------------------------------------------
0105 // Inline methods
0106 // --------------------------------------------------------------------
0107 
0108 inline G4GeometryType G4UTrd::GetEntityType() const
0109 {
0110   return "G4Trd";
0111 }
0112 
0113 #endif  // G4GEOM_USE_USOLIDS
0114 
0115 #endif