- Timestamp:
- Nov 5, 2010, 3:45:55 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/geometry/magneticfield/src/G4UniformMagField.cc
r1337 r1340 25 25 // 26 26 // 27 // $Id: G4UniformMagField.cc,v 1.1 1 2006/06/29 18:24:58 gunterExp $28 // GEANT4 tag $Name: geant4-09-04-beta-01$27 // $Id: G4UniformMagField.cc,v 1.12 2010/07/14 10:00:36 gcosmo Exp $ 28 // GEANT4 tag $Name: field-V09-03-03 $ 29 29 // 30 30 // … … 56 56 G4double vPhi ) 57 57 { 58 if(vField >= 0 && 59 vTheta >= 0 && vTheta <= pi && 60 vPhi >= 0 && vPhi <= twopi) 61 { 62 fFieldComponents[0] = vField*std::sin(vTheta)*std::cos(vPhi) ; 63 fFieldComponents[1] = vField*std::sin(vTheta)*std::sin(vPhi) ; 64 fFieldComponents[2] = vField*std::cos(vTheta) ; 65 } 66 else 58 if ( (vField<0) || (vTheta<0) || (vTheta>pi) || (vPhi<0) || (vPhi>twopi) ) 67 59 { 68 60 G4Exception("G4UniformMagField::G4UniformMagField()", 69 61 "WrongArgumentValue", FatalException, "Invalid parameters.") ; 70 62 } 63 fFieldComponents[0] = vField*std::sin(vTheta)*std::cos(vPhi) ; 64 fFieldComponents[1] = vField*std::sin(vTheta)*std::sin(vPhi) ; 65 fFieldComponents[2] = vField*std::cos(vTheta) ; 71 66 } 72 67
Note: See TracChangeset
for help on using the changeset viewer.