File indexing completed on 2024-04-06 12:30:25
0001 #ifndef SimG4Core_MagneticField_CMSFieldManager_H
0002 #define SimG4Core_MagneticField_CMSFieldManager_H
0003
0004
0005
0006
0007
0008
0009 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0010
0011 #include "G4FieldManager.hh"
0012 #include <vector>
0013
0014 class G4Track;
0015 class G4ChordFinder;
0016 class G4PropagatorInField;
0017 class G4MagIntegratorStepper;
0018 class G4Region;
0019
0020 namespace sim {
0021 class Field;
0022 }
0023
0024 class CMSFieldManager : public G4FieldManager {
0025 public:
0026 explicit CMSFieldManager();
0027
0028 ~CMSFieldManager() override;
0029
0030 void ConfigureForTrack(const G4Track *) override;
0031
0032 void InitialiseForVolume(const edm::ParameterSet &,
0033 sim::Field *,
0034 G4ChordFinder *cfDefault,
0035 G4ChordFinder *cfMonopole,
0036 const std::string &vol,
0037 const std::string &fieldType,
0038 const std::string &stepperName,
0039 double delta,
0040 G4PropagatorInField *);
0041
0042 void setMonopoleTracking(G4bool);
0043
0044 CMSFieldManager(const CMSFieldManager &) = delete;
0045 CMSFieldManager &operator=(const CMSFieldManager &) = delete;
0046
0047 private:
0048 bool isInsideVacuum(const G4Track *);
0049 bool isInsideTracker(const G4Track *);
0050 void setDefaultChordFinder();
0051 void setChordFinderForTracker();
0052 void setChordFinderForVacuum();
0053
0054 std::unique_ptr<sim::Field> theField;
0055
0056 G4ChordFinder *m_currChordFinder;
0057 G4ChordFinder *m_chordFinder;
0058 G4ChordFinder *m_chordFinderMonopole;
0059
0060 G4PropagatorInField *m_propagator;
0061
0062 std::vector<const G4Region *> m_regions;
0063
0064 double m_dChord;
0065 double m_dChordTracker;
0066 double m_dOneStep;
0067 double m_dOneStepTracker;
0068 double m_dIntersection;
0069 double m_dInterTracker;
0070 double m_Rmax2;
0071 double m_Zmax;
0072 double m_stepMax;
0073 double m_energyThTracker;
0074 double m_energyThreshold;
0075 double m_dChordSimple;
0076 double m_dOneStepSimple;
0077 double m_dIntersectionSimple;
0078 double m_stepMaxSimple;
0079
0080 bool m_cfTracker;
0081 bool m_cfVacuum;
0082 };
0083 #endif