/// \file exampleB3b.cc /// \brief Main program of the B3b example #include "G4Types.hh" #include "G4RunManagerFactory.hh" #include "G4UImanager.hh" #include "G4VisExecutive.hh" #include "G4UIExecutive.hh" #include "Shielding.hh" #include "Randomize.hh" #include "B3DetectorConstruction.hh" #include "B3PhysicsList.hh" #include "B3bActionInitialization.hh" // #include "G4TScoreNtupleWriter.hh" #include "G4ScoringManager.hh" // #include "g4csv.hh" // #include "g4analysis.hh" //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... int main(int argc,char** argv) { G4UImanager* UImanager = G4UImanager::GetUIpointer(); // batch mode G4String command = "/control/execute "; G4String fileName = argv[1]; // Optionally: choose a different Random engine... // G4Random::setTheEngine(new CLHEP::MTwistEngine); auto* runManager = G4RunManagerFactory::CreateRunManager(G4RunManagerType::Default); runManager->SetUserInitialization(new B3DetectorConstruction); G4ScoringManager::GetScoringManager(); runManager->SetUserInitialization(new B3PhysicsList); runManager->SetUserInitialization(new B3bActionInitialization()); // for( int i = 0; i < 180; i = i + 1) // { // char str[50]; // sprintf(str, "/rotPhantom/Deg %f deg", (double) i); // UImanager->ApplyCommand(str); // UImanager->ApplyCommand("/run/beamOn 10000000"); // char writer1[100]; // char writer2[100]; // char writer3[100]; // sprintf(writer1, "/score/dumpQuantityToFile pix1 eDep det1_the%d.csv", (int) i); // sprintf(writer2, "/score/dumpQuantityToFile pix2 eDep det2_the%d.csv", (int) i); // sprintf(writer3, "/score/dumpQuantityToFile pix3 eDep det3_the%d.csv", (int) i); // UImanager->ApplyCommand(writer1); // UImanager->ApplyCommand(writer2); // UImanager->ApplyCommand(writer3); // } // UImanager->ApplyCommand("/run/numberOfThreads 10"); // UImanager->ApplyCommand("/rotPhantom/angleDeg 45 deg"); // UImanager->ApplyCommand("/run/initialize"); // UImanager->ApplyCommand(command+fileName); // UImanager->ApplyCommand("/run/beamOn 1000000"); // UImanager->ApplyCommand("/score/dumpQuantityToFile pix1 eDep det1_0.csv"); // UImanager->ApplyCommand("/rotPhantom/angleDeg 0 deg"); // // runManager->InitializeGeometry(); // UImanager->ApplyCommand("/run/initialize"); UImanager->ApplyCommand(command+fileName); UImanager->ApplyCommand("/rotPhantom/angleDeg 0 deg"); runManager->InitializeGeometry(); runManager->Initialize(new B3DetectorConstruction); // UImanager->ApplyCommand("/run/initialize"); UImanager->ApplyCommand("/run/beamOn 4"); UImanager->ApplyCommand("/score/dumpQuantityToFile pix1 eDep det1_1.csv"); delete runManager; } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....