Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
ExGflash.cc File Reference

Main program of the parameterisations/gflash example. More...

#include <algorithm>
#include <iostream>
#include "G4Timer.hh"
#include "G4ios.hh"
#include "G4GlobalFastSimulationManager.hh"
#include "G4UImanager.hh"
#include "G4RunManager.hh"
#include "ExGflashActionInitialization.hh"
#include "ExGflashDetectorConstruction.hh"
#include "ExGflashPhysicsList.hh"
#include "ExGflashPrimaryGeneratorAction.hh"
#include "ExGflashEventAction.hh"
#include "ExGflashRunAction.hh"
#include "QBBC.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Main program of the parameterisations/gflash example.

Definition in file ExGflash.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 79 of file ExGflash.cc.

References G4UImanager::ApplyCommand(), G4cout, G4endl, G4Timer::GetRealElapsed(), G4Timer::GetSystemElapsed(), G4UImanager::GetUIpointer(), G4Timer::GetUserElapsed(), G4RunManager::Initialize(), G4VisManager::Initialize(), G4UIExecutive::SessionStart(), G4MTRunManager::SetNumberOfThreads(), G4RunManager::SetUserInitialization(), G4Timer::Start(), and G4Timer::Stop().

80 {
81  // Timer to see GFlash performance
82  G4Timer Timer;
83  Timer.Start();
84 
85  G4cout<<"+-------------------------------------------------------+"<<G4endl;
86  G4cout<<"| |"<<G4endl;
87  G4cout<<"| This is an example of Shower |"<<G4endl;
88  G4cout<<"| Parameterization with GFLASH |"<<G4endl;
89  G4cout<<"+-------------------------------------------------------+"<<G4endl;
90 
91 
92 
93 #ifdef G4MULTITHREADED
94  G4MTRunManager * runManager = new G4MTRunManager;
95  runManager->SetNumberOfThreads(4);
96  G4cout<<"+-------------------------------------------------------+"<<G4endl;
97  G4cout<<"| Constructing MT run manager |"<<G4endl;
98  G4cout<<"+-------------------------------------------------------+"<<G4endl;
99 #else
100  G4RunManager * runManager = new G4RunManager;
101  G4cout<<"+-------------------------------------------------------+"<<G4endl;
102  G4cout<<"| Constructing sequential run manager |"<<G4endl;
103  G4cout<<"+-------------------------------------------------------+"<<G4endl;
104 #endif
105 
106  // UserInitialization classes (mandatory)
107  G4cout<<"# GFlash Example: Detector Construction"<<G4endl;
109  G4cout<<"# GFlash Example: Physics list"<<G4endl;
111  // runManager->SetUserInitialization(new QBBC);
112  // Action initialization:
114 
115 
116 #ifdef G4VIS_USE
117  G4VisManager* visManager = new G4VisExecutive;
118  visManager->Initialize();
119 #endif
120 
121  G4UImanager* UImanager = G4UImanager::GetUIpointer();
122  UImanager->ApplyCommand("/run/verbose 0");
123  runManager->Initialize();
124  UImanager->ApplyCommand("/Step/Verbose 0");
125 
126  if (argc==1) // Define UI terminal for interactive mode
127  {
128 #ifdef G4UI_USE
129  G4UIExecutive* ui = new G4UIExecutive(argc, argv);
130 #ifdef G4VIS_USE
131  UImanager->ApplyCommand("/control/execute vis.mac");
132 #endif
133  ui->SessionStart();
134  delete ui;
135 #endif
136  }
137  else // Batch mode
138  {
139  G4String s=*(argv+1);
140  UImanager->ApplyCommand("/control/execute "+s);
141  }
142 
143  #ifdef G4VIS_USE
144  delete visManager;
145  #endif
146  delete runManager;
147 
148  Timer.Stop();
149  G4cout << G4endl;
150  G4cout << "******************************************";
151  G4cout << G4endl;
152  G4cout << "Total Real Elapsed Time is: "<< Timer.GetRealElapsed();
153  G4cout << G4endl;
154  G4cout << "Total System Elapsed Time: " << Timer.GetSystemElapsed();
155  G4cout << G4endl;
156  G4cout << "Total GetUserElapsed Time: " << Timer.GetUserElapsed();
157  G4cout << G4endl;
158  G4cout << "******************************************";
159  G4cout << G4endl;
160 
161  return 0;
162 }
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
G4double GetSystemElapsed() const
Definition: G4Timer.cc:119
void SetNumberOfThreads(G4int n)
const XML_Char * s
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:58
G4GLOB_DLL std::ostream G4cout
G4double GetUserElapsed() const
Definition: G4Timer.cc:130
void Initialize()
G4double GetRealElapsed() const
Definition: G4Timer.cc:107
void Stop()
virtual void Initialize()
#define G4endl
Definition: G4ios.hh:61
void Start()
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:419