File indexing completed on 2025-12-17 09:21:30
0001
0002
0003 #ifndef G4DETECTORS_BEAMLINEMAGNETMAGNETDETECTOR_H
0004 #define G4DETECTORS_BEAMLINEMAGNETMAGNETDETECTOR_H
0005
0006 #include <g4main/PHG4Detector.h>
0007
0008 #include <string>
0009
0010 class BeamLineMagnetDisplayAction;
0011 class G4LogicalVolume;
0012 class G4VPhysicalVolume;
0013 class PHCompositeNode;
0014 class PHG4Subsystem;
0015 class PHParameters;
0016 class G4MagneticField;
0017
0018 class BeamLineMagnetDetector : public PHG4Detector
0019 {
0020 public:
0021
0022 BeamLineMagnetDetector(PHG4Subsystem *subsys, PHCompositeNode *Node, PHParameters *parameters, const std::string &dnam, const int magnet_id = 0);
0023
0024
0025 ~BeamLineMagnetDetector() override = default;
0026
0027
0028 void ConstructMe(G4LogicalVolume *logicMother) override;
0029
0030
0031 void PostConstruction() override;
0032
0033 int IsInBeamLineMagnet(const G4VPhysicalVolume *) const;
0034 void SuperDetector(const std::string &name) { m_SuperDetector = name; }
0035 const std::string &SuperDetector() const { return m_SuperDetector; }
0036 int get_MagnetId() const { return m_MagnetId; }
0037
0038 private:
0039 PHParameters *m_Params {nullptr};
0040
0041 G4VPhysicalVolume *magnet_physi {nullptr};
0042 G4VPhysicalVolume *magnet_iron_physi {nullptr};
0043 G4VPhysicalVolume *magnet_core_physi {nullptr};
0044 BeamLineMagnetDisplayAction *m_DisplayAction {nullptr};
0045 G4LogicalVolume *m_magnetFieldLogic {nullptr};
0046 G4MagneticField *m_magField {nullptr};
0047
0048 int m_MagnetId {-1};
0049
0050 std::string m_SuperDetector {"NONE"};
0051 };
0052
0053 #endif