12 #include "SimG4Core/MagneticField/interface/G4MonopoleEquation.hh"
21 #include "G4Mag_UsualEqRhs.hh"
22 #include "G4ClassicalRK4.hh"
23 #include "G4PropagatorInField.hh"
24 #include "G4FieldManager.hh"
25 #include "G4TransportationManager.hh"
26 #include "G4ChordFinder.hh"
27 #include "G4UniformMagField.hh"
31 #include "G4LogicalVolumeStore.hh"
37 : theField( new
Field(f,p.getParameter<double>(
"delta"))),
38 theFieldEquation(new G4Mag_UsualEqRhs(theField.
get())),
39 theTopVolume(0), fChordFinder(0), fChordFinderMonopole(0),
40 fieldValue(0.), minStep(0.), dChord(0.), dOneStep(0.),
41 dIntersection(0.), dIntersectionAndOneStep(0.),
42 maxLoopCount(0), minEpsilonStep(0.), maxEpsilonStep(0.),
54 std::string volName = thePSetForGMFM.
getParameter< std::string >(
"Volume");
72 if ( thePSetForLMFM == defpset ) {
73 std::cout <<
" Patology ! Local Mag.Field Manager requested but config not given !\n";
77 std::vector<std::string> ListOfVolumes =
78 thePSetForLMFM.
getParameter< std::vector<std::string> >(
"ListOfVolumes");
81 for (
unsigned int i = 0;
i < ListOfVolumes.size(); ++
i ) {
83 G4FieldManager* fAltM =
new G4FieldManager() ;
98 G4PropagatorInField * fP ) {
100 G4LogicalVolumeStore* theStore = G4LogicalVolumeStore::GetInstance();
101 for (
unsigned int i=0;
i<(*theStore).size(); ++
i ) {
102 std::string curVolName = ((*theStore)[
i])->GetName();
103 if ( curVolName == volName ) {
112 minStep = stpPSet.getParameter<
double>(
"MinStep") ;
113 dChord = stpPSet.getParameter<
double>(
"DeltaChord") ;
114 dOneStep = stpPSet.getParameter<
double>(
"DeltaOneStep") ;
115 dIntersection = stpPSet.getParameter<
double>(
"DeltaIntersection") ;
117 maxLoopCount = stpPSet.getUntrackedParameter<
double>(
"MaximumLoopCounts",1000);
118 minEpsilonStep = stpPSet.getUntrackedParameter<
double>(
"MinimumEpsilonStep",0.00001);
119 maxEpsilonStep = stpPSet.getUntrackedParameter<
double>(
"MaximumEpsilonStep",0.01);
146 fM->SetDetectorField(
theField.get());
149 G4ChordFinder * CF =
new G4ChordFinder(
theField.get(),
minStep,theStepper);
150 CF->SetDeltaChord(
dChord);
151 fM->SetChordFinder(CF);
158 G4MonopoleEquation* fMonopoleEquation =
new G4MonopoleEquation(
theField.get());
159 G4MagIntegratorStepper* theStepper =
new G4ClassicalRK4(fMonopoleEquation,8);
170 fP->SetVerboseLevel(0);
T getParameter(std::string const &) const
G4ChordFinder * fChordFinder
T getUntrackedParameter(std::string const &, T const &) const
void build(G4FieldManager *fM=0, G4PropagatorInField *fP=0)
G4ChordFinder * fChordFinderMonopole
void configureForVolume(const std::string &volName, edm::ParameterSet &volPSet, G4FieldManager *fM=0, G4PropagatorInField *fP=0)
G4LogicalVolume * theTopVolume
void SetVerbosity(bool flag)
void setStepperAndChordFinder(G4FieldManager *fM, int val)
double dIntersectionAndOneStep
FieldBuilder(const MagneticField *, const edm::ParameterSet &)
G4MagIntegratorStepper * select(const std::string &s)
void configureFieldManager(G4FieldManager *fM)
std::auto_ptr< Field > theField
G4LogicalVolume * fieldTopVolume()
G4Mag_UsualEqRhs * theFieldEquation
edm::ParameterSet thePSet
void configurePropagatorInField(G4PropagatorInField *fP)
T get(const Candidate &c)