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;
56 double minEpsStep =
p.getUntrackedParameter<
double>(
"MinimumEpsilonStep", 0.00001) * CLHEP::mm;
57 double maxEpsStep =
p.getUntrackedParameter<
double>(
"MaximumEpsilonStep", 0.01) * CLHEP::mm;
58 int maxLC = (
int)
p.getUntrackedParameter<
double>(
"MaximumLoopCounts", 1000.);
61 m_dChord =
p.getParameter<
double>(
"DeltaChord") * CLHEP::mm;
63 m_dOneStep =
p.getParameter<
double>(
"DeltaOneStep") * CLHEP::mm;
66 m_dInterTracker =
p.getParameter<
double>(
"DeltaIntersectionTracker") * CLHEP::mm;
67 m_stepMax =
p.getParameter<
double>(
"MaxStep") * CLHEP::cm;
72 double rmax =
p.getParameter<
double>(
"RmaxTracker") * CLHEP::mm;
74 m_Zmax =
p.getParameter<
double>(
"ZmaxTracker") * CLHEP::mm;
76 m_dChordSimple =
p.getParameter<
double>(
"DeltaChordSimple") * 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" 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
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()
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 *)