ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4VUserActionInitialization.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4VUserActionInitialization.hh
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 //
28 
29 #ifndef G4VUserActionInitialization_h
30 #define G4VUserActionInitialization_h 1
31 
32 // class description:
33 //
34 // This is the abstract base class for instantiating all the user action classes.
35 // It has a pure virtual method Build() which is invoked by G4RunManager for
36 // sequential execution and G4WorkerRunManager for multi-threaded execution.
37 // The additional virtual method BuildForMaster() will be invoked from G4MTRunManager
38 // for multi-threaded execution.
39 //
40 // Note that these virtual methods are const. It means the user may construct
41 // user action objects, but should not store the pointers of these objects as
42 // data members of the derived class.
43 //
44 // Note for multi-threaded mode:
45 // The only action class the user may set to G4MTRunManager is a run action. It is
46 // then used at the beginning and the end of a run. It may be the same class or a
47 // dedicated class different from the run action instantiated for G4WorkerRunManager.
48 //
49 
51 class G4UserRunAction;
52 class G4UserEventAction;
56 class G4VSteppingVerbose;
57 
59 {
60  public:
63 
64  public: // with description
65  virtual void Build() const = 0;
66  // Virtual method to be implemented by the user to instantiate user action
67  // class objects.
68  virtual void BuildForMaster() const;
69  // Virtual method to be implemented by the user to instantiate user run action
70  // class object to be used by G4MTRunManager. This method is not invoked in
71  // the sequential mode. The user should not use this method to instantiate
72  // user action classes rather than user run action.
74  // Virtual method to be implemented by the user if (s)he has a concrete
75  // SteppingVerbose class to be used by the worker thread. In this case
76  // (s)he should instantiate her/his SteppingVerbose in the concrete
77  // implementation of this method and return its pointer. If this method is
78  // not implemented, the default G4SteppingVerbose will be used. Please note
79  // that this method affects only for the worker thread.
80 
81  protected: // with description
83  void SetUserAction(G4UserRunAction*) const;
84  void SetUserAction(G4UserEventAction*) const;
88  // These methods should be used to define user's action classes.
89 
90 };
91 
92 #endif
93