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