File indexing completed on 2025-01-18 09:55:22
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef DDG4_GEANT4ACTIONCONTAINER_H
0014 #define DDG4_GEANT4ACTIONCONTAINER_H
0015
0016
0017 #include <DD4hep/Printout.h>
0018 #include <DDG4/Geant4Action.h>
0019 #include <DDG4/Geant4Primitives.h>
0020
0021
0022 #include <map>
0023 #include <string>
0024 #include <typeinfo>
0025
0026
0027 namespace dd4hep {
0028
0029
0030 namespace sim {
0031
0032
0033 class Geant4Context;
0034 class Geant4Action;
0035 class Geant4RunAction;
0036 class Geant4EventAction;
0037 class Geant4SteppingAction;
0038 class Geant4TrackingAction;
0039 class Geant4StackingAction;
0040 class Geant4GeneratorAction;
0041 class Geant4PhysicsList;
0042 class Geant4RunActionSequence;
0043 class Geant4EventActionSequence;
0044 class Geant4SteppingActionSequence;
0045 class Geant4TrackingActionSequence;
0046 class Geant4StackingActionSequence;
0047 class Geant4GeneratorActionSequence;
0048 class Geant4PhysicsListActionSequence;
0049 class Geant4DetectorConstructionSequence;
0050 class Geant4UserInitializationSequence;
0051 class Geant4SensDetActionSequence;
0052 class Geant4SensDetSequences;
0053
0054
0055
0056
0057
0058
0059
0060 class Geant4ActionContainer {
0061 protected:
0062
0063
0064 Geant4Context* m_context { nullptr };
0065
0066
0067 Geant4GeneratorActionSequence* m_generatorAction { nullptr };
0068
0069 Geant4RunActionSequence* m_runAction { nullptr };
0070
0071 Geant4EventActionSequence* m_eventAction { nullptr };
0072
0073 Geant4TrackingActionSequence* m_trackingAction { nullptr };
0074
0075 Geant4SteppingActionSequence* m_steppingAction { nullptr };
0076
0077 Geant4StackingActionSequence* m_stackingAction { nullptr };
0078
0079 Geant4DetectorConstructionSequence* m_constructionAction { nullptr };
0080
0081
0082 Geant4SensDetSequences* m_sensDetActions { nullptr };
0083
0084 Geant4PhysicsListActionSequence* m_physicsList { nullptr };
0085
0086 Geant4UserInitializationSequence* m_userInit { nullptr };
0087
0088
0089 template <typename C> bool registerSequence(C*& seq, const std::string& name);
0090
0091
0092 Geant4ActionContainer(Geant4Context* ctxt=0);
0093
0094
0095 virtual ~Geant4ActionContainer();
0096
0097
0098 void setContext(Geant4Context* ctxt);
0099
0100 public:
0101
0102 Geant4Context* workerContext();
0103
0104
0105 virtual int terminate();
0106
0107
0108 Geant4GeneratorActionSequence* generatorAction(bool create);
0109
0110 Geant4GeneratorActionSequence& generatorAction() {
0111 return *generatorAction(true);
0112 }
0113
0114
0115 Geant4RunActionSequence* runAction(bool create);
0116
0117 Geant4RunActionSequence& runAction() {
0118 return *runAction(true);
0119 }
0120
0121
0122 Geant4EventActionSequence* eventAction(bool create);
0123
0124 Geant4EventActionSequence& eventAction() {
0125 return *eventAction(true);
0126 }
0127
0128
0129 Geant4SteppingActionSequence* steppingAction(bool create);
0130
0131 Geant4SteppingActionSequence& steppingAction() {
0132 return *steppingAction(true);
0133 }
0134
0135
0136 Geant4TrackingActionSequence* trackingAction(bool create);
0137
0138 Geant4TrackingActionSequence& trackingAction() {
0139 return *trackingAction(true);
0140 }
0141
0142
0143 Geant4StackingActionSequence* stackingAction(bool create);
0144
0145 Geant4StackingActionSequence& stackingAction() {
0146 return *stackingAction(true);
0147 }
0148
0149
0150 Geant4DetectorConstructionSequence* detectorConstruction(bool create);
0151
0152 Geant4DetectorConstructionSequence& detectorConstruction() {
0153 return *detectorConstruction(true);
0154 }
0155
0156
0157 Geant4SensDetSequences& sensitiveActions() const;
0158
0159 Geant4SensDetActionSequence* sensitiveAction(const std::string& name);
0160
0161
0162 Geant4PhysicsListActionSequence* physicsList(bool create);
0163
0164 Geant4PhysicsListActionSequence& physicsList() {
0165 return *physicsList(true);
0166 }
0167
0168 Geant4UserInitializationSequence* userInitialization(bool create);
0169
0170 Geant4UserInitializationSequence& userInitialization() {
0171 return *userInitialization(true);
0172 }
0173 };
0174
0175 }
0176 }
0177 #endif