]>
Commit | Line | Data |
---|---|---|
267e5cd8 | 1 | // $Id$ |
2 | // | |
3 | // Configuration macro for running aliroot with Geant4 | |
4 | // with primary events read from external file. | |
5 | // | |
6 | // By I. Hrivnacova, IPN Orsay | |
7 | ||
8 | ||
9 | void Config() | |
10 | { | |
11 | cout << "Running g4Config.C ... " << endl; | |
12 | ||
13 | // AliRoot setup | |
14 | // | |
15 | gROOT->LoadMacro("$ALICE_ROOT/test/vmctest/gun/commonConfig.C"); | |
16 | commonConfig(kTRUE); | |
17 | ||
18 | // Load Geant4 + Geant4 VMC libraries | |
19 | // | |
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()"); | |
25 | } | |
26 | } | |
27 | ||
28 | // Create Geant4 VMC | |
29 | // | |
30 | TGeant4 *geant4 = 0; | |
31 | if ( ! gMC ) { | |
32 | TG4RunConfiguration* runConfiguration | |
33 | = new TG4RunConfiguration("geomRoot", | |
34 | "QGSP_BERT_EMV+optical", | |
35 | "specialCuts+stackPopper+stepLimiter", | |
36 | true); | |
37 | // = new TG4RunConfiguration("geomRootToGeant4", | |
38 | // "emStandard+optical", | |
39 | // "specialCuts+specialControls+stackPopper+stepLimiter", | |
40 | // true); | |
41 | ||
42 | ||
43 | geant4 = new TGeant4("TGeant4", "The Geant4 Monte Carlo", runConfiguration); | |
44 | cout << "Geant4 has been created." << endl; | |
45 | } | |
46 | else { | |
47 | cout << "Monte Carlo has been already created." << endl; | |
48 | } | |
49 | ||
50 | // Customization of Geant4 VMC | |
51 | // | |
52 | ||
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 | ||
64 | // Uncomment this line to get a detail info from each step | |
65 | // geant4->ProcessGeantCommand("/tracking/verbose 1"); | |
66 | ||
67 | // More info from the physics list | |
68 | // the verbosity level is passed to all contained physics lists and their | |
69 | // physics builders | |
70 | //geant4->ProcessGeantCommand("/mcVerbose/composedPhysicsList 2"); | |
71 | ||
72 | // More info from optical processes | |
73 | //geant4->ProcessGeantCommand("/mcVerbose/opticalPhysicsList 3"); | |
74 | ||
75 | // More info from geometry building | |
76 | //geant4->ProcessGeantCommand("/mcVerbose/geometryManager 1"); | |
77 | ||
78 | // More info from setting geometry properties (in materials and surfaces) | |
79 | // for optical physics | |
80 | //geant4->ProcessGeantCommand("/mcVerbose/opGeometryManager 1"); | |
81 | ||
82 | // More info about regions construction | |
83 | // and conversion of VMC cuts in cuts in range per regions | |
84 | // geant4->ProcessGeantCommand("/mcVerbose/regionsManager 2"); | |
85 | ||
86 | // Suppress verbose info from tracks which reached maximum number of steps | |
87 | // (default value is 30000) | |
88 | //geant4->ProcessGeantCommand("/mcTracking/loopVerbose 0"); | |
89 | ||
90 | // | |
91 | // Set apply cuts | |
92 | /* | |
93 | geant4->ProcessGeantCommand("/run/particle/applyCuts"); | |
94 | // geant4->ProcessGeantCommand("/mcVerbose/geometryManager 2"); | |
95 | ||
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"); | |
100 | ||
101 | geant4->ProcessGeantCommand("/mcControl/g3Defaults"); | |
102 | !!!!n Generates warnings: | |
103 | >>> Event 0 | |
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 | |
109 | ||
110 | */ | |
111 | ||
112 | // AliRoot event generator | |
113 | // (it has to be created after MC, as it may use decayer via VMC) | |
114 | // | |
115 | gROOT->LoadMacro("$ALICE_ROOT/test/vmctest/gun/genExtFileConfig.C"); | |
116 | genExtFileConfig(); | |
117 | ||
118 | cout << "Running g4Config.C finished ... " << endl; | |
119 | } |