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/gun/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 // "emStandard+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");
64 // Uncomment this line to get a detail info from each step
65 // geant4->ProcessGeantCommand("/tracking/verbose 1");
67 // More info from the physics list
68 // the verbosity level is passed to all contained physics lists and their
70 //geant4->ProcessGeantCommand("/mcVerbose/composedPhysicsList 2");
72 // More info from optical processes
73 //geant4->ProcessGeantCommand("/mcVerbose/opticalPhysicsList 3");
75 // More info from geometry building
76 //geant4->ProcessGeantCommand("/mcVerbose/geometryManager 1");
78 // More info from setting geometry properties (in materials and surfaces)
79 // for optical physics
80 //geant4->ProcessGeantCommand("/mcVerbose/opGeometryManager 1");
82 // More info about regions construction
83 // and conversion of VMC cuts in cuts in range per regions
84 // geant4->ProcessGeantCommand("/mcVerbose/regionsManager 2");
86 // Suppress verbose info from tracks which reached maximum number of steps
87 // (default value is 30000)
88 //geant4->ProcessGeantCommand("/mcTracking/loopVerbose 0");
93 geant4->ProcessGeantCommand("/run/particle/applyCuts");
94 // geant4->ProcessGeantCommand("/mcVerbose/geometryManager 2");
96 geant4->ProcessGeantCommand("/mcVerbose/composedPhysicsList 2");
97 geant4->ProcessGeantCommand("/mcDet/volNameSeparator !");
98 geant4->ProcessGeantCommand("/mcPhysics/setStackPopperSelection e+ e- pi+ pi- kaon+ kaon- gamma");
99 //geant4->ProcessGeantCommand("/tracking/verbose 1");
101 geant4->ProcessGeantCommand("/mcControl/g3Defaults");
102 !!!!n Generates warnings:
104 G4ProcessTable::Insert : arguments are 0 pointer
105 G4ProcessTable::Insert : arguments are 0 pointer
106 G4ProcessTable::Insert : arguments are 0 pointer
107 G4ProcessTable::Insert : arguments are 0 pointer
108 G4ProcessTable::Insert : arguments are 0 pointer
112 // AliRoot event generator
113 // (it has to be created after MC, as it may use decayer via VMC)
115 gROOT->LoadMacro("$ALICE_ROOT/test/vmctest/gun/genExtFileConfig.C");
118 cout << "Running g4Config.C finished ... " << endl;