Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
pythia6_decayer.cc File Reference

Main program of the pythia6Decayer example. More...

#include "P6DExtDecayerPhysics.hh"
#include "ExG4DetectorConstruction01.hh"
#include "ExG4PrimaryGeneratorAction01.hh"
#include "ExG4RunAction01.hh"
#include "ExG4EventAction01.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4ThreeVector.hh"
#include "QGSP_BERT.hh"
#include "G4SystemOfUnits.hh"
#include "Randomize.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Main program of the pythia6Decayer example.

Definition in file pythia6_decayer.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 55 of file pythia6_decayer.cc.

References G4UImanager::ApplyCommand(), G4UImanager::GetUIpointer(), G4VisManager::Initialize(), python.hepunit::MeV, G4VModularPhysicsList::RegisterPhysics(), G4UIExecutive::SessionStart(), CLHEP::HepRandom::setTheEngine(), G4RunManager::SetUserAction(), and G4RunManager::SetUserInitialization().

56 {
57  // Choose the Random engine
58  //
60 
61  // Construct the default run manager
62  //
63  G4RunManager * runManager = new G4RunManager;
64 
65  // Set mandatory initialization classes
66  //
68 
69  //
70 /*
71  G4VUserPhysicsList* physics = new P6DPhysicsList;
72  runManager->SetUserInitialization(physics);
73 */
74  G4VModularPhysicsList* physicsList = new QGSP_BERT;
75  physicsList->RegisterPhysics(new P6DExtDecayerPhysics());
76  runManager->SetUserInitialization(physicsList);
77 
78 
79  // Set user action classes
80  //
81  runManager->SetUserAction(
82  new ExG4PrimaryGeneratorAction01("B-", 50.*MeV));
83  // B- meson has not defined decay in Geant4
84  runManager->SetUserAction(new ExG4RunAction01);
85  runManager->SetUserAction(new ExG4EventAction01);
86  //
87  //G4UserSteppingAction* stepping_action =
88  // new SteppingAction(detector, event_action);
89  //runManager->SetUserAction(stepping_action);
90 
91  // Get the pointer to the User Interface manager
92  //
93  G4UImanager* UImanager = G4UImanager::GetUIpointer();
94 
95  if (argc!=1) {
96  // batch mode{
97  G4String command = "/control/execute ";
98  G4String fileName = argv[1];
99  UImanager->ApplyCommand(command+fileName);
100  }
101  else { // interactive mode : define UI session
102 #ifdef G4UI_USE
103 #ifdef G4VIS_USE
104  G4VisManager* visManager = new G4VisExecutive;
105  visManager->Initialize();
106 #endif
107  G4UIExecutive* ui = new G4UIExecutive(argc, argv);
108 #ifdef G4VIS_USE
109  UImanager->ApplyCommand("/control/execute init_vis.mac");
110 #else
111  UImanager->ApplyCommand("/control/execute init.mac");
112 #endif
113  ui->SessionStart();
114  delete ui;
115 #ifdef G4VIS_USE
116  delete visManager;
117 #endif
118 #endif
119  }
120 
121  // Job termination
122  // Free the store: user actions, physics_list and detector_description are
123  // owned and deleted by the run manager, so they should not
124  // be deleted in the main() program !
125  delete runManager;
126 
127  return 0;
128 }
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
TQGSP_BERT< G4VModularPhysicsList > QGSP_BERT
Definition: QGSP_BERT.hh:63
void RegisterPhysics(G4VPhysicsConstructor *)
Simple detector construction with only a world volume.
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:58
void Initialize()
static void setTheEngine(HepRandomEngine *theNewEngine)
Definition: Random.cc:170
The primary generator class with particle gun.
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:419
virtual void SetUserAction(G4UserRunAction *userAction)