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 | // |
---|
27 | // $Id: G4Hype.icc,v 1.7 2006/06/29 18:47:03 gunter Exp $ |
---|
28 | // GEANT4 tag $Name: HEAD $ |
---|
29 | // |
---|
30 | // -------------------------------------------------------------------- |
---|
31 | // GEANT 4 inline definitions file |
---|
32 | // |
---|
33 | // G4Hype.icc |
---|
34 | // |
---|
35 | // Implementation of inline methods of G4Hype |
---|
36 | // -------------------------------------------------------------------- |
---|
37 | |
---|
38 | inline |
---|
39 | G4double G4Hype::GetInnerRadius () const |
---|
40 | { |
---|
41 | return innerRadius; |
---|
42 | } |
---|
43 | |
---|
44 | inline |
---|
45 | G4double G4Hype::GetOuterRadius () const |
---|
46 | { |
---|
47 | return outerRadius; |
---|
48 | } |
---|
49 | |
---|
50 | inline |
---|
51 | G4double G4Hype::GetZHalfLength () const |
---|
52 | { |
---|
53 | return halfLenZ; |
---|
54 | } |
---|
55 | |
---|
56 | inline |
---|
57 | G4double G4Hype::GetInnerStereo () const |
---|
58 | { |
---|
59 | return innerStereo; |
---|
60 | } |
---|
61 | |
---|
62 | inline |
---|
63 | G4double G4Hype::GetOuterStereo () const |
---|
64 | { |
---|
65 | return outerStereo; |
---|
66 | } |
---|
67 | |
---|
68 | inline |
---|
69 | void G4Hype::SetInnerRadius (G4double newIRad) |
---|
70 | { |
---|
71 | innerRadius= newIRad; |
---|
72 | innerRadius2= newIRad*newIRad; |
---|
73 | endInnerRadius2=HypeInnerRadius2(halfLenZ); |
---|
74 | endInnerRadius=std::sqrt(endInnerRadius2); |
---|
75 | fCubicVolume = 0.; |
---|
76 | fpPolyhedron = 0; |
---|
77 | } |
---|
78 | |
---|
79 | inline |
---|
80 | void G4Hype::SetOuterRadius (G4double newORad) |
---|
81 | { |
---|
82 | outerRadius= newORad; |
---|
83 | outerRadius2=newORad*newORad; |
---|
84 | endOuterRadius2=HypeOuterRadius2(halfLenZ); |
---|
85 | endOuterRadius=std::sqrt(endOuterRadius2); |
---|
86 | fCubicVolume = 0.; |
---|
87 | fpPolyhedron = 0; |
---|
88 | } |
---|
89 | |
---|
90 | inline |
---|
91 | void G4Hype::SetZHalfLength (G4double newHLZ) |
---|
92 | { |
---|
93 | halfLenZ = newHLZ ; |
---|
94 | fCubicVolume = 0.; |
---|
95 | fpPolyhedron = 0; |
---|
96 | } |
---|
97 | |
---|
98 | inline |
---|
99 | void G4Hype::SetInnerStereo (G4double newISte) |
---|
100 | { |
---|
101 | innerStereo= std::fabs(newISte); |
---|
102 | tanInnerStereo=std::tan(innerStereo); |
---|
103 | tanInnerStereo2=tanInnerStereo*tanInnerStereo; |
---|
104 | endInnerRadius2=HypeInnerRadius2(halfLenZ); |
---|
105 | endInnerRadius=std::sqrt(endInnerRadius2); |
---|
106 | fCubicVolume = 0.; |
---|
107 | fpPolyhedron = 0; |
---|
108 | } |
---|
109 | |
---|
110 | inline |
---|
111 | void G4Hype::SetOuterStereo (G4double newOSte) |
---|
112 | { |
---|
113 | outerStereo= std::fabs(newOSte); |
---|
114 | tanOuterStereo=std::tan(outerStereo); |
---|
115 | tanOuterStereo2=tanOuterStereo*tanOuterStereo; |
---|
116 | endOuterRadius2=HypeOuterRadius2(halfLenZ); |
---|
117 | endOuterRadius=std::sqrt(endOuterRadius2); |
---|
118 | fCubicVolume = 0.; |
---|
119 | fpPolyhedron = 0; |
---|
120 | } |
---|
121 | |
---|
122 | inline |
---|
123 | G4bool G4Hype::InnerSurfaceExists() const |
---|
124 | { |
---|
125 | return (innerRadius > DBL_MIN) || (innerStereo != 0); |
---|
126 | } |
---|
127 | |
---|
128 | inline |
---|
129 | G4double G4Hype::HypeInnerRadius2(G4double zVal) const |
---|
130 | { |
---|
131 | return (tanInnerStereo2*zVal*zVal+innerRadius2); |
---|
132 | } |
---|
133 | |
---|
134 | inline |
---|
135 | G4double G4Hype::HypeOuterRadius2(G4double zVal) const |
---|
136 | { |
---|
137 | return (tanOuterStereo2*zVal*zVal+outerRadius2); |
---|
138 | } |
---|