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