get tables from the aliroot directory if they are not in the current one
[u/mrichter/AliRoot.git] / MUON / Config.C
CommitLineData
2102e462 1enum gentype_t {hijing, gun, box, pythia, param, cocktail, fluka, halo, ntuple, scan, doublescan, hijing_g};
2
bdad9037 3gentype_t gentype=param;
2102e462 4Int_t ntracks=1;
5
6void Config()
7
8{
aee1d6a1 9 gSystem->Load("libgeant321");
10 new TGeant3("C++ Interface to Geant3");
11
12
2102e462 13
14//=======================================================================
15// Create the output file
16
17 TFile *rootfile = new TFile("galice.root","recreate");
18 rootfile->SetCompressionLevel(2);
2102e462 19 AliDecayer* decayer = new AliDecayerPythia();
d5ca3e62 20 decayer->SetForceDecay(kAll);
2102e462 21 decayer->Init();
22 gMC->SetExternalDecayer(decayer);
23
aee1d6a1 24 TGeant3 *geant3 = (TGeant3*)gMC;
2102e462 25//=======================================================================
26// ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
27geant3->SetTRIG(1); //Number of events to be processed
28geant3->SetSWIT(4,100);
29geant3->SetDEBU(0,0,1);
30geant3->SetDCAY(1);
31geant3->SetPAIR(1);
32geant3->SetCOMP(1);
33geant3->SetPHOT(1);
34geant3->SetPFIS(0);
35geant3->SetDRAY(0);
36geant3->SetANNI(1);
37geant3->SetBREM(1);
38geant3->SetMUNU(1);
39geant3->SetCKOV(0);
40geant3->SetHADR(4); //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
41geant3->SetLOSS(1);
42geant3->SetMULS(1);
43geant3->SetRAYL(0);
44geant3->SetAUTO(1); //Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0)
45geant3->SetABAN(1); //Restore 3.16 behaviour for abandoned tracks
46geant3->SetOPTI(2); //Select optimisation level for GEANT geometry searches (0,1,2)
47Float_t cut = 1.e-4; // 100MeV cut by default
48Float_t tofmax = 1.e10;
49// GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX
50geant3->SetCUTS(1.e-4, 1.e-4, 1.e-3, 1.e-4, 1.e-3, cut, cut, cut, cut, cut, 1.e-5);
51
4ec16dd1 52gAlice->TrackingLimits(700, 2000);
2102e462 53
54//
55//=======================================================================
56// ************* STEERING parameters FOR ALICE SIMULATION **************
57// --- Specify event type to be tracked through the ALICE setup
58// --- All positions are in cm, angles in degrees, and P and E in GeV
59
60 switch(gentype)
61 {
62 case gun:
63//*********************************************
64// Example for Fixed Particle Gun *
65//*********************************************
66 AliGenFixed *gener = new AliGenFixed(ntracks);
67 gener->SetMomentum(10);
68 gener->SetPhiRange(0);
69 gener->SetThetaRange(0.);
70 gener->SetOrigin(30,30,1200); //vertex position
71 gener->SetPart(kProton); //GEANT particle type
72 break;
73 case box:
74//*********************************************
75// Example for Moving Particle Gun *
76//*********************************************
77 AliGenBox *gener = new AliGenBox(ntracks);
78 gener->SetMomentumRange(33,34);
79 gener->SetPhiRange(-180,180);
80 gener->SetThetaRange(2., 9.);
81 gener->SetOrigin(0,0,0);
82 gener->SetVertexSmear(kPerTrack);
83 //vertex position
84 gener->SetSigma(0, 0, 0); // Sigma in (X,Y,Z) (cm) on IP position
85 gener->SetPart(kMuonPlus); // GEANT particle type
86 break;
87 case scan:
88//*********************************************
89// Scanning on a grid *
90//*********************************************
91 AliGenScan *gener = new AliGenScan(-1);
92 gener->SetMomentumRange(20,20);
93 gener->SetPhiRange(90,90);
94 gener->SetThetaRange(0,0);
95 //vertex position
96 gener->SetSigma(1,1,0); //Sigma in (X,Y,Z) (cm) on IP position
97 gener->SetPart(kMuonMinus);
4ec16dd1 98 gener->SetRange(100, -300., 300., 100, -300., 300., 1, 900, 900);
2102e462 99 break;
100 case doublescan:
101//*********************************************
102// Scanning on a grid *
103//*********************************************
104 AliGenDoubleScan *gener = new AliGenDoubleScan(-1);
105 gener->SetMomentumRange(4,4);
106 gener->SetPhiRange(0,360);
107 gener->SetThetaRange(0,0);
108 //vertex position
109 gener->SetSigma(3,3,0); //Sigma in (X,Y,Z) (cm) on IP position
110 gener->SetPart(8);
111 gener->SetRange(20, -100, 100, 20, -100, 100, 1, 500, 500);
112 gener->SetDistance(1);
113 break;
114
115 case hijing:
116 AliGenHIJINGpara *gener = new AliGenHIJINGpara(ntracks);
117 gener->SetMomentumRange(0,999);
118 gener->SetPtRange(0,999);
119 gener->SetPhiRange(0,360);
120// gener->SetThetaRange(0.104,33.52);
121 gener->SetThetaRange(0.104,90.0);
122// gener->SetThetaRange(2.,9.);
123 gener->SetOrigin(0., 0.0 ,0); // vertex position
124 gener->SetSigma(0,0,5.3); // Sigma in (X,Y,Z) (cm) on IP position
125 gener->SetVertexSmear(kPerTrack);
126 gener->SetTrackingFlag(0);
127 break;
128 case hijing_g:
129 AliGenHijing *gener = new AliGenHijing(-1);
130
131 gener->SetEnergyCMS(5600.);
132 gener->SetReferenceFrame("CMS");
133 gener->SetProjectile("A", 208, 82);
134 gener->SetTarget ("A", 208, 82);
135 gener->SetImpactParameterRange(0, 5.);
136 gener->SetEvaluate(0);
137 gener->KeepFullEvent();
138 gener->SetJetQuenching(1);
139 gener->SetShadowing(1);
140 gener->SetDecaysOff(1);
141 gener->SetTrigger(0);
142 gener->SetSelectAll(1);
143 gener->SetMomentumRange(0,9999);
144 gener->SetPhiRange(-180,180);
145 gener->SetThetaRange(0.104,90.0);
146// gener->SetFlavor(4);
147 gener->SetOrigin(0., 0.0 ,0);
148 gener->SetSigma(0,0,5.3);
149 gener->SetVertexSmear(kPerEvent);
150 gener->SetTrackingFlag(0);
151
152 break;
153
154 case pythia:
155//********************************************
156// Example for Charm Production with Pythia *
157//********************************************
158AliGenPythia *gener = new AliGenPythia(ntracks);
159 gener->SetMomentumRange(0,999);
160 gener->SetPhiRange(0,360);
161 gener->SetThetaRange(0., 180.);
162 gener->SetYRange(-10,10);
163 gener->SetPtRange(0,100);
164 //gener->SetOrigin(0,0,0); // vertex position
165 //gener->SetVertexSmear(kPerEvent);
aee1d6a1 166 //gener->SetSigma(0,0,5.6); // Sigma in (X,Y,Z) (cm) on IP position
167 gener->SetStrucFunc(kDOSet1);
4ec16dd1 168 gener->SetProcess(kPyCharm);
2102e462 169 gener->SetEnergyCMS(5500.);
170 break;
171/*
172 AliGenPythia *gener = new AliGenPythia(ntracks);
173 gener->SetMomentumRange(0,999);
174 gener->SetPhiRange(0,360);
175 gener->SetThetaRange(0., 180.);
176 gener->SetYRange(-10,10);
177 gener->SetPtRange(0,100);
178 gener->SetOrigin(0,0,0); // vertex position
179 gener->SetVertexSmear(kPerEvent);
180 gener->SetSigma(0,0,5.6); // Sigma in (X,Y,Z) (cm) on IP position
181 gener->SetStrucFunc(DO_Set_1);
182 gener->SetProcess(charm);
183 gener->SetForceDecay(dimuon);
184 gener->SetEnergyCMS(5500.);
185 gener->SetTrackingFlag(0);
186
187 break;
188 */
189 case param:
190//*******************************************************
191// Example for J/psi or Upsilon Production from Parameterisation *
192//*******************************************************
d5ca3e62 193 AliGenParam *gener = new AliGenParam(ntracks, AliGenMUONlib::kUpsilon);
2102e462 194 gener->SetMomentumRange(0,999);
aee1d6a1 195 gener->SetPtRange(0,100.);
2102e462 196 gener->SetPhiRange(-180, 180);
197 gener->SetYRange(2.5,4);
198 gener->SetCutOnChild(1);
bdad9037 199 gener->SetChildThetaRange(2.0,9);
2102e462 200 gener->SetOrigin(0,0,0); //vertex position
201 gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
d5ca3e62 202 gener->SetForceDecay(kDiMuon);
2102e462 203 gener->SetTrackingFlag(1);
204
205 break;
206
207 case fluka:
208//*******************************************************
209// Example for a FLUKA Boundary Source *
210//*******************************************************
211 AliGenFLUKAsource *gener = new AliGenFLUKAsource(-1);
212 gener->AddFile("$(ALICE_ROOT)/data/alice.root");
213 rootfile->cd();
214 gener->SetPartFlag(7);
215 gener->SetMomentumRange(0,999);
216 gener->SetPhiRange(0,360);
217 gener->SetThetaRange(0., 180.);
218 gener->SetAgeMax(1.e-5);
219
220// 31.7 events
221 gener->SetFraction(1.);
222 break;
223
224 case ntuple:
225//*******************************************************
226// Example for reading from a external file *
227//*******************************************************
228 AliGenExtFileCH *gener = new AliGenExtFileCH(-1);
229 gener->SetFileName("$(ALICE_ROOT)/data/pbpb.root");
230 gener->SetThetaRange(0.104,90.);
231 gener->SetOrigin(0,0,0); //vertex position
232 gener->SetSigma(0,0,5.6); //Sigma in (X,Y,Z) (cm) on IP position
233 gener->SetVertexSmear(kPerTrack);
234 gener->SetTrackingFlag(1);
235 break;
236
237 case halo:
238//*******************************************************
239// Example for Tunnel Halo Source *
240//*******************************************************
241 AliGenHalo *gener = new AliGenHalo(ntracks);
242 gener->SetFileName("/h1/morsch/marsip/marsip5.mu");
243 break;
244
245 case cocktail:
246//*******************************************************
247// Example for a Cocktail *
248//*******************************************************
249 AliGenCocktail *gener = new AliGenCocktail();
250 gener->SetMomentumRange(0,10);
251 gener->SetPhiRange(0,360);
252 gener->SetThetaRange(2.,9.);
253 gener->SetTrackingFlag(0);
4ec16dd1 254 AliGenParam *Pi0 = new AliGenParam(100, new AliGenPMDlib(), AliGenPMDlib::kPion);
255 AliGenParam *Eta = new AliGenParam( 10, new AliGenPMDlib(), AliGenPMDlib::kEta);
2102e462 256 gener->AddGenerator(Pi0, "neutral pions" , 1.);
257 gener->AddGenerator(Eta, "neutral etas" , 1.);
258 break;
259 }
260
261
262gener->Init();
263gAlice->SetField(2,1); //Specify maximum magnetic field in Tesla (neg. ==> default field)
264
265Int_t iFRAME =0;
266Int_t iMAG =0;
267Int_t iITS =0;
fa13d8fe 268Int_t iABSO =1;
be3bb6c1 269Int_t iDIPO =0;
2102e462 270Int_t iHALL =0;
fa13d8fe 271Int_t iSHIL =1;
272Int_t iPIPE =1;
2102e462 273Int_t iFMD =0;
274Int_t iMUON =1;
275
276//=================== Alice BODY parameters =============================
277AliBODY *BODY = new AliBODY("BODY","Alice envelop");
278
279if(iFRAME) {
280//=================== FRAME parameters ============================
281AliFRAME *FRAME = new AliFRAMEv0("FRAME","Space Frame");
282}
283
284if(iMAG) {
285//=================== MAG parameters ============================
286// --- Start with Magnet since detector layouts may be depending ---
287// --- on the selected Magnet dimensions ---
288AliMAG *MAG = new AliMAG("MAG","Magnet");
289}
290
291if(iABSO) {
292//=================== ABSO parameters ============================
293 AliABSO *ABSO = new AliABSOv0("ABSO","Muon Absorber");
294}
295
296if(iDIPO) {
297//=================== DIPO parameters ============================
298
299 AliDIPO *DIPO = new AliDIPOv2("DIPO","Dipole version 2");
300}
301
302if(iHALL) {
303//=================== HALL parameters ============================
304 AliHALL *HALL = new AliHALL("HALL","Alice Hall");
305}
306
307
308
309if(iSHIL) {
310//=================== SHIL parameters ============================
311// AliSHIL *SHIL = new AliSAROV("SHIL","Shielding");
bdad9037 312 AliSHILvF *SHIL = new AliSHILvF("SHIL","Shielding");
2102e462 313 SHIL->SetPbCone(1);
314// AliSAROV *SHIL = new AliSAROV("SHIL","Shielding");
315}
316
317
318if(iPIPE) {
319//=================== PIPE parameters ============================
320 AliPIPE *PIPE = new AliPIPEv0("PIPE","Beam Pipe");
321}
322
323
324if(iFMD) {
325//=================== FMD parameters ============================
326 AliFMD *FMD = new AliFMDv1("FMD","normal FMD");
327}
328
329if(iMUON) {
330//=================== MUON parameters ===========================
331
be3bb6c1 332 AliMUON *MUON = new AliMUONv1("MUON","default");
333
2102e462 334}
be3bb6c1 335
2102e462 336}
337
338
339
340
341