]> git.uio.no Git - u/mrichter/AliRoot.git/blob - AliGeant4/macro/ag4test.C
Merging the VirtualMC branch to the main development branch (HEAD)
[u/mrichter/AliRoot.git] / AliGeant4 / macro / ag4test.C
1 // $Id$
2 //
3 // Root macro that runs G4 test macro (alirunN.in) specified by macroName.
4 // Available tests:
5 // alirun0.in - standard AliRoot run - all detectors, AliRoot event generator
6 // alirun1.in - interactive particle gun, event visualization - TPC
7 // alirun2.in - lego run - TRD
8 // alirun3.in - geometry test - all detectors (excluded MANY)");
9 // alirun4.in - geometry browser - FRAME;
10
11 void ag4test(const char* macroName)
12 {
13   // Load Geant4 + Geant4 VMC libraries
14   //
15   if (!gInterpreter->IsLoaded("$ALICE/geant4_vmc/examples/macro/g4libs.C")) 
16     gROOT->LoadMacro("$ALICE/geant4_vmc/examples/macro/g4libs.C");
17   g4libs();
18  
19   // Load AliGeant4 library
20   //
21   gSystem->Load("libAliGeant4.so");
22
23   // Create AliGeant4 VMC
24   //  
25   if (!gMC) {
26   
27     // AliRoot run configuration for Geant4
28     AliRunConfiguration* runConfiguration 
29       = new AliRunConfiguration();
30   
31     // TGeant4
32     TGeant4* geant4
33       = new TGeant4("TGeant4", "The Geant4 Monte Carlo", runConfiguration);
34
35     cout << "Geant4 has been created." << endl;
36   }      
37   else 
38     cout << "Monte Carlo has been already created." << endl;
39
40   // Process G4 macro
41   // 
42   ((TGeant4*)gMC)->ProcessGeantMacro(macroName);
43