////////////////////////////////////////////////////////////////////
/// \class GLG4PrimaryGeneratorAction
///
/// \author Glenn Horton-Smith -- not on SNO+
/// \author Phil Jones
-- contact person
///
/// REVISION HISTORY:\n
/// inherited as part of the generic GLG4 software
// new GLG4PrimaryGeneratorAction.hh by Glenn Horton-Smith, August 3-17, 2001
// This file is part of the GenericLAND software library.
////////////////////////////////////////////////////////////////////
#ifndef __GLG4PrimaryGeneratorAction_hh__
#define __GLG4PrimaryGeneratorAction_hh__ 1
////////////////////////////////////////////////////////////////
// GLG4PrimaryGeneratorAction
////////////////////////////////////////////////////////////////
#include "G4VUserPrimaryGeneratorAction.hh" // for user primary vertex gen.
#include "GLG4GenList.hh"
#include
class GLG4PrimaryGeneratorMessenger;
class G4Event;
class G4Track;
class GLG4PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
GLG4PrimaryGeneratorAction();
~GLG4PrimaryGeneratorAction();
void AddGenerator(GLG4Gen *gen);
void GeneratePrimaries(G4Event * argEvent); // generate primary particles
double GetUniversalTime() { return fUniversalTime; }
double GetUniversalTimeSincePriorEvent()
{ return fUniversalTimeSincePriorEvent; }
double GetEventWindow() { return fEventWindow; }
void SetEventWindow(double argEventWindow);
static GLG4PrimaryGeneratorAction* GetTheGLG4PrimaryGeneratorAction()
{ return fTheGLG4PrimaryGeneratorAction; }
void DeferTrackToLaterEvent(const G4Track * track);
void BeginOfRun( /*DS::Run& run*/ );
void EndOfRun( /*DS::Run& run*/ );
GLG4Gen *GetLastAddedGen() {return fLastAddedGen;}
RAT::Profiler *GetProfiler() {return &fEventGenerateProfile;}
protected:
GLG4PrimaryGeneratorMessenger *fMessenger;
RAT::Profiler fEventGenerateProfile; // Profiled event generation
double fUniversalTime;
double fUniversalTimeSincePriorEvent;
double fEventWindow;
bool fNeedReset;
GLG4GenList fGenList;
// Keeps a pointer to the last generator added to the list
// Useful to pass custom commands and allow the generator to repeat itself
GLG4Gen *fLastAddedGen;
static GLG4PrimaryGeneratorAction* fTheGLG4PrimaryGeneratorAction;
};
#endif