CMS 3D CMS Logo

CMSFieldManager.h
Go to the documentation of this file.
1 #ifndef SimG4Core_MagneticField_CMSFieldManager_H
2 #define SimG4Core_MagneticField_CMSFieldManager_H
3 
4 /*
5  Created: 13 January 2017, V. Ivanchenko
6  This class implements smart magnetic field manager
7 */
8 
10 
11 #include "G4FieldManager.hh"
12 #include <vector>
13 
14 class G4Track;
15 class G4ChordFinder;
16 class G4PropagatorInField;
17 class G4MagIntegratorStepper;
18 class G4Region;
19 
20 namespace sim {
21  class Field;
22 }
23 
24 class CMSFieldManager : public G4FieldManager {
25 public:
26  explicit CMSFieldManager();
27 
28  ~CMSFieldManager() override;
29 
30  void ConfigureForTrack(const G4Track *) override;
31 
32  void InitialiseForVolume(const edm::ParameterSet &,
33  sim::Field *,
34  G4ChordFinder *cfDefault,
35  G4ChordFinder *cfMonopole,
36  const std::string &vol,
37  const std::string &fieldType,
38  const std::string &stepperName,
39  double delta,
40  G4PropagatorInField *);
41 
42  void SetMonopoleTracking(G4bool);
43 
44 private:
45  bool isInsideVacuum(const G4Track *);
46  void setDefaultChordFinder();
47  void setChordFinderForVacuum();
48 
49  CMSFieldManager(const CMSFieldManager &) = delete;
50  CMSFieldManager &operator=(const CMSFieldManager &) = delete;
51 
52  std::unique_ptr<sim::Field> theField;
53 
54  G4ChordFinder *m_currChordFinder;
55  G4ChordFinder *m_chordFinder;
56  G4ChordFinder *m_chordFinderMonopole;
57 
58  G4PropagatorInField *m_propagator;
59 
60  std::vector<const G4Region *> m_regions;
61 
62  double m_dChord;
63  double m_dOneStep;
65  double m_stepMax;
71 
72  bool m_cfVacuum;
73 };
74 #endif
G4ChordFinder * m_chordFinder
double m_dIntersectionSimple
double m_energyThreshold
G4PropagatorInField * m_propagator
G4ChordFinder * m_currChordFinder
G4ChordFinder * m_chordFinderMonopole
std::unique_ptr< sim::Field > theField
std::vector< const G4Region * > m_regions