Main program of the biasing/B01 example.
More...
#include <iostream>
#include <stdlib.h>
#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 91 of file exampleB01.cc.
94 if (argc>1) mode = atoi(argv[1]);
96 G4int numberOfEvents = 100;
97 G4long myseed = 345354;
99 #ifdef G4MULTITHREADED 100 G4MTRunManager * runManager =
new G4MTRunManager;
101 G4cout <<
" Number of cores: " << G4Threading::G4GetNumberOfCores() << G4endl;
102 G4cout <<
" and using 2 of them! " << G4endl;
103 runManager->SetNumberOfThreads(2);
106 G4RunManager * runManager =
new G4RunManager;
109 G4Random::setTheSeed(myseed);
111 G4VWeightWindowAlgorithm *wwAlg = 0;
114 B01DetectorConstruction* detector =
new B01DetectorConstruction();
115 runManager->SetUserInitialization(detector);
116 G4GeometrySampler mgs(detector->GetWorldVolume(),
"neutron");
118 G4VModularPhysicsList* physicsList =
new FTFP_BERT;
121 physicsList->RegisterPhysics(
new G4ImportanceBiasing(&mgs));
125 wwAlg =
new G4WeightWindowAlgorithm(1,
129 physicsList->RegisterPhysics(
new G4WeightWindowBiasing
130 (&mgs, wwAlg, onBoundary));
133 runManager->SetUserInitialization(physicsList);
137 B01ActionInitialization* actions =
new B01ActionInitialization;
138 runManager->SetUserInitialization(actions);
140 runManager->Initialize();
144 detector->CreateImportanceStore();
148 detector->CreateWeightWindowStore();
154 G4UImanager* UImanager = G4UImanager::GetUIpointer();
155 G4String command1 =
"/control/cout/setCoutFile threadOut";
156 UImanager->ApplyCommand(command1);
157 G4String command2 =
"/run/beamOn " +
158 G4UIcommand::ConvertToString(numberOfEvents);;
159 UImanager->ApplyCommand(command2);
163 G4GeometryManager::GetInstance()->OpenGeometry();