Main program of the biasing/B02 example.
More...
#include <iostream>
#include <stdlib.h>
#include "G4RunManager.hh"
#include "G4VPhysicalVolume.hh"
#include "G4UImanager.hh"
#include "G4GeometryManager.hh"
#include "B02DetectorConstruction.hh"
#include "B02ImportanceDetectorConstruction.hh"
#include "FTFP_BERT.hh"
#include "G4ImportanceBiasing.hh"
#include "G4ParallelWorldPhysics.hh"
#include "B02ActionInitialization.hh"
#include "G4GeometrySampler.hh"
#include "G4IStore.hh"
#include "G4VWeightWindowStore.hh"
#include "G4WeightWindowAlgorithm.hh"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
Main program of the biasing/B02 example.
Definition in file exampleB02.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 84 of file exampleB02.cc.
87 if (argc>1) mode = atoi(argv[1]);
89 G4cout <<
" mode not used yet, refer to B01 to see WeightWindow technique " 93 G4int numberOfEvents = 100;
94 G4long myseed = 345354;
96 #ifdef G4MULTITHREADED 97 G4MTRunManager * runManager =
new G4MTRunManager;
98 G4cout <<
" Number of cores: " << G4Threading::G4GetNumberOfCores() << G4endl;
99 G4cout <<
" but using two! " << G4endl;
100 runManager->SetNumberOfThreads(2);
103 G4RunManager * runManager =
new G4RunManager;
106 G4Random::setTheSeed(myseed);
109 B02DetectorConstruction* detector =
new B02DetectorConstruction();
110 runManager->SetUserInitialization(detector);
112 G4String parallelName(
"ParallelBiasingWorld");
113 B02ImportanceDetectorConstruction* pdet =
114 new B02ImportanceDetectorConstruction(parallelName);
115 detector->RegisterParallelWorld(pdet);
117 G4GeometrySampler pgs(pdet->GetWorldVolume(),
"neutron");
119 pgs.SetParallel(
true);
121 G4VModularPhysicsList* physicsList =
new FTFP_BERT;
122 physicsList->RegisterPhysics(
new G4ImportanceBiasing(&pgs,parallelName));
123 physicsList->RegisterPhysics(
new G4ParallelWorldPhysics(parallelName));
125 runManager->SetUserInitialization(physicsList);
129 B02ActionInitialization* actions =
new B02ActionInitialization;
130 runManager->SetUserInitialization(actions);
132 runManager->Initialize();
134 pdet->CreateImportanceStore();
137 G4UImanager* UImanager = G4UImanager::GetUIpointer();
138 G4String command1 =
"/control/cout/setCoutFile threadOut";
139 UImanager->ApplyCommand(command1);
140 G4String command2 =
"/run/beamOn " +
141 G4UIcommand::ConvertToString(numberOfEvents);
142 UImanager->ApplyCommand(command2);
146 G4GeometryManager::GetInstance()->OpenGeometry();