ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4Run.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4Run.hh
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 G4Run_h
30 #define G4Run_h 1
31 
32 #include "globals.hh"
33 #include <vector>
34 class G4Event;
35 class G4HCtable;
36 class G4DCtable;
37 
38 // class description:
39 //
40 // This class represents a run. An object of this class is constructed
41 // and deleted by G4RunManager. Basically the user should use only the
42 // get methods. All properties are set by G4RunManager.
43 //
44 
45 class G4Run
46 {
47  public:
48  G4Run();
49  virtual ~G4Run();
50 
51  private:
52  // These copy constructor and = operator must not be used.
53  G4Run(const G4Run &) {;}
54  G4Run& operator=(const G4Run &) { return *this; }
55 
56  protected:
63  std::vector<const G4Event*>* eventVector;
64 
65  public: // with description
66  virtual void RecordEvent(const G4Event*);
67  // Method to be overwritten by the user for recording events in this run.
68  // In such a case, it is the user's responsibility to increment numberOfEvent.
69  // Also, user's run class object must be instantiated in user's runAction.
70  virtual void Merge(const G4Run*);
71  // Method to be overwritten by the user for merging local G4Run object to
72  // the global G4Run object.
73 
74  public: // with description
75  inline G4int GetRunID() const
76  { return runID; }
77  // Returns the run ID. Run ID is set by G4RunManager.
78  inline G4int GetNumberOfEvent() const
79  { return numberOfEvent; }
80  // Returns number of events processed in this run. The number is
81  // incremented at the end of each event processing.
83  { return numberOfEventToBeProcessed; }
84  inline const G4HCtable* GetHCtable() const
85  { return HCtable; }
86  // List of names of hits collection
87  inline const G4DCtable* GetDCtable() const
88  { return DCtable; }
89  // List of names of digi collection
90  inline const G4String& GetRandomNumberStatus() const
91  { return randomNumberStatus; }
92  // Return random number status at the beginning of this run
93  public:
94  inline void SetRunID(G4int id)
95  { runID = id; }
97  { numberOfEventToBeProcessed = n_ev; }
98  inline void SetHCtable(G4HCtable* HCtbl)
99  { HCtable = HCtbl; }
100  inline void SetDCtable(G4DCtable* DCtbl)
101  { DCtable = DCtbl; }
103  { randomNumberStatus = st; }
104 
105  public: // with description
106  void StoreEvent(G4Event* evt);
107  // Store a G4Event object until this run object is deleted.
108  // Given the potential large memory size of G4Event and its datamember
109  // objects stored in G4Event, the user must be careful and responsible for
110  // not to store too many G4Event objects. This method is invoked by G4RunManager
111  // if the user invokes G4EventManager::KeepTheCurrentEvent() or
112  // /event/keepCurrentEvent UI command while the particular event is in process
113  // (typically in EndOfEventAction).
114  inline const std::vector<const G4Event*>* GetEventVector() const
115  { return eventVector; }
116  // Return the event vector
117 };
118 
119 
120 #endif
121