Main program of the biasing/B01 example.
More...
#include <iostream>
#include <stdlib.h>
#include "G4Types.hh"
#include "G4RunManager.hh"
#include "G4VPhysicalVolume.hh"
#include "G4UImanager.hh"
#include "G4GeometryManager.hh"
#include "B01DetectorConstruction.hh"
#include "FTFP_BERT.hh"
#include "G4ImportanceBiasing.hh"
#include "G4WeightWindowBiasing.hh"
#include "B01ActionInitialization.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/B01 example.
Definition in file exampleB01.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 92 of file exampleB01.cc.
95 if (argc>1) mode = atoi(argv[1]);
97 G4int numberOfEvents = 100;
98 G4long myseed = 345354;
100 #ifdef G4MULTITHREADED 101 G4MTRunManager * runManager =
new G4MTRunManager;
102 G4cout <<
" Number of cores: " << G4Threading::G4GetNumberOfCores() << G4endl;
103 G4cout <<
" and using 2 of them! " << G4endl;
104 runManager->SetNumberOfThreads(2);
107 G4RunManager * runManager =
new G4RunManager;
110 G4Random::setTheSeed(myseed);
112 G4VWeightWindowAlgorithm *wwAlg = 0;
115 B01DetectorConstruction* detector =
new B01DetectorConstruction();
116 runManager->SetUserInitialization(detector);
117 G4GeometrySampler mgs(detector->GetWorldVolume(),
"neutron");
119 G4VModularPhysicsList* physicsList =
new FTFP_BERT;
122 physicsList->RegisterPhysics(
new G4ImportanceBiasing(&mgs));
126 wwAlg =
new G4WeightWindowAlgorithm(1,
130 physicsList->RegisterPhysics(
new G4WeightWindowBiasing
131 (&mgs, wwAlg, onBoundary));
134 runManager->SetUserInitialization(physicsList);
138 B01ActionInitialization* actions =
new B01ActionInitialization;
139 runManager->SetUserInitialization(actions);
141 runManager->Initialize();
145 detector->CreateImportanceStore();
149 detector->CreateWeightWindowStore();
155 G4UImanager* UImanager = G4UImanager::GetUIpointer();
156 G4String command1 =
"/control/cout/setCoutFile threadOut";
157 UImanager->ApplyCommand(command1);
158 G4String command2 =
"/run/beamOn " +
159 G4UIcommand::ConvertToString(numberOfEvents);;
160 UImanager->ApplyCommand(command2);
164 G4GeometryManager::GetInstance()->OpenGeometry();