64 #ifdef G4MULTITHREADED 65 #include "G4MTRunManager.hh" 67 #include "G4RunManager.hh" 70 #include "G4VPhysicalVolume.hh" 71 #include "G4UImanager.hh" 72 #include "G4GeometryManager.hh" 75 #include "B01DetectorConstruction.hh" 76 #include "FTFP_BERT.hh" 77 #include "G4ImportanceBiasing.hh" 78 #include "G4WeightWindowBiasing.hh" 80 #include "B01ActionInitialization.hh" 85 #include "G4GeometrySampler.hh" 86 #include "G4IStore.hh" 87 #include "G4VWeightWindowStore.hh" 88 #include "G4WeightWindowAlgorithm.hh" 92 int main(
int argc,
char **argv)
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();
int main(int argc, char **argv)