ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4Orb.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4Orb.hh
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // G4Orb
27 //
28 // Class description:
29 //
30 // A G4Orb is a simple case of G4Sphere. It has only:
31 // fRmax outer radius
32 
33 // 20.08.03 V.Grichine - created
34 // 08.08.17 E.Tcherniaev - revised
35 // --------------------------------------------------------------------
36 #ifndef G4ORB_HH
37 #define G4ORB_HH
38 
39 #include "G4GeomTypes.hh"
40 
41 #if defined(G4GEOM_USE_USOLIDS)
42 #define G4GEOM_USE_UORB 1
43 #endif
44 
45 #if defined(G4GEOM_USE_UORB)
46  #define G4UOrb G4Orb
47  #include "G4UOrb.hh"
48 #else
49 
51 
52 #include "G4CSGSolid.hh"
53 #include "G4Polyhedron.hh"
54 
55 class G4Orb : public G4CSGSolid
56 {
57  public: // with description
58 
59  G4Orb(const G4String& pName, G4double pRmax);
60 
61  ~G4Orb();
62 
63  // Accessors and modifiers
64 
65  inline G4double GetRadius() const;
66  inline G4double GetRadialTolerance() const;
67 
68  inline void SetRadius(G4double newRmax);
69 
70  // Methods for solid
71 
72  inline G4double GetCubicVolume();
73  inline G4double GetSurfaceArea();
74 
76  const G4int n,
77  const G4VPhysicalVolume* pRep);
78 
80 
81  G4bool CalculateExtent(const EAxis pAxis,
82  const G4VoxelLimits& pVoxelLimit,
83  const G4AffineTransform& pTransform,
84  G4double& pmin, G4double& pmax) const;
85 
86  EInside Inside(const G4ThreeVector& p) const;
87 
88  G4ThreeVector SurfaceNormal( const G4ThreeVector& p) const;
89 
91  const G4ThreeVector& v) const;
92 
93  G4double DistanceToIn(const G4ThreeVector& p) const;
94 
96  const G4ThreeVector& v,
97  const G4bool calcNorm = false,
98  G4bool* validNorm = nullptr,
99  G4ThreeVector* n = nullptr) const;
100 
101  G4double DistanceToOut(const G4ThreeVector& p) const;
102 
104 
106 
107  G4VSolid* Clone() const;
108 
109  std::ostream& StreamInfo(std::ostream& os) const;
110 
111  // Visualisation functions
112 
113  void DescribeYourselfTo (G4VGraphicsScene& scene) const;
114  G4VisExtent GetExtent () const;
115  G4Polyhedron* CreatePolyhedron () const;
116 
117  public: // without description
118 
119  G4Orb(__void__&);
120  // Fake default constructor for usage restricted to direct object
121  // persistency for clients requiring preallocation of memory for
122  // persistifiable objects
123 
124  G4Orb(const G4Orb& rhs);
125  G4Orb& operator=(const G4Orb& rhs);
126  // Copy constructor and assignment operator
127 
128  protected:
129 
130  void Initialize();
131 
132  private:
133 
137 };
138 
139 #include "G4Orb.icc"
140 
141 #endif
142 
143 #endif