DD4hep - The AIDA detector description toolkit for high energy physics experiments
DD4hep  Rev:Unversioneddirectory
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Geant4ActionContainer.h
Go to the documentation of this file.
1 // $Id$
2 //==========================================================================
3 // AIDA Detector description implementation for LCD
4 //--------------------------------------------------------------------------
5 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
6 // All rights reserved.
7 //
8 // For the licensing terms see $DD4hepINSTALL/LICENSE.
9 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
10 //
11 // Author : M.Frank
12 //
13 //==========================================================================
14 #ifndef DD4HEP_DDG4_GEANT4ACTIONCONTAINER_H
15 #define DD4HEP_DDG4_GEANT4ACTIONCONTAINER_H
16 
17 // Framework include files
18 #include "DD4hep/Printout.h"
19 #include "DDG4/Geant4Primitives.h"
20 #include "DDG4/Geant4Action.h"
21 
22 // C/C++ include files
23 #include <map>
24 #include <string>
25 #include <typeinfo>
26 
28 namespace DD4hep {
29 
31  namespace Simulation {
32 
33  // Forward declarations
34  class Geant4Context;
35  class Geant4Action;
36  class Geant4RunAction;
37  class Geant4EventAction;
38  class Geant4SteppingAction;
39  class Geant4TrackingAction;
40  class Geant4StackingAction;
41  class Geant4GeneratorAction;
42  class Geant4PhysicsList;
43  class Geant4RunActionSequence;
44  class Geant4EventActionSequence;
45  class Geant4SteppingActionSequence;
46  class Geant4TrackingActionSequence;
47  class Geant4StackingActionSequence;
48  class Geant4GeneratorActionSequence;
49  class Geant4PhysicsListActionSequence;
50  class Geant4DetectorConstructionSequence;
51  class Geant4UserInitializationSequence;
52  class Geant4SensDetActionSequence;
53  class Geant4SensDetSequences;
54 
56 
62  protected:
63 
66 
81 
88 
90  template <typename C> bool registerSequence(C*& seq, const std::string& name);
91 
94 
96  virtual ~Geant4ActionContainer();
97 
99  void setContext(Geant4Context* ctxt);
100 
101  public:
104 
106  virtual int terminate();
107 
112  return *generatorAction(true);
113  }
114 
116  Geant4RunActionSequence* runAction(bool create);
119  return *runAction(true);
120  }
121 
126  return *eventAction(true);
127  }
128 
133  return *steppingAction(true);
134  }
135 
140  return *trackingAction(true);
141  }
142 
147  return *stackingAction(true);
148  }
149 
154  return *detectorConstruction(true);
155  }
156 
160  Geant4SensDetActionSequence* sensitiveAction(const std::string& name);
161 
166  return *physicsList(true);
167  }
172  return *userInitialization(true);
173  }
174  };
175 
176  } // End namespace Simulation
177 } // End namespace DD4hep
178 #endif // DD4HEP_DDG4_GEANT4KERNEL_H
Geant4DetectorConstructionSequence & detectorConstruction()
Access detector construcion action sequence (geometry+sensitives+field)
Concrete implementation of the Geant4 stepping action sequence.
Geant4StackingActionSequence & stackingAction()
Access stacking action sequence.
Class to orchestrate a modular initializion of a multi- or single threaded Geant4 application...
void setContext(Geant4Context *ctxt)
Set the thread's context.
Concrete basic implementation of the Geant4 detector construction sequencer.
Geant4SensDetSequences * m_sensDetActions
Reference to the Geant4 sensitive action sequences.
Geant4UserInitializationSequence * m_userInit
Reference to the user initialization object.
Geant4SensDetActionSequence * sensitiveAction(const std::string &name)
Access to the sensitive detector action from the actioncontainer object.
Geant4EventActionSequence & eventAction()
Access run action sequence.
Concrete implementation of the Geant4 event action sequence.
Geant4SteppingActionSequence * m_steppingAction
Reference to the Geant4 step action.
Concrete implementation of the Geant4 tracking action sequence.
Geant4StackingActionSequence * m_stackingAction
Reference to the Geant4 stacking action.
Geant4PhysicsListActionSequence * m_physicsList
Reference to the Geant4 physics list.
Concrete implementation of the Geant4 stacking action sequence.
Geant4RunActionSequence * m_runAction
Reference to the Geant4 run action.
Geant4PhysicsListActionSequence & physicsList()
Access to the physics list.
Class, which allows all Geant4Action to be stored.
The implementation of the single Geant4 physics list action sequence.
Geant4GeneratorActionSequence & generatorAction()
Access generator action sequence.
virtual ~Geant4ActionContainer()
Default destructor.
Geant4TrackingActionSequence * m_trackingAction
Reference to the Geant4 track action.
Geant4Context * m_context
Geant4 worker context (thread specific)
Concrete implementation of the Geant4 generator action sequence.
Concrete basic implementation of the Geant4 run action sequencer.
Geant4Context * workerContext()
Thread's Geant4 execution context.
The sequencer to host Geant4 sensitive actions called if particles interact with sensitive elements...
bool registerSequence(C *&seq, const std::string &name)
Helper to register an action sequence.
Geant4GeneratorActionSequence * m_generatorAction
Reference to the Geant4 primary generator action.
Geant4TrackingActionSequence & trackingAction()
Access tracking action sequence.
Generic context to extend user, run and event information.
Geant4UserInitializationSequence & userInitialization()
Access to the user initialization object.
Geant4RunActionSequence & runAction()
Access run action sequence.
Geant4SensDetSequences & sensitiveActions() const
Access to the sensitive detector sequences from the actioncontainer object.
Geant4DetectorConstructionSequence * m_constructionAction
Reference to the Geant4 detector construction sequence.
Geant4EventActionSequence * m_eventAction
Reference to the Geant4 event action.
Geant4SensDetSequences: class to access groups of sensitive actions.
Geant4ActionContainer(Geant4Context *ctxt=0)
Standard constructor.
virtual int terminate()
Terminate all associated action instances.
Geant4SteppingActionSequence & steppingAction()
Access stepping action sequence.