Geant4  10.02
G4VUserActionInitialization.hh
Go to the documentation of this file.
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 // $Id: G4VUserActionInitialization.hh 68830 2013-04-06 04:17:11Z asaim $
28 //
29 
30 #ifndef G4VUserActionInitialization_h
31 #define G4VUserActionInitialization_h 1
32 
33 // class description:
34 //
35 // This is the abstract base class for instantiating all the user action classes.
36 // It has a pure virtual method Build() which is invoked by G4RunManager for
37 // sequential execution and G4WorkerRunManager for multi-threaded execution.
38 // The additional virtual method BuildForMaster() will be invoked from G4MTRunManager
39 // for multi-threaded execution.
40 //
41 // Note that these virtual methods are const. It means the user may construct
42 // user action objects, but should not store the pointers of these objects as
43 // data members of the derived class.
44 //
45 // Note for multi-threaded mode:
46 // The only action class the user may set to G4MTRunManager is a run action. It is
47 // then used at the beginning and the end of a run. It may be the same class or a
48 // dedicated class different from the run action instantiated for G4WorkerRunManager.
49 //
50 
52 class G4UserRunAction;
53 class G4UserEventAction;
57 class G4VSteppingVerbose;
58 
60 {
61  public:
64 
65  public: // with description
66  virtual void Build() const = 0;
67  // Virtual method to be implemented by the user to instantiate user action
68  // class objects.
69  virtual void BuildForMaster() const;
70  // Virtual method to be implemented by the user to instantiate user run action
71  // class object to be used by G4MTRunManager. This method is not invoked in
72  // the sequential mode. The user should not use this method to instantiate
73  // user action classes rather than user run action.
75  // Virtual method to be implemented by the user if (s)he has a concrete
76  // SteppingVerbose class to be used by the worker thread. In this case
77  // (s)he should instantiate her/his SteppingVerbose in the concrete
78  // implementation of this method and return its pointer. If this method is
79  // not implemented, the default G4SteppingVerbose will be used. Please note
80  // that this method affects only for the worker thread.
81 
82  protected: // with description
84  void SetUserAction(G4UserRunAction*) const;
85  void SetUserAction(G4UserEventAction*) const;
89  // These methods should be used to define user's action classes.
90 
91 };
92 
93 #endif
94 
virtual void Build() const =0
void SetUserAction(G4VUserPrimaryGeneratorAction *) const
virtual G4VSteppingVerbose * InitializeSteppingVerbose() const