musrsim/geant4/LEMuSR/src/LEMuSRRunAction.cc
2006-02-23 13:23:18 +00:00

90 lines
2.9 KiB
C++

//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//*
// LOW ENERGY MUON SPIN RELAXATION, ROTATION, RADIATION Geant4 SIMULATION
// ID : LEMuSRRunAction.cc , v 1.0
// AUTHOR: Taofiq PARAISO
// DATE : 2004-07-12 16:15
//
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
//
// & &&&&&&&&&& &&&&&&& &&&&&&&&
// & & && && & &&
// & & & & & & &&
// & &&&&&&& & & &&&&&& &&&&&&&&
// & & & && & & &&
// & & && & & && && & &
// &&&&&&&&&& &&&&&&&&&& & &&&&& && &&&&&&& & &&
// &
// &
// &
// &
// RUN ACTION.CC
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
#include "LEMuSRRunAction.hh"
#include "G4Run.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4VVisManager.hh"
#include "G4ios.hh"
// ROOT
#include "TROOT.h"
#include "TApplication.h"
#include "TSystem.h"
#include "TH1.h"
#include "TPad.h"
#include "TCanvas.h"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LEMuSRRunAction::LEMuSRRunAction()
{
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LEMuSRRunAction::~LEMuSRRunAction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
/*! Initializes the user interface manager.*/
void LEMuSRRunAction::BeginOfRunAction(const G4Run* aRun)
{
G4UImanager* UI = G4UImanager::GetUIpointer();
G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
G4RunManager::GetRunManager()->SetRandomNumberStore(true);
if (G4VVisManager::GetConcreteInstance())
{
UI->ApplyCommand("/vis/scene/notifyHandlers");
}
//! BUILD THE DETECTOR IN TOTAL GEOMETRY
// G4cout<<"WILL REBUILD THE DETECTOR"<<G4endl;
// UI->ApplyCommand("/Detector/View total");
// G4VPhysicalVolume* newDetector = LEMuSRDetectorConstruction::GetInstance()->Construct();
// G4RunManager::GetRunManager()->DefineWorldVolume(newDetector);
// G4cout<<"DETECTOR BUILT."<<G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
/*! Updates the user interface manager.*/
void LEMuSRRunAction::EndOfRunAction(const G4Run*)
{
if (G4VVisManager::GetConcreteInstance())
{
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/update");
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......