46 #ifdef G4MULTITHREADED 47 #include "G4MTRunManager.hh" 49 #include "G4RunManager.hh" 53 #include "G4UImanager.hh" 54 #include "Randomize.hh" 56 #include "G4GenericPhysicsList.hh" 58 #include "DicomRegularDetectorConstruction.hh" 59 #include "DicomNestedParamDetectorConstruction.hh" 60 #include "DicomPartialDetectorConstruction.hh" 62 #include "DicomActionInitialization.hh" 65 # include "DicomFileMgr.hh" 67 # include "DicomHandler.hh" 70 #include "DicomIntersectVolume.hh" 71 #include "QGSP_BIC.hh" 72 #include "G4tgrMessenger.hh" 74 #include "G4VisExecutive.hh" 75 #include "G4UIExecutive.hh" 77 #include "Shielding.hh" 81 int main(
int argc,
char** argv)
84 G4UIExecutive* ui =
nullptr;
86 ui =
new G4UIExecutive(argc, argv);
90 char*
part = std::getenv(
"DICOM_PARTIAL_PARAM" );
91 G4bool bPartial = FALSE;
92 if( part &&
G4String(part) ==
"1" ) {
96 CLHEP::HepRandom::setTheEngine(
new CLHEP::RanecuEngine);
97 CLHEP::HepRandom::setTheSeed(G4long(24534575684783));
99 seeds[0] = G4long(534524575674523);
100 seeds[1] = G4long(526345623452457);
101 CLHEP::HepRandom::setTheSeeds(seeds);
104 #ifdef G4MULTITHREADED 105 char* nthread_c = std::getenv(
"DICOM_NTHREADS");
107 unsigned nthreads = 4;
108 unsigned env_threads = 0;
110 if(nthread_c) {env_threads=unsigned(G4UIcommand::ConvertToDouble(nthread_c));}
111 if(env_threads > 0) {nthreads=env_threads;}
113 G4MTRunManager* runManager =
new G4MTRunManager;
114 runManager->SetNumberOfThreads(nthreads);
116 G4cout <<
"\n\n\tDICOM running in multithreaded mode with " << nthreads
117 <<
" threads\n\n" << G4endl;
121 G4RunManager* runManager =
new G4RunManager;
122 G4cout <<
"\n\n\tDICOM running in serial mode\n\n" << G4endl;
126 DicomDetectorConstruction* theGeometry = 0;
129 DicomFileMgr* theFileMgr = 0;
131 DicomHandler* dcmHandler = 0;
137 theFileMgr = DicomFileMgr::GetInstance();
138 theFileMgr->Convert(
"Data.dat");
142 dcmHandler = DicomHandler::Instance();
143 dcmHandler->CheckFileFormat();
147 char* nest = std::getenv(
"DICOM_NESTED_PARAM" );
148 if( nest &&
G4String(nest) ==
"1" ) {
149 theGeometry =
new DicomNestedParamDetectorConstruction();
151 theGeometry =
new DicomRegularDetectorConstruction();
154 theGeometry =
new DicomPartialDetectorConstruction();
156 runManager->SetUserInitialization(theGeometry);
161 G4VModularPhysicsList* phys =
new Shielding();
162 runManager->SetUserInitialization(phys);
165 runManager->SetUserInitialization(
new DicomActionInitialization());
167 runManager->Initialize();
169 new DicomIntersectVolume();
172 G4VisManager* visManager =
new G4VisExecutive;
173 visManager->Initialize();
175 G4UImanager* UImanager = G4UImanager::GetUIpointer();
179 UImanager->ApplyCommand(
"/control/execute vis.mac");
185 G4String command =
"/control/execute ";
187 UImanager->ApplyCommand(command+fileName);
std::vector< TrajPoint > seeds
int main(int argc, char **argv)