source: trunk/source/geometry/solids/CSG/include/G4Cons.icc@ 899

Last change on this file since 899 was 850, checked in by garnier, 17 years ago

geant4.8.2 beta

File size: 5.0 KB
Line 
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: G4Cons.icc,v 1.6 2006/10/19 15:33:37 gcosmo Exp $
28// GEANT4 tag $Name: HEAD $
29//
30// --------------------------------------------------------------------
31// GEANT 4 inline definitions file
32//
33// G4Cons.icc
34//
35// Implementation of inline methods of G4Cons
36// --------------------------------------------------------------------
37
38inline
39G4double G4Cons::GetInnerRadiusMinusZ() const
40{
41 return fRmin1 ;
42}
43
44inline
45G4double G4Cons::GetOuterRadiusMinusZ() const
46{
47 return fRmax1 ;
48}
49
50inline
51G4double G4Cons::GetInnerRadiusPlusZ() const
52{
53 return fRmin2 ;
54}
55
56inline
57G4double G4Cons::GetOuterRadiusPlusZ() const
58{
59 return fRmax2 ;
60}
61
62inline
63G4double G4Cons::GetZHalfLength() const
64{
65 return fDz ;
66}
67
68inline
69G4double G4Cons::GetStartPhiAngle() const
70{
71 return fSPhi ;
72}
73
74inline
75G4double G4Cons::GetDeltaPhiAngle() const
76{
77 return fDPhi;
78}
79
80inline
81void G4Cons::SetInnerRadiusMinusZ( G4double Rmin1 )
82{
83 fRmin1= Rmin1 ;
84 fCubicVolume= 0.;
85 fSurfaceArea= 0.;
86 fpPolyhedron = 0;
87}
88
89inline
90void G4Cons::SetOuterRadiusMinusZ( G4double Rmax1 )
91{
92 fRmax1= Rmax1 ;
93 fCubicVolume= 0.;
94 fSurfaceArea= 0.;
95 fpPolyhedron = 0;
96}
97
98inline
99void G4Cons::SetInnerRadiusPlusZ ( G4double Rmin2 )
100{
101 fRmin2= Rmin2 ;
102 fCubicVolume= 0.;
103 fSurfaceArea= 0.;
104 fpPolyhedron = 0;
105}
106
107inline
108void G4Cons::SetOuterRadiusPlusZ ( G4double Rmax2 )
109{
110 fRmax2= Rmax2 ;
111 fCubicVolume= 0.;
112 fSurfaceArea= 0.;
113 fpPolyhedron = 0;
114}
115
116inline
117void G4Cons::SetZHalfLength ( G4double newDz )
118{
119 fDz= newDz ;
120 fCubicVolume= 0.;
121 fSurfaceArea= 0.;
122 fpPolyhedron = 0;
123}
124
125inline
126void G4Cons::SetStartPhiAngle ( G4double newSPhi )
127{
128 fSPhi= newSPhi;
129 fCubicVolume= 0.;
130 fSurfaceArea= 0.;
131 fpPolyhedron = 0;
132}
133
134void G4Cons::SetDeltaPhiAngle ( G4double newDPhi )
135{
136 fDPhi= newDPhi;
137 fCubicVolume= 0.;
138 fSurfaceArea= 0.;
139 fpPolyhedron = 0;
140}
141
142// Old access methods ...
143
144inline
145G4double G4Cons::GetRmin1() const
146{
147 return GetInnerRadiusMinusZ();
148}
149
150inline
151G4double G4Cons::GetRmax1() const
152{
153 return GetOuterRadiusMinusZ();
154}
155
156inline
157G4double G4Cons::GetRmin2() const
158{
159 return GetInnerRadiusPlusZ();
160}
161
162inline
163G4double G4Cons::GetRmax2() const
164{
165 return GetOuterRadiusPlusZ();
166}
167
168inline
169G4double G4Cons::GetDz() const
170{
171 return GetZHalfLength();
172}
173
174inline
175G4double G4Cons::GetSPhi() const
176{
177 return GetStartPhiAngle();
178}
179
180inline
181G4double G4Cons::GetDPhi() const
182{
183 return GetDeltaPhiAngle();
184}
185
186inline
187G4double G4Cons::GetCubicVolume()
188{
189 if(fCubicVolume != 0.) {;}
190 else
191 {
192 G4double Rmean, rMean, deltaR, deltar;
193
194 Rmean = 0.5*(fRmax1+fRmax2);
195 deltaR = fRmax1-fRmax2;
196
197 rMean = 0.5*(fRmin1+fRmin2);
198 deltar = fRmin1-fRmin2;
199 fCubicVolume = fDPhi*fDz*(Rmean*Rmean-rMean*rMean
200 +(deltaR*deltaR-deltar*deltar)/12);
201 }
202 return fCubicVolume;
203}
204
205inline
206G4double G4Cons::GetSurfaceArea()
207{
208 if(fSurfaceArea != 0.) {;}
209 else
210 {
211 G4double mmin, mmax, dmin, dmax;
212
213 mmin= (fRmin1+fRmin2)*0.5;
214 mmax= (fRmax1+fRmax2)*0.5;
215 dmin= (fRmin2-fRmin1);
216 dmax= (fRmax2-fRmax1);
217
218 fSurfaceArea = fDPhi*( mmin * std::sqrt(dmin*dmin+4*fDz*fDz)
219 + mmax * std::sqrt(dmax*dmax+4*fDz*fDz)
220 + 0.5*(fRmax1*fRmax1-fRmin1*fRmin1
221 +fRmax2*fRmax2-fRmin2*fRmin2 ));
222 if(fDPhi < twopi )
223 {
224 fSurfaceArea = fSurfaceArea+4*fDz*(mmax-mmin);
225 }
226 }
227 return fSurfaceArea;
228}
Note: See TracBrowser for help on using the repository browser.