Import Geant4 10.1.0 source tree
This commit is contained in:
@@ -39,9 +39,13 @@
|
||||
// main program
|
||||
// --------------------------------------------------------------
|
||||
|
||||
#ifdef G4MULTITHREADED
|
||||
#include "G4MTRunManager.hh"
|
||||
#else
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#endif
|
||||
|
||||
#include "G4UImanager.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
@@ -55,27 +59,26 @@
|
||||
#include "DMXAnalysisManager.hh"
|
||||
#include "DMXDetectorConstruction.hh"
|
||||
#include "DMXPhysicsList.hh"
|
||||
#include "DMXPrimaryGeneratorAction.hh"
|
||||
#include "DMXRunAction.hh"
|
||||
#include "DMXEventAction.hh"
|
||||
#include "DMXSteppingAction.hh"
|
||||
#include "DMXStackingAction.hh"
|
||||
|
||||
#include <vector>
|
||||
#include "DMXActionInitializer.hh"
|
||||
|
||||
int main(int argc,char** argv) {
|
||||
|
||||
// choose the Random engine
|
||||
CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine);
|
||||
G4Random::setTheEngine(new CLHEP::RanecuEngine);
|
||||
|
||||
// Construct the default run manager
|
||||
G4RunManager * runManager = new G4RunManager;
|
||||
#ifdef G4MULTITHREADED
|
||||
G4MTRunManager* runManager = new G4MTRunManager;
|
||||
//runManager->SetNumberOfThreads(2);
|
||||
#else
|
||||
G4RunManager* runManager = new G4RunManager;
|
||||
#endif
|
||||
|
||||
// set mandatory initialization classes
|
||||
DMXDetectorConstruction* detector = new DMXDetectorConstruction;
|
||||
runManager->SetUserInitialization(detector);
|
||||
runManager->SetUserInitialization(new DMXDetectorConstruction);
|
||||
runManager->SetUserInitialization(new DMXPhysicsList);
|
||||
|
||||
runManager->SetUserInitialization(new DMXActionInitializer());
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
// visualization manager
|
||||
G4VisManager* visManager = new G4VisExecutive;
|
||||
@@ -89,21 +92,7 @@ int main(int argc,char** argv) {
|
||||
G4cout << " Using the DMX gun " << G4endl;
|
||||
#endif
|
||||
|
||||
// set user action classes
|
||||
DMXPrimaryGeneratorAction* DMXGenerator = new DMXPrimaryGeneratorAction;
|
||||
runManager->SetUserAction(DMXGenerator);
|
||||
// runManager->SetUserAction(new DMXPrimaryGeneratorAction);
|
||||
// RunAction is inherited by EventAction for output filenames - will all
|
||||
// change when implement proper analysis manager?
|
||||
DMXRunAction* DMXRun = new DMXRunAction;
|
||||
runManager->SetUserAction(DMXRun);
|
||||
DMXEventAction* eventAction = new DMXEventAction(DMXRun,DMXGenerator);
|
||||
runManager->SetUserAction(eventAction);
|
||||
// eventAction is inherited by SteppingAction in order to switch colour
|
||||
// flag:
|
||||
runManager->SetUserAction(new DMXSteppingAction(eventAction));
|
||||
runManager->SetUserAction(new DMXStackingAction);
|
||||
|
||||
|
||||
//Initialize G4 kernel
|
||||
runManager->Initialize();
|
||||
|
||||
@@ -130,9 +119,13 @@ int main(int argc,char** argv) {
|
||||
UImanager->ApplyCommand(command+fileName);
|
||||
}
|
||||
|
||||
// job termination
|
||||
DMXRun->Finish();
|
||||
G4cout << "Analysis files closed" << G4endl;
|
||||
//Close-out analysis:
|
||||
// Save histograms
|
||||
G4AnalysisManager* man = G4AnalysisManager::Instance();
|
||||
man->Write();
|
||||
man->CloseFile();
|
||||
// Complete clean-up
|
||||
delete G4AnalysisManager::Instance();
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
if(visManager) delete visManager;
|
||||
|
||||
Reference in New Issue
Block a user