Geant4-11
G4Para.icc
Go to the documentation of this file.
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// Implementation of inline methods of G4Para
27// --------------------------------------------------------------------
28
29inline
30G4double G4Para::GetZHalfLength() const
31{
32 return fDz;
33}
34
35inline
36G4ThreeVector G4Para::GetSymAxis() const
37{
38 return G4ThreeVector(fTthetaCphi,fTthetaSphi,1.).unit();
39}
40
41inline
42G4double G4Para::GetYHalfLength() const
43{
44 return fDy;
45}
46
47inline
48G4double G4Para::GetXHalfLength() const
49{
50 return fDx;
51}
52
53inline
54G4double G4Para::GetTanAlpha() const
55{
56 return fTalpha;
57}
58
59inline
60void G4Para::SetXHalfLength(G4double val)
61{
62 fDx = val;
63
64 fCubicVolume = 0.;
65 fSurfaceArea = 0.;
66 fRebuildPolyhedron = true;
67
68 CheckParameters();
69 MakePlanes();
70}
71
72inline
73void G4Para::SetYHalfLength(G4double val)
74{
75 fDy = val;
76
77 fCubicVolume = 0.;
78 fSurfaceArea = 0.;
79 fRebuildPolyhedron = true;
80
81 CheckParameters();
82 MakePlanes();
83}
84
85inline
86void G4Para::SetZHalfLength(G4double val)
87{
88 fDz = val;
89
90 fCubicVolume = 0.;
91 fSurfaceArea = 0.;
92 fRebuildPolyhedron = true;
93
94 CheckParameters();
95 MakePlanes();
96}
97
98inline
99void G4Para::SetAlpha(G4double alpha)
100{
101 fTalpha = std::tan(alpha);
102
103 fSurfaceArea = 0.;
104 fCubicVolume = 0.;
105 fRebuildPolyhedron = true;
106
107 MakePlanes();
108}
109
110inline
111void G4Para::SetTanAlpha(G4double val)
112{
113 fTalpha = val;
114
115 fCubicVolume = 0.;
116 fSurfaceArea = 0.;
117 fRebuildPolyhedron = true;
118
119 MakePlanes();
120}
121
122inline
123void G4Para::SetThetaAndPhi(double pTheta, double pPhi)
124{
125 G4double tanTheta = std::tan(pTheta);
126 fTthetaCphi = tanTheta*std::cos(pPhi);
127 fTthetaSphi = tanTheta*std::sin(pPhi);
128
129 fCubicVolume = 0.;
130 fSurfaceArea = 0.;
131 fRebuildPolyhedron = true;
132
133 MakePlanes();
134}
135
136inline G4double G4Para::GetPhi() const
137{
138 return std::atan2(fTthetaSphi,fTthetaCphi);
139}
140
141inline G4double G4Para::GetTheta() const
142{
143 return std::atan(std::sqrt(fTthetaCphi*fTthetaCphi
144 +fTthetaSphi*fTthetaSphi));
145}
146
147inline G4double G4Para::GetAlpha() const
148{
149 return std::atan(fTalpha);
150}