10 #include "SimG4Core/MagneticField/interface/G4MonopoleEquation.hh"
19 #include "G4Mag_UsualEqRhs.hh"
20 #include "G4ClassicalRK4.hh"
21 #include "G4PropagatorInField.hh"
22 #include "G4FieldManager.hh"
23 #include "G4TransportationManager.hh"
24 #include "G4ChordFinder.hh"
25 #include "G4UniformMagField.hh"
29 #include "G4LogicalVolumeStore.hh"
35 : theField(new
Field(f, p.getParameter<double>(
"delta"))),
36 theFieldEquation(new G4Mag_UsualEqRhs(theField.
get())),
37 theTopVolume(0), fChordFinder(0), fChordFinderMonopole(0),
38 fieldValue(0.), minStep(0.), dChord(0.), dOneStep(0.),
39 dIntersection(0.), dIntersectionAndOneStep(0.),
40 maxLoopCount(0), minEpsilonStep(0.), maxEpsilonStep(0.),
64 <<
" FieldBuilder: Local magnetic field is used";
73 if ( thePSetForLMFM == defpset ) {
74 std::cout <<
" Patology ! Local Mag.Field Manager requested but config not given !\n";
78 std::vector<std::string> ListOfVolumes =
79 thePSetForLMFM.
getParameter< std::vector<std::string> >(
"ListOfVolumes");
82 for (
unsigned int i = 0;
i < ListOfVolumes.size(); ++
i ) {
84 G4FieldManager* fAltM =
new G4FieldManager() ;
93 <<
" FieldBuilder: Global magnetic field is used";
100 G4PropagatorInField * fP )
102 G4LogicalVolumeStore* theStore = G4LogicalVolumeStore::GetInstance();
103 for (
unsigned int i=0;
i<(*theStore).size(); ++
i ) {
105 if ( curVolName == volName ) {
114 minStep = stpPSet.getParameter<
double>(
"MinStep") ;
115 dChord = stpPSet.getParameter<
double>(
"DeltaChord") ;
116 dOneStep = stpPSet.getParameter<
double>(
"DeltaOneStep") ;
117 dIntersection = stpPSet.getParameter<
double>(
"DeltaIntersection") ;
119 stpPSet.getUntrackedParameter<
double>(
"DeltaIntersectionAndOneStep",-1.);
121 stpPSet.getUntrackedParameter<
double>(
"MaximumLoopCounts",1000);
123 stpPSet.getUntrackedParameter<
double>(
"MinimumEpsilonStep",0.00001);
125 stpPSet.getUntrackedParameter<
double>(
"MaximumEpsilonStep",0.01);
131 <<
" FieldBuilder: Selected stepper: <" << stepper
132 <<
"> const field delta(mm)= " <<
delta;
152 fM->SetDetectorField(
theField.get());
156 G4ChordFinder * CF =
new G4ChordFinder(
theField.get(),
minStep,theStepper);
157 CF->SetDeltaChord(
dChord);
158 fM->SetChordFinder(CF);
165 G4MonopoleEquation* fMonopoleEquation =
166 new G4MonopoleEquation(
theField.get());
167 G4MagIntegratorStepper* theStepper =
168 new G4ClassicalRK4(fMonopoleEquation,8);
180 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)