]> git.uio.no Git - u/mrichter/AliRoot.git/blob - AliGeant4/aligeant4.cxx
Merging the VirtualMC branch to the main development branch (HEAD)
[u/mrichter/AliRoot.git] / AliGeant4 / aligeant4.cxx
1 // $Id$
2
3 #include "AliRunConfiguration.h"
4 #include "AliFiles.h"
5 #include "AliRun.h"
6
7 #include "TGeant4.h"
8 #include "TG4RunManager.h"
9
10 int main(int argc, char** argv) 
11 {
12   // AliRun
13   AliRun* run
14     = new AliRun("gAlice","The Alice run manager");
15   G4cout << "AliRun has been created." << G4endl;
16
17   // AliRunConfiguration for Geant4
18   AliRunConfiguration* runConfiguration 
19     = new AliRunConfiguration();
20   G4cout << "AliRunConfiguration has been created." << G4endl;
21    
22   // Geant4 ======================
23
24   // TGeant4
25   new TGeant4("TGeant4", "The Geant4 Monte Carlo",
26               runConfiguration, argc, argv );
27   G4cout << "TGeant4 has been created." << G4endl;
28   
29   // start UI ===================
30
31   TG4RunManager* runManager = TG4RunManager::Instance();
32
33   // Root interactive session
34   //runManager->StartRootUI();
35
36   // Geant4 interactive session
37   runManager->StartGeantUI();
38
39   delete run;
40   //runConfiguration is deleted in TG4RunManager
41   //geant4 is deleted in AliRun destructor 
42
43   G4cout << "Everything has been deleted." << G4endl;
44   return 0;
45 }
46