00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // $Id: G4Hype.icc 67011 2013-01-29 16:17:41Z gcosmo $ 00028 // 00029 // -------------------------------------------------------------------- 00030 // GEANT 4 inline definitions file 00031 // 00032 // G4Hype.icc 00033 // 00034 // Implementation of inline methods of G4Hype 00035 // -------------------------------------------------------------------- 00036 00037 inline 00038 G4double G4Hype::GetInnerRadius () const 00039 { 00040 return innerRadius; 00041 } 00042 00043 inline 00044 G4double G4Hype::GetOuterRadius () const 00045 { 00046 return outerRadius; 00047 } 00048 00049 inline 00050 G4double G4Hype::GetZHalfLength () const 00051 { 00052 return halfLenZ; 00053 } 00054 00055 inline 00056 G4double G4Hype::GetInnerStereo () const 00057 { 00058 return innerStereo; 00059 } 00060 00061 inline 00062 G4double G4Hype::GetOuterStereo () const 00063 { 00064 return outerStereo; 00065 } 00066 00067 inline 00068 void G4Hype::SetInnerRadius (G4double newIRad) 00069 { 00070 innerRadius= newIRad; 00071 innerRadius2= newIRad*newIRad; 00072 endInnerRadius2=HypeInnerRadius2(halfLenZ); 00073 endInnerRadius=std::sqrt(endInnerRadius2); 00074 fCubicVolume = 0.; 00075 fpPolyhedron = 0; 00076 } 00077 00078 inline 00079 void G4Hype::SetOuterRadius (G4double newORad) 00080 { 00081 outerRadius= newORad; 00082 outerRadius2=newORad*newORad; 00083 endOuterRadius2=HypeOuterRadius2(halfLenZ); 00084 endOuterRadius=std::sqrt(endOuterRadius2); 00085 fCubicVolume = 0.; 00086 fpPolyhedron = 0; 00087 } 00088 00089 inline 00090 void G4Hype::SetZHalfLength (G4double newHLZ) 00091 { 00092 halfLenZ = newHLZ ; 00093 fCubicVolume = 0.; 00094 fpPolyhedron = 0; 00095 } 00096 00097 inline 00098 void G4Hype::SetInnerStereo (G4double newISte) 00099 { 00100 innerStereo= std::fabs(newISte); 00101 tanInnerStereo=std::tan(innerStereo); 00102 tanInnerStereo2=tanInnerStereo*tanInnerStereo; 00103 endInnerRadius2=HypeInnerRadius2(halfLenZ); 00104 endInnerRadius=std::sqrt(endInnerRadius2); 00105 fCubicVolume = 0.; 00106 fpPolyhedron = 0; 00107 } 00108 00109 inline 00110 void G4Hype::SetOuterStereo (G4double newOSte) 00111 { 00112 outerStereo= std::fabs(newOSte); 00113 tanOuterStereo=std::tan(outerStereo); 00114 tanOuterStereo2=tanOuterStereo*tanOuterStereo; 00115 endOuterRadius2=HypeOuterRadius2(halfLenZ); 00116 endOuterRadius=std::sqrt(endOuterRadius2); 00117 fCubicVolume = 0.; 00118 fpPolyhedron = 0; 00119 } 00120 00121 inline 00122 G4bool G4Hype::InnerSurfaceExists() const 00123 { 00124 return (innerRadius > DBL_MIN) || (innerStereo != 0); 00125 } 00126 00127 inline 00128 G4double G4Hype::HypeInnerRadius2(G4double zVal) const 00129 { 00130 return (tanInnerStereo2*zVal*zVal+innerRadius2); 00131 } 00132 00133 inline 00134 G4double G4Hype::HypeOuterRadius2(G4double zVal) const 00135 { 00136 return (tanOuterStereo2*zVal*zVal+outerRadius2); 00137 }