G4Run.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id$
00028 //
00029 
00030 #ifndef G4Run_h
00031 #define G4Run_h 1
00032 
00033 #include "globals.hh"
00034 #include <vector>
00035 class G4Event;
00036 class G4HCtable;
00037 class G4DCtable;
00038 
00039 // class description:
00040 //
00041 //  This class represents a run. An object of this class is constructed
00042 // and deleted by G4RunManager. Basically the user should use only the
00043 // get methods. All properties are set by G4RunManager.
00044 //  
00045 
00046 class G4Run
00047 {
00048   public:
00049     G4Run();
00050     virtual ~G4Run();
00051 
00052   private:
00053     // These copy constructor and = operator must not be used.
00054     G4Run(const G4Run &) {;}
00055     G4Run& operator=(const G4Run &) { return *this; }
00056 
00057   protected:
00058     G4int runID;
00059     G4int numberOfEvent;
00060     G4int numberOfEventToBeProcessed;
00061     G4HCtable* HCtable;
00062     G4DCtable* DCtable;
00063     G4String randomNumberStatus;
00064     std::vector<const G4Event*>* eventVector;
00065 
00066   public: // with description
00067     virtual void RecordEvent(const G4Event*);
00068     //  Method to be overwritten by the user for recording events in this run.
00069     //  In such a case, it is the user's responsibility to increment numberOfEvent.
00070     //  Also, user's run class object must be instantiated in user's runAction.
00071 
00072   public: // with description
00073     inline G4int GetRunID() const
00074     { return runID; }
00075     //  Returns the run ID. Run ID is set by G4RunManager.
00076     inline G4int GetNumberOfEvent() const
00077     { return numberOfEvent; }
00078     //  Returns number of events processed in this run. The number is
00079     // incremented at the end of each event processing.
00080     inline G4int GetNumberOfEventToBeProcessed() const
00081     { return numberOfEventToBeProcessed; }
00082     inline const G4HCtable* GetHCtable() const
00083     { return HCtable; }
00084     //  List of names of hits collection
00085     inline const G4DCtable* GetDCtable() const
00086     { return DCtable; }
00087     //  List of names of digi collection
00088     inline const G4String& GetRandomNumberStatus() const
00089     { return randomNumberStatus; }
00090     // Return random number status at the beginning of this run
00091   public:
00092     inline void SetRunID(G4int id)
00093     { runID = id; }
00094     inline void SetNumberOfEventToBeProcessed(G4int n_ev)
00095     { numberOfEventToBeProcessed = n_ev; }
00096     inline void SetHCtable(G4HCtable* HCtbl)
00097     { HCtable = HCtbl; }
00098     inline void SetDCtable(G4DCtable* DCtbl)
00099     { DCtable = DCtbl; }
00100     inline void SetRandomNumberStatus(G4String& st)
00101     { randomNumberStatus = st; }
00102 
00103   public: // with description
00104     void StoreEvent(G4Event* evt);
00105     // Store a G4Event object until this run object is deleted.
00106     // Given the potential large memory size of G4Event and its datamember
00107     // objects stored in G4Event, the user must be careful and responsible for
00108     // not to store too many G4Event objects. This method is invoked by G4RunManager
00109     // if the user invokes G4EventManager::KeepTheCurrentEvent() or 
00110     // /event/keepCurrentEvent UI command while the particular event is in process
00111     // (typically in EndOfEventAction).
00112     inline const std::vector<const G4Event*>* GetEventVector() const
00113     { return eventVector; }
00114     // Return the event vector
00115 };
00116 
00117 
00118 #endif
00119 

Generated on Mon May 27 17:49:47 2013 for Geant4 by  doxygen 1.4.7