src/BDSSbendMagField.cc

00001 /* BDSIM code.    Version 1.0
00002    Author: Grahame A. Blair, Royal Holloway, Univ. of London.
00003    Last modified 24.7.2002
00004    Copyright (c) 2002 by G.A.Blair.  ALL RIGHTS RESERVED. 
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     {    // original
00021       //    itsLocalRadius=length/angle;
00022       itsLocalRadius=-length/angle;// minus sign for correct machine convention
00023       // check for synchrotron radiation factors
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 

Generated on 27 Aug 2013 for BDSIM by  doxygen 1.4.7