Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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//
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
35// 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
39// G4MTRunManager 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
47// is
48// then used at the beginning and the end of a run. It may be the same class or
49// a dedicated class different from the run action instantiated for
50// G4WorkerRunManager.
51//
52
54class G4UserRunAction;
60
62{
63 public:
66
67 public: // with description
68 virtual void Build() const = 0;
69 // Virtual method to be implemented by the user to instantiate user action
70 // class objects.
71 virtual void BuildForMaster() const;
72 // Virtual method to be implemented by the user to instantiate user run action
73 // class object to be used by G4MTRunManager. This method is not invoked in
74 // the sequential mode. The user should not use this method to instantiate
75 // user action classes rather than user run action.
77 // Virtual method to be implemented by the user if (s)he has a concrete
78 // SteppingVerbose class to be used by the worker thread. In this case
79 // (s)he should instantiate her/his SteppingVerbose in the concrete
80 // implementation of this method and return its pointer. If this method is
81 // not implemented, the default G4SteppingVerbose will be used. Please note
82 // that this method affects only for the worker thread.
83
84 protected: // with description
86 void SetUserAction(G4UserRunAction*) const;
91 // These methods should be used to define user's action classes.
92};
93
94#endif
void SetUserAction(G4VUserPrimaryGeneratorAction *) const
virtual void Build() const =0
virtual G4VSteppingVerbose * InitializeSteppingVerbose() const