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 "AliITSv11.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,
74 bool forRealistic=kFALSE)
76 //=====================================================================
77 // Config file for MUON test
78 //=====================================================================
79 // Libraries required by geant321
81 gSystem->Load("liblhapdf.so"); // Parton density functions
82 gSystem->Load("libpythia6.so"); // Pythia
83 gSystem->Load("libgeant321.so");
84 gSystem->Load("libEG");
85 gSystem->Load("libEGPythia6");
86 gSystem->Load("libAliPythia6.so"); // ALICE specific implementations
88 new TGeant3TGeo("C++ Interface to Geant3");
90 //=======================================================================
91 // Create the output file
93 sprintf(filename,"%sgalice.root",directory);
94 cout << ">>> Output file is " << filename << endl;
95 cout << ">>> Config.C: Creating Run Loader ..."<<endl;
97 rl = AliRunLoader::Open(
98 filename, AliConfig::GetDefaultEventFolderName(), "recreate");
100 { gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
102 rl->SetCompressionLevel(2);
103 rl->SetNumberOfEventsPerFile(10000);
104 gAlice->SetRunLoader(rl);
105 //=======================================================================
106 // For having more debuging messages
107 //AliLog::SetModuleDebugLevel("MUON", 1);
108 //=======================================================================
109 // Set External decayer
110 TVirtualMCDecayer *decayer = new AliDecayerPythia();
111 decayer->SetForceDecay(kAll);
113 gMC->SetExternalDecayer(decayer);
114 //=======================================================================
115 // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
116 gMC->SetProcess("DCAY",1);
117 gMC->SetProcess("PAIR",1);
118 gMC->SetProcess("COMP",1);
119 gMC->SetProcess("PHOT",1);
120 gMC->SetProcess("PFIS",0);
121 gMC->SetProcess("DRAY",0);
122 gMC->SetProcess("ANNI",1);
123 gMC->SetProcess("BREM",1);
124 gMC->SetProcess("MUNU",1);
125 gMC->SetProcess("CKOV",1);
126 gMC->SetProcess("HADR",1);
127 gMC->SetProcess("LOSS",2);
128 gMC->SetProcess("MULS",1);
129 gMC->SetProcess("RAYL",1);
130 Float_t cut = 1.e-3; // 1MeV cut by default
131 Float_t tofmax = 1.e10;
132 gMC->SetCut("CUTGAM", cut);
133 gMC->SetCut("CUTELE", cut);
134 gMC->SetCut("CUTNEU", cut);
135 gMC->SetCut("CUTHAD", cut);
136 gMC->SetCut("CUTMUO", cut);
137 gMC->SetCut("BCUTE", cut);
138 gMC->SetCut("BCUTM", cut);
139 gMC->SetCut("DCUTE", cut);
140 gMC->SetCut("DCUTM", cut);
141 gMC->SetCut("PPCUTM", cut);
142 gMC->SetCut("TOFMAX", tofmax);
143 //=======================================================================
144 // Examples of generators. Only option param is sistematically tested
145 if (!strcmp(option,"box")) {
146 AliGenBox * gener = new AliGenBox(1);
147 gener->SetMomentumRange(20.,20.1);
148 gener->SetPhiRange(0., 360.);
149 gener->SetThetaRange(171.000,178.001);
150 gener->SetPart(kMuonMinus); // Muons
151 gener->SetOrigin(0.,0., 0.); //vertex position
152 gener->SetSigma(0.0, 0.0, 0.0); //Sigma in (X,Y,Z) (cm) on IP position
154 if (!strcmp(option,"gun")) {
155 AliGenFixed *gener = new AliGenFixed(1);
156 gener->SetMomentum(10);
157 gener->SetPhiRange(0.);
158 gener->SetThetaRange(0.);
159 gener->SetOrigin(30,30,-1200);//vertex position
160 gener->SetPart(kMuonMinus); //GEANT particle type 13 is muons
162 if (!strcmp(option,"scan")) {
163 AliGenScan *gener = new AliGenScan(-1);
164 gener->SetMomentumRange(10,10);
165 gener->SetPhiRange(0, 0);
166 gener->SetThetaRange(-180, -180);
168 //gener->SetSigma(1,1,0); //Sigma in (X,Y,Z) (cm) on IP position
169 gener->SetPart(kRootino);
170 gener->SetRange(100, -300., 300., 100, -300., 300., 1, 2000, 2000);
172 if (!strcmp(option,"param")) {
173 AliGenParam *gener = new AliGenParam(1, AliGenMUONlib::kUpsilon);
174 gener->SetMomentumRange(0,999);
175 gener->SetPtRange(0,100.);
176 gener->SetPhiRange(0., 360.);
177 gener->SetCutOnChild(1);
178 gener->SetChildPhiRange(0.,360.);
179 gener->SetChildThetaRange(171.0,178.0);
180 gener->SetOrigin(0,0,0); //vertex position gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
183 gener->SetVertexSmear(kPerEvent);
185 gener->SetForceDecay(kDiMuon);
186 gener->SetTrackingFlag(1);
189 if (!strcmp(option,"paramJpsi")) {
190 AliGenParam *gener = new AliGenParam(1, AliGenMUONlib::kJpsi);
191 gener->SetMomentumRange(0,999);
192 gener->SetPtRange(0,100.);
193 gener->SetPhiRange(0., 360.);
194 gener->SetCutOnChild(1);
195 gener->SetChildPhiRange(0.,360.);
196 gener->SetChildThetaRange(171.0,178.0);
197 gener->SetOrigin(0,0,0);
198 gener->SetForceDecay(kDiMuon);
199 gener->SetTrackingFlag(1);
202 if (!strcmp(option,"hijing")) { //Hijing generator from ConfigPPR in macros
203 AliGenHijing *gener = new AliGenHijing(-1);
204 // centre of mass energy
205 gener->SetEnergyCMS(5500.);
207 gener->SetReferenceFrame("CMS");
209 gener->SetProjectile("A", 208, 82);
210 gener->SetTarget ("A", 208, 82);
211 // tell hijing to keep the full parent child chain
212 gener->KeepFullEvent();
213 // enable jet quenching
214 gener->SetJetQuenching(1);
216 gener->SetShadowing(1);
217 // neutral pion and heavy particle decays switched off
218 gener->SetDecaysOff(1);
219 // Don't track spectators
220 gener->SetSpectators(0);
221 // kinematic selection
222 gener->SetSelectAll(0);
223 // impact parameter range
224 gener->SetImpactParameterRange(0., 5.); // 0. - 5. fm corresponds to ~10% most central
227 if (!strcmp(option,"muoncocktail")) { // Muon cocktail for PbPb
228 AliGenMUONCocktail * gener = new AliGenMUONCocktail();
229 gener->SetPtRange(1.,100.); // Transverse momentum range
230 gener->SetPhiRange(0.,360.); // Azimuthal angle range
231 gener->SetYRange(-4.0,-2.5);
232 gener->SetMuonPtCut(0.5);
233 gener->SetMuonThetaCut(171.,178.);
234 gener->SetMuonMultiplicity(2);
235 gener->SetImpactParameterRange(0.,5.); // 10% most centra PbPb collisions
236 gener->SetVertexSmear(kPerTrack);
237 gener->SetOrigin(0,0,0); // Vertex position
238 gener->SetSigma(0,0,0.0); // Sigma in (X,Y,Z) (cm) on IP position
241 //=============================================================
243 TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", -1., -1, AliMagF::k5kG));
244 //=============================================================
245 //=================== Alice BODY parameters =============================
246 new AliBODY("BODY","Alice envelop");
247 //=================== ABSO parameters ============================
248 new AliABSOv3("ABSO", "Muon Absorber");
249 //=================== DIPO parameters ============================
250 new AliDIPOv3("DIPO", "Dipole version 2");
251 //================== HALL parameters ============================
252 new AliHALLv3("HALL", "Alice Hall");
253 //=================== PIPE parameters ============================
254 new AliPIPEv3("PIPE", "Beam Pipe");
255 //=================== SHIL parameters ============================
256 new AliSHILv3("SHIL", "Shielding Version 2");
258 //=================== MUON Subsystem ===========================
259 AliMUON *MUON = new AliMUONv1("MUON", "default");
261 // The 3 switches below are to be used for the trigger code
262 // their default value is set in AliMUON.h
263 // activate trigger cluster-size (0=default, 1=cluster-size according to AliMUONResponseTriggerV1
264 // MUON->SetTriggerResponseV1(0);
265 // activate 4/4 trigger coincidence (0=default (coinc 3/4), 1=coinc 4/4)
266 // MUON->SetTriggerCoinc44(0);
267 // activate trigger chamber efficiency by cells (0=default, 1=trigger efficiency according to AliMUONTriggerEfficiencyCells
268 // MUON->SetTriggerEffCells(0);
270 // Activate the following line when running with Fluka
271 // MUON->SetIsMaxStep(kFALSE);
273 // Use SetDigitStoreClassName() to change the digitStore implementation used by (s)digitizer
274 MUON->SetDigitStoreClassName(digitstore);
278 // Noise-only digits in tracker/trigger (0=no noise, 1=default (noise in tracker), 2=noise in tracker and trigger):
279 cout << "****** DISABLING NOISE GENERATION AS WE DO EMBEDDING ******" << endl;
280 MUON->SetDigitizerWithNoise(0);
281 MUON->SetConvertTrigger(true);
283 new AliITSv11("ITS","ITS v11");
285 else if (forRealistic)
287 new AliITSv11("ITS","ITS v11");
290 // Use non-high performance raw data decoder
291 //MUON->SetFastTrackerDecoder(kFALSE);
292 //MUON->SetFastTriggerDecoder(kFALSE);
295 // If SetAlign, the detection elements transformations
296 // are taken from the input file and not from the code
297 // MUON->SetAlign("transform.dat");
299 // To generate and read scaler trigger events in rawdata
300 // MUON->SetTriggerScalerEvent();
302 // To switch off the tail effect
303 // MUON->SetTailEffect(kFALSE);
305 // If you want to play with builders, first reset the geometry builder,
306 // and then add yours.
307 // MUON->ResetGeometryBuilder();
308 // MUON->AddGeometryBuilder(new AliMUONSt1GeometryBuilderV2(MUON));
309 // MUON->AddGeometryBuilder(new AliMUONSt2GeometryBuilderV2(MUON));
310 // MUON->AddGeometryBuilder(new AliMUONSlatGeometryBuilder(MUON));
311 // MUON->AddGeometryBuilder(new AliMUONTriggerGeometryBuilder(MUON));