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),
20 m_dChordTracker(0.001),
22 m_dOneStepTracker(0.0001),
23 m_dIntersection(0.0001),
24 m_dInterTracker(1
e-6),
28 m_energyThTracker(1.
e+7),
29 m_energyThreshold(0.0),
31 m_dOneStepSimple(0.1),
32 m_dIntersectionSimple(0.01),
33 m_stepMaxSimple(1000.),
54 G4PropagatorInField *pf) {
55 double minstep = p.
getParameter<
double>(
"MinStep") * CLHEP::mm;
72 double rmax = p.
getParameter<
double>(
"RmaxTracker") * CLHEP::mm;
82 <<
" New CMSFieldManager: LogicalVolume: <" << vol <<
">\n"
83 <<
" Stepper: <" << stepper <<
">\n"
84 <<
" Field type <" << type <<
">\n"
85 <<
" Field const delta " << delta <<
" mm\n"
86 <<
" MaximumLoopCounts " << maxLC <<
"\n"
87 <<
" MinimumEpsilonStep " << minEpsStep <<
"\n"
88 <<
" MaximumEpsilonStep " << maxEpsStep <<
"\n"
89 <<
" MinStep " << minstep <<
" mm\n"
90 <<
" MaxStep " << m_stepMax / CLHEP::cm <<
" cm\n"
91 <<
" DeltaChord " <<
m_dChord <<
" mm\n"
92 <<
" DeltaOneStep " << m_dOneStep <<
" mm\n"
93 <<
" DeltaIntersection " << m_dIntersection <<
" mm\n"
94 <<
" DeltaInterTracker " << m_dInterTracker <<
" mm\n"
95 <<
" EnergyThresholdSimple " << m_energyThreshold /
CLHEP::MeV <<
" MeV\n"
96 <<
" EnergyThresholdTracker " << m_energyThTracker /
CLHEP::MeV <<
" MeV\n"
97 <<
" DeltaChordSimple " << m_dChordSimple <<
" mm\n"
98 <<
" DeltaOneStepSimple " << m_dOneStepSimple <<
" mm\n"
99 <<
" DeltaIntersectionSimple " << m_dIntersectionSimple <<
" mm\n"
100 <<
" MaxStepInVacuum " << m_stepMaxSimple / CLHEP::cm <<
" cm";
110 SetDetectorField(field);
111 SetMinimumEpsilonStep(minEpsStep);
112 SetMaximumEpsilonStep(maxEpsStep);
116 pf->SetMaxLoopCount(maxLC);
117 pf->SetMinimumEpsilonStep(minEpsStep);
118 pf->SetMaximumEpsilonStep(maxEpsStep);
124 std::vector<std::string> rnames = p.
getParameter<std::vector<std::string>>(
"VacRegions");
125 if (!rnames.empty()) {
126 std::stringstream
ss;
127 std::vector<G4Region *> *rs = G4RegionStore::GetInstance();
128 for (
auto ®nam : rnames) {
129 for (
auto ® : *rs) {
130 if (regnam == reg->GetName()) {
136 edm::LogVerbatim(
"SimG4CoreApplication") <<
"Simple field integration in G4Regions:\n" << ss.str() <<
"\n";
170 SetFieldChangesEnergy(flag);
176 const G4Region *reg = track->GetVolume()->GetLogicalVolume()->GetRegion();
187 const G4ThreeVector &pos = track->GetPosition();
188 const double x = pos.x();
189 const double y = pos.y();
G4ChordFinder * m_chordFinder
Log< level::Info, true > LogVerbatim
double m_dIntersectionSimple
T getUntrackedParameter(std::string const &, T const &) const
void setDefaultChordFinder()
~CMSFieldManager() override
G4PropagatorInField * m_propagator
G4ChordFinder * m_currChordFinder
void setChordFinderForTracker()
void ConfigureForTrack(const G4Track *) override
Abs< T >::type abs(const T &t)
bool isInsideVacuum(const G4Track *)
G4ChordFinder * m_chordFinderMonopole
void setChordFinderForVacuum()
T getParameter(std::string const &) const
std::unique_ptr< sim::Field > theField
std::vector< const G4Region * > m_regions
void InitialiseForVolume(const edm::ParameterSet &, sim::Field *, G4ChordFinder *cfDefault, G4ChordFinder *cfMonopole, const std::string &vol, const std::string &fieldType, const std::string &stepperName, double delta, G4PropagatorInField *)
void setMonopoleTracking(G4bool)
bool isInsideTracker(const G4Track *)