46 #include "ML2PrimaryGenerationAction.hh" 47 #include "ML2WorldConstruction.hh" 48 #include "ML2PhysicsList.hh" 49 #include "ML2SteppingAction.hh" 50 #include "ML2EventAction.hh" 51 #include "ML2TrackingAction.hh" 53 #include "G4UImanager.hh" 58 #include "G4VisExecutive.hh" 61 #include "G4UIExecutive.hh" 67 void visio(
int argc,
char* argv[])
69 G4VisManager *visManager=
new G4VisExecutive;
70 visManager->Initialize();
72 G4UIExecutive *ui =
new G4UIExecutive(argc, argv);
73 G4UImanager *UImanager = G4UImanager::GetUIpointer();
74 UImanager->ApplyCommand(
"/control/execute vis.mac");
82 int main(
int argc,
char* argv[])
85 CML2WorldConstruction *myWorld=CML2WorldConstruction::GetInstance();
87 G4RunManager *runManager=
new G4RunManager();
88 ML2PhysicsList *physics=
new ML2PhysicsList();
89 runManager->SetUserInitialization(physics);
92 CML2PrimaryGenerationAction *gun;
93 gun = CML2PrimaryGenerationAction::GetInstance();
96 CML2CInputData *myInputData;
97 myInputData=
new CML2CInputData();
100 gun->inizialize(&myInputData->inputData.primaryParticleData);
105 myInputData->inputData.generalData.seed=1;
106 myInputData->inputData.generalData.StartFileInputData=
"ml2.mac";
110 myInputData->inputData.generalData.seed=1;
111 myInputData->inputData.generalData.StartFileInputData=(
G4String)argv[1];
115 sscanf(argv[2],
"%d", &myInputData->inputData.generalData.seed);
116 myInputData->inputData.generalData.StartFileInputData=(
G4String)argv[1];
120 G4UImanager* UImanager = G4UImanager::GetUIpointer();
121 G4String command =
"/control/execute ";
122 UImanager->ApplyCommand(command+myInputData->inputData.generalData.StartFileInputData);
126 CLHEP::HepRandom::setTheEngine(
new CLHEP::RanecuEngine);
127 CLHEP::HepRandom :: setTheSeed(myInputData->inputData.generalData.seed);
130 if (!myWorld->create(&myInputData->inputData, myInputData->getbOnlyVisio()))
137 gun->design(myWorld->getCML2AcceleratorConstruction()->getAcceleratorIsoCentre());
141 CML2Convergence *convergence=
new CML2Convergence(myInputData->inputData.generalData.seed, myInputData->inputData.generalData.saving_in_Selected_Voxels_every_events, myInputData->inputData.generalData.fileExperimentalData, myInputData->inputData.generalData.fileExperimentalDataOut, myInputData->inputData.generalData.bCompareExp, myInputData->inputData.generalData.maxNumberOfEvents, gun->getNrecycling(), myInputData->inputData.generalData.nMaxLoop);
145 CML2RunAction *myRunAction=
new CML2RunAction(convergence, myInputData->inputData.generalData.nBeam, myInputData->bOnlyVisio);
147 CML2SteppingAction *myStepAction=
new CML2SteppingAction(convergence);
148 CML2EventAction *ML2EventAction =
new CML2EventAction();
150 runManager->SetUserInitialization(myWorld);
151 runManager->SetUserAction(myRunAction);
152 runManager->SetUserAction(gun);
153 runManager->SetUserAction(myStepAction);
154 runManager->SetUserAction(ML2EventAction);
155 runManager->SetUserAction(
new CML2TrackingAction);
156 runManager->Initialize();
161 G4double loopElapsedTime;
162 G4bool bStopRun=
false;
163 G4bool bNewGeometry=
true;
164 if (myInputData->bOnlyVisio)
168 myWorld->newGeometry();
169 convergence->setNewGeometry();
179 bNewGeometry=myWorld->newGeometry();
180 convergence->setNewGeometry();
183 if (CML2PhantomConstruction::GetInstance()->getPhantomName()!=
"Dicom1")
184 {CML2WorldConstruction::GetInstance()->checkVolumeOverlap();}
185 std::cout<<
"################ START NEW GEOMETRY ########################"<<
'\n';
186 myRunAction->setActualLoop(nLoop);
189 runManager->BeamOn(myInputData->inputData.generalData.nBeam);
191 bStopRun=convergence->stopRun();
194 std::cout<<
"################ END NEW GEOMETRY ########################"<<
'\n';
199 loopElapsedTime=MyFullTime.GetUserElapsed();
200 std::cout <<
"loop elapsed time [s] : "<< loopElapsedTime <<
'\n';
int main(int argc, char *argv[])