LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
dnadamage1.cc File Reference

Implementation of the dnadamage1 example. More...

#include "G4Types.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4UIExecutive.hh"
#include "G4VisExecutive.hh"
#include "G4ParallelWorldPhysics.hh"
#include "ActionInitialization.hh"
#include "DetectorConstruction.hh"
#include "ParallelWorld.hh"
#include "PhysicsList.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Implementation of the dnadamage1 example.

Definition in file dnadamage1.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 46 of file dnadamage1.cc.

47 {
48  //long seed = ((long) time(NULL));
49  //long enterseed = ((long) time(NULL)) + seed;
50 
51  //G4Random::setTheSeed(enterseed);
52  //G4Random::showEngineStatus();
53 
54 #ifdef G4MULTITHREADED
55  std::unique_ptr<G4MTRunManager> pRunManager(new G4MTRunManager);
56  pRunManager->SetNumberOfThreads(2);//by default
57 #else
58  std::unique_ptr<G4RunManager> pRunManager(new G4RunManager);
59 #endif
60 
61  DetectorConstruction* pDetector = new DetectorConstruction();
62  pDetector->RegisterParallelWorld(new ParallelWorld("ChemistryWorld"));
63  pRunManager->SetUserInitialization(pDetector);
64 
65  PhysicsList* pPhysList = new PhysicsList;
66  pRunManager->SetUserInitialization(pPhysList);
67  pRunManager->SetUserInitialization(new ActionInitialization(pDetector));
68 
69  std::unique_ptr<G4VisManager> pVisuManager(new G4VisExecutive);
70  pVisuManager->Initialize();
71 
72  G4UImanager* pUImanager = G4UImanager::GetUIpointer();
73 
74  if (argc > 1)
75  {
76 // batch mode
77  G4String command = "/control/execute ";
78  G4String fileName = argv[1];
79  pUImanager->ApplyCommand(command+fileName);
80  }
81  else
82  {
83 // interactive mode
84  std::unique_ptr<G4UIExecutive> pUi(new G4UIExecutive(argc, argv));
85  pUImanager->ApplyCommand("/control/execute vis.mac");
86  pUi->SessionStart();
87  }
88  return 0;
89 }
TConfigurablePhysicsList< ModularPhysicsList > PhysicsList
Definition: PhysicsList.h:83