Geant4  10.02.p03
channeling.cc File Reference
Include dependency graph for channeling.cc:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 64 of file channeling.cc.

65 {
66  // Construct the default run manager
67 #ifdef G4MULTITHREADED
68  G4MTRunManager* runManager = new G4MTRunManager;
69  if(argv[2]){
70  if(atoi(argv[2])>0){
71  runManager->SetNumberOfThreads(atoi(argv[2]));
72  }
73  }
74  G4cout << "MT MODE ON " << runManager->GetNumberOfThreads() << G4endl;
75 #else
76  G4RunManager* runManager = new G4RunManager;
77  G4cout << "MT MODE OFF" << G4endl;
78 #endif
79 
80  // Activate UI-command base scorer
82  scManager->SetVerboseLevel(0);
83 
84  // Choose the Random engine
85 #ifndef G4MULTITHREADED
87 #endif
88 
89  // Set mandatory initialization classes
90  G4VUserDetectorConstruction* detector =
92  runManager->SetUserInitialization(detector);
93  runManager->SetUserInitialization(new ExExChPhysicsList());
94 
95 #ifndef G4MULTITHREADED
96  // Set user action classes
98  runManager->SetUserAction(new ExExChEventAction());
99  runManager->SetUserAction(new ExExChStackingAction());
100  runManager->SetUserAction(new ExExChTrackingAction());
101  runManager->SetUserAction(new ExExChRunAction());
102 #else
103  runManager->SetUserInitialization(
104  new ExExChUserActionInitialization());
105 #endif
106 
107  // Get the pointer to the User Interface manager
109 
110  if(argc!=1) {
111  // Batch mode
112  G4String command = "/control/execute ";
113  G4String fileName = argv[1];
114  UI->ApplyCommand(command+fileName);
115  }
116 
117  else {
118  // Define visualization and UI terminal for interactive mode
119 #ifdef G4VIS_USE
120  G4VisManager* visManager = new G4VisExecutive;
121  visManager->Initialize();
122 #endif
123 
124 #ifdef G4UI_USE
125  G4UIExecutive * ui = new G4UIExecutive(argc,argv);
126  ui->SessionStart();
127  delete ui;
128 #endif
129 
130 #ifdef G4VIS_USE
131  delete visManager;
132 #endif
133  }
134 
135  // Job termination
136  delete runManager;
137 
138  return 0;
139 }
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
void SetNumberOfThreads(G4int n)
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:58
G4GLOB_DLL std::ostream G4cout
G4int GetNumberOfThreads() const
void Initialize()
#define G4endl
Definition: G4ios.hh:61
static void setTheEngine(HepRandomEngine *theNewEngine)
Definition: Random.cc:171
static G4ScoringManager * GetScoringManager()
void SetVerboseLevel(G4int vl)
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:446
virtual void SetUserAction(G4UserRunAction *userAction)
Here is the call graph for this function: