1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
20 /// \brief Configuration macro for MUON spectormeter simulation
22 /// Remember to define the directory and event generator option:
24 /// gAlice->SetConfigFunction("Config('$HOME','box');");
26 /// Can be compiled by :
28 /// (depends on the correct rootlogon.C though...)
30 #if !defined(__CINT__) || defined(__MAKECINT__)
32 #include "AliABSOv3.h"
34 #include "AliConfig.h"
35 #include "AliDIPOv3.h"
36 #include "AliDecayerPythia.h"
37 #include "AliFRAMEv2.h"
38 #include "AliGenBox.h"
39 #include "AliGenFixed.h"
40 #include "AliGenHijing.h"
41 #include "AliGenMUONCocktail.h"
42 #include "AliGenMUONlib.h"
43 #include "AliGenParam.h"
44 #include "AliGenScan.h"
45 #include "AliHALLv3.h"
46 #include "AliITSv11Hybrid.h"
49 #include "AliMUONv1.h"
50 #include "AliPIPEv3.h"
52 #include "AliRunLoader.h"
53 #include "AliSHILv3.h"
54 #include <Riostream.h>
56 #include <TGeant3TGeo.h>
57 #include <TGeoGlobalMagField.h>
61 #include <TVirtualMC.h>
63 //#include "AliZDCv3.h"
64 //#include "AliFMDv1.h"
65 //#include "AliPMDv1.h"
66 //#include "AliVZEROv7.h"
70 void Config(const char* directory="",
71 const char* option="param",
72 const char* digitstore="AliMUONDigitStoreV2S",
73 bool forEmbedding=kFALSE)
75 //=====================================================================
76 // Config file for MUON test
77 //=====================================================================
78 // Libraries required by geant321
80 gSystem->Load("liblhapdf.so"); // Parton density functions
81 gSystem->Load("libpythia6.so"); // Pythia
82 gSystem->Load("libgeant321.so");
83 gSystem->Load("libEG");
84 gSystem->Load("libEGPythia6");
85 gSystem->Load("libAliPythia6.so"); // ALICE specific implementations
87 new TGeant3TGeo("C++ Interface to Geant3");
89 //=======================================================================
90 // Create the output file
92 sprintf(filename,"%sgalice.root",directory);
93 cout << ">>> Output file is " << filename << endl;
94 cout << ">>> Config.C: Creating Run Loader ..."<<endl;
96 rl = AliRunLoader::Open(
97 filename, AliConfig::GetDefaultEventFolderName(), "recreate");
99 { gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
101 rl->SetCompressionLevel(2);
102 rl->SetNumberOfEventsPerFile(100);
103 gAlice->SetRunLoader(rl);
104 //=======================================================================
105 // For having more debuging messages
106 //AliLog::SetModuleDebugLevel("MUON", 1);
107 //=======================================================================
108 // Set External decayer
109 TVirtualMCDecayer *decayer = new AliDecayerPythia();
110 decayer->SetForceDecay(kAll);
112 gMC->SetExternalDecayer(decayer);
113 //=======================================================================
114 // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
115 gMC->SetProcess("DCAY",1);
116 gMC->SetProcess("PAIR",1);
117 gMC->SetProcess("COMP",1);
118 gMC->SetProcess("PHOT",1);
119 gMC->SetProcess("PFIS",0);
120 gMC->SetProcess("DRAY",0);
121 gMC->SetProcess("ANNI",1);
122 gMC->SetProcess("BREM",1);
123 gMC->SetProcess("MUNU",1);
124 gMC->SetProcess("CKOV",1);
125 gMC->SetProcess("HADR",1);
126 gMC->SetProcess("LOSS",2);
127 gMC->SetProcess("MULS",1);
128 gMC->SetProcess("RAYL",1);
129 Float_t cut = 1.e-3; // 1MeV cut by default
130 Float_t tofmax = 1.e10;
131 gMC->SetCut("CUTGAM", cut);
132 gMC->SetCut("CUTELE", cut);
133 gMC->SetCut("CUTNEU", cut);
134 gMC->SetCut("CUTHAD", cut);
135 gMC->SetCut("CUTMUO", cut);
136 gMC->SetCut("BCUTE", cut);
137 gMC->SetCut("BCUTM", cut);
138 gMC->SetCut("DCUTE", cut);
139 gMC->SetCut("DCUTM", cut);
140 gMC->SetCut("PPCUTM", cut);
141 gMC->SetCut("TOFMAX", tofmax);
142 //=======================================================================
143 // Examples of generators. Only option param is sistematically tested
144 if (!strcmp(option,"box")) {
145 AliGenBox * gener = new AliGenBox(1);
146 gener->SetMomentumRange(20.,20.1);
147 gener->SetPhiRange(0., 360.);
148 gener->SetThetaRange(171.000,178.001);
149 gener->SetPart(kMuonMinus); // Muons
150 gener->SetOrigin(0.,0., 0.); //vertex position
151 gener->SetSigma(0.0, 0.0, 0.0); //Sigma in (X,Y,Z) (cm) on IP position
153 if (!strcmp(option,"gun")) {
154 AliGenFixed *gener = new AliGenFixed(1);
155 gener->SetMomentum(10);
156 gener->SetPhiRange(0.);
157 gener->SetThetaRange(0.);
158 gener->SetOrigin(30,30,-1200);//vertex position
159 gener->SetPart(kMuonMinus); //GEANT particle type 13 is muons
161 if (!strcmp(option,"scan")) {
162 AliGenScan *gener = new AliGenScan(-1);
163 gener->SetMomentumRange(10,10);
164 gener->SetPhiRange(0, 0);
165 gener->SetThetaRange(-180, -180);
167 //gener->SetSigma(1,1,0); //Sigma in (X,Y,Z) (cm) on IP position
168 gener->SetPart(kRootino);
169 gener->SetRange(100, -300., 300., 100, -300., 300., 1, 2000, 2000);
171 if (!strcmp(option,"param")) {
172 AliGenParam *gener = new AliGenParam(1, AliGenMUONlib::kUpsilon);
173 gener->SetMomentumRange(0,999);
174 gener->SetPtRange(0,100.);
175 gener->SetPhiRange(0., 360.);
176 gener->SetCutOnChild(1);
177 gener->SetChildPhiRange(0.,360.);
178 gener->SetChildThetaRange(171.0,178.0);
179 gener->SetOrigin(0,0,0); //vertex position gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
180 gener->SetForceDecay(kDiMuon);
181 gener->SetTrackingFlag(1);
184 if (!strcmp(option,"paramJpsi")) {
185 AliGenParam *gener = new AliGenParam(1, AliGenMUONlib::kJpsi);
186 gener->SetMomentumRange(0,999);
187 gener->SetPtRange(0,100.);
188 gener->SetPhiRange(0., 360.);
189 gener->SetCutOnChild(1);
190 gener->SetChildPhiRange(0.,360.);
191 gener->SetChildThetaRange(171.0,178.0);
192 gener->SetOrigin(0,0,0);
193 gener->SetForceDecay(kDiMuon);
194 gener->SetTrackingFlag(1);
197 if (!strcmp(option,"hijing")) { //Hijing generator from ConfigPPR in macros
198 AliGenHijing *gener = new AliGenHijing(-1);
199 // centre of mass energy
200 gener->SetEnergyCMS(5500.);
202 gener->SetReferenceFrame("CMS");
204 gener->SetProjectile("A", 208, 82);
205 gener->SetTarget ("A", 208, 82);
206 // tell hijing to keep the full parent child chain
207 gener->KeepFullEvent();
208 // enable jet quenching
209 gener->SetJetQuenching(1);
211 gener->SetShadowing(1);
212 // neutral pion and heavy particle decays switched off
213 gener->SetDecaysOff(1);
214 // Don't track spectators
215 gener->SetSpectators(0);
216 // kinematic selection
217 gener->SetSelectAll(0);
218 // impact parameter range
219 gener->SetImpactParameterRange(0., 5.); // 0. - 5. fm corresponds to ~10% most central
222 if (!strcmp(option,"muoncocktail")) { // Muon cocktail for PbPb
223 AliGenMUONCocktail * gener = new AliGenMUONCocktail();
224 gener->SetPtRange(1.,100.); // Transverse momentum range
225 gener->SetPhiRange(0.,360.); // Azimuthal angle range
226 gener->SetYRange(-4.0,-2.5);
227 gener->SetMuonPtCut(0.5);
228 gener->SetMuonThetaCut(171.,178.);
229 gener->SetMuonMultiplicity(2);
230 gener->SetImpactParameterRange(0.,5.); // 10% most centra PbPb collisions
231 gener->SetVertexSmear(kPerTrack);
232 gener->SetOrigin(0,0,0); // Vertex position
233 gener->SetSigma(0,0,0.0); // Sigma in (X,Y,Z) (cm) on IP position
236 //=============================================================
238 TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", -1., -1, AliMagF::k5kG));
239 //=============================================================
240 //=================== Alice BODY parameters =============================
241 new AliBODY("BODY","Alice envelop");
242 //=================== ABSO parameters ============================
243 new AliABSOv3("ABSO", "Muon Absorber");
244 //=================== DIPO parameters ============================
245 new AliDIPOv3("DIPO", "Dipole version 2");
246 //================== HALL parameters ============================
247 new AliHALLv3("HALL", "Alice Hall");
248 //=================== PIPE parameters ============================
249 new AliPIPEv3("PIPE", "Beam Pipe");
250 //=================== SHIL parameters ============================
251 new AliSHILv3("SHIL", "Shielding Version 2");
253 //=================== MUON Subsystem ===========================
254 AliMUON *MUON = new AliMUONv1("MUON", "default");
256 // The 3 switches below are to be used for the trigger code
257 // their default value is set in AliMUON.h
258 // activate trigger cluster-size (0=default, 1=cluster-size according to AliMUONResponseTriggerV1
259 // MUON->SetTriggerResponseV1(0);
260 // activate 4/4 trigger coincidence (0=default (coinc 3/4), 1=coinc 4/4)
261 // MUON->SetTriggerCoinc44(0);
262 // activate trigger chamber efficiency by cells (0=default, 1=trigger efficiency according to AliMUONTriggerEfficiencyCells
263 // MUON->SetTriggerEffCells(0);
265 // Activate the following line when running with Fluka
266 // MUON->SetIsMaxStep(kFALSE);
268 // Use SetDigitStoreClassName() to change the digitStore implementation used by (s)digitizer
269 MUON->SetDigitStoreClassName(digitstore);
273 // Noise-only digits in tracker/trigger (0=no noise, 1=default (noise in tracker), 2=noise in tracker and trigger):
274 cout << "****** DISABLING NOISE GENERATION AS WE DO EMBEDDING ******" << endl;
275 MUON->SetDigitizerWithNoise(0);
276 MUON->SetConvertTrigger(true);
278 new AliITSv11Hybrid("ITS","ITS v11Hybrid");
282 // Use non-high performance raw data decoder
283 //MUON->SetFastTrackerDecoder(kFALSE);
284 //MUON->SetFastTriggerDecoder(kFALSE);
287 // If SetAlign, the detection elements transformations
288 // are taken from the input file and not from the code
289 // MUON->SetAlign("transform.dat");
291 // To generate and read scaler trigger events in rawdata
292 // MUON->SetTriggerScalerEvent();
294 // To switch off the tail effect
295 // MUON->SetTailEffect(kFALSE);
297 // If you want to play with builders, first reset the geometry builder,
298 // and then add yours.
299 // MUON->ResetGeometryBuilder();
300 // MUON->AddGeometryBuilder(new AliMUONSt1GeometryBuilderV2(MUON));
301 // MUON->AddGeometryBuilder(new AliMUONSt2GeometryBuilderV2(MUON));
302 // MUON->AddGeometryBuilder(new AliMUONSlatGeometryBuilder(MUON));
303 // MUON->AddGeometryBuilder(new AliMUONTriggerGeometryBuilder(MUON));