55 #ifdef G4MULTITHREADED 56 #include "G4MTRunManager.hh" 58 #include "G4RunManager.hh" 61 #include "G4VPhysicalVolume.hh" 62 #include "G4UImanager.hh" 63 #include "G4GeometryManager.hh" 66 #include "B02DetectorConstruction.hh" 67 #include "B02ImportanceDetectorConstruction.hh" 68 #include "FTFP_BERT.hh" 69 #include "G4ImportanceBiasing.hh" 70 #include "G4ParallelWorldPhysics.hh" 72 #include "B02ActionInitialization.hh" 77 #include "G4GeometrySampler.hh" 78 #include "G4IStore.hh" 79 #include "G4VWeightWindowStore.hh" 80 #include "G4WeightWindowAlgorithm.hh" 84 int main(
int argc,
char **argv)
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();
int main(int argc, char **argv)