5 #include "CLHEP/Units/GlobalSystemOfUnits.h"
6 #include "G4ChordFinder.hh"
7 #include "G4MagIntegratorStepper.hh"
8 #include "G4PropagatorInField.hh"
10 #include "G4RegionStore.hh"
15 m_currChordFinder(nullptr),
16 m_chordFinder(nullptr),
17 m_chordFinderMonopole(nullptr),
18 m_propagator(nullptr),
21 m_dIntersection(0.0001),
23 m_energyThreshold(0.0),
25 m_dOneStepSimple(0.1),
26 m_dIntersectionSimple(0.01),
27 m_stepMaxSimple(1000.),
47 G4PropagatorInField *
pf) {
48 double minstep =
p.getParameter<
double>(
"MinStep") * CLHEP::mm;
49 double minEpsStep =
p.getUntrackedParameter<
double>(
"MinimumEpsilonStep", 0.00001) * CLHEP::mm;
50 double maxEpsStep =
p.getUntrackedParameter<
double>(
"MaximumEpsilonStep", 0.01) * CLHEP::mm;
51 int maxLC = (
int)
p.getUntrackedParameter<
double>(
"MaximumLoopCounts", 1000.);
54 m_dChord =
p.getParameter<
double>(
"DeltaChord") * CLHEP::mm;
55 m_dOneStep =
p.getParameter<
double>(
"DeltaOneStep") * CLHEP::mm;
57 m_stepMax =
p.getParameter<
double>(
"MaxStep") * CLHEP::cm;
62 m_dChordSimple =
p.getParameter<
double>(
"DeltaChordSimple") * CLHEP::mm;
68 <<
" New CMSFieldManager: LogicalVolume: <" << vol <<
">\n"
69 <<
" Stepper: <" << stepper <<
">\n"
70 <<
" Field type <" <<
type <<
">\n"
71 <<
" Field const delta " <<
delta <<
" mm\n"
72 <<
" MaximumLoopCounts " << maxLC <<
"\n"
73 <<
" MinimumEpsilonStep " << minEpsStep <<
"\n"
74 <<
" MaximumEpsilonStep " << maxEpsStep <<
"\n"
75 <<
" MinStep " << minstep <<
" mm\n"
76 <<
" MaxStep " <<
m_stepMax / CLHEP::cm <<
" cm\n"
77 <<
" DeltaChord " <<
m_dChord <<
" mm\n"
95 SetDetectorField(field);
96 SetMinimumEpsilonStep(minEpsStep);
97 SetMaximumEpsilonStep(maxEpsStep);
101 pf->SetMaxLoopCount(maxLC);
102 pf->SetMinimumEpsilonStep(minEpsStep);
103 pf->SetMaximumEpsilonStep(maxEpsStep);
109 std::vector<std::string> rnames =
p.getParameter<std::vector<std::string>>(
"VacRegions");
110 if (!rnames.empty()) {
111 std::stringstream
ss;
112 std::vector<G4Region *> *rs = G4RegionStore::GetInstance();
113 for (
auto ®nam : rnames) {
114 for (
auto ® : *rs) {
115 if (regnam == reg->GetName()) {
121 edm::LogVerbatim(
"SimG4CoreApplication") <<
"Simple field integration in G4Regions:\n" <<
ss.str() <<
"\n";
150 SetFieldChangesEnergy(
flag);
156 const G4Region *reg =
track->GetVolume()->GetLogicalVolume()->GetRegion();