Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

G4IBField.cxx

Go to the documentation of this file.
00001 //--------------------------------------------------------------
00002 // G4IBField.cxx
00003 //
00004 // seun@huhepl.harvard/edu
00005 //--------------------------------------------------------------
00006 #ifdef SITE_HAS_GEANT4
00007 #include "G4I/G4IBField.h"
00008 #include "SystemOfUnits.h"    // GEANT
00009 #include "TVector3.h"         // ROOT
00010 #include "BField/BField.h"
00011 #include "Conventions/Munits.h"
00012 
00013 void G4IBField::GetFieldValue(const double Point[], 
00014                               double Bfield[]) const
00015 {
00016   // Convert from GEANT to MINOS units
00017   static const double c1 = Munits::meter/meter;
00018   TVector3 xyz(Point[0]*c1,
00019                Point[1]*c1,
00020                Point[2]*c1);
00021 
00022   // Convert from MINOS units to GEANT units
00023   static const double c2 = tesla/Munits::tesla;
00024   Bfield[0] = fMINOSBField->GetBField(xyz).X()*c2;
00025   Bfield[1] = fMINOSBField->GetBField(xyz).Y()*c2;
00026   Bfield[2] = fMINOSBField->GetBField(xyz).Z()*c2;
00027 }
00028 #endif // SITE_HAS_GEANT4
00029 

Generated on Mon Feb 15 11:06:45 2010 for loon by  doxygen 1.3.9.1