CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 
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  CMSFieldManager(const CMSFieldManager &) = delete;
45  CMSFieldManager &operator=(const CMSFieldManager &) = delete;
46 
47 private:
48  bool isInsideVacuum(const G4Track *);
49  bool isInsideTracker(const G4Track *);
50  void setDefaultChordFinder();
53 
54  std::unique_ptr<sim::Field> theField;
55 
56  G4ChordFinder *m_currChordFinder;
57  G4ChordFinder *m_chordFinder;
58  G4ChordFinder *m_chordFinderMonopole;
59 
60  G4PropagatorInField *m_propagator;
61 
62  std::vector<const G4Region *> m_regions;
63 
64  double m_dChord;
66  double m_dOneStep;
70  double m_Rmax2;
71  double m_Zmax;
72  double m_stepMax;
79 
81  bool m_cfVacuum;
82 };
83 #endif
G4ChordFinder * m_chordFinder
double m_dIntersectionSimple
void setDefaultChordFinder()
double m_energyThreshold
CMSFieldManager & operator=(const CMSFieldManager &)=delete
double m_dOneStepTracker
~CMSFieldManager() override
G4PropagatorInField * m_propagator
G4ChordFinder * m_currChordFinder
void setChordFinderForTracker()
void ConfigureForTrack(const G4Track *) override
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)
double m_energyThTracker
bool isInsideTracker(const G4Track *)