File indexing completed on 2025-08-05 08:18:11
0001
0002
0003 #ifndef G4MAIN_PHG4SUBSYSTEM_H
0004 #define G4MAIN_PHG4SUBSYSTEM_H
0005
0006 #include <fun4all/Fun4AllReturnCodes.h>
0007 #include <fun4all/SubsysReco.h>
0008
0009 #include <iostream>
0010 #include <string>
0011
0012 class G4LogicalVolume;
0013 class G4ParticleDefinition;
0014 class PHCompositeNode;
0015 class PHG4Detector;
0016 class PHG4DisplayAction;
0017 class PHG4EventAction;
0018 class PHG4StackingAction;
0019 class PHG4SteppingAction;
0020 class PHG4TrackingAction;
0021
0022 class PHG4Subsystem : public SubsysReco
0023 {
0024 public:
0025
0026 PHG4Subsystem(const std::string &name = "Generic Subsystem")
0027 : SubsysReco(name)
0028 {
0029 }
0030
0031
0032 ~PHG4Subsystem(void) override {}
0033
0034
0035 virtual int process_after_geant(PHCompositeNode *)
0036 {
0037 return Fun4AllReturnCodes::EVENT_OK;
0038 }
0039
0040
0041 virtual PHG4Detector *GetDetector(void) const
0042 {
0043 return nullptr;
0044 }
0045
0046
0047 virtual PHG4EventAction *GetEventAction(void) const
0048 {
0049 return nullptr;
0050 }
0051
0052
0053 virtual PHG4SteppingAction *GetSteppingAction(void) const
0054 {
0055 return nullptr;
0056 }
0057
0058
0059 virtual PHG4TrackingAction *GetTrackingAction(void) const
0060 {
0061 return nullptr;
0062 }
0063
0064
0065 virtual PHG4DisplayAction *GetDisplayAction() const
0066 {
0067 return nullptr;
0068 }
0069
0070 virtual PHG4StackingAction *GetStackingAction() const { return nullptr; }
0071
0072 void OverlapCheck(const bool chk = true) { overlapcheck = chk; }
0073
0074 bool CheckOverlap() const { return overlapcheck; }
0075
0076 void SetMotherSubsystem(PHG4Subsystem *subsys);
0077 PHG4Subsystem *GetMotherSubsystem() const { return m_MyMotherSubsystem; }
0078
0079 void SetLogicalVolume(G4LogicalVolume *vol) { m_MyLogicalVolume = vol; }
0080 G4LogicalVolume *GetLogicalVolume() const { return m_MyLogicalVolume; }
0081
0082
0083
0084
0085 virtual bool CanBeMotherSubsystem() const { return false; }
0086
0087
0088 virtual void AddProcesses(G4ParticleDefinition * ) {}
0089
0090
0091 virtual void DefineMaterials() {}
0092
0093 private:
0094 PHG4Subsystem *m_MyMotherSubsystem = nullptr;
0095 G4LogicalVolume *m_MyLogicalVolume = nullptr;
0096 bool overlapcheck = false;
0097 };
0098
0099 #endif