Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-03 07:44:41

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 /// \file Hadr10.cc
0027 /// \brief Main program of the hadronic/Hadr10 example
0028 
0029 #include "ActionInitialization.hh"
0030 #include "CLHEP/Random/MTwistEngine.h"
0031 #include "CLHEP/Random/Ranlux64Engine.h"
0032 #include "DetectorConstruction.hh"
0033 
0034 #include "G4PhysListFactory.hh"
0035 #include "G4RunManagerFactory.hh"
0036 #include "G4Threading.hh"
0037 #include "G4UImanager.hh"
0038 
0039 int main(int argc, char** argv)
0040 {
0041   CLHEP::Ranlux64Engine defaultEngine(1234567, 4);
0042   CLHEP::HepRandom::setTheEngine(&defaultEngine);
0043   G4int seed = time(NULL);
0044   CLHEP::HepRandom::setTheSeed(seed);
0045   G4cout << G4endl << " ===================================================== " << G4endl
0046          << " Initial seed = " << seed << G4endl
0047          << " ===================================================== " << G4endl << G4endl;
0048 
0049   auto* runManager = G4RunManagerFactory::CreateRunManager();
0050   // runManager->SetNumberOfThreads(4);
0051 
0052   DetectorConstruction* pDetectorInstance = new DetectorConstruction;
0053   runManager->SetUserInitialization(pDetectorInstance);
0054 
0055   // Physics list factory: use the PHYSLIST environmental variable.
0056   G4PhysListFactory factory;
0057   G4VModularPhysicsList* thePL = factory.ReferencePhysList();
0058 
0059   runManager->SetUserInitialization(thePL);
0060   runManager->SetUserInitialization(new ActionInitialization);
0061 
0062   G4UImanager* UI = G4UImanager::GetUIpointer();
0063   if (argc == 1) {
0064     // Define UI session for interactive mode.
0065   }
0066   else {
0067     // Batch mode
0068     G4String command = "/control/execute ";
0069     G4String fileName = argv[1];
0070     UI->ApplyCommand(command + fileName);
0071   }
0072 
0073   // job termination
0074   delete runManager;
0075   return 0;
0076 }
0077 
0078 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......