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