src/BDSRunAction.cc

00001 /* BDSIM code.    Version 1.0
00002    Author: Grahame A. Blair, Royal Holloway, Univ. of London.
00003    Last modified 24.7.2002
00004    Copyright (c) 2002 by G.A.Blair.  ALL RIGHTS RESERVED. 
00005 */
00006 
00007 //==========================================================
00008 //==========================================================
00009 
00010 #include "BDSExecOptions.hh"
00011 #include "BDSGlobalConstants.hh" 
00012 #include "BDSDebug.hh"
00013 #include "BDSRunAction.hh"
00014 #include "BDSRunManager.hh"
00015 #include "BDSDump.hh"
00016 #include "BDSBeamline.hh"
00017 
00018 #include "G4Run.hh"
00019 #include "G4StateManager.hh"
00020 #include "G4UImanager.hh"
00021 #include "G4VVisManager.hh"
00022 #include "G4ios.hh"
00023 
00024 #include "BDSAcceleratorComponent.hh"
00025 #include <list>
00026 #include <fstream>
00027 #include <string>
00028 
00029 #include "BDSTrackingFIFO.hh"
00030 
00031 #if defined(__unix__) || defined(__linux__) || defined(__APPLE__)
00032 #include <unistd.h> // for sleep, will not work on windows?
00033 #endif
00034 
00035 #define DEBUG 1
00036 
00037 //==========================================================
00038 
00039 BDSRunAction::BDSRunAction()
00040 {
00041   nptwiss = BDSExecOptions::Instance()->GetNPTwiss();
00042 }
00043 
00044 //==========================================================
00045 
00046 BDSRunAction::~BDSRunAction()
00047 {}
00048 
00049 //==========================================================
00050 
00051 void BDSRunAction::BeginOfRunAction(const G4Run* aRun)
00052 {
00053   G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
00054 
00055   //  if (G4VVisManager::GetConcreteInstance())
00056   //    {
00057       //      G4UImanager* UI = G4UImanager::GetUIpointer(); 
00058       //  UI->ApplyCommand("/vis/scene/notifyHandlers");
00059   //    } 
00060 
00061 
00062 }
00063 
00064 //==========================================================
00065 
00066 void BDSRunAction::EndOfRunAction(const G4Run* aRun)
00067 {
00068   //Do the fifo at the end of the run.
00069   BDSTrackingFIFO* fifo = new BDSTrackingFIFO();
00070   fifo->doFifo();
00071   G4cout << "### Run " << aRun->GetRunID() << " end." << G4endl;
00072 }
00073 //==========================================================

Generated on 27 Aug 2013 for BDSIM by  doxygen 1.4.7