Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // >> 26 // >> 27 // >> 28 // -------------------------------------------------------------------- >> 29 // GEANT 4 inline definitions file >> 30 // >> 31 // G4Para.icc >> 32 // 26 // Implementation of inline methods of G4Para 33 // Implementation of inline methods of G4Para 27 // ------------------------------------------- 34 // -------------------------------------------------------------------- 28 35 29 inline 36 inline 30 G4double G4Para::GetZHalfLength() const 37 G4double G4Para::GetZHalfLength() const 31 { 38 { 32 return fDz; 39 return fDz; 33 } 40 } 34 41 35 inline 42 inline 36 G4ThreeVector G4Para::GetSymAxis() const 43 G4ThreeVector G4Para::GetSymAxis() const 37 { 44 { 38 return G4ThreeVector(fTthetaCphi,fTthetaSphi 45 return G4ThreeVector(fTthetaCphi,fTthetaSphi,1.).unit(); 39 } 46 } 40 47 41 inline 48 inline 42 G4double G4Para::GetYHalfLength() const 49 G4double G4Para::GetYHalfLength() const 43 { 50 { 44 return fDy; 51 return fDy; 45 } 52 } 46 53 47 inline 54 inline 48 G4double G4Para::GetXHalfLength() const 55 G4double G4Para::GetXHalfLength() const 49 { 56 { 50 return fDx; 57 return fDx; 51 } 58 } 52 59 53 inline 60 inline 54 G4double G4Para::GetTanAlpha() const 61 G4double G4Para::GetTanAlpha() const 55 { 62 { 56 return fTalpha; 63 return fTalpha; 57 } 64 } 58 65 59 inline 66 inline 60 void G4Para::SetXHalfLength(G4double val) 67 void G4Para::SetXHalfLength(G4double val) 61 { 68 { 62 fDx = val; 69 fDx = val; 63 70 64 fCubicVolume = 0.; 71 fCubicVolume = 0.; 65 fSurfaceArea = 0.; 72 fSurfaceArea = 0.; 66 fRebuildPolyhedron = true; 73 fRebuildPolyhedron = true; 67 74 68 CheckParameters(); 75 CheckParameters(); 69 MakePlanes(); 76 MakePlanes(); 70 } 77 } 71 78 72 inline 79 inline 73 void G4Para::SetYHalfLength(G4double val) 80 void G4Para::SetYHalfLength(G4double val) 74 { 81 { 75 fDy = val; 82 fDy = val; 76 83 77 fCubicVolume = 0.; 84 fCubicVolume = 0.; 78 fSurfaceArea = 0.; 85 fSurfaceArea = 0.; 79 fRebuildPolyhedron = true; 86 fRebuildPolyhedron = true; 80 87 81 CheckParameters(); 88 CheckParameters(); 82 MakePlanes(); 89 MakePlanes(); 83 } 90 } 84 91 85 inline 92 inline 86 void G4Para::SetZHalfLength(G4double val) 93 void G4Para::SetZHalfLength(G4double val) 87 { 94 { 88 fDz = val; 95 fDz = val; 89 96 90 fCubicVolume = 0.; 97 fCubicVolume = 0.; 91 fSurfaceArea = 0.; 98 fSurfaceArea = 0.; 92 fRebuildPolyhedron = true; 99 fRebuildPolyhedron = true; 93 100 94 CheckParameters(); 101 CheckParameters(); 95 MakePlanes(); 102 MakePlanes(); 96 } 103 } 97 104 98 inline 105 inline 99 void G4Para::SetAlpha(G4double alpha) 106 void G4Para::SetAlpha(G4double alpha) 100 { 107 { 101 fTalpha = std::tan(alpha); 108 fTalpha = std::tan(alpha); 102 109 103 fSurfaceArea = 0.; 110 fSurfaceArea = 0.; 104 fCubicVolume = 0.; 111 fCubicVolume = 0.; 105 fRebuildPolyhedron = true; 112 fRebuildPolyhedron = true; 106 113 107 MakePlanes(); 114 MakePlanes(); 108 } 115 } 109 116 110 inline 117 inline 111 void G4Para::SetTanAlpha(G4double val) 118 void G4Para::SetTanAlpha(G4double val) 112 { 119 { 113 fTalpha = val; 120 fTalpha = val; 114 121 115 fCubicVolume = 0.; 122 fCubicVolume = 0.; 116 fSurfaceArea = 0.; 123 fSurfaceArea = 0.; 117 fRebuildPolyhedron = true; 124 fRebuildPolyhedron = true; 118 125 119 MakePlanes(); 126 MakePlanes(); 120 } 127 } 121 128 122 inline 129 inline 123 void G4Para::SetThetaAndPhi(G4double pTheta, G << 130 void G4Para::SetThetaAndPhi(double pTheta, double pPhi) 124 { 131 { 125 G4double tanTheta = std::tan(pTheta); 132 G4double tanTheta = std::tan(pTheta); 126 fTthetaCphi = tanTheta*std::cos(pPhi); 133 fTthetaCphi = tanTheta*std::cos(pPhi); 127 fTthetaSphi = tanTheta*std::sin(pPhi); 134 fTthetaSphi = tanTheta*std::sin(pPhi); 128 135 129 fCubicVolume = 0.; 136 fCubicVolume = 0.; 130 fSurfaceArea = 0.; 137 fSurfaceArea = 0.; 131 fRebuildPolyhedron = true; 138 fRebuildPolyhedron = true; 132 139 133 MakePlanes(); 140 MakePlanes(); 134 } << 135 << 136 inline G4double G4Para::GetPhi() const << 137 { << 138 return std::atan2(fTthetaSphi,fTthetaCphi); << 139 } << 140 << 141 inline G4double G4Para::GetTheta() const << 142 { << 143 return std::atan(std::sqrt(fTthetaCphi*fTth << 144 +fTthetaSphi*fTt << 145 } << 146 << 147 inline G4double G4Para::GetAlpha() const << 148 { << 149 return std::atan(fTalpha); << 150 } 141 } 151 142