Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
XrayFluoSimulation Class Reference

#include <XrayFluoSimulation.hh>

Public Member Functions

 XrayFluoSimulation (G4int seed)
 
 ~XrayFluoSimulation ()
 
void RunSimulation (int argc, char *argv[])
 

Detailed Description

Definition at line 40 of file XrayFluoSimulation.hh.

Constructor & Destructor Documentation

XrayFluoSimulation::XrayFluoSimulation ( G4int  seed)

Definition at line 63 of file XrayFluoSimulation.cc.

63  :dir(seed)
64 {;}
long seed
Definition: chem4.cc:68
XrayFluoSimulation::~XrayFluoSimulation ( )

Definition at line 67 of file XrayFluoSimulation.cc.

68 {;}

Member Function Documentation

void XrayFluoSimulation::RunSimulation ( int  argc,
char *  argv[] 
)

Definition at line 70 of file XrayFluoSimulation.cc.

71 {
72  // choose the Random engine
73  G4Random::setTheEngine(new CLHEP::RanecuEngine);
74  G4Random::setTheSeed(dir);
75 
76 #ifdef G4MULTITHREADED
77  // Construct the default run manager
78  G4MTRunManager* runManager = new G4MTRunManager();
79  G4cout << "Using the MT Run Manager (G4MULTITHREADED=ON)" << G4endl;
80 #else
81  G4RunManager * runManager = new G4RunManager;
82  G4cout << "Using the sequential Run Manager" << G4endl;
83 #endif
84 
85 
86  // chosing Geometry setup
87  G4int geometryNumber = 0;
88 
89  if (argc == 3){
90  geometryNumber = atoi(argv[2]);
91 
92  }
93  while ( (geometryNumber < 1) || (geometryNumber >4)) {
94  G4cout << "Please Select Simulation Geometrical Set-Up: "<< G4endl;
95  G4cout << "1 - Test Beam" << G4endl;
96  G4cout << "2 - Infinite Plane" << G4endl;
97  G4cout << "3 - Planet and Sun"<< G4endl;
98  G4cout << "4 - Phase-Space Production"<< G4endl;
99 
100  G4cin >> geometryNumber;
101  }
102 
103  // set analysis to have the messenger running...
104  XrayFluoAnalysisManager* analysis =
106 
107  // set mandatory initialization
108 
109  //Initialize geometry
110  if (geometryNumber == 1 || geometryNumber == 4) {
111  XrayFluoDetectorConstruction* testBeamDetector
113  if (geometryNumber == 4) {
114  testBeamDetector->PhaseSpaceOn();
115  analysis->PhaseSpaceOn();
116  }
117  runManager->SetUserInitialization(testBeamDetector);
118  }
119  else if (geometryNumber == 2) {
122  runManager->SetUserInitialization(planeDetector);
123  }
124  else if (geometryNumber == 3) {
125  XrayFluoMercuryDetectorConstruction* mercuryDetector =
127  runManager->SetUserInitialization(mercuryDetector);
128  }
129 
130 
131  //Initialize physics
132  runManager->SetUserInitialization(new XrayFluoPhysicsList());
133 
134  //Initialize actions
135  runManager->SetUserInitialization
136  (new XrayFluoActionInitializer(geometryNumber));
137 
138 #ifdef G4VIS_USE
139  //visualization manager
140  G4VisManager* visManager = new G4VisExecutive;
141  visManager->Initialize();
142 #endif
143 
144  // get the pointer to the User Interface manager
145  G4UImanager* UImanager = G4UImanager::GetUIpointer();
146 
147  if (getenv("G4VIS_USE")) {
148  UImanager->ApplyCommand("/control/execute vis.mac");
149  }
150 
151  if (argc == 1) // Define UI session for interactive mode.
152  {
153  UImanager->ApplyCommand("/control/execute initInter.mac");
154 #ifdef G4UI_USE
155  G4UIExecutive* ui = new G4UIExecutive(argc, argv);
156  ui->SessionStart();
157  delete ui;
158 #endif
159  }
160  else // Batch mode
161  {
162  G4String command = "/control/execute ";
163  G4String fileName = argv[1];
164  UImanager->ApplyCommand(command+fileName);
165  }
166 
167  // job termination
168 #ifdef G4VIS_USE
169  delete visManager;
170  G4cout << "visManager deleted"<< G4endl;
171 #endif
172 
173 
174  delete runManager;
175 
176 
177 }
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
int G4int
Definition: G4Types.hh:78
static XrayFluoDetectorConstruction * GetInstance()
static XrayFluoMercuryDetectorConstruction * GetInstance()
static XrayFluoPlaneDetectorConstruction * GetInstance()
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:59
#define G4cin
Definition: G4ios.hh:60
G4GLOB_DLL std::ostream G4cout
static XrayFluoAnalysisManager * getInstance()
void Initialize()
#define G4endl
Definition: G4ios.hh:61
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:447

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files: