Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4UserRunAction.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// G4UserRunAction
27//
28// Class description:
29//
30// This is the base class of a user's action class defining the user's
31// action at the begining and the end of each run. The user can override
32// the following two methods but should not change any of the contents of
33// a G4Run object:
34// virtual void BeginOfRunAction(const G4Run* aRun);
35// virtual void EndOfRunAction(const G4Run* aRun);
36// The user can override the following method to instanciate his/her own
37// concrete Run class. G4Run has a virtual method RecordEvent(), so that
38// one can store any information useful for event statistics:
39// virtual G4Run* GenerateRun();
40// The user's concrete class derived from this class must be set to
41// G4RunManager via the G4RunManager::SetUserAction() method.
42
43// Original author: M.Asai, 1998
44// --------------------------------------------------------------------
45#ifndef G4UserRunAction_hh
46#define G4UserRunAction_hh 1
47
48#include "G4Types.hh"
49
50class G4Run;
51
53{
54 public:
56 virtual ~G4UserRunAction() = default;
57
58 virtual G4Run* GenerateRun() { return nullptr; }
59 virtual void BeginOfRunAction(const G4Run* /*aRun*/) {}
60 virtual void EndOfRunAction(const G4Run* /*aRun*/) {}
61
62 inline virtual void SetMaster(G4bool val = true) { isMaster = val; }
63 inline G4bool IsMaster() const { return isMaster; }
64
65 protected:
67};
68
69#endif
bool G4bool
Definition G4Types.hh:86
Definition G4Run.hh:49
virtual ~G4UserRunAction()=default
virtual void EndOfRunAction(const G4Run *)
G4bool IsMaster() const
virtual void SetMaster(G4bool val=true)
virtual G4Run * GenerateRun()
virtual void BeginOfRunAction(const G4Run *)