Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:21:52

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 //
0027 /// \file dnadamage1.cc
0028 /// \brief Implementation of the dnadamage1 example
0029 #include "ActionInitialization.hh"
0030 #include "DetectorConstruction.hh"
0031 #include "ParallelWorld.hh"
0032 #include "PhysicsList.hh"
0033 
0034 #include "G4ParallelWorldPhysics.hh"
0035 #include "G4RunManagerFactory.hh"
0036 #include "G4Types.hh"
0037 #include "G4UIExecutive.hh"
0038 #include "G4UImanager.hh"
0039 #include "G4VisExecutive.hh"
0040 
0041 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0042 
0043 int main(int argc, char** argv)
0044 {
0045   // long seed = ((long) time(NULL));
0046   // long enterseed = ((long) time(NULL)) + seed;
0047 
0048   // G4Random::setTheSeed(enterseed);
0049   // G4Random::showEngineStatus();
0050 
0051   std::unique_ptr<G4RunManager> pRunManager(G4RunManagerFactory::CreateRunManager());
0052   pRunManager->SetNumberOfThreads(2);  // by default
0053 
0054   DetectorConstruction* pDetector = new DetectorConstruction();
0055   pDetector->RegisterParallelWorld(new ParallelWorld("ChemistryWorld"));
0056   pRunManager->SetUserInitialization(pDetector);
0057 
0058   PhysicsList* pPhysList = new PhysicsList;
0059   pRunManager->SetUserInitialization(pPhysList);
0060   pRunManager->SetUserInitialization(new ActionInitialization(pDetector));
0061 
0062   std::unique_ptr<G4VisManager> pVisuManager(new G4VisExecutive);
0063   pVisuManager->Initialize();
0064 
0065   G4UImanager* pUImanager = G4UImanager::GetUIpointer();
0066 
0067   if (argc > 1) {
0068     // batch mode
0069     G4String command = "/control/execute ";
0070     G4String fileName = argv[1];
0071     pUImanager->ApplyCommand(command + fileName);
0072   }
0073   else {
0074     // interactive mode
0075     std::unique_ptr<G4UIExecutive> pUi(new G4UIExecutive(argc, argv));
0076     pUImanager->ApplyCommand("/control/execute vis.mac");
0077     pUi->SessionStart();
0078   }
0079   return 0;
0080 }