]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/g4Config.C
Fix bug in filling the track hit pattern from trigger track extrapolation
[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(const char* directory="", 
25             const char* option="param", 
26             const char* digitstore="AliMUONDigitStoreV2S",
27             bool forEmbedding=kFALSE)
28 {
29   cout << "Running g4Config.C ... " << endl;
30
31   // AliRoot setup
32   //
33   gROOT->LoadMacro("$ALICE_ROOT/MUON/commonConfig.C");
34   commonConfig(directory, digitstore, forEmbedding);
35
36   // Load Geant4 + Geant4 VMC libraries
37   //
38   if (gClassTable->GetID("TGeant4") == -1) {
39     // Load Geant4 libraries 
40     if (!gInterpreter->IsLoaded("$ALICE/geant4_vmc/examples/macro/g4libs.C")) {
41       gROOT->LoadMacro("$ALICE/geant4_vmc/examples/macro/g4libs.C");
42       gInterpreter->ProcessLine("g4libs()");
43     }
44   }    
45
46   // Create Geant4 VMC
47   //  
48   TGeant4 *geant4 = 0;
49   if ( ! gMC ) {
50     TG4RunConfiguration* runConfiguration 
51       = new TG4RunConfiguration("geomRoot", 
52                                 "QGSP_BERT_EMV", 
53                                 "specialCuts+stepLimiter",
54                                  true);
55
56     geant4 = new TGeant4("TGeant4", "The Geant4 Monte Carlo", runConfiguration);
57     cout << "Geant4 has been created." << endl;
58   } 
59   else {
60     cout << "Monte Carlo has been already created." << endl;
61   }  
62
63   // Customization of Geant4 VMC
64   //
65
66   geant4->ProcessGeantCommand("/mcPhysics/rangeCuts 0.01 mm"); 
67   geant4->ProcessGeantCommand("/mcVerbose/all 1");  
68   geant4->ProcessGeantCommand("/mcTracking/loopVerbose 0");     
69   geant4->ProcessGeantCommand("/mcTracking/skipNeutrino true");
70
71   // Uncomment these lines when running with G4 native navigation
72   // (geomRootToGeant4)
73   //geant4->ProcessGeantCommand("/vgm/setNameSeparator /");
74   //geant4->ProcessGeantCommand("/mcControl/accountAssemblies true");
75
76   // Uncomment this line to get a detail info from each step 
77   // geant4->ProcessGeantCommand("/tracking/verbose 1");  
78   
79   // More info from the physics list
80   // the verbosity level is passed to all contained physics lists and their
81   // physics builders
82   //geant4->ProcessGeantCommand("/mcVerbose/composedPhysicsList 2");  
83   
84   // More info from optical processes
85   //geant4->ProcessGeantCommand("/mcVerbose/opticalPhysicsList 3");  
86   
87   // More info from geometry building
88   //geant4->ProcessGeantCommand("/mcVerbose/geometryManager 2");  
89
90   // More info from setting geometry properties (in materials and surfaces)
91   // for optical physics
92   //geant4->ProcessGeantCommand("/mcVerbose/opGeometryManager 1");  
93   
94   // More info about regions construction 
95   // and conversion of VMC cuts in cuts in range per regions 
96   // geant4->ProcessGeantCommand("/mcVerbose/regionsManager 2");
97   
98   // Suppress verbose info from tracks which reached maximum number of steps
99   // (default value is 30000)  
100   //geant4->ProcessGeantCommand("/mcTracking/loopVerbose 0"); 
101     
102   // AliRoot event generator
103   // (it has to be created after MC, as it may use decayer via VMC)
104   //
105   gROOT->LoadMacro("$ALICE_ROOT/MUON/genTestConfig.C");
106   genConfig(option);
107
108   // From external file
109   //
110   //gROOT->LoadMacro("$ALICE_ROOT/MUON/genExtFileConfig.C");
111   //genConfig();
112
113   cout << "Running g4Config.C finished ... " << endl;
114 }