]> git.uio.no Git - u/mrichter/AliRoot.git/blame - AliGeant4/macro/g4Config.C
Merging the VirtualMC branch to the main development branch (HEAD)
[u/mrichter/AliRoot.git] / AliGeant4 / macro / g4Config.C
CommitLineData
b9d0a01d 1// $Id$
2//
3// Configuration macro for running aliroot with Geant4.
4// All AliRoot specifics are defined in g4ConfigCommon.C
5//
6// In order to run aliroot with Geant4, you have to Initialize
7// AliRun with this g4Config.C
8//
9// aliroot
10// root [0] gAlice->Init("g4Config.C");
11// root [1] gAlice->Run();
12//
13// You can also start from a mini GUI - g4menu.C.
14// See description in this macro.
15
16
0f507a31 17void Config()
18{
0f507a31 19 // =============================
20 // Geant4
21 // =============================
22
b9d0a01d 23 // Load Geant4 + Geant4 VMC libraries
661c4fa9 24 //
b9d0a01d 25 if (gClassTable->GetID("TGeant4") == -1) {
26 // Load Geant4 libraries
27 if (!gInterpreter->IsLoaded("$ALICE/geant4_vmc/examples/macro/g4libs.C")) {
28 gROOT->LoadMacro("$ALICE/geant4_vmc/examples/macro/g4libs.C");
29 gInterpreter->ProcessLine("g4libs()");
30 }
31 }
0f507a31 32
b9d0a01d 33 // Create Geant4 VMC
34 //
35 if (!gMC) {
0f507a31 36
b9d0a01d 37 TG4RunConfiguration* runConfiguration
38 = new TG4RunConfiguration(true);
39
40 TGeant4* geant4
41 = new TGeant4("TGeant4", "The Geant4 Monte Carlo", runConfiguration);
0f507a31 42
b9d0a01d 43 cout << "Geant4 has been created." << endl;
44 }
45 else
46 cout << "Monte Carlo has been already created." << endl;
0f507a31 47
48 // =============================
b9d0a01d 49 // AliRoot setup
0f507a31 50 // =============================
51
b9d0a01d 52 gROOT->LoadMacro("g4ConfigCommon.C");
53 ConfigCommon(false);
661c4fa9 54}