30#include "BesMagneticField.hh"
31#include "BesMagneticFieldMessenger.hh"
33#include "G4MagneticField.hh"
35#include "G4FieldManager.hh"
36#include "G4TransportationManager.hh"
37#include "G4Mag_UsualEqRhs.hh"
38#include "G4MagIntegratorStepper.hh"
39#include "G4ChordFinder.hh"
40#include "G4PropagatorInField.hh"
42#include "G4ExplicitEuler.hh"
43#include "G4ImplicitEuler.hh"
44#include "G4SimpleRunge.hh"
45#include "G4SimpleHeum.hh"
46#include "G4ClassicalRK4.hh"
47#include "G4HelixExplicitEuler.hh"
48#include "G4HelixImplicitEuler.hh"
49#include "G4HelixSimpleRunge.hh"
50#include "G4CashKarpRKF45.hh"
51#include "G4RKG3_Stepper.hh"
52#include "Randomize.hh"
53#include "CLHEP/Random/RanecuEngine.h"
54#include "CLHEP/Random/RandGauss.h"
56#include "GaudiKernel/AlgFactory.h"
57#include "GaudiKernel/MsgStream.h"
58#include "GaudiKernel/SvcFactory.h"
59#include "GaudiKernel/ISvcLocator.h"
60#include "GaudiKernel/SmartDataPtr.h"
62#include "GaudiKernel/Bootstrap.h"
64#include "CLHEP/Geometry/Vector3D.h"
65#include "CLHEP/Geometry/Point3D.h"
66#include "CLHEP/Units/PhysicalConstants.h"
69#include "ReadBoostRoot.hh"
72#ifndef ENABLE_BACKWARDS_COMPATIBILITY
75#ifndef ENABLE_BACKWARDS_COMPATIBILITY
84 : fChordFinder(0), fStepper(0),m_pIMF(0)
86 ISvcLocator* svcLocator = Gaudi::svcLocator();
87 StatusCode sc = svcLocator->service(
"MagneticFieldSvc",
m_pIMF);
88 if(sc!=StatusCode::SUCCESS) {
89 G4cout<<
"Unable to open Magnetic field service"<<G4endl;
139 fFieldManager = G4TransportationManager::GetTransportationManager()
141 G4cout<<
"before CreateStepperAndChordFinder"<<G4endl;
152 G4cout<<
"The minimal step is equal to "<<
fMinStep/mm<<
" mm"<<G4endl ;
167 G4PropagatorInField* fieldPropagator
168 = G4TransportationManager::GetTransportationManager()
169 ->GetPropagatorInField();
170 G4cout<<
"LargestAcceptableStep is "<<fieldPropagator->GetLargestAcceptableStep()/m<<G4endl;
172 G4cout<<
"field has created"<<G4endl;
173 G4cout<<
"fDelta_One_Step_Value is "<<
fFieldManager->GetDeltaOneStep()<<G4endl;
174 G4cout<<
"fDelta_Intersection_Val is "<<
fFieldManager->GetDeltaIntersection()<<G4endl;
175 G4cout<<
"fEpsilonMin is "<<
fFieldManager->GetMinimumEpsilonStep()<<G4endl;
176 G4cout<<
"fEpsilonMax is "<<
fFieldManager->GetMaximumEpsilonStep()<<G4endl;
193 G4cout<<
"G4ExplicitEuler is called"<<G4endl;
197 G4cout<<
"G4ImplicitEuler is called"<<G4endl;
201 G4cout<<
"G4SimpleRunge is called"<<G4endl;
205 G4cout<<
"G4SimpleHeum is called"<<G4endl;
209 G4cout<<
"G4ClassicalRK4 (default) is called"<<G4endl;
213 G4cout<<
"G4HelixExplicitEuler is called"<<G4endl;
217 G4cout<<
"G4HelixImplicitEuler is called"<<G4endl;
221 G4cout<<
"G4HelixSimpleRunge is called"<<G4endl;
225 G4cout<<
"G4CashKarpRKF45 is called"<<G4endl;
229 G4cout<<
"G4RKG3_Stepper is called"<<G4endl;
239 fFieldManager = G4TransportationManager::GetTransportationManager()
245 fFieldManager = G4TransportationManager::GetTransportationManager()->GetFieldManager();
250 fFieldManager = G4TransportationManager::GetTransportationManager()->GetFieldManager();
255 fFieldManager =G4TransportationManager::GetTransportationManager()->GetFieldManager();
HepGeom::Point3D< double > HepPoint3D
HepGeom::Vector3D< double > HepVector3D
IMagneticFieldSvc * m_pIMF
void SetMaximumEpsilonStep(double newvalue)
void CreateStepperAndChordFinder()
BesMagneticFieldMessenger * fFieldMessenger
void SetDeltaIntersection(double newvalue)
G4MagIntegratorStepper * fStepper
void GetFieldValue(const double Point[3], double *Bfield) const
void SetMinimumEpsilonStep(double newvalue)
G4ChordFinder * fChordFinder
G4Mag_UsualEqRhs * fEquation
G4FieldManager * fFieldManager
void SetDeltaOneStep(double newvalue)
virtual StatusCode uniFieldVector(const HepGeom::Point3D< double > &xyz, HepGeom::Vector3D< double > &fvec) const =0
virtual StatusCode fieldVector(const HepGeom::Point3D< double > &xyz, HepGeom::Vector3D< double > &fvec) const =0