00001
00002
00003
00004
00005
00006
00007 #include "BDSGlobalConstants.hh"
00008 #include "G4UniformMagField.hh"
00009 #include "globals.hh"
00010 #include "geomdefs.hh"
00011 #include "BDSSbendMagField.hh"
00012
00013 const int DEBUG = 0;
00014
00015 BDSSbendMagField::BDSSbendMagField(const G4ThreeVector& aField,
00016 const G4double length,
00017 const G4double angle)
00018 :G4UniformMagField(aField)
00019 {
00020 if(angle!=0.)
00021 {
00022
00023 itsLocalRadius=-length/angle;
00024
00025 G4double B_inferred=
00026 (BDSGlobals->GetBeamMomentum()/GeV)/
00027 (0.299792458 * (GeV/tesla/m)*itsLocalRadius/m);
00028
00029 if(DEBUG) G4cout<<"B_inferred="<<B_inferred/tesla<<
00030 " aField="<<aField/tesla<<G4endl;
00031 }
00032 else
00033 G4Exception("BDSSbendMagField: zero angle not allowed");
00034 }
00035
00036
00037 BDSSbendMagField::~BDSSbendMagField()
00038 {}
00039