63 #ifdef G4MULTITHREADED 64 #include "G4MTRunManager.hh" 66 #include "G4RunManager.hh" 69 #include "G4VPhysicalVolume.hh" 70 #include "G4UImanager.hh" 71 #include "G4GeometryManager.hh" 74 #include "B01DetectorConstruction.hh" 75 #include "FTFP_BERT.hh" 76 #include "G4ImportanceBiasing.hh" 77 #include "G4WeightWindowBiasing.hh" 79 #include "B01ActionInitialization.hh" 84 #include "G4GeometrySampler.hh" 85 #include "G4IStore.hh" 86 #include "G4VWeightWindowStore.hh" 87 #include "G4WeightWindowAlgorithm.hh" 91 int main(
int argc,
char **argv)
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();
int main(int argc, char **argv)