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.),
70 if ( thePSetForLMFM == defpset ) {
71 std::cout <<
" Patology ! Local Mag.Field Manager requested but config not given !\n";
75 std::vector<std::string> ListOfVolumes =
76 thePSetForLMFM.
getParameter< std::vector<std::string> >(
"ListOfVolumes");
79 for (
unsigned int i = 0;
i < ListOfVolumes.size(); ++
i ) {
81 G4FieldManager* fAltM =
new G4FieldManager() ;
96 G4PropagatorInField * fP ) {
98 G4LogicalVolumeStore* theStore = G4LogicalVolumeStore::GetInstance();
99 for (
unsigned int i=0;
i<(*theStore).size(); ++
i ) {
101 if ( curVolName == volName ) {
110 minStep = stpPSet.getParameter<
double>(
"MinStep") ;
111 dChord = stpPSet.getParameter<
double>(
"DeltaChord") ;
112 dOneStep = stpPSet.getParameter<
double>(
"DeltaOneStep") ;
113 dIntersection = stpPSet.getParameter<
double>(
"DeltaIntersection") ;
115 maxLoopCount = stpPSet.getUntrackedParameter<
double>(
"MaximumLoopCounts",1000);
116 minEpsilonStep = stpPSet.getUntrackedParameter<
double>(
"MinimumEpsilonStep",0.00001);
117 maxEpsilonStep = stpPSet.getUntrackedParameter<
double>(
"MaximumEpsilonStep",0.01);
144 fM->SetDetectorField(
theField.get());
147 G4ChordFinder * CF =
new G4ChordFinder(
theField.get(),
minStep,theStepper);
148 CF->SetDeltaChord(
dChord);
149 fM->SetChordFinder(CF);
156 G4MonopoleEquation* fMonopoleEquation =
new G4MonopoleEquation(
theField.get());
157 G4MagIntegratorStepper* theStepper =
new G4ClassicalRK4(fMonopoleEquation,8);
168 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
return(e1-e2)*(e1-e2)+dp *dp
G4LogicalVolume * fieldTopVolume()
G4Mag_UsualEqRhs * theFieldEquation
edm::ParameterSet thePSet
void configurePropagatorInField(G4PropagatorInField *fP)
T get(const Candidate &c)