3 // Configuration macro for running aliroot with Geant4
4 // with primary events read from external file
5 // with reprocessing 5th event starting from the saved random
6 // engine status files.
8 // By I. Hrivnacova, IPN Orsay
13 cout << "Running g4Config.C ... " << endl;
17 gROOT->LoadMacro("$ALICE_ROOT/test/vmctest/gun/commonConfig.C");
20 // TPC primary ionization
21 AliTPC* TPC = (AliTPC*)gAlice->GetDetector("TPC");
23 cerr << "Cannot get TPC detector" << endl;
25 cerr << "Setting TPC primary ionization" << endl;
26 TPC->SetPrimaryIonisation(); // not used with Geant3
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 "FTFP_BERT_EMV+optical",
46 "specialCuts+stackPopper+stepLimiter",
48 // = new TG4RunConfiguration("geomRootToGeant4",
49 // "FTFP_BERT_EMV+optical",
50 // "specialCuts+specialControls+stackPopper+stepLimiter",
53 geant4 = new TGeant4("TGeant4",
54 "The Geant4 Monte Carlo : FTFP_BERT_EMV+optical",
56 // Repeat physics selection in the title; to be removed
57 // with new geant4_vmc tag (1.13)
59 cout << "Geant4 has been created." << endl;
62 cout << "Monte Carlo has been already created." << endl;
65 // Customization of Geant4 VMC
68 geant4->ProcessGeantCommand("/mcVerbose/all 1");
69 geant4->ProcessGeantCommand("/mcVerbose/geometryManager 1");
70 geant4->ProcessGeantCommand("/mcVerbose/opGeometryManager 1");
71 geant4->ProcessGeantCommand("/mcTracking/loopVerbose 0");
72 geant4->ProcessGeantCommand("/mcPhysics/rangeCuts 0.01 mm");
73 geant4->ProcessGeantCommand("/mcTracking/skipNeutrino true");
74 geant4->ProcessGeantCommand("/mcDet/setMaxStepInLowDensityMaterials 1 cm");
76 // for Geant4 <= 9.4.p03
77 //geant4->ProcessGeantCommand("/mcPhysics/selectOpProcess Scintillation");
78 //geant4->ProcessGeantCommand("/mcPhysics/setOpProcessActivation false");
80 geant4->ProcessGeantCommand("/optics_engine/selectOpProcess Scintillation");
81 geant4->ProcessGeantCommand("/optics_engine/setOpProcessUse false");
82 geant4->ProcessGeantCommand("/optics_engine/selectOpProcess OpWLS");
83 geant4->ProcessGeantCommand("/optics_engine/setOpProcessUse false");
84 geant4->ProcessGeantCommand("/optics_engine/selectOpProcess OpMieHG");
85 geant4->ProcessGeantCommand("/optics_engine/setOpProcessUse false");
87 // Activate reading random engine status from a file
88 gAlice->GetMCApp()->SetReadRndmStatus(kTRUE);
89 gAlice->GetMCApp()->SetRndmFileName("randomEvt4.root");
90 geant4->ProcessGeantCommand("/mcRun/readRandom true");
91 geant4->ProcessGeantCommand("/mcRun/setRandomFile run0evt4.rndm");
93 // Uncomment this line to get a detail info from each step
94 geant4->ProcessGeantCommand("/tracking/verbose 1");
96 // More info from the physics list
97 // the verbosity level is passed to all contained physics lists and their
99 //geant4->ProcessGeantCommand("/mcVerbose/composedPhysicsList 2");
101 // More info from optical processes
102 //geant4->ProcessGeantCommand("/mcVerbose/opticalPhysicsList 3");
104 // More info from geometry building
105 //geant4->ProcessGeantCommand("/mcVerbose/geometryManager 1");
107 // More info from setting geometry properties (in materials and surfaces)
108 // for optical physics
109 //geant4->ProcessGeantCommand("/mcVerbose/opGeometryManager 1");
111 // More info about regions construction
112 // and conversion of VMC cuts in cuts in range per regions
113 // geant4->ProcessGeantCommand("/mcVerbose/regionsManager 2");
114 // geant4->ProcessGeantCommand("/mcRegions/print true");
116 // Suppress verbose info from tracks which reached maximum number of steps
117 // (default value is 30000)
118 //geant4->ProcessGeantCommand("/mcTracking/loopVerbose 0");
123 geant4->ProcessGeantCommand("/run/particle/applyCuts");
124 // geant4->ProcessGeantCommand("/mcVerbose/geometryManager 2");
126 geant4->ProcessGeantCommand("/mcVerbose/composedPhysicsList 2");
127 geant4->ProcessGeantCommand("/mcDet/volNameSeparator !");
128 geant4->ProcessGeantCommand("/mcPhysics/setStackPopperSelection e+ e- pi+ pi- kaon+ kaon- gamma");
129 //geant4->ProcessGeantCommand("/tracking/verbose 1");
131 geant4->ProcessGeantCommand("/mcControl/g3Defaults");
132 !!!!n Generates warnings:
134 G4ProcessTable::Insert : arguments are 0 pointer
135 G4ProcessTable::Insert : arguments are 0 pointer
136 G4ProcessTable::Insert : arguments are 0 pointer
137 G4ProcessTable::Insert : arguments are 0 pointer
138 G4ProcessTable::Insert : arguments are 0 pointer
142 // AliRoot event generator
143 // (it has to be created after MC, as it may use decayer via VMC)
145 gROOT->LoadMacro("$ALICE_ROOT/test/vmctest/gun/genExtFileConfig.C");
148 cout << "Running g4Config.C finished ... " << endl;