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] AliSimulation sim("$ALICE_ROOT/macros/g4Config.C");
11 // root [1] .... customize your simulation setting here
12 // root [1] sim.Run(10);
14 // You can also start from a mini GUI - g4menu.C.
15 // See description in this macro.
17 // By I. Hrivnacova, IPN Orsay
22 cout << "Running g4Config.C ... " << endl;
26 gROOT->LoadMacro("$ALICE_ROOT/macros/g4ConfigCommon1.C");
29 // Load Geant4 + Geant4 VMC libraries
31 if (gClassTable->GetID("TGeant4") == -1) {
32 // Load Geant4 libraries
33 if (!gInterpreter->IsLoaded("$ALICE/geant4_vmc/examples/macro/g4libs.C")) {
34 gROOT->LoadMacro("$ALICE/geant4_vmc/examples/macro/g4libs.C");
35 gInterpreter->ProcessLine("g4libs()");
43 TG4RunConfiguration* runConfiguration
44 = new TG4RunConfiguration("geomRoot",
45 "QGSP_BERT_EMV+optical",
46 "specialCuts+stackPopper+stepLimiter",
48 // = new TG4RunConfiguration("geomRootToGeant4",
49 // "emStandard+optical",
50 // "specialCuts+specialControls+stackPopper+stepLimiter",
54 geant4 = new TGeant4("TGeant4", "The Geant4 Monte Carlo", runConfiguration);
55 cout << "Geant4 has been created." << endl;
58 cout << "Monte Carlo has been already created." << endl;
61 // Customization of Geant4 VMC
64 geant4->ProcessGeantCommand("/mcPhysics/rangeCuts 0.01 mm");
65 geant4->ProcessGeantCommand("/mcVerbose/all 1");
67 // Uncomment this line to get a detail info from each step
68 //geant4->ProcessGeantCommand("/tracking/verbose 1");
70 // More info from the physics list
71 // the verbosity level is passed to all contained physics lists and their
73 //geant4->ProcessGeantCommand("/mcVerbose/composedPhysicsList 2");
75 // More info from optical processes
76 //geant4->ProcessGeantCommand("/mcVerbose/opticalPhysicsList 3");
78 // More info from geometry building
79 //geant4->ProcessGeantCommand("/mcVerbose/geometryManager 1");
81 // More info from setting geometry properties (in materials and surfaces)
82 // for optical physics
83 //geant4->ProcessGeantCommand("/mcVerbose/opGeometryManager 1");
85 // More info about regions construction
86 // and conversion of VMC cuts in cuts in range per regions
87 //geant4->ProcessGeantCommand("/mcVerbose/regionsManager 2");
89 // Suppress verbose info from tracks which reached maximum number of steps
90 // (default value is 30000)
91 geant4->ProcessGeantCommand("/mcTracking/loopVerbose 0");
93 // AliRoot event generator
94 // (it has to be created after MC, as it may use decayer via VMC)
96 gROOT->LoadMacro("$ALICE_ROOT/macros/g4ConfigCommon2.C");
99 cout << "Running g4Config.C finished ... " << endl;