-
Notifications
You must be signed in to change notification settings - Fork 0
/
GRAiNTIA.cc
63 lines (45 loc) · 1.43 KB
/
GRAiNTIA.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include <G4RunManagerFactory.hh>
#include <G4UIExecutive.hh>
#include <G4VisExecutive.hh>
#include <G4UImanager.hh>
#include <FTFP_BERT.hh>
#include <G4ScoringManager.hh>
#include "GRAiNTIADetectorConstruction.hh"
#include "GRAiNTIAActionInitialization.hh"
#include "GRAiNTIACommander.hh"
int main(int argc, char **argv)
{
G4UIExecutive* ui = new G4UIExecutive(argc, argv);
G4RunManager* runManager = G4RunManagerFactory::CreateRunManager(G4RunManagerType::Serial);
runManager->SetUserInitialization(new GRAiNTIADetectorConstruction());
runManager->SetUserInitialization(new FTFP_BERT());
runManager->SetUserInitialization(new GRAiNTIAActionInitialization());
//initialize Scorin manager
G4ScoringManager * scManager = G4ScoringManager::GetScoringManager();
scManager->SetVerboseLevel(1);
G4VisManager* visManager = new G4VisExecutive;
visManager->Initialise();
G4UImanager* UImanager = G4UImanager::GetUIpointer();
if(argc == 2)
{
G4String macro = argv[1];
if(macro != "comander")
{
G4String command = "/control/execute ";
UImanager->ApplyCommand(command + macro);
}
else
{
runComands();
}
}
else
{
UImanager->ApplyCommand("/control/execute init_vis.mac");
ui->SessionStart();
delete ui;
}
delete visManager;
delete runManager;
return 0;
}