]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/g4Config.C
A few fixes
[u/mrichter/AliRoot.git] / MUON / g4Config.C
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 /* $Id$ */
17
18 /// \ingroup macros
19 /// \file g4Config.C
20 /// \brief Configuration macro for MUON spectrometer Geant4 simulation
21 ///
22 /// \author I. Hrivnacova, IPN Orsay
23         
24 void Config()
25 {
26   cout << "Running g4Config.C ... " << endl;
27
28   // AliRoot setup
29   //
30   gROOT->LoadMacro("$ALICE_ROOT/MUON/commonConfig.C");
31   commonConfig(kTRUE);
32
33   // Load Geant4 + Geant4 VMC libraries
34   //
35   if (gClassTable->GetID("TGeant4") == -1) {
36     // Load Geant4 libraries 
37     if (!gInterpreter->IsLoaded("$ALICE/geant4_vmc/examples/macro/g4libs.C")) {
38       gROOT->LoadMacro("$ALICE/geant4_vmc/examples/macro/g4libs.C");
39       gInterpreter->ProcessLine("g4libs()");
40     }
41   }    
42
43   // Create Geant4 VMC
44   //  
45   TGeant4 *geant4 = 0;
46   if ( ! gMC ) {
47     TG4RunConfiguration* runConfiguration 
48       = new TG4RunConfiguration("geomRoot", 
49                                 "QGSP_BERT_EMV", 
50                                 "specialCuts+stepLimiter",
51                                  true);
52
53     geant4 = new TGeant4("TGeant4", "The Geant4 Monte Carlo", runConfiguration);
54     cout << "Geant4 has been created." << endl;
55   } 
56   else {
57     cout << "Monte Carlo has been already created." << endl;
58   }  
59
60   // Customization of Geant4 VMC
61   //
62
63   geant4->ProcessGeantCommand("/mcPhysics/rangeCuts 0.01 mm"); 
64   geant4->ProcessGeantCommand("/mcVerbose/all 1");  
65   geant4->ProcessGeantCommand("/mcTracking/loopVerbose 0");     
66   geant4->ProcessGeantCommand("/mcTracking/skipNeutrino true");
67
68   // Uncomment these lines when running with G4 native navigation
69   // (geomRootToGeant4)
70   //geant4->ProcessGeantCommand("/vgm/setNameSeparator /");
71   //geant4->ProcessGeantCommand("/mcControl/accountAssemblies true");
72
73   // Uncomment this line to get a detail info from each step 
74   // geant4->ProcessGeantCommand("/tracking/verbose 1");  
75   
76   // More info from the physics list
77   // the verbosity level is passed to all contained physics lists and their
78   // physics builders
79   //geant4->ProcessGeantCommand("/mcVerbose/composedPhysicsList 2");  
80   
81   // More info from optical processes
82   //geant4->ProcessGeantCommand("/mcVerbose/opticalPhysicsList 3");  
83   
84   // More info from geometry building
85   //geant4->ProcessGeantCommand("/mcVerbose/geometryManager 2");  
86
87   // More info from setting geometry properties (in materials and surfaces)
88   // for optical physics
89   //geant4->ProcessGeantCommand("/mcVerbose/opGeometryManager 1");  
90   
91   // More info about regions construction 
92   // and conversion of VMC cuts in cuts in range per regions 
93   // geant4->ProcessGeantCommand("/mcVerbose/regionsManager 2");
94   
95   // Suppress verbose info from tracks which reached maximum number of steps
96   // (default value is 30000)  
97   //geant4->ProcessGeantCommand("/mcTracking/loopVerbose 0"); 
98     
99   // AliRoot event generator
100   // (it has to be created after MC, as it may use decayer via VMC)
101   //
102   gROOT->LoadMacro("$ALICE_ROOT/MUON/genTestConfig.C");
103   genConfig();
104
105   // From external file
106   //
107   //gROOT->LoadMacro("$ALICE_ROOT/MUON/genExtFileConfig.C");
108   //genConfig();
109
110   cout << "Running g4Config.C finished ... " << endl;
111 }