00001 //<<<<<< INCLUDES >>>>>> 00002 00003 #include "VisGeant4/VisG4Fields/interface/VisG4MagField.h" 00004 #include "CLHEP/Units/SystemOfUnits.h" 00005 #include "G4Field.hh" 00006 00007 //<<<<<< PRIVATE DEFINES >>>>>> 00008 //<<<<<< PRIVATE CONSTANTS >>>>>> 00009 //<<<<<< PRIVATE TYPES >>>>>> 00010 //<<<<<< PRIVATE VARIABLE DEFINITIONS >>>>>> 00011 //<<<<<< PUBLIC VARIABLE DEFINITIONS >>>>>> 00012 //<<<<<< CLASS STRUCTURE INITIALIZATION >>>>>> 00013 //<<<<<< PRIVATE FUNCTION DEFINITIONS >>>>>> 00014 //<<<<<< PUBLIC FUNCTION DEFINITIONS >>>>>> 00015 //<<<<<< MEMBER FUNCTION DEFINITIONS >>>>>> 00016 00017 VisG4MagField::VisG4MagField (const G4Field *field /* = 0 */) 00018 : m_field (field) 00019 {} 00020 00021 void 00022 VisG4MagField::setField (const G4Field *field) 00023 { m_field = field; } 00024 00025 void 00026 VisG4MagField::evaluate (const double point [3], double field [3]) const 00027 { 00028 double pt [3] = { point [0] * m, point [1] * m, point [2] * m }; 00029 m_field->GetFieldValue (pt, field); 00030 field [0] /= tesla; 00031 field [1] /= tesla; 00032 field [2] /= tesla; 00033 }