3 // Configuration macro for running aliroot with Geant4
4 // with primary events read from external file.
6 // By I. Hrivnacova, IPN Orsay
11 cout << "Running g4Config.C ... " << endl;
15 gROOT->LoadMacro("$ALICE_ROOT/test/vmctest/ppbench/commonConfig.C");
18 // Load Geant4 + Geant4 VMC libraries
20 if (gClassTable->GetID("TGeant4") == -1) {
21 // Load Geant4 libraries
22 if (!gInterpreter->IsLoaded("$ALICE/geant4_vmc/examples/macro/g4libs.C")) {
23 gROOT->LoadMacro("$ALICE/geant4_vmc/examples/macro/g4libs.C");
24 gInterpreter->ProcessLine("g4libs()");
32 TG4RunConfiguration* runConfiguration
33 = new TG4RunConfiguration("geomRoot",
34 "QGSP_BERT_EMV+optical",
35 "specialCuts+stackPopper+stepLimiter",
37 // = new TG4RunConfiguration("geomRootToGeant4",
38 // "QGSP_BERT_EMV+optical",
39 // "specialCuts+specialControls+stackPopper+stepLimiter",
43 geant4 = new TGeant4("TGeant4", "The Geant4 Monte Carlo", runConfiguration);
44 cout << "Geant4 has been created." << endl;
47 cout << "Monte Carlo has been already created." << endl;
50 // Customization of Geant4 VMC
53 //geant4->ProcessGeantCommand("/mcPhysics/rangeCuts 0.01 mm");
54 geant4->ProcessGeantCommand("/mcVerbose/all 1");
55 geant4->ProcessGeantCommand("/mcVerbose/geometryManager 2");
56 geant4->ProcessGeantCommand("/mcVerbose/opGeometryManager 1");
57 geant4->ProcessGeantCommand("/mcTracking/loopVerbose 0");
58 geant4->ProcessGeantCommand("/mcPhysics/rangeCuts 0.01 mm");
59 //geant4->ProcessGeantCommand("/mcPhysics/rangeCuts 1 mm");
60 geant4->ProcessGeantCommand("/mcPhysics/selectOpProcess Scintillation");
61 geant4->ProcessGeantCommand("/mcPhysics/setOpProcessActivation false");
62 geant4->ProcessGeantCommand("/mcTracking/skipNeutrino true");
63 //geant4->ProcessGeantCommand("/mcMagField/stepperType HelixImplicitEuler");
64 //geant4->ProcessGeantCommand("/mcMagField/stepperType HelixSimpleRunge");
66 // Uncomment this line to get a detail info from each step
67 // geant4->ProcessGeantCommand("/tracking/verbose 1");
69 // More info from the physics list
70 // the verbosity level is passed to all contained physics lists and their
72 geant4->ProcessGeantCommand("/mcVerbose/composedPhysicsList 2");
74 // More info from optical processes
75 //geant4->ProcessGeantCommand("/mcVerbose/opticalPhysicsList 3");
77 // More info from geometry building
78 //geant4->ProcessGeantCommand("/mcVerbose/geometryManager 1");
80 // More info from setting geometry properties (in materials and surfaces)
81 // for optical physics
82 //geant4->ProcessGeantCommand("/mcVerbose/opGeometryManager 1");
84 // More info about regions construction
85 // and conversion of VMC cuts in cuts in range per regions
86 //geant4->ProcessGeantCommand("/mcVerbose/regionsManager 2");
87 //geant4->ProcessGeantCommand("/mcRegions/print true");
90 // Suppress verbose info from tracks which reached maximum number of steps
91 // (default value is 30000)
92 //geant4->ProcessGeantCommand("/mcTracking/loopVerbose 0");
97 geant4->ProcessGeantCommand("/run/particle/applyCuts");
98 // geant4->ProcessGeantCommand("/mcVerbose/geometryManager 2");
100 geant4->ProcessGeantCommand("/mcVerbose/composedPhysicsList 2");
101 geant4->ProcessGeantCommand("/mcDet/volNameSeparator !");
102 geant4->ProcessGeantCommand("/mcPhysics/setStackPopperSelection e+ e- pi+ pi- kaon+ kaon- gamma");
103 //geant4->ProcessGeantCommand("/tracking/verbose 1");
105 geant4->ProcessGeantCommand("/mcControl/g3Defaults");
106 !!!!n Generates warnings:
108 G4ProcessTable::Insert : arguments are 0 pointer
109 G4ProcessTable::Insert : arguments are 0 pointer
110 G4ProcessTable::Insert : arguments are 0 pointer
111 G4ProcessTable::Insert : arguments are 0 pointer
112 G4ProcessTable::Insert : arguments are 0 pointer
116 // AliRoot event generator
117 // (it has to be created after MC, as it may use decayer via VMC)
119 gROOT->LoadMacro("$ALICE_ROOT/test/vmctest/ppbench/genPPbenchConfig.C");
120 gROOT->LoadMacro("$ALICE_ROOT/test/vmctest/ppbench/genExtFileConfig.C");
121 // The event generator selection (srun) is done in genPPbenchConfig.C
122 // that´s why we have to load it too
123 genExtFileConfig(srun);
125 cout << "Running g4Config.C finished ... " << endl;