Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4Run.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// G4Run
27//
28// Class description:
29//
30// This class represents a run. An object of this class is constructed
31// and deleted by G4RunManager. Basically the user should use only the
32// accessors (get methods). All properties are set by G4RunManager.
33
34// Author: M.Asai, 1996
35// --------------------------------------------------------------------
36#ifndef G4Run_hh
37#define G4Run_hh 1
38
39#include <vector>
40
41#include "globals.hh"
42#include "G4Profiler.hh"
43
44class G4Event;
45class G4HCtable;
46class G4DCtable;
47
48class G4Run
49{
50 public:
51
53
54 G4Run();
55 virtual ~G4Run();
56
57 G4Run(const G4Run&) = delete;
58 G4Run& operator=(const G4Run&) = delete;
59 // Forbidden copy constructor and assignment operator.
60
61 virtual void RecordEvent(const G4Event*);
62 // Method to be overwritten by the user for recording events in this run.
63 // In such a case, it is the user's responsibility to increment
64 // numberOfEvent. Also, user's run class object must be instantiated in
65 // user's runAction.
66 virtual void Merge(const G4Run*);
67 // Method to be overwritten by the user for merging local G4Run object
68 // to the global G4Run object.
69 void StoreEvent(G4Event* evt);
70 // Store a G4Event object until this run object is deleted.
71 // Given the potential large memory size of G4Event and its data-member
72 // objects stored in G4Event, the user must be careful and responsible
73 // for not storing too many G4Event objects. This method is invoked by
74 // G4RunManager if the user invokes G4EventManager::KeepTheCurrentEvent()
75 // or "/event/keepCurrentEvent" UI command while the particular event is
76 // in being processed (typically in EndOfEventAction).
77
78 inline G4int GetRunID() const { return runID; }
79 // Returns the run ID. Run ID is set by G4RunManager.
80 inline G4int GetNumberOfEvent() const { return numberOfEvent; }
81 // Returns number of events processed in this run. The number is
82 // incremented at the end of each event processing.
84 {
86 }
87 inline const G4HCtable* GetHCtable() const { return HCtable; }
88 // List of names of hits collection.
89 inline const G4DCtable* GetDCtable() const { return DCtable; }
90 // List of names of digi collection.
91 inline const G4String& GetRandomNumberStatus() const
92 {
93 return randomNumberStatus;
94 }
95 // Returns random number status at the beginning of this run.
96 inline const std::vector<const G4Event*>* GetEventVector() const
97 {
98 return eventVector;
99 }
100 // Returns the event vector.
101
102 inline void SetRunID(G4int id) { runID = id; }
104 {
106 }
107 inline void SetHCtable(G4HCtable* HCtbl) { HCtable = HCtbl; }
108 inline void SetDCtable(G4DCtable* DCtbl) { DCtable = DCtbl; }
110
111 protected:
112
116 G4HCtable* HCtable = nullptr;
117 G4DCtable* DCtable = nullptr;
119 std::vector<const G4Event*>* eventVector = nullptr;
120};
121
122#endif
int G4int
Definition: G4Types.hh:85
Definition: G4Run.hh:49
void SetHCtable(G4HCtable *HCtbl)
Definition: G4Run.hh:107
G4int GetRunID() const
Definition: G4Run.hh:78
void StoreEvent(G4Event *evt)
Definition: G4Run.cc:78
G4String randomNumberStatus
Definition: G4Run.hh:118
std::vector< const G4Event * > * eventVector
Definition: G4Run.hh:119
const G4HCtable * GetHCtable() const
Definition: G4Run.hh:87
G4int numberOfEvent
Definition: G4Run.hh:114
G4int GetNumberOfEventToBeProcessed() const
Definition: G4Run.hh:83
const G4DCtable * GetDCtable() const
Definition: G4Run.hh:89
virtual ~G4Run()
Definition: G4Run.cc:44
const G4String & GetRandomNumberStatus() const
Definition: G4Run.hh:91
G4DCtable * DCtable
Definition: G4Run.hh:117
G4int GetNumberOfEvent() const
Definition: G4Run.hh:80
G4Run(const G4Run &)=delete
virtual void Merge(const G4Run *)
Definition: G4Run.cc:67
G4HCtable * HCtable
Definition: G4Run.hh:116
virtual void RecordEvent(const G4Event *)
Definition: G4Run.cc:61
void SetNumberOfEventToBeProcessed(G4int n_ev)
Definition: G4Run.hh:103
G4int runID
Definition: G4Run.hh:113
const std::vector< const G4Event * > * GetEventVector() const
Definition: G4Run.hh:96
G4Run & operator=(const G4Run &)=delete
void SetRunID(G4int id)
Definition: G4Run.hh:102
G4Run()
Definition: G4Run.cc:37
void SetDCtable(G4DCtable *DCtbl)
Definition: G4Run.hh:108
void SetRandomNumberStatus(G4String &st)
Definition: G4Run.hh:109
G4int numberOfEventToBeProcessed
Definition: G4Run.hh:115