Import Geant4 5.1.0 source tree
This commit is contained in:
@@ -21,13 +21,12 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: exampleN06.cc,v 1.7 2003/01/23 15:31:39 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 - exampleExN06
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
// File: exampleExN06.cc
|
||||
// Description: Test of Continuous Process G4Cerenkov
|
||||
// and RestDiscrete Process G4Scintillation
|
||||
// -- Generation Cerenkov Photons --
|
||||
@@ -36,72 +35,101 @@
|
||||
// Version: 5.0
|
||||
// Created: 1996-04-30
|
||||
// Author: Juliet Armstrong
|
||||
// Updated: 2002-11-12 by Peter Gumplinger
|
||||
// Change user interface to G4Scintillation
|
||||
// Add UserStackingAction
|
||||
// 1998-06-03 by Peter Gumplinger for example ExN06
|
||||
// mail: gum@triumf.ca
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
#include "ExN06RunAction.hh"
|
||||
#include "ExN06DetectorConstruction.hh"
|
||||
#include "ExN06PrimaryGeneratorAction.hh"
|
||||
#include "ExN06StackingAction.hh"
|
||||
#include "ExN06PhysicsList.hh"
|
||||
// Updated:
|
||||
//
|
||||
// 2002-11-12 by Peter Gumplinger
|
||||
// - Change user interface to G4Scintillation
|
||||
// - Add UserStackingAction
|
||||
//
|
||||
// 1998-06-03 by Peter Gumplinger for example ExN06
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4UIterminal.hh"
|
||||
#include "G4UItcsh.hh"
|
||||
|
||||
#include "G4ios.hh"
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "ExN06DetectorConstruction.hh"
|
||||
#include "ExN06PhysicsList.hh"
|
||||
#include "ExN06PrimaryGeneratorAction.hh"
|
||||
#include "ExN06RunAction.hh"
|
||||
#include "ExN06EventAction.hh"
|
||||
#include "ExN06StackingAction.hh"
|
||||
#include "ExN06SteppingVerbose.hh"
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
#include "ExN06VisManager.hh"
|
||||
#endif
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
int main(int argc,char** argv) {
|
||||
|
||||
// Seed the random number generator manually
|
||||
// -----------------------------------------
|
||||
|
||||
G4long myseed = 345354;
|
||||
|
||||
HepRandom::setTheSeed(myseed);
|
||||
|
||||
|
||||
//my Verbose output class
|
||||
G4VSteppingVerbose::SetInstance(new ExN06SteppingVerbose);
|
||||
|
||||
// Run manager
|
||||
|
||||
G4RunManager * runManager = new G4RunManager;
|
||||
G4RunManager* runManager = new G4RunManager;
|
||||
|
||||
// UserInitialization classes - mandatory
|
||||
|
||||
runManager-> SetUserInitialization(new ExN06DetectorConstruction);
|
||||
runManager-> SetUserInitialization(new ExN06PhysicsList);
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
// visualization manager
|
||||
G4VisManager* visManager = new ExN06VisManager;
|
||||
visManager->Initialize();
|
||||
#endif
|
||||
|
||||
// UserAction classes - optional
|
||||
|
||||
// UserAction classes
|
||||
runManager->SetUserAction(new ExN06RunAction);
|
||||
runManager->SetUserAction(new ExN06PrimaryGeneratorAction);
|
||||
|
||||
runManager->SetUserAction(new ExN06EventAction);
|
||||
runManager->SetUserAction(new ExN06StackingAction);
|
||||
|
||||
// User interactions
|
||||
// Define (G)UI for interactive mode
|
||||
if(argc==1)
|
||||
{
|
||||
// G4UIterminal is a (dumb) terminal.
|
||||
G4UIsession * session = new G4UIterminal;
|
||||
session->SessionStart();
|
||||
delete session;
|
||||
}
|
||||
else
|
||||
// Batch mode
|
||||
{
|
||||
G4UImanager * UI = G4UImanager::GetUIpointer();
|
||||
G4String command = "/control/execute ";
|
||||
G4String fileName = argv[1];
|
||||
UI->ApplyCommand(command+fileName);
|
||||
}
|
||||
|
||||
|
||||
//Initialize G4 kernel
|
||||
runManager->Initialize();
|
||||
|
||||
// get the pointer to the User Interface manager
|
||||
G4UImanager* UI = G4UImanager::GetUIpointer();
|
||||
|
||||
if (argc==1) //define UI session for interactive mode
|
||||
{
|
||||
G4UIsession* session = 0;
|
||||
#ifdef G4UI_USE_TCSH
|
||||
session = new G4UIterminal(new G4UItcsh);
|
||||
#else
|
||||
session = new G4UIterminal();
|
||||
#endif
|
||||
UI->ApplyCommand("/control/execute vis.mac");
|
||||
session->SessionStart();
|
||||
delete session;
|
||||
}
|
||||
|
||||
else // Batch mode
|
||||
{
|
||||
G4String command = "/control/execute ";
|
||||
G4String fileName = argv[1];
|
||||
UI->ApplyCommand(command+fileName);
|
||||
}
|
||||
|
||||
// job termination
|
||||
#ifdef G4VIS_USE
|
||||
delete visManager;
|
||||
#endif
|
||||
delete runManager;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
return 0;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
Reference in New Issue
Block a user