31 #ifdef G4MULTITHREADED 32 # include "G4MTRunManager.hh" 34 # include "G4RunManager.hh" 36 #include "G4UImanager.hh" 37 #include "G4GenericPhysicsList.hh" 38 #include "G4tgrMessenger.hh" 39 #include "G4VisExecutive.hh" 40 #include "G4UIExecutive.hh" 43 #include "Randomize.hh" 44 #include "Shielding.hh" 45 #include "QGSP_BIC.hh" 48 #include "DicomRegularDetectorConstruction.hh" 49 #include "DicomNestedParamDetectorConstruction.hh" 50 #include "DicomPartialDetectorConstruction.hh" 51 #include "Dicom2ActionInitialization.hh" 52 #include "DicomIntersectVolume.hh" 54 # include "DicomFileMgr.hh" 56 # include "DicomHandler.hh" 62 int main(
int argc,
char** argv)
66 G4UIExecutive* ui = 0;
68 ui =
new G4UIExecutive(argc, argv);
71 char*
part = std::getenv(
"DICOM_PARTIAL_PARAM");
72 G4bool bPartial = (part &&
G4String(part) ==
"1") ?
true :
false;
74 CLHEP::HepRandom::setTheEngine(
new CLHEP::MixMaxRng);
75 CLHEP::HepRandom::setTheSeed(G4long(24534575684783));
77 seeds[0] = G4long(534524575674523);
78 seeds[1] = G4long(526345623452457);
79 CLHEP::HepRandom::setTheSeeds(seeds);
82 #ifdef G4MULTITHREADED 83 G4int nthreads = G4GetEnv<G4int>(
"DICOM_NTHREADS", G4Thread::hardware_concurrency());
84 G4MTRunManager* runManager =
new G4MTRunManager;
85 runManager->SetNumberOfThreads(nthreads);
87 G4cout <<
"\n\n\tDICOM2 running in multithreaded mode with " 88 << runManager->GetNumberOfThreads()
89 <<
" threads\n\n" << G4endl;
91 G4RunManager* runManager =
new G4RunManager;
92 G4cout <<
"\n\n\tDICOM running in serial mode\n\n" << G4endl;
95 DicomDetectorConstruction* theGeometry = 0;
98 DicomFileMgr* theFileMgr = 0;
100 DicomHandler* dcmHandler = 0;
107 char* env_inpfile = std::getenv(
"DICOM_INPUT_FILE");
109 inpfile = env_inpfile;
111 theFileMgr = DicomFileMgr::GetInstance();
112 theFileMgr->Convert(inpfile);
115 dcmHandler = DicomHandler::Instance();
116 dcmHandler->CheckFileFormat();
120 char* nest = std::getenv(
"DICOM_NESTED_PARAM" );
121 if( nest &&
G4String(nest) ==
"1" ) {
122 theGeometry =
new DicomNestedParamDetectorConstruction();
124 theGeometry =
new DicomRegularDetectorConstruction();
127 theGeometry =
new DicomPartialDetectorConstruction();
129 runManager->SetUserInitialization(theGeometry);
134 G4VModularPhysicsList* phys =
new Shielding();
135 phys->SetDefaultCutValue(0.5*CLHEP::mm);
136 runManager->SetUserInitialization(phys);
139 runManager->SetUserInitialization(
new Dicom2ActionInitialization());
141 runManager->Initialize();
143 new DicomIntersectVolume();
147 G4VisManager* visManager =
new G4VisExecutive;
150 visManager->Initialize();
153 G4UImanager* UImanager = G4UImanager::GetUIpointer();
162 G4String command =
"/control/execute ";
164 UImanager->ApplyCommand(command+fileName);
168 UImanager->ApplyCommand(
"/control/execute vis.mac");
190 G4cout <<
"\n[" << argv[0] <<
"] Primary execution time: " << t <<
"\n"
int main(int argc, char **argv)
std::vector< TrajPoint > seeds