LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
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 54 of file pythia6_decayer.cc.

55 {
56  // Choose the Random engine
57  //
58  G4Random::setTheEngine(new CLHEP::RanecuEngine);
59 
60  // Construct the default run manager
61  //
62  G4RunManager * runManager = new G4RunManager;
63 
64  // Set mandatory initialization classes
65  //
66  runManager->SetUserInitialization(new ExG4DetectorConstruction01);
67 
68  //
69  G4VModularPhysicsList* physicsList = new QGSP_BERT;
70  physicsList->RegisterPhysics(new P6DExtDecayerPhysics());
71  runManager->SetUserInitialization(physicsList);
72 
73 
74  // Set user action classes
75  //
76  runManager->SetUserAction(
77  new ExG4PrimaryGeneratorAction01("B-", 50.*MeV));
78  // B- meson has not defined decay in Geant4
79  runManager->SetUserAction(new ExG4RunAction01);
80  runManager->SetUserAction(new ExG4EventAction01);
81 
82  runManager->Initialize();
83 
84 #ifdef G4VIS_USE
85  // Initialize visualization
86  G4VisManager* visManager = new G4VisExecutive;
87  // G4VisExecutive can take a verbosity argument - see /vis/verbose guidance.
88  // G4VisManager* visManager = new G4VisExecutive("Quiet");
89  visManager->Initialize();
90 #endif
91 
92  // Get the pointer to the User Interface manager
93  //
94  G4UImanager* UImanager = G4UImanager::GetUIpointer();
95 
96  if (argc!=1) {
97  // batch mode{
98  G4String command = "/control/execute ";
99  G4String fileName = argv[1];
100  UImanager->ApplyCommand(command+fileName);
101  }
102  else { // interactive mode : define UI session
103 #ifdef G4UI_USE
104  G4UIExecutive* ui = new G4UIExecutive(argc, argv);
105 #ifdef G4VIS_USE
106  UImanager->ApplyCommand("/control/execute init_vis.mac");
107 #else
108  UImanager->ApplyCommand("/control/execute init.mac");
109 #endif
110  ui->SessionStart();
111  delete ui;
112 #endif
113  }
114 
115 #ifdef G4VIS_USE
116  delete visManager;
117 #endif
118  // Job termination
119  // Free the store: user actions, physics_list and detector_description are
120  // owned and deleted by the run manager, so they should not
121  // be deleted in the main() program !
122  delete runManager;
123 
124  return 0;
125 }