3 // Configuration macro for running aliroot with Geant4.
4 // All AliRoot specifics are defined in g4ConfigCommon.C
6 // In order to run aliroot with Geant4, you have to Initialize
7 // AliRun with this g4Config.C
10 // root [0] gAlice->Init("g4Config.C");
11 // root [1] gAlice->Run();
13 // You can also start from a mini GUI - g4menu.C.
14 // See description in this macro.
19 // =============================
21 // =============================
23 // Load Geant4 + Geant4 VMC libraries
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()");
37 TG4RunConfiguration* runConfiguration
38 = new TG4RunConfiguration(true);
41 = new TGeant4("TGeant4", "The Geant4 Monte Carlo", runConfiguration);
43 cout << "Geant4 has been created." << endl;
46 cout << "Monte Carlo has been already created." << endl;
48 // Switch on hadron physics
49 geant4->ProcessGeantCommand("/mcPhysics/setHadron true");
51 // Switch on special cuts process
52 geant4->ProcessGeantCommand("/mcPhysics/setSpecialCuts true");
53 geant4->ProcessGeantCommand("/run/particle/applyCuts");
55 // =============================
57 // =============================
59 gROOT->LoadMacro("g4ConfigCommon.C");