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