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