]>
Commit | Line | Data |
---|---|---|
e6dc94be | 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/ppbench/commonConfig.C"); | |
c05b5bd1 | 16 | commonConfig(); |
e6dc94be | 17 | |
d111ffce | 18 | // TPC primary ionization |
19 | AliTPC* TPC = (AliTPC*)gAlice->GetDetector("TPC"); | |
20 | if ( ! TPC ) | |
21 | cerr << "Cannot get TPC detector" << endl; | |
22 | else { | |
23 | cerr << "Setting TPC primary ionization" << endl; | |
24 | TPC->SetPrimaryIonisation(); // not used with Geant3 | |
25 | } | |
26 | ||
e6dc94be | 27 | // Load Geant4 + Geant4 VMC libraries |
28 | // | |
29 | if (gClassTable->GetID("TGeant4") == -1) { | |
30 | // Load Geant4 libraries | |
31 | if (!gInterpreter->IsLoaded("$ALICE/geant4_vmc/examples/macro/g4libs.C")) { | |
32 | gROOT->LoadMacro("$ALICE/geant4_vmc/examples/macro/g4libs.C"); | |
33 | gInterpreter->ProcessLine("g4libs()"); | |
34 | } | |
35 | } | |
36 | ||
37 | // Create Geant4 VMC | |
38 | // | |
39 | TGeant4 *geant4 = 0; | |
40 | if ( ! gMC ) { | |
41 | TG4RunConfiguration* runConfiguration | |
42 | = new TG4RunConfiguration("geomRoot", | |
43 | "QGSP_BERT_EMV+optical", | |
44 | "specialCuts+stackPopper+stepLimiter", | |
45 | true); | |
46 | // = new TG4RunConfiguration("geomRootToGeant4", | |
47 | // "QGSP_BERT_EMV+optical", | |
c05b5bd1 | 48 | // "specialCuts+stackPopper+stepLimiter", |
e6dc94be | 49 | // true); |
50 | ||
51 | ||
52 | geant4 = new TGeant4("TGeant4", "The Geant4 Monte Carlo", runConfiguration); | |
53 | cout << "Geant4 has been created." << endl; | |
54 | } | |
55 | else { | |
56 | cout << "Monte Carlo has been already created." << endl; | |
57 | } | |
58 | ||
59 | // Customization of Geant4 VMC | |
60 | // | |
61 | ||
e6dc94be | 62 | geant4->ProcessGeantCommand("/mcVerbose/all 1"); |
d111ffce | 63 | geant4->ProcessGeantCommand("/mcVerbose/geometryManager 1"); |
e6dc94be | 64 | geant4->ProcessGeantCommand("/mcVerbose/opGeometryManager 1"); |
d111ffce | 65 | geant4->ProcessGeantCommand("/mcTracking/loopVerbose 1"); |
e6dc94be | 66 | geant4->ProcessGeantCommand("/mcPhysics/rangeCuts 0.01 mm"); |
e6dc94be | 67 | geant4->ProcessGeantCommand("/mcPhysics/selectOpProcess Scintillation"); |
68 | geant4->ProcessGeantCommand("/mcPhysics/setOpProcessActivation false"); | |
69 | geant4->ProcessGeantCommand("/mcTracking/skipNeutrino true"); | |
d111ffce | 70 | geant4->ProcessGeantCommand("/mcDet/setMaxStepInLowDensityMaterials 1 cm"); |
e6dc94be | 71 | |
72 | // Uncomment this line to get a detail info from each step | |
73 | // geant4->ProcessGeantCommand("/tracking/verbose 1"); | |
74 | ||
75 | // More info from the physics list | |
76 | // the verbosity level is passed to all contained physics lists and their | |
77 | // physics builders | |
78 | geant4->ProcessGeantCommand("/mcVerbose/composedPhysicsList 2"); | |
79 | ||
80 | // More info from optical processes | |
81 | //geant4->ProcessGeantCommand("/mcVerbose/opticalPhysicsList 3"); | |
82 | ||
83 | // More info from geometry building | |
84 | //geant4->ProcessGeantCommand("/mcVerbose/geometryManager 1"); | |
85 | ||
86 | // More info from setting geometry properties (in materials and surfaces) | |
87 | // for optical physics | |
88 | //geant4->ProcessGeantCommand("/mcVerbose/opGeometryManager 1"); | |
89 | ||
90 | // More info about regions construction | |
91 | // and conversion of VMC cuts in cuts in range per regions | |
92 | //geant4->ProcessGeantCommand("/mcVerbose/regionsManager 2"); | |
93 | //geant4->ProcessGeantCommand("/mcRegions/print true"); | |
94 | ||
95 | ||
96 | // Suppress verbose info from tracks which reached maximum number of steps | |
97 | // (default value is 30000) | |
98 | //geant4->ProcessGeantCommand("/mcTracking/loopVerbose 0"); | |
99 | ||
100 | // | |
101 | // Set apply cuts | |
102 | /* | |
103 | geant4->ProcessGeantCommand("/run/particle/applyCuts"); | |
104 | // geant4->ProcessGeantCommand("/mcVerbose/geometryManager 2"); | |
105 | ||
106 | geant4->ProcessGeantCommand("/mcVerbose/composedPhysicsList 2"); | |
107 | geant4->ProcessGeantCommand("/mcDet/volNameSeparator !"); | |
108 | geant4->ProcessGeantCommand("/mcPhysics/setStackPopperSelection e+ e- pi+ pi- kaon+ kaon- gamma"); | |
109 | //geant4->ProcessGeantCommand("/tracking/verbose 1"); | |
110 | ||
111 | geant4->ProcessGeantCommand("/mcControl/g3Defaults"); | |
112 | !!!!n Generates warnings: | |
113 | >>> Event 0 | |
114 | G4ProcessTable::Insert : arguments are 0 pointer | |
115 | G4ProcessTable::Insert : arguments are 0 pointer | |
116 | G4ProcessTable::Insert : arguments are 0 pointer | |
117 | G4ProcessTable::Insert : arguments are 0 pointer | |
118 | G4ProcessTable::Insert : arguments are 0 pointer | |
119 | ||
120 | */ | |
121 | ||
122 | // AliRoot event generator | |
123 | // (it has to be created after MC, as it may use decayer via VMC) | |
124 | // | |
125 | gROOT->LoadMacro("$ALICE_ROOT/test/vmctest/ppbench/genPPbenchConfig.C"); | |
126 | gROOT->LoadMacro("$ALICE_ROOT/test/vmctest/ppbench/genExtFileConfig.C"); | |
127 | // The event generator selection (srun) is done in genPPbenchConfig.C | |
128 |