File indexing completed on 2025-08-05 08:17:42
0001
0002
0003 #ifndef G4DETECTORS_PHG4BLOCKSUBSYSTEM_H
0004 #define G4DETECTORS_PHG4BLOCKSUBSYSTEM_H
0005
0006 #include "PHG4DetectorSubsystem.h"
0007
0008 #include <array> // for array
0009 #include <string> // for string
0010
0011 class PHCompositeNode;
0012 class PHG4Detector;
0013 class PHG4BlockDetector;
0014 class PHG4DisplayAction;
0015 class PHG4SteppingAction;
0016
0017 class PHG4BlockSubsystem : public PHG4DetectorSubsystem
0018 {
0019 public:
0020
0021 PHG4BlockSubsystem(const std::string& name = "BLOCK", const int layer = 0);
0022
0023
0024 ~PHG4BlockSubsystem() override;
0025
0026
0027
0028
0029
0030
0031
0032 int InitRunSubsystem(PHCompositeNode*) override;
0033
0034
0035
0036
0037
0038
0039 int process_event(PHCompositeNode*) override;
0040
0041
0042 PHG4Detector* GetDetector() const override;
0043
0044 PHG4SteppingAction* GetSteppingAction() const override { return m_SteppingAction; }
0045
0046 PHG4DisplayAction* GetDisplayAction() const override { return m_DisplayAction; }
0047
0048 void set_color(const double red, const double green, const double blue, const double alpha = 1.)
0049 {
0050 m_ColorArray[0] = red;
0051 m_ColorArray[1] = green;
0052 m_ColorArray[2] = blue;
0053 m_ColorArray[3] = alpha;
0054 }
0055
0056
0057
0058 bool CanBeMotherSubsystem() const override { return true; }
0059
0060 private:
0061 void SetDefaultParameters() override;
0062
0063
0064
0065 PHG4BlockDetector* m_Detector{nullptr};
0066
0067
0068
0069 PHG4SteppingAction* m_SteppingAction{nullptr};
0070
0071
0072
0073 PHG4DisplayAction* m_DisplayAction{nullptr};
0074
0075 std::array<double, 4> m_ColorArray{};
0076 };
0077
0078 #endif