LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
GunGPS.cc File Reference
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "Randomize.hh"
#include "DetectorConstruction.hh"
#include "PhysicsList.hh"
#include "PrimaryGeneratorGPS.hh"
#include "PrimaryGeneratorGun1.hh"
#include "PrimaryGeneratorGun2.hh"
#include "RunAction.hh"
#include "TrackingAction.hh"
#include "SteppingVerbose.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

int main ( int  argc,
char **  argv 
)

PrimaryGeneratorGPS* prim = new PrimaryGeneratorGPS();

PrimaryGeneratorGun2* prim = new PrimaryGeneratorGun2();

Definition at line 58 of file GunGPS.cc.

References track.

58  {
59 
60  //choose the Random engine
61  CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine);
62 
63  //my Verbose output class
64  G4VSteppingVerbose::SetInstance(new SteppingVerbose);
65 
66  // Construct the default run manager
67  G4RunManager * runManager = new G4RunManager;
68 
69  // set mandatory initialization classes
70  //
72  runManager->SetUserInitialization(detector);
73  runManager->SetUserInitialization(new PhysicsList);
74 
75  // set user action classes
76  //
77  RunAction* run = new RunAction();
79  PrimaryGeneratorGun1* prim = new PrimaryGeneratorGun1();
81  TrackingAction* track = new TrackingAction();
82 
83  runManager->SetUserAction(run);
84  runManager->SetUserAction(prim);
85  runManager->SetUserAction(track);
86 
87  //Initialize G4 kernel
88  runManager->Initialize();
89 
90  // get the pointer to the User Interface manager
91  G4UImanager* UI = G4UImanager::GetUIpointer();
92 
93 #ifdef G4VIS_USE
94  G4VisManager* visManager = new G4VisExecutive;
95  visManager->Initialize();
96 #endif
97 
98  if (argc!=1) // batch mode
99  {
100  G4String command = "/control/execute ";
101  G4String fileName = argv[1];
102  UI->ApplyCommand(command+fileName);
103  }
104 
105  else // define visualization and UI terminal for interactive mode
106  {
107 #ifdef G4UI_USE
108  G4UIExecutive * ui = new G4UIExecutive(argc,argv);
109 #ifdef G4VIS_USE
110  UI->ApplyCommand("/control/execute vis.mac");
111 #endif
112  ui->SessionStart();
113  delete ui;
114 #endif
115 
116 #ifdef G4VIS_USE
117  delete visManager;
118 #endif
119  }
120 
121  // job termination
122  //
123  delete runManager;
124 
125  return 0;
126 }
Float_t track
Definition: plot.C:34