Code from MUON-dev joined
[u/mrichter/AliRoot.git] / MUON / AliMUONv1.cxx
CommitLineData
a9e2aefa 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/*
17$Log$
18Revision 1.1.2.14 2000/06/14 14:37:25 morsch
19Initialization of TriggerCircuit added (PC)
20
21Revision 1.1.2.13 2000/06/09 21:55:47 morsch
22Most coding rule violations corrected.
23
24Revision 1.1.2.12 2000/05/05 11:34:29 morsch
25Log inside comments.
26
27Revision 1.1.2.11 2000/05/05 10:06:48 morsch
28Coding Rule violations regarding trigger section corrected (CP)
29Log messages included.
30*/
31
32/////////////////////////////////////////////////////////
33// Manager and hits classes for set:MUON version 0 //
34/////////////////////////////////////////////////////////
35
36#include <TTUBE.h>
37#include <TNode.h>
38#include <TRandom.h>
39#include <TLorentzVector.h>
40#include <iostream.h>
41
42#include "AliMUONv1.h"
43#include "AliRun.h"
44#include "AliMC.h"
45#include "AliCallf77.h"
46#include "AliConst.h"
47#include "AliMUONChamber.h"
48#include "AliMUONHit.h"
49#include "AliMUONPadHit.h"
50
51ClassImp(AliMUONv1)
52
53//___________________________________________
54AliMUONv1::AliMUONv1() : AliMUON()
55{
56// Constructor
57 fChambers = 0;
58}
59
60//___________________________________________
61AliMUONv1::AliMUONv1(const char *name, const char *title)
62 : AliMUON(name,title)
63{
64// Constructor
65}
66
67//___________________________________________
68void AliMUONv1::CreateGeometry()
69{
70//
71// Note: all chambers have the same structure, which could be
72// easily parameterised. This was intentionally not done in order
73// to give a starting point for the implementation of the actual
74// design of each station.
75 Int_t *idtmed = fIdtmed->GetArray()-1099;
76
77// Distance between Stations
78//
79 Float_t bpar[3];
80 Float_t tpar[3];
81 Float_t pgpar[10];
82 Float_t zpos1, zpos2, zfpos;
83 Float_t dframep=.001; // Value for station 3 should be 6 ...
84 Float_t dframep1=.001;
85// Bool_t frames=kTRUE;
86 Bool_t frames=kFALSE;
87
88 Float_t dframez=0.9;
89 Float_t dr;
90 Float_t dstation;
91
92//
93// Rotation matrices in the x-y plane
94 Int_t idrotm[1199];
95// phi= 0 deg
96 AliMatrix(idrotm[1100], 90., 0., 90., 90., 0., 0.);
97// phi= 90 deg
98 AliMatrix(idrotm[1101], 90., 90., 90., 180., 0., 0.);
99// phi= 180 deg
100 AliMatrix(idrotm[1102], 90., 180., 90., 270., 0., 0.);
101// phi= 270 deg
102 AliMatrix(idrotm[1103], 90., 270., 90., 0., 0., 0.);
103//
104 Float_t phi=2*TMath::Pi()/12/2;
105
106//
107// pointer to the current chamber
108// pointer to the current chamber
109 Int_t idAlu1=idtmed[1103];
110 Int_t idAlu2=idtmed[1104];
111// Int_t idAlu1=idtmed[1100];
112// Int_t idAlu2=idtmed[1100];
113 Int_t idAir=idtmed[1100];
114 Int_t idGas=idtmed[1105];
115
116
117 AliMUONChamber *iChamber, *iChamber1, *iChamber2;
118//********************************************************************
119// Station 1 **
120//********************************************************************
121// CONCENTRIC
122 // indices 1 and 2 for first and second chambers in the station
123 // iChamber (first chamber) kept for other quanties than Z,
124 // assumed to be the same in both chambers
125 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[0];
126 iChamber2 =(AliMUONChamber*) (*fChambers)[1];
127 zpos1=iChamber1->Z();
128 zpos2=iChamber2->Z();
129 dstation = zpos2 - zpos1;
130 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
131
132//
133// Mother volume
134 tpar[0] = iChamber->RInner()-dframep1;
135 tpar[1] = (iChamber->ROuter()+dframep1)/TMath::Cos(phi);
136 tpar[2] = dstation/4;
137
138 gMC->Gsvolu("C01M", "TUBE", idAir, tpar, 3);
139 gMC->Gsvolu("C02M", "TUBE", idAir, tpar, 3);
140 gMC->Gspos("C01M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
141 gMC->Gspos("C02M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
142// Aluminium frames
143// Outer frames
144 pgpar[0] = 360/12/2;
145 pgpar[1] = 360.;
146 pgpar[2] = 12.;
147 pgpar[3] = 2;
148 pgpar[4] = -dframez/2;
149 pgpar[5] = iChamber->ROuter();
150 pgpar[6] = pgpar[5]+dframep1;
151 pgpar[7] = +dframez/2;
152 pgpar[8] = pgpar[5];
153 pgpar[9] = pgpar[6];
154 gMC->Gsvolu("C01O", "PGON", idAlu1, pgpar, 10);
155 gMC->Gsvolu("C02O", "PGON", idAlu1, pgpar, 10);
156 gMC->Gspos("C01O",1,"C01M", 0.,0.,-zfpos, 0,"ONLY");
157 gMC->Gspos("C01O",2,"C01M", 0.,0.,+zfpos, 0,"ONLY");
158 gMC->Gspos("C02O",1,"C02M", 0.,0.,-zfpos, 0,"ONLY");
159 gMC->Gspos("C02O",2,"C02M", 0.,0.,+zfpos, 0,"ONLY");
160//
161// Inner frame
162 tpar[0]= iChamber->RInner()-dframep1;
163 tpar[1]= iChamber->RInner();
164 tpar[2]= dframez/2;
165 gMC->Gsvolu("C01I", "TUBE", idAlu1, tpar, 3);
166 gMC->Gsvolu("C02I", "TUBE", idAlu1, tpar, 3);
167
168 gMC->Gspos("C01I",1,"C01M", 0.,0.,-zfpos, 0,"ONLY");
169 gMC->Gspos("C01I",2,"C01M", 0.,0.,+zfpos, 0,"ONLY");
170 gMC->Gspos("C02I",1,"C02M", 0.,0.,-zfpos, 0,"ONLY");
171 gMC->Gspos("C02I",2,"C02M", 0.,0.,+zfpos, 0,"ONLY");
172//
173// Frame Crosses
174 if (frames) {
175
176 bpar[0] = (iChamber->ROuter() - iChamber->RInner())/2;
177 bpar[1] = dframep1/2;
178 bpar[2] = dframez/2;
179 gMC->Gsvolu("C01B", "BOX", idAlu1, bpar, 3);
180 gMC->Gsvolu("C02B", "BOX", idAlu1, bpar, 3);
181
182 gMC->Gspos("C01B",1,"C01M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
183 idrotm[1100],"ONLY");
184 gMC->Gspos("C01B",2,"C01M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
185 idrotm[1100],"ONLY");
186 gMC->Gspos("C01B",3,"C01M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
187 idrotm[1101],"ONLY");
188 gMC->Gspos("C01B",4,"C01M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
189 idrotm[1101],"ONLY");
190 gMC->Gspos("C01B",5,"C01M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
191 idrotm[1100],"ONLY");
192 gMC->Gspos("C01B",6,"C01M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
193 idrotm[1100],"ONLY");
194 gMC->Gspos("C01B",7,"C01M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
195 idrotm[1101],"ONLY");
196 gMC->Gspos("C01B",8,"C01M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
197 idrotm[1101],"ONLY");
198
199 gMC->Gspos("C02B",1,"C02M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
200 idrotm[1100],"ONLY");
201 gMC->Gspos("C02B",2,"C02M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
202 idrotm[1100],"ONLY");
203 gMC->Gspos("C02B",3,"C02M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
204 idrotm[1101],"ONLY");
205 gMC->Gspos("C02B",4,"C02M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
206 idrotm[1101],"ONLY");
207 gMC->Gspos("C02B",5,"C02M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
208 idrotm[1100],"ONLY");
209 gMC->Gspos("C02B",6,"C02M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
210 idrotm[1100],"ONLY");
211 gMC->Gspos("C02B",7,"C02M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
212 idrotm[1101],"ONLY");
213 gMC->Gspos("C02B",8,"C02M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
214 idrotm[1101],"ONLY");
215 }
216//
217// Chamber Material represented by Alu sheet
218 tpar[0]= iChamber->RInner();
219 tpar[1]= iChamber->ROuter();
220 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
221 gMC->Gsvolu("C01A", "TUBE", idAlu2, tpar, 3);
222 gMC->Gsvolu("C02A", "TUBE",idAlu2, tpar, 3);
223 gMC->Gspos("C01A", 1, "C01M", 0., 0., 0., 0, "ONLY");
224 gMC->Gspos("C02A", 1, "C02M", 0., 0., 0., 0, "ONLY");
225//
226// Sensitive volumes
227 // tpar[2] = iChamber->DGas();
228 tpar[2] = iChamber->DGas()/2;
229 gMC->Gsvolu("C01G", "TUBE", idtmed[1108], tpar, 3);
230 gMC->Gsvolu("C02G", "TUBE", idtmed[1108], tpar, 3);
231 gMC->Gspos("C01G", 1, "C01A", 0., 0., 0., 0, "ONLY");
232 gMC->Gspos("C02G", 1, "C02A", 0., 0., 0., 0, "ONLY");
233//
234// Frame Crosses to be placed inside gas
235 if (frames) {
236
237 dr = (iChamber->ROuter() - iChamber->RInner());
238 bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
239 bpar[1] = dframep1/2;
240 bpar[2] = iChamber->DGas()/2;
241 gMC->Gsvolu("C01F", "BOX", idAlu1, bpar, 3);
242 gMC->Gsvolu("C02F", "BOX", idAlu1, bpar, 3);
243
244 gMC->Gspos("C01F",1,"C01G", +iChamber->RInner()+bpar[0] , 0, 0,
245 idrotm[1100],"ONLY");
246 gMC->Gspos("C01F",2,"C01G", -iChamber->RInner()-bpar[0] , 0, 0,
247 idrotm[1100],"ONLY");
248 gMC->Gspos("C01F",3,"C01G", 0, +iChamber->RInner()+bpar[0] , 0,
249 idrotm[1101],"ONLY");
250 gMC->Gspos("C01F",4,"C01G", 0, -iChamber->RInner()-bpar[0] , 0,
251 idrotm[1101],"ONLY");
252
253 gMC->Gspos("C02F",1,"C02G", +iChamber->RInner()+bpar[0] , 0, 0,
254 idrotm[1100],"ONLY");
255 gMC->Gspos("C02F",2,"C02G", -iChamber->RInner()-bpar[0] , 0, 0,
256 idrotm[1100],"ONLY");
257 gMC->Gspos("C02F",3,"C02G", 0, +iChamber->RInner()+bpar[0] , 0,
258 idrotm[1101],"ONLY");
259 gMC->Gspos("C02F",4,"C02G", 0, -iChamber->RInner()-bpar[0] , 0,
260 idrotm[1101],"ONLY");
261 }
262
263//
264//
265//********************************************************************
266// Station 2 **
267//********************************************************************
268 // indices 1 and 2 for first and second chambers in the station
269 // iChamber (first chamber) kept for other quanties than Z,
270 // assumed to be the same in both chambers
271 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[2];
272 iChamber2 =(AliMUONChamber*) (*fChambers)[3];
273 zpos1=iChamber1->Z();
274 zpos2=iChamber2->Z();
275 dstation = zpos2 - zpos1;
276 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
277
278//
279// Mother volume
280 tpar[0] = iChamber->RInner()-dframep;
281 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
282 tpar[2] = dstation/4;
283
284 gMC->Gsvolu("C03M", "TUBE", idAir, tpar, 3);
285 gMC->Gsvolu("C04M", "TUBE", idAir, tpar, 3);
286 gMC->Gspos("C03M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
287 gMC->Gspos("C04M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
288// Aluminium frames
289// Outer frames
290 pgpar[0] = 360/12/2;
291 pgpar[1] = 360.;
292 pgpar[2] = 12.;
293 pgpar[3] = 2;
294 pgpar[4] = -dframez/2;
295 pgpar[5] = iChamber->ROuter();
296 pgpar[6] = pgpar[5]+dframep;
297 pgpar[7] = +dframez/2;
298 pgpar[8] = pgpar[5];
299 pgpar[9] = pgpar[6];
300 gMC->Gsvolu("C03O", "PGON", idAlu1, pgpar, 10);
301 gMC->Gsvolu("C04O", "PGON", idAlu1, pgpar, 10);
302 gMC->Gspos("C03O",1,"C03M", 0.,0.,-zfpos, 0,"ONLY");
303 gMC->Gspos("C03O",2,"C03M", 0.,0.,+zfpos, 0,"ONLY");
304 gMC->Gspos("C04O",1,"C04M", 0.,0.,-zfpos, 0,"ONLY");
305 gMC->Gspos("C04O",2,"C04M", 0.,0.,+zfpos, 0,"ONLY");
306//
307// Inner frame
308 tpar[0]= iChamber->RInner()-dframep;
309 tpar[1]= iChamber->RInner();
310 tpar[2]= dframez/2;
311 gMC->Gsvolu("C03I", "TUBE", idAlu1, tpar, 3);
312 gMC->Gsvolu("C04I", "TUBE", idAlu1, tpar, 3);
313
314 gMC->Gspos("C03I",1,"C03M", 0.,0.,-zfpos, 0,"ONLY");
315 gMC->Gspos("C03I",2,"C03M", 0.,0.,+zfpos, 0,"ONLY");
316 gMC->Gspos("C04I",1,"C04M", 0.,0.,-zfpos, 0,"ONLY");
317 gMC->Gspos("C04I",2,"C04M", 0.,0.,+zfpos, 0,"ONLY");
318//
319// Frame Crosses
320 if (frames) {
321
322 bpar[0] = (iChamber->ROuter() - iChamber->RInner())/2;
323 bpar[1] = dframep/2;
324 bpar[2] = dframez/2;
325 gMC->Gsvolu("C03B", "BOX", idAlu1, bpar, 3);
326 gMC->Gsvolu("C04B", "BOX", idAlu1, bpar, 3);
327
328 gMC->Gspos("C03B",1,"C03M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
329 idrotm[1100],"ONLY");
330 gMC->Gspos("C03B",2,"C03M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
331 idrotm[1100],"ONLY");
332 gMC->Gspos("C03B",3,"C03M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
333 idrotm[1101],"ONLY");
334 gMC->Gspos("C03B",4,"C03M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
335 idrotm[1101],"ONLY");
336 gMC->Gspos("C03B",5,"C03M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
337 idrotm[1100],"ONLY");
338 gMC->Gspos("C03B",6,"C03M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
339 idrotm[1100],"ONLY");
340 gMC->Gspos("C03B",7,"C03M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
341 idrotm[1101],"ONLY");
342 gMC->Gspos("C03B",8,"C03M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
343 idrotm[1101],"ONLY");
344
345 gMC->Gspos("C04B",1,"C04M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
346 idrotm[1100],"ONLY");
347 gMC->Gspos("C04B",2,"C04M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
348 idrotm[1100],"ONLY");
349 gMC->Gspos("C04B",3,"C04M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
350 idrotm[1101],"ONLY");
351 gMC->Gspos("C04B",4,"C04M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
352 idrotm[1101],"ONLY");
353 gMC->Gspos("C04B",5,"C04M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
354 idrotm[1100],"ONLY");
355 gMC->Gspos("C04B",6,"C04M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
356 idrotm[1100],"ONLY");
357 gMC->Gspos("C04B",7,"C04M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
358 idrotm[1101],"ONLY");
359 gMC->Gspos("C04B",8,"C04M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
360 idrotm[1101],"ONLY");
361 }
362//
363// Chamber Material represented by Alu sheet
364 tpar[0]= iChamber->RInner();
365 tpar[1]= iChamber->ROuter();
366 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
367 gMC->Gsvolu("C03A", "TUBE", idAlu2, tpar, 3);
368 gMC->Gsvolu("C04A", "TUBE", idAlu2, tpar, 3);
369 gMC->Gspos("C03A", 1, "C03M", 0., 0., 0., 0, "ONLY");
370 gMC->Gspos("C04A", 1, "C04M", 0., 0., 0., 0, "ONLY");
371//
372// Sensitive volumes
373 // tpar[2] = iChamber->DGas();
374 tpar[2] = iChamber->DGas()/2;
375 gMC->Gsvolu("C03G", "TUBE", idGas, tpar, 3);
376 gMC->Gsvolu("C04G", "TUBE", idGas, tpar, 3);
377 gMC->Gspos("C03G", 1, "C03A", 0., 0., 0., 0, "ONLY");
378 gMC->Gspos("C04G", 1, "C04A", 0., 0., 0., 0, "ONLY");
379
380 if (frames) {
381//
382// Frame Crosses to be placed inside gas
383 dr = (iChamber->ROuter() - iChamber->RInner());
384 bpar[0] = TMath::Sqrt(dr*dr-dframep*dframep/4)/2;
385 bpar[1] = dframep/2;
386 bpar[2] = iChamber->DGas()/2;
387 gMC->Gsvolu("C03F", "BOX", idAlu1, bpar, 3);
388 gMC->Gsvolu("C04F", "BOX", idAlu1, bpar, 3);
389
390 gMC->Gspos("C03F",1,"C03G", +iChamber->RInner()+bpar[0] , 0, 0,
391 idrotm[1100],"ONLY");
392 gMC->Gspos("C03F",2,"C03G", -iChamber->RInner()-bpar[0] , 0, 0,
393 idrotm[1100],"ONLY");
394 gMC->Gspos("C03F",3,"C03G", 0, +iChamber->RInner()+bpar[0] , 0,
395 idrotm[1101],"ONLY");
396 gMC->Gspos("C03F",4,"C03G", 0, -iChamber->RInner()-bpar[0] , 0,
397 idrotm[1101],"ONLY");
398
399 gMC->Gspos("C04F",1,"C04G", +iChamber->RInner()+bpar[0] , 0, 0,
400 idrotm[1100],"ONLY");
401 gMC->Gspos("C04F",2,"C04G", -iChamber->RInner()-bpar[0] , 0, 0,
402 idrotm[1100],"ONLY");
403 gMC->Gspos("C04F",3,"C04G", 0, +iChamber->RInner()+bpar[0] , 0,
404 idrotm[1101],"ONLY");
405 gMC->Gspos("C04F",4,"C04G", 0, -iChamber->RInner()-bpar[0] , 0,
406 idrotm[1101],"ONLY");
407 }
408
409//********************************************************************
410// Station 3 **
411//********************************************************************
412 // indices 1 and 2 for first and second chambers in the station
413 // iChamber (first chamber) kept for other quanties than Z,
414 // assumed to be the same in both chambers
415 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[4];
416 iChamber2 =(AliMUONChamber*) (*fChambers)[5];
417 zpos1=iChamber1->Z();
418 zpos2=iChamber2->Z();
419 dstation = zpos2 - zpos1;
420
421 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
422//
423// Mother volume
424 tpar[0] = iChamber->RInner()-dframep;
425 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
426 tpar[2] = dstation/4;
427 gMC->Gsvolu("C05M", "TUBE", idAir, tpar, 3);
428 gMC->Gsvolu("C06M", "TUBE", idAir, tpar, 3);
429 gMC->Gspos("C05M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
430 gMC->Gspos("C06M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
431// Aluminium frames
432// Outer frames
433 pgpar[0] = 360/12/2;
434 pgpar[1] = 360.;
435 pgpar[2] = 12.;
436 pgpar[3] = 2;
437 pgpar[4] = -dframez/2;
438 pgpar[5] = iChamber->ROuter();
439 pgpar[6] = pgpar[5]+dframep;
440 pgpar[7] = +dframez/2;
441 pgpar[8] = pgpar[5];
442 pgpar[9] = pgpar[6];
443 gMC->Gsvolu("C05O", "PGON", idAlu1, pgpar, 10);
444 gMC->Gsvolu("C06O", "PGON", idAlu1, pgpar, 10);
445 gMC->Gspos("C05O",1,"C05M", 0.,0.,-zfpos, 0,"ONLY");
446 gMC->Gspos("C05O",2,"C05M", 0.,0.,+zfpos, 0,"ONLY");
447 gMC->Gspos("C06O",1,"C06M", 0.,0.,-zfpos, 0,"ONLY");
448 gMC->Gspos("C06O",2,"C06M", 0.,0.,+zfpos, 0,"ONLY");
449//
450// Inner frame
451 tpar[0]= iChamber->RInner()-dframep;
452 tpar[1]= iChamber->RInner();
453 tpar[2]= dframez/2;
454 gMC->Gsvolu("C05I", "TUBE", idAlu1, tpar, 3);
455 gMC->Gsvolu("C06I", "TUBE", idAlu1, tpar, 3);
456
457 gMC->Gspos("C05I",1,"C05M", 0.,0.,-zfpos, 0,"ONLY");
458 gMC->Gspos("C05I",2,"C05M", 0.,0.,+zfpos, 0,"ONLY");
459 gMC->Gspos("C06I",1,"C06M", 0.,0.,-zfpos, 0,"ONLY");
460 gMC->Gspos("C06I",2,"C06M", 0.,0.,+zfpos, 0,"ONLY");
461//
462// Frame Crosses
463 if (frames) {
464 bpar[0] = (iChamber->ROuter() - iChamber->RInner())/2;
465 bpar[1] = dframep/2;
466 bpar[2] = dframez/2;
467 gMC->Gsvolu("C05B", "BOX", idAlu1, bpar, 3);
468 gMC->Gsvolu("C06B", "BOX", idAlu1, bpar, 3);
469
470 gMC->Gspos("C05B",1,"C05M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
471 idrotm[1100],"ONLY");
472 gMC->Gspos("C05B",2,"C05M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
473 idrotm[1100],"ONLY");
474 gMC->Gspos("C05B",3,"C05M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
475 idrotm[1101],"ONLY");
476 gMC->Gspos("C05B",4,"C05M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
477 idrotm[1101],"ONLY");
478 gMC->Gspos("C05B",5,"C05M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
479 idrotm[1100],"ONLY");
480 gMC->Gspos("C05B",6,"C05M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
481 idrotm[1100],"ONLY");
482 gMC->Gspos("C05B",7,"C05M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
483 idrotm[1101],"ONLY");
484 gMC->Gspos("C05B",8,"C05M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
485 idrotm[1101],"ONLY");
486
487 gMC->Gspos("C06B",1,"C06M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
488 idrotm[1100],"ONLY");
489 gMC->Gspos("C06B",2,"C06M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
490 idrotm[1100],"ONLY");
491 gMC->Gspos("C06B",3,"C06M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
492 idrotm[1101],"ONLY");
493 gMC->Gspos("C06B",4,"C06M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
494 idrotm[1101],"ONLY");
495 gMC->Gspos("C06B",5,"C06M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
496 idrotm[1100],"ONLY");
497 gMC->Gspos("C06B",6,"C06M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
498 idrotm[1100],"ONLY");
499 gMC->Gspos("C06B",7,"C06M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
500 idrotm[1101],"ONLY");
501 gMC->Gspos("C06B",8,"C06M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
502 idrotm[1101],"ONLY");
503 }
504
505
506//
507// Chamber Material represented by Alu sheet
508 tpar[0]= iChamber->RInner();
509 tpar[1]= iChamber->ROuter();
510 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
511 gMC->Gsvolu("C05A", "TUBE", idAlu2, tpar, 3);
512 gMC->Gsvolu("C06A", "TUBE", idAlu2, tpar, 3);
513 gMC->Gspos("C05A", 1, "C05M", 0., 0., 0., 0, "ONLY");
514 gMC->Gspos("C06A", 1, "C06M", 0., 0., 0., 0, "ONLY");
515//
516// Sensitive volumes
517 tpar[2] = iChamber->DGas()/2.;
518 gMC->Gsvolu("C05G", "TUBE", idGas, tpar, 3);
519 gMC->Gsvolu("C06G", "TUBE", idGas, tpar, 3);
520 gMC->Gspos("C05G", 1, "C05A", 0., 0., 0., 0, "ONLY");
521 gMC->Gspos("C06G", 1, "C06A", 0., 0., 0., 0, "ONLY");
522//
523// Frame Crosses to be placed inside gas
524 if (frames) {
525 dr = (iChamber->ROuter() - iChamber->RInner());
526 bpar[0] = TMath::Sqrt(dr*dr-dframep*dframep/4)/2;
527 bpar[1] = dframep/2;
528 bpar[2] = iChamber->DGas()/2;
529 gMC->Gsvolu("C05F", "BOX", idAlu1, bpar, 3);
530 gMC->Gsvolu("C06F", "BOX", idAlu1, bpar, 3);
531
532 gMC->Gspos("C05F",1,"C05G", +iChamber->RInner()+bpar[0] , 0, 0,
533 idrotm[1100],"ONLY");
534 gMC->Gspos("C05F",2,"C05G", -iChamber->RInner()-bpar[0] , 0, 0,
535 idrotm[1100],"ONLY");
536 gMC->Gspos("C05F",3,"C05G", 0, +iChamber->RInner()+bpar[0] , 0,
537 idrotm[1101],"ONLY");
538 gMC->Gspos("C05F",4,"C05G", 0, -iChamber->RInner()-bpar[0] , 0,
539 idrotm[1101],"ONLY");
540
541 gMC->Gspos("C06F",1,"C06G", +iChamber->RInner()+bpar[0] , 0, 0,
542 idrotm[1100],"ONLY");
543 gMC->Gspos("C06F",2,"C06G", -iChamber->RInner()-bpar[0] , 0, 0,
544 idrotm[1100],"ONLY");
545 gMC->Gspos("C06F",3,"C06G", 0, +iChamber->RInner()+bpar[0] , 0,
546 idrotm[1101],"ONLY");
547 gMC->Gspos("C06F",4,"C06G", 0, -iChamber->RInner()-bpar[0] , 0,
548 idrotm[1101],"ONLY");
549}
550
551//********************************************************************
552// Station 4 **
553//********************************************************************
554 // indices 1 and 2 for first and second chambers in the station
555 // iChamber (first chamber) kept for other quanties than Z,
556 // assumed to be the same in both chambers
557 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[6];
558 iChamber2 =(AliMUONChamber*) (*fChambers)[7];
559 zpos1=iChamber1->Z();
560 zpos2=iChamber2->Z();
561 dstation = zpos2 - zpos1;
562 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
563
564//
565// Mother volume
566 tpar[0] = iChamber->RInner()-dframep;
567 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
568 tpar[2] = dstation/4;
569
570 gMC->Gsvolu("C07M", "TUBE", idAir, tpar, 3);
571 gMC->Gsvolu("C08M", "TUBE", idAir, tpar, 3);
572 gMC->Gspos("C07M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
573 gMC->Gspos("C08M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
574// Aluminium frames
575// Outer frames
576 pgpar[0] = 360/12/2;
577 pgpar[1] = 360.;
578 pgpar[2] = 12.;
579 pgpar[3] = 2;
580 pgpar[4] = -dframez/2;
581 pgpar[5] = iChamber->ROuter();
582 pgpar[6] = pgpar[5]+dframep;
583 pgpar[7] = +dframez/2;
584 pgpar[8] = pgpar[5];
585 pgpar[9] = pgpar[6];
586 gMC->Gsvolu("C07O", "PGON", idAlu1, pgpar, 10);
587 gMC->Gsvolu("C08O", "PGON", idAlu1, pgpar, 10);
588 gMC->Gspos("C07O",1,"C07M", 0.,0.,-zfpos, 0,"ONLY");
589 gMC->Gspos("C07O",2,"C07M", 0.,0.,+zfpos, 0,"ONLY");
590 gMC->Gspos("C08O",1,"C08M", 0.,0.,-zfpos, 0,"ONLY");
591 gMC->Gspos("C08O",2,"C08M", 0.,0.,+zfpos, 0,"ONLY");
592//
593// Inner frame
594 tpar[0]= iChamber->RInner()-dframep;
595 tpar[1]= iChamber->RInner();
596 tpar[2]= dframez/2;
597 gMC->Gsvolu("C07I", "TUBE", idAlu1, tpar, 3);
598 gMC->Gsvolu("C08I", "TUBE", idAlu1, tpar, 3);
599
600 gMC->Gspos("C07I",1,"C07M", 0.,0.,-zfpos, 0,"ONLY");
601 gMC->Gspos("C07I",2,"C07M", 0.,0.,+zfpos, 0,"ONLY");
602 gMC->Gspos("C08I",1,"C08M", 0.,0.,-zfpos, 0,"ONLY");
603 gMC->Gspos("C08I",2,"C08M", 0.,0.,+zfpos, 0,"ONLY");
604//
605// Frame Crosses
606 if (frames) {
607 bpar[0] = (iChamber->ROuter() - iChamber->RInner())/2;
608 bpar[1] = dframep/2;
609 bpar[2] = dframez/2;
610 gMC->Gsvolu("C07B", "BOX", idAlu1, bpar, 3);
611 gMC->Gsvolu("C08B", "BOX", idAlu1, bpar, 3);
612
613 gMC->Gspos("C07B",1,"C07M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
614 idrotm[1100],"ONLY");
615 gMC->Gspos("C07B",2,"C07M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
616 idrotm[1100],"ONLY");
617 gMC->Gspos("C07B",3,"C07M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
618 idrotm[1101],"ONLY");
619 gMC->Gspos("C07B",4,"C07M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
620 idrotm[1101],"ONLY");
621 gMC->Gspos("C07B",5,"C07M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
622 idrotm[1100],"ONLY");
623 gMC->Gspos("C07B",6,"C07M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
624 idrotm[1100],"ONLY");
625 gMC->Gspos("C07B",7,"C07M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
626 idrotm[1101],"ONLY");
627 gMC->Gspos("C07B",8,"C07M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
628 idrotm[1101],"ONLY");
629
630 gMC->Gspos("C08B",1,"C08M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
631 idrotm[1100],"ONLY");
632 gMC->Gspos("C08B",2,"C08M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
633 idrotm[1100],"ONLY");
634 gMC->Gspos("C08B",3,"C08M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
635 idrotm[1101],"ONLY");
636 gMC->Gspos("C08B",4,"C08M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
637 idrotm[1101],"ONLY");
638 gMC->Gspos("C08B",5,"C08M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
639 idrotm[1100],"ONLY");
640 gMC->Gspos("C08B",6,"C08M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
641 idrotm[1100],"ONLY");
642 gMC->Gspos("C08B",7,"C08M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
643 idrotm[1101],"ONLY");
644 gMC->Gspos("C08B",8,"C08M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
645 idrotm[1101],"ONLY");
646 }
647
648
649//
650// Chamber Material represented by Alu sheet
651 tpar[0]= iChamber->RInner();
652 tpar[1]= iChamber->ROuter();
653 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
654 gMC->Gsvolu("C07A", "TUBE", idAlu2, tpar, 3);
655 gMC->Gsvolu("C08A", "TUBE", idAlu2, tpar, 3);
656 gMC->Gspos("C07A", 1, "C07M", 0., 0., 0., 0, "ONLY");
657 gMC->Gspos("C08A", 1, "C08M", 0., 0., 0., 0, "ONLY");
658//
659// Sensitive volumes
660 // tpar[2] = iChamber->DGas();
661 tpar[2] = iChamber->DGas()/2;
662 gMC->Gsvolu("C07G", "TUBE", idGas, tpar, 3);
663 gMC->Gsvolu("C08G", "TUBE", idGas, tpar, 3);
664 gMC->Gspos("C07G", 1, "C07A", 0., 0., 0., 0, "ONLY");
665 gMC->Gspos("C08G", 1, "C08A", 0., 0., 0., 0, "ONLY");
666//
667// Frame Crosses to be placed inside gas
668 if (frames) {
669 dr = (iChamber->ROuter() - iChamber->RInner());
670 bpar[0] = TMath::Sqrt(dr*dr-dframep*dframep/4)/2;
671 bpar[1] = dframep/2;
672 bpar[2] = iChamber->DGas()/2;
673 gMC->Gsvolu("C07F", "BOX", idAlu1, bpar, 3);
674 gMC->Gsvolu("C08F", "BOX", idAlu1, bpar, 3);
675
676 gMC->Gspos("C07F",1,"C07G", +iChamber->RInner()+bpar[0] , 0, 0,
677 idrotm[1100],"ONLY");
678 gMC->Gspos("C07F",2,"C07G", -iChamber->RInner()-bpar[0] , 0, 0,
679 idrotm[1100],"ONLY");
680 gMC->Gspos("C07F",3,"C07G", 0, +iChamber->RInner()+bpar[0] , 0,
681 idrotm[1101],"ONLY");
682 gMC->Gspos("C07F",4,"C07G", 0, -iChamber->RInner()-bpar[0] , 0,
683 idrotm[1101],"ONLY");
684
685 gMC->Gspos("C08F",1,"C08G", +iChamber->RInner()+bpar[0] , 0, 0,
686 idrotm[1100],"ONLY");
687 gMC->Gspos("C08F",2,"C08G", -iChamber->RInner()-bpar[0] , 0, 0,
688 idrotm[1100],"ONLY");
689 gMC->Gspos("C08F",3,"C08G", 0, +iChamber->RInner()+bpar[0] , 0,
690 idrotm[1101],"ONLY");
691 gMC->Gspos("C08F",4,"C08G", 0, -iChamber->RInner()-bpar[0] , 0,
692 idrotm[1101],"ONLY");
693 }
694//********************************************************************
695// Station 5 **
696//********************************************************************
697 // indices 1 and 2 for first and second chambers in the station
698 // iChamber (first chamber) kept for other quanties than Z,
699 // assumed to be the same in both chambers
700 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[8];
701 iChamber2 =(AliMUONChamber*) (*fChambers)[9];
702 zpos1=iChamber1->Z();
703 zpos2=iChamber2->Z();
704 dstation = zpos2 - zpos1;
705 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
706
707//
708// Mother volume
709 tpar[0] = iChamber->RInner()-dframep;
710 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
711 tpar[2] = dstation/4;
712
713 gMC->Gsvolu("C09M", "TUBE", idAir, tpar, 3);
714 gMC->Gsvolu("C10M", "TUBE", idAir, tpar, 3);
715 gMC->Gspos("C09M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
716 gMC->Gspos("C10M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
717// Aluminium frames
718// Outer frames
719 pgpar[0] = 360/12/2;
720 pgpar[1] = 360.;
721 pgpar[2] = 12.;
722 pgpar[3] = 2;
723 pgpar[4] = -dframez/2;
724 pgpar[5] = iChamber->ROuter();
725 pgpar[6] = pgpar[5]+dframep;
726 pgpar[7] = +dframez/2;
727 pgpar[8] = pgpar[5];
728 pgpar[9] = pgpar[6];
729 gMC->Gsvolu("C09O", "PGON", idAlu1, pgpar, 10);
730 gMC->Gsvolu("C10O", "PGON", idAlu1, pgpar, 10);
731 gMC->Gspos("C09O",1,"C09M", 0.,0.,-zfpos, 0,"ONLY");
732 gMC->Gspos("C09O",2,"C09M", 0.,0.,+zfpos, 0,"ONLY");
733 gMC->Gspos("C10O",1,"C10M", 0.,0.,-zfpos, 0,"ONLY");
734 gMC->Gspos("C10O",2,"C10M", 0.,0.,+zfpos, 0,"ONLY");
735//
736// Inner frame
737 tpar[0]= iChamber->RInner()-dframep;
738 tpar[1]= iChamber->RInner();
739 tpar[2]= dframez/2;
740 gMC->Gsvolu("C09I", "TUBE", idAlu1, tpar, 3);
741 gMC->Gsvolu("C10I", "TUBE", idAlu1, tpar, 3);
742
743 gMC->Gspos("C09I",1,"C09M", 0.,0.,-zfpos, 0,"ONLY");
744 gMC->Gspos("C09I",2,"C09M", 0.,0.,+zfpos, 0,"ONLY");
745 gMC->Gspos("C10I",1,"C10M", 0.,0.,-zfpos, 0,"ONLY");
746 gMC->Gspos("C10I",2,"C10M", 0.,0.,+zfpos, 0,"ONLY");
747
748 if (frames) {
749//
750// Frame Crosses
751
752 bpar[0] = (iChamber->ROuter() - iChamber->RInner())/2;
753 bpar[1] = dframep/2;
754 bpar[2] = dframez/2;
755 gMC->Gsvolu("C09B", "BOX", idAlu1, bpar, 3);
756 gMC->Gsvolu("C10B", "BOX", idAlu1, bpar, 3);
757
758 gMC->Gspos("C09B",1,"C09M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
759 idrotm[1100],"ONLY");
760 gMC->Gspos("C09B",2,"C09M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
761 idrotm[1100],"ONLY");
762 gMC->Gspos("C09B",3,"C09M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
763 idrotm[1101],"ONLY");
764 gMC->Gspos("C09B",4,"C09M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
765 idrotm[1101],"ONLY");
766 gMC->Gspos("C09B",5,"C09M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
767 idrotm[1100],"ONLY");
768 gMC->Gspos("C09B",6,"C09M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
769 idrotm[1100],"ONLY");
770 gMC->Gspos("C09B",7,"C09M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
771 idrotm[1101],"ONLY");
772 gMC->Gspos("C09B",8,"C09M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
773 idrotm[1101],"ONLY");
774
775 gMC->Gspos("C10B",1,"C10M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
776 idrotm[1100],"ONLY");
777 gMC->Gspos("C10B",2,"C10M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
778 idrotm[1100],"ONLY");
779 gMC->Gspos("C10B",3,"C10M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
780 idrotm[1101],"ONLY");
781 gMC->Gspos("C10B",4,"C10M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
782 idrotm[1101],"ONLY");
783 gMC->Gspos("C10B",5,"C10M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
784 idrotm[1100],"ONLY");
785 gMC->Gspos("C10B",6,"C10M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
786 idrotm[1100],"ONLY");
787 gMC->Gspos("C10B",7,"C10M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
788 idrotm[1101],"ONLY");
789 gMC->Gspos("C10B",8,"C10M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
790 idrotm[1101],"ONLY");
791 }
792
793
794//
795// Chamber Material represented by Alu sheet
796 tpar[0]= iChamber->RInner();
797 tpar[1]= iChamber->ROuter();
798 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
799 gMC->Gsvolu("C09A", "TUBE", idAlu2, tpar, 3);
800 gMC->Gsvolu("C10A", "TUBE", idAlu2, tpar, 3);
801 gMC->Gspos("C09A", 1, "C09M", 0., 0., 0., 0, "ONLY");
802 gMC->Gspos("C10A", 1, "C10M", 0., 0., 0., 0, "ONLY");
803//
804// Sensitive volumes
805 // tpar[2] = iChamber->DGas();
806 tpar[2] = iChamber->DGas()/2;
807 gMC->Gsvolu("C09G", "TUBE", idGas, tpar, 3);
808 gMC->Gsvolu("C10G", "TUBE", idGas, tpar, 3);
809 gMC->Gspos("C09G", 1, "C09A", 0., 0., 0., 0, "ONLY");
810 gMC->Gspos("C10G", 1, "C10A", 0., 0., 0., 0, "ONLY");
811//
812// Frame Crosses to be placed inside gas
813 if (frames) {
814 dr = (iChamber->ROuter() - iChamber->RInner());
815 bpar[0] = TMath::Sqrt(dr*dr-dframep*dframep/4)/2;
816 bpar[1] = dframep/2;
817 bpar[2] = iChamber->DGas()/2;
818 gMC->Gsvolu("C09F", "BOX", idAlu1, bpar, 3);
819 gMC->Gsvolu("C10F", "BOX", idAlu1, bpar, 3);
820
821 gMC->Gspos("C09F",1,"C09G", +iChamber->RInner()+bpar[0] , 0, 0,
822 idrotm[1100],"ONLY");
823 gMC->Gspos("C09F",2,"C09G", -iChamber->RInner()-bpar[0] , 0, 0,
824 idrotm[1100],"ONLY");
825 gMC->Gspos("C09F",3,"C09G", 0, +iChamber->RInner()+bpar[0] , 0,
826 idrotm[1101],"ONLY");
827 gMC->Gspos("C09F",4,"C09G", 0, -iChamber->RInner()-bpar[0] , 0,
828 idrotm[1101],"ONLY");
829
830 gMC->Gspos("C10F",1,"C10G", +iChamber->RInner()+bpar[0] , 0, 0,
831 idrotm[1100],"ONLY");
832 gMC->Gspos("C10F",2,"C10G", -iChamber->RInner()-bpar[0] , 0, 0,
833 idrotm[1100],"ONLY");
834 gMC->Gspos("C10F",3,"C10G", 0, +iChamber->RInner()+bpar[0] , 0,
835 idrotm[1101],"ONLY");
836 gMC->Gspos("C10F",4,"C10G", 0, -iChamber->RInner()-bpar[0] , 0,
837 idrotm[1101],"ONLY");
838 }
839
840///////////////////////////////////////
841// GEOMETRY FOR THE TRIGGER CHAMBERS //
842///////////////////////////////////////
843
844// 03/00 P. Dupieux : introduce a slighly more realistic
845// geom. of the trigger readout planes with
846// 2 Zpos per trigger plane (alternate
847// between left and right of the trigger)
848
849// Parameters of the Trigger Chambers
850
851
852 const Float_t kXMC1MIN=34.;
853 const Float_t kXMC1MED=51.;
854 const Float_t kXMC1MAX=272.;
855 const Float_t kYMC1MIN=34.;
856 const Float_t kYMC1MAX=51.;
857 const Float_t kRMIN1=50.;
858 const Float_t kRMAX1=62.;
859 const Float_t kRMIN2=50.;
860 const Float_t kRMAX2=66.;
861
862// zposition of the middle of the gas gap in mother vol
863 const Float_t kZMCm=-3.6;
864 const Float_t kZMCp=+3.6;
865
866
867// TRIGGER STATION 1 - TRIGGER STATION 1 - TRIGGER STATION 1
868
869 // iChamber 1 and 2 for first and second chambers in the station
870 // iChamber (first chamber) kept for other quanties than Z,
871 // assumed to be the same in both chambers
872 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[10];
873 iChamber2 =(AliMUONChamber*) (*fChambers)[11];
874
875 // 03/00
876 // zpos1 and zpos2 are now the middle of the first and second
877 // plane of station 1 :
878 // zpos1=(16075+15995)/2=16035 mm, thick/2=40 mm
879 // zpos2=(16225+16145)/2=16185 mm, thick/2=40 mm
880 //
881 // zpos1m=15999 mm , zpos1p=16071 mm (middles of gas gaps)
882 // zpos2m=16149 mm , zpos2p=16221 mm (middles of gas gaps)
883 // rem : the total thickness accounts for 1 mm of al on both
884 // side of the RPCs (see zpos1 and zpos2), as previously
885
886 zpos1=iChamber1->Z();
887 zpos2=iChamber2->Z();
888
889
890// Mother volume definition
891 tpar[0] = iChamber->RInner();
892 tpar[1] = iChamber->ROuter();
893 tpar[2] = 4.0;
894 gMC->Gsvolu("CM11", "TUBE", idAir, tpar, 3);
895 gMC->Gsvolu("CM12", "TUBE", idAir, tpar, 3);
896
897// Definition of the flange between the beam shielding and the RPC
898 tpar[0]= kRMIN1;
899 tpar[1]= kRMAX1;
900 tpar[2]= 4.0;
901
902 gMC->Gsvolu("CF1A", "TUBE", idAlu1, tpar, 3); //Al
903 gMC->Gspos("CF1A", 1, "CM11", 0., 0., 0., 0, "MANY");
904 gMC->Gspos("CF1A", 2, "CM12", 0., 0., 0., 0, "MANY");
905
906
907// FIRST PLANE OF STATION 1
908
909// ratios of zpos1m/zpos1p and inverse for first plane
910 Float_t zmp=(zpos1-3.6)/(zpos1+3.6);
911 Float_t zpm=1./zmp;
912
913
914// Definition of prototype for chambers in the first plane
915
916 tpar[0]= 0.;
917 tpar[1]= 0.;
918 tpar[2]= 0.;
919
920 gMC->Gsvolu("CC1A", "BOX ", idAlu1, tpar, 0); //Al
921 gMC->Gsvolu("CB1A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
922 gMC->Gsvolu("CG1A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
923
924// chamber type A
925 tpar[0] = -1.;
926 tpar[1] = -1.;
927
928 const Float_t kXMC1A=kXMC1MED+(kXMC1MAX-kXMC1MED)/2.;
929 const Float_t kYMC1Am=0.;
930 const Float_t kYMC1Ap=0.;
931
932 tpar[2] = 0.1;
933 gMC->Gsposp("CG1A", 1, "CB1A", 0., 0., 0., 0, "ONLY",tpar,3);
934 tpar[2] = 0.3;
935 gMC->Gsposp("CB1A", 1, "CC1A", 0., 0., 0., 0, "ONLY",tpar,3);
936
937 tpar[2] = 0.4;
938 tpar[0] = (kXMC1MAX-kXMC1MED)/2.;
939 tpar[1] = kYMC1MIN;
940
941 gMC->Gsposp("CC1A", 1, "CM11",kXMC1A,kYMC1Am,kZMCm, 0, "ONLY", tpar, 3);
942 gMC->Gsposp("CC1A", 2, "CM11",-kXMC1A,kYMC1Ap,kZMCp, 0, "ONLY", tpar, 3);
943
944// chamber type B
945 Float_t tpar1save=tpar[1];
946 Float_t y1msave=kYMC1Am;
947 Float_t y1psave=kYMC1Ap;
948
949 tpar[0] = (kXMC1MAX-kXMC1MIN)/2.;
950 tpar[1] = (kYMC1MAX-kYMC1MIN)/2.;
951
952 const Float_t kXMC1B=kXMC1MIN+tpar[0];
953 const Float_t kYMC1Bp=(y1msave+tpar1save)*zpm+tpar[1];
954 const Float_t kYMC1Bm=(y1psave+tpar1save)*zmp+tpar[1];
955
956 gMC->Gsposp("CC1A", 3, "CM11",kXMC1B,kYMC1Bp,kZMCp, 0, "ONLY", tpar, 3);
957 gMC->Gsposp("CC1A", 4, "CM11",-kXMC1B,kYMC1Bm,kZMCm, 0, "ONLY", tpar, 3);
958 gMC->Gsposp("CC1A", 5, "CM11",kXMC1B,-kYMC1Bp,kZMCp, 0, "ONLY", tpar, 3);
959 gMC->Gsposp("CC1A", 6, "CM11",-kXMC1B,-kYMC1Bm,kZMCm, 0, "ONLY", tpar, 3);
960
961// chamber type C (end of type B !!)
962 tpar1save=tpar[1];
963 y1msave=kYMC1Bm;
964 y1psave=kYMC1Bp;
965
966 tpar[0] = kXMC1MAX/2;
967 tpar[1] = kYMC1MAX/2;
968
969 const Float_t kXMC1C=tpar[0];
970// warning : same Z than type B
971 const Float_t kYMC1Cp=(y1psave+tpar1save)*1.+tpar[1];
972 const Float_t kYMC1Cm=(y1msave+tpar1save)*1.+tpar[1];
973
974 gMC->Gsposp("CC1A", 7, "CM11",kXMC1C,kYMC1Cp,kZMCp, 0, "ONLY", tpar, 3);
975 gMC->Gsposp("CC1A", 8, "CM11",-kXMC1C,kYMC1Cm,kZMCm, 0, "ONLY", tpar, 3);
976 gMC->Gsposp("CC1A", 9, "CM11",kXMC1C,-kYMC1Cp,kZMCp, 0, "ONLY", tpar, 3);
977 gMC->Gsposp("CC1A", 10, "CM11",-kXMC1C,-kYMC1Cm,kZMCm, 0, "ONLY", tpar, 3);
978
979// chamber type D, E and F (same size)
980 tpar1save=tpar[1];
981 y1msave=kYMC1Cm;
982 y1psave=kYMC1Cp;
983
984 tpar[0] = kXMC1MAX/2.;
985 tpar[1] = kYMC1MIN;
986
987 const Float_t kXMC1D=tpar[0];
988 const Float_t kYMC1Dp=(y1msave+tpar1save)*zpm+tpar[1];
989 const Float_t kYMC1Dm=(y1psave+tpar1save)*zmp+tpar[1];
990
991 gMC->Gsposp("CC1A", 11, "CM11",kXMC1D,kYMC1Dm,kZMCm, 0, "ONLY", tpar, 3);
992 gMC->Gsposp("CC1A", 12, "CM11",-kXMC1D,kYMC1Dp,kZMCp, 0, "ONLY", tpar, 3);
993 gMC->Gsposp("CC1A", 13, "CM11",kXMC1D,-kYMC1Dm,kZMCm, 0, "ONLY", tpar, 3);
994 gMC->Gsposp("CC1A", 14, "CM11",-kXMC1D,-kYMC1Dp,kZMCp, 0, "ONLY", tpar, 3);
995
996
997 tpar1save=tpar[1];
998 y1msave=kYMC1Dm;
999 y1psave=kYMC1Dp;
1000 const Float_t kYMC1Ep=(y1msave+tpar1save)*zpm+tpar[1];
1001 const Float_t kYMC1Em=(y1psave+tpar1save)*zmp+tpar[1];
1002
1003 gMC->Gsposp("CC1A", 15, "CM11",kXMC1D,kYMC1Ep,kZMCp, 0, "ONLY", tpar, 3);
1004 gMC->Gsposp("CC1A", 16, "CM11",-kXMC1D,kYMC1Em,kZMCm, 0, "ONLY", tpar, 3);
1005 gMC->Gsposp("CC1A", 17, "CM11",kXMC1D,-kYMC1Ep,kZMCp, 0, "ONLY", tpar, 3);
1006 gMC->Gsposp("CC1A", 18, "CM11",-kXMC1D,-kYMC1Em,kZMCm, 0, "ONLY", tpar, 3);
1007
1008 tpar1save=tpar[1];
1009 y1msave=kYMC1Em;
1010 y1psave=kYMC1Ep;
1011 const Float_t kYMC1Fp=(y1msave+tpar1save)*zpm+tpar[1];
1012 const Float_t kYMC1Fm=(y1psave+tpar1save)*zmp+tpar[1];
1013
1014 gMC->Gsposp("CC1A", 19, "CM11",kXMC1D,kYMC1Fm,kZMCm, 0, "ONLY", tpar, 3);
1015 gMC->Gsposp("CC1A", 20, "CM11",-kXMC1D,kYMC1Fp,kZMCp, 0, "ONLY", tpar, 3);
1016 gMC->Gsposp("CC1A", 21, "CM11",kXMC1D,-kYMC1Fm,kZMCm, 0, "ONLY", tpar, 3);
1017 gMC->Gsposp("CC1A", 22, "CM11",-kXMC1D,-kYMC1Fp,kZMCp, 0, "ONLY", tpar, 3);
1018
1019// Positioning first plane in ALICE
1020 gMC->Gspos("CM11", 1, "ALIC", 0., 0., zpos1, 0, "ONLY");
1021
1022// End of geometry definition for the first plane of station 1
1023
1024
1025
1026// SECOND PLANE OF STATION 1 : proj ratio = zpos2/zpos1
1027
1028 const Float_t kZ12=zpos2/zpos1;
1029
1030// Definition of prototype for chambers in the second plane of station 1
1031
1032 tpar[0]= 0.;
1033 tpar[1]= 0.;
1034 tpar[2]= 0.;
1035
1036 gMC->Gsvolu("CC2A", "BOX ", idAlu1, tpar, 0); //Al
1037 gMC->Gsvolu("CB2A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1038 gMC->Gsvolu("CG2A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1039
1040// chamber type A
1041 tpar[0] = -1.;
1042 tpar[1] = -1.;
1043
1044 const Float_t kXMC2A=kXMC1A*kZ12;
1045 const Float_t kYMC2Am=0.;
1046 const Float_t kYMC2Ap=0.;
1047
1048 tpar[2] = 0.1;
1049 gMC->Gsposp("CG2A", 1, "CB2A", 0., 0., 0., 0, "ONLY",tpar,3);
1050 tpar[2] = 0.3;
1051 gMC->Gsposp("CB2A", 1, "CC2A", 0., 0., 0., 0, "ONLY",tpar,3);
1052
1053 tpar[2] = 0.4;
1054 tpar[0] = ((kXMC1MAX-kXMC1MED)/2.)*kZ12;
1055 tpar[1] = kYMC1MIN*kZ12;
1056
1057 gMC->Gsposp("CC2A", 1, "CM12",kXMC2A,kYMC2Am,kZMCm, 0, "ONLY", tpar, 3);
1058 gMC->Gsposp("CC2A", 2, "CM12",-kXMC2A,kYMC2Ap,kZMCp, 0, "ONLY", tpar, 3);
1059
1060
1061// chamber type B
1062
1063 tpar[0] = ((kXMC1MAX-kXMC1MIN)/2.)*kZ12;
1064 tpar[1] = ((kYMC1MAX-kYMC1MIN)/2.)*kZ12;
1065
1066 const Float_t kXMC2B=kXMC1B*kZ12;
1067 const Float_t kYMC2Bp=kYMC1Bp*kZ12;
1068 const Float_t kYMC2Bm=kYMC1Bm*kZ12;
1069 gMC->Gsposp("CC2A", 3, "CM12",kXMC2B,kYMC2Bp,kZMCp, 0, "ONLY", tpar, 3);
1070 gMC->Gsposp("CC2A", 4, "CM12",-kXMC2B,kYMC2Bm,kZMCm, 0, "ONLY", tpar, 3);
1071 gMC->Gsposp("CC2A", 5, "CM12",kXMC2B,-kYMC2Bp,kZMCp, 0, "ONLY", tpar, 3);
1072 gMC->Gsposp("CC2A", 6, "CM12",-kXMC2B,-kYMC2Bm,kZMCm, 0, "ONLY", tpar, 3);
1073
1074
1075// chamber type C (end of type B !!)
1076
1077 tpar[0] = (kXMC1MAX/2)*kZ12;
1078 tpar[1] = (kYMC1MAX/2)*kZ12;
1079
1080 const Float_t kXMC2C=kXMC1C*kZ12;
1081 const Float_t kYMC2Cp=kYMC1Cp*kZ12;
1082 const Float_t kYMC2Cm=kYMC1Cm*kZ12;
1083 gMC->Gsposp("CC2A", 7, "CM12",kXMC2C,kYMC2Cp,kZMCp, 0, "ONLY", tpar, 3);
1084 gMC->Gsposp("CC2A", 8, "CM12",-kXMC2C,kYMC2Cm,kZMCm, 0, "ONLY", tpar, 3);
1085 gMC->Gsposp("CC2A", 9, "CM12",kXMC2C,-kYMC2Cp,kZMCp, 0, "ONLY", tpar, 3);
1086 gMC->Gsposp("CC2A", 10, "CM12",-kXMC2C,-kYMC2Cm,kZMCm, 0, "ONLY", tpar, 3);
1087
1088// chamber type D, E and F (same size)
1089
1090 tpar[0] = (kXMC1MAX/2.)*kZ12;
1091 tpar[1] = kYMC1MIN*kZ12;
1092
1093 const Float_t kXMC2D=kXMC1D*kZ12;
1094 const Float_t kYMC2Dp=kYMC1Dp*kZ12;
1095 const Float_t kYMC2Dm=kYMC1Dm*kZ12;
1096 gMC->Gsposp("CC2A", 11, "CM12",kXMC2D,kYMC2Dm,kZMCm, 0, "ONLY", tpar, 3);
1097 gMC->Gsposp("CC2A", 12, "CM12",-kXMC2D,kYMC2Dp,kZMCp, 0, "ONLY", tpar, 3);
1098 gMC->Gsposp("CC2A", 13, "CM12",kXMC2D,-kYMC2Dm,kZMCm, 0, "ONLY", tpar, 3);
1099 gMC->Gsposp("CC2A", 14, "CM12",-kXMC2D,-kYMC2Dp,kZMCp, 0, "ONLY", tpar, 3);
1100
1101 const Float_t kYMC2Ep=kYMC1Ep*kZ12;
1102 const Float_t kYMC2Em=kYMC1Em*kZ12;
1103 gMC->Gsposp("CC2A", 15, "CM12",kXMC2D,kYMC2Ep,kZMCp, 0, "ONLY", tpar, 3);
1104 gMC->Gsposp("CC2A", 16, "CM12",-kXMC2D,kYMC2Em,kZMCm, 0, "ONLY", tpar, 3);
1105 gMC->Gsposp("CC2A", 17, "CM12",kXMC2D,-kYMC2Ep,kZMCp, 0, "ONLY", tpar, 3);
1106 gMC->Gsposp("CC2A", 18, "CM12",-kXMC2D,-kYMC2Em,kZMCm, 0, "ONLY", tpar, 3);
1107
1108
1109 const Float_t kYMC2Fp=kYMC1Fp*kZ12;
1110 const Float_t kYMC2Fm=kYMC1Fm*kZ12;
1111 gMC->Gsposp("CC2A", 19, "CM12",kXMC2D,kYMC2Fm,kZMCm, 0, "ONLY", tpar, 3);
1112 gMC->Gsposp("CC2A", 20, "CM12",-kXMC2D,kYMC2Fp,kZMCp, 0, "ONLY", tpar, 3);
1113 gMC->Gsposp("CC2A", 21, "CM12",kXMC2D,-kYMC2Fm,kZMCm, 0, "ONLY", tpar, 3);
1114 gMC->Gsposp("CC2A", 22, "CM12",-kXMC2D,-kYMC2Fp,kZMCp, 0, "ONLY", tpar, 3);
1115
1116// Positioning second plane of station 1 in ALICE
1117
1118 gMC->Gspos("CM12", 1, "ALIC", 0., 0., zpos2, 0, "ONLY");
1119
1120// End of geometry definition for the second plane of station 1
1121
1122
1123
1124// TRIGGER STATION 2 - TRIGGER STATION 2 - TRIGGER STATION 2
1125
1126 // 03/00
1127 // zpos3 and zpos4 are now the middle of the first and second
1128 // plane of station 2 :
1129 // zpos3=(17075+16995)/2=17035 mm, thick/2=40 mm
1130 // zpos4=(17225+17145)/2=17185 mm, thick/2=40 mm
1131 //
1132 // zpos3m=16999 mm , zpos3p=17071 mm (middles of gas gaps)
1133 // zpos4m=17149 mm , zpos4p=17221 mm (middles of gas gaps)
1134 // rem : the total thickness accounts for 1 mm of al on both
1135 // side of the RPCs (see zpos3 and zpos4), as previously
1136 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[12];
1137 iChamber2 =(AliMUONChamber*) (*fChambers)[13];
1138 Float_t zpos3=iChamber1->Z();
1139 Float_t zpos4=iChamber2->Z();
1140
1141
1142// Mother volume definition
1143 tpar[0] = iChamber->RInner();
1144 tpar[1] = iChamber->ROuter();
1145 tpar[2] = 4.0;
1146
1147 gMC->Gsvolu("CM21", "TUBE", idAir, tpar, 3);
1148 gMC->Gsvolu("CM22", "TUBE", idAir, tpar, 3);
1149
1150// Definition of the flange between the beam shielding and the RPC
1151// ???? interface shielding
1152
1153 tpar[0]= kRMIN2;
1154 tpar[1]= kRMAX2;
1155 tpar[2]= 4.0;
1156
1157 gMC->Gsvolu("CF2A", "TUBE", idAlu1, tpar, 3); //Al
1158 gMC->Gspos("CF2A", 1, "CM21", 0., 0., 0., 0, "MANY");
1159 gMC->Gspos("CF2A", 2, "CM22", 0., 0., 0., 0, "MANY");
1160
1161
1162
1163// FIRST PLANE OF STATION 2 : proj ratio = zpos3/zpos1
1164
1165 const Float_t kZ13=zpos3/zpos1;
1166
1167// Definition of prototype for chambers in the first plane of station 2
1168 tpar[0]= 0.;
1169 tpar[1]= 0.;
1170 tpar[2]= 0.;
1171
1172 gMC->Gsvolu("CC3A", "BOX ", idAlu1, tpar, 0); //Al
1173 gMC->Gsvolu("CB3A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1174 gMC->Gsvolu("CG3A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1175
1176
1177// chamber type A
1178 tpar[0] = -1.;
1179 tpar[1] = -1.;
1180
1181 const Float_t kXMC3A=kXMC1A*kZ13;
1182 const Float_t kYMC3Am=0.;
1183 const Float_t kYMC3Ap=0.;
1184
1185 tpar[2] = 0.1;
1186 gMC->Gsposp("CG3A", 1, "CB3A", 0., 0., 0., 0, "ONLY",tpar,3);
1187 tpar[2] = 0.3;
1188 gMC->Gsposp("CB3A", 1, "CC3A", 0., 0., 0., 0, "ONLY",tpar,3);
1189
1190 tpar[2] = 0.4;
1191 tpar[0] = ((kXMC1MAX-kXMC1MED)/2.)*kZ13;
1192 tpar[1] = kYMC1MIN*kZ13;
1193 gMC->Gsposp("CC3A", 1, "CM21",kXMC3A,kYMC3Am,kZMCm, 0, "ONLY", tpar, 3);
1194 gMC->Gsposp("CC3A", 2, "CM21",-kXMC3A,kYMC3Ap,kZMCp, 0, "ONLY", tpar, 3);
1195
1196
1197// chamber type B
1198 tpar[0] = ((kXMC1MAX-kXMC1MIN)/2.)*kZ13;
1199 tpar[1] = ((kYMC1MAX-kYMC1MIN)/2.)*kZ13;
1200
1201 const Float_t kXMC3B=kXMC1B*kZ13;
1202 const Float_t kYMC3Bp=kYMC1Bp*kZ13;
1203 const Float_t kYMC3Bm=kYMC1Bm*kZ13;
1204 gMC->Gsposp("CC3A", 3, "CM21",kXMC3B,kYMC3Bp,kZMCp, 0, "ONLY", tpar, 3);
1205 gMC->Gsposp("CC3A", 4, "CM21",-kXMC3B,kYMC3Bm,kZMCm, 0, "ONLY", tpar, 3);
1206 gMC->Gsposp("CC3A", 5, "CM21",kXMC3B,-kYMC3Bp,kZMCp, 0, "ONLY", tpar, 3);
1207 gMC->Gsposp("CC3A", 6, "CM21",-kXMC3B,-kYMC3Bm,kZMCm, 0, "ONLY", tpar, 3);
1208
1209
1210// chamber type C (end of type B !!)
1211 tpar[0] = (kXMC1MAX/2)*kZ13;
1212 tpar[1] = (kYMC1MAX/2)*kZ13;
1213
1214 const Float_t kXMC3C=kXMC1C*kZ13;
1215 const Float_t kYMC3Cp=kYMC1Cp*kZ13;
1216 const Float_t kYMC3Cm=kYMC1Cm*kZ13;
1217 gMC->Gsposp("CC3A", 7, "CM21",kXMC3C,kYMC3Cp,kZMCp, 0, "ONLY", tpar, 3);
1218 gMC->Gsposp("CC3A", 8, "CM21",-kXMC3C,kYMC3Cm,kZMCm, 0, "ONLY", tpar, 3);
1219 gMC->Gsposp("CC3A", 9, "CM21",kXMC3C,-kYMC3Cp,kZMCp, 0, "ONLY", tpar, 3);
1220 gMC->Gsposp("CC3A", 10, "CM21",-kXMC3C,-kYMC3Cm,kZMCm, 0, "ONLY", tpar, 3);
1221
1222
1223// chamber type D, E and F (same size)
1224
1225 tpar[0] = (kXMC1MAX/2.)*kZ13;
1226 tpar[1] = kYMC1MIN*kZ13;
1227
1228 const Float_t kXMC3D=kXMC1D*kZ13;
1229 const Float_t kYMC3Dp=kYMC1Dp*kZ13;
1230 const Float_t kYMC3Dm=kYMC1Dm*kZ13;
1231 gMC->Gsposp("CC3A", 11, "CM21",kXMC3D,kYMC3Dm,kZMCm, 0, "ONLY", tpar, 3);
1232 gMC->Gsposp("CC3A", 12, "CM21",-kXMC3D,kYMC3Dp,kZMCp, 0, "ONLY", tpar, 3);
1233 gMC->Gsposp("CC3A", 13, "CM21",kXMC3D,-kYMC3Dm,kZMCm, 0, "ONLY", tpar, 3);
1234 gMC->Gsposp("CC3A", 14, "CM21",-kXMC3D,-kYMC3Dp,kZMCp, 0, "ONLY", tpar, 3);
1235
1236 const Float_t kYMC3Ep=kYMC1Ep*kZ13;
1237 const Float_t kYMC3Em=kYMC1Em*kZ13;
1238 gMC->Gsposp("CC3A", 15, "CM21",kXMC3D,kYMC3Ep,kZMCp, 0, "ONLY", tpar, 3);
1239 gMC->Gsposp("CC3A", 16, "CM21",-kXMC3D,kYMC3Em,kZMCm, 0, "ONLY", tpar, 3);
1240 gMC->Gsposp("CC3A", 17, "CM21",kXMC3D,-kYMC3Ep,kZMCp, 0, "ONLY", tpar, 3);
1241 gMC->Gsposp("CC3A", 18, "CM21",-kXMC3D,-kYMC3Em,kZMCm, 0, "ONLY", tpar, 3);
1242
1243 const Float_t kYMC3Fp=kYMC1Fp*kZ13;
1244 const Float_t kYMC3Fm=kYMC1Fm*kZ13;
1245 gMC->Gsposp("CC3A", 19, "CM21",kXMC3D,kYMC3Fm,kZMCm, 0, "ONLY", tpar, 3);
1246 gMC->Gsposp("CC3A", 20, "CM21",-kXMC3D,kYMC3Fp,kZMCp, 0, "ONLY", tpar, 3);
1247 gMC->Gsposp("CC3A", 21, "CM21",kXMC3D,-kYMC3Fm,kZMCm, 0, "ONLY", tpar, 3);
1248 gMC->Gsposp("CC3A", 22, "CM21",-kXMC3D,-kYMC3Fp,kZMCp, 0, "ONLY", tpar, 3);
1249
1250
1251// Positioning first plane of station 2 in ALICE
1252
1253 gMC->Gspos("CM21", 1, "ALIC", 0., 0., zpos3, 0, "ONLY");
1254
1255// End of geometry definition for the first plane of station 2
1256
1257
1258
1259
1260// SECOND PLANE OF STATION 2 : proj ratio = zpos4/zpos1
1261
1262 const Float_t kZ14=zpos4/zpos1;
1263
1264// Definition of prototype for chambers in the second plane of station 2
1265
1266 tpar[0]= 0.;
1267 tpar[1]= 0.;
1268 tpar[2]= 0.;
1269
1270 gMC->Gsvolu("CC4A", "BOX ", idAlu1, tpar, 0); //Al
1271 gMC->Gsvolu("CB4A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1272 gMC->Gsvolu("CG4A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1273
1274// chamber type A
1275 tpar[0] = -1.;
1276 tpar[1] = -1.;
1277
1278 const Float_t kXMC4A=kXMC1A*kZ14;
1279 const Float_t kYMC4Am=0.;
1280 const Float_t kYMC4Ap=0.;
1281
1282 tpar[2] = 0.1;
1283 gMC->Gsposp("CG4A", 1, "CB4A", 0., 0., 0., 0, "ONLY",tpar,3);
1284 tpar[2] = 0.3;
1285 gMC->Gsposp("CB4A", 1, "CC4A", 0., 0., 0., 0, "ONLY",tpar,3);
1286
1287 tpar[2] = 0.4;
1288 tpar[0] = ((kXMC1MAX-kXMC1MED)/2.)*kZ14;
1289 tpar[1] = kYMC1MIN*kZ14;
1290 gMC->Gsposp("CC4A", 1, "CM22",kXMC4A,kYMC4Am,kZMCm, 0, "ONLY", tpar, 3);
1291 gMC->Gsposp("CC4A", 2, "CM22",-kXMC4A,kYMC4Ap,kZMCp, 0, "ONLY", tpar, 3);
1292
1293
1294// chamber type B
1295 tpar[0] = ((kXMC1MAX-kXMC1MIN)/2.)*kZ14;
1296 tpar[1] = ((kYMC1MAX-kYMC1MIN)/2.)*kZ14;
1297
1298 const Float_t kXMC4B=kXMC1B*kZ14;
1299 const Float_t kYMC4Bp=kYMC1Bp*kZ14;
1300 const Float_t kYMC4Bm=kYMC1Bm*kZ14;
1301 gMC->Gsposp("CC4A", 3, "CM22",kXMC4B,kYMC4Bp,kZMCp, 0, "ONLY", tpar, 3);
1302 gMC->Gsposp("CC4A", 4, "CM22",-kXMC4B,kYMC4Bm,kZMCm, 0, "ONLY", tpar, 3);
1303 gMC->Gsposp("CC4A", 5, "CM22",kXMC4B,-kYMC4Bp,kZMCp, 0, "ONLY", tpar, 3);
1304 gMC->Gsposp("CC4A", 6, "CM22",-kXMC4B,-kYMC4Bm,kZMCm, 0, "ONLY", tpar, 3);
1305
1306
1307// chamber type C (end of type B !!)
1308 tpar[0] =(kXMC1MAX/2)*kZ14;
1309 tpar[1] = (kYMC1MAX/2)*kZ14;
1310
1311 const Float_t kXMC4C=kXMC1C*kZ14;
1312 const Float_t kYMC4Cp=kYMC1Cp*kZ14;
1313 const Float_t kYMC4Cm=kYMC1Cm*kZ14;
1314 gMC->Gsposp("CC4A", 7, "CM22",kXMC4C,kYMC4Cp,kZMCp, 0, "ONLY", tpar, 3);
1315 gMC->Gsposp("CC4A", 8, "CM22",-kXMC4C,kYMC4Cm,kZMCm, 0, "ONLY", tpar, 3);
1316 gMC->Gsposp("CC4A", 9, "CM22",kXMC4C,-kYMC4Cp,kZMCp, 0, "ONLY", tpar, 3);
1317 gMC->Gsposp("CC4A", 10, "CM22",-kXMC4C,-kYMC4Cm,kZMCm, 0, "ONLY", tpar, 3);
1318
1319
1320// chamber type D, E and F (same size)
1321 tpar[0] = (kXMC1MAX/2.)*kZ14;
1322 tpar[1] = kYMC1MIN*kZ14;
1323
1324 const Float_t kXMC4D=kXMC1D*kZ14;
1325 const Float_t kYMC4Dp=kYMC1Dp*kZ14;
1326 const Float_t kYMC4Dm=kYMC1Dm*kZ14;
1327 gMC->Gsposp("CC4A", 11, "CM22",kXMC4D,kYMC4Dm,kZMCm, 0, "ONLY", tpar, 3);
1328 gMC->Gsposp("CC4A", 12, "CM22",-kXMC4D,kYMC4Dp,kZMCp, 0, "ONLY", tpar, 3);
1329 gMC->Gsposp("CC4A", 13, "CM22",kXMC4D,-kYMC4Dm,kZMCm, 0, "ONLY", tpar, 3);
1330 gMC->Gsposp("CC4A", 14, "CM22",-kXMC4D,-kYMC4Dp,kZMCp, 0, "ONLY", tpar, 3);
1331
1332 const Float_t kYMC4Ep=kYMC1Ep*kZ14;
1333 const Float_t kYMC4Em=kYMC1Em*kZ14;
1334 gMC->Gsposp("CC4A", 15, "CM22",kXMC4D,kYMC4Ep,kZMCp, 0, "ONLY", tpar, 3);
1335 gMC->Gsposp("CC4A", 16, "CM22",-kXMC4D,kYMC4Em,kZMCm, 0, "ONLY", tpar, 3);
1336 gMC->Gsposp("CC4A", 17, "CM22",kXMC4D,-kYMC4Ep,kZMCp, 0, "ONLY", tpar, 3);
1337 gMC->Gsposp("CC4A", 18, "CM22",-kXMC4D,-kYMC4Em,kZMCm, 0, "ONLY", tpar, 3);
1338
1339 const Float_t kYMC4Fp=kYMC1Fp*kZ14;
1340 const Float_t kYMC4Fm=kYMC1Fm*kZ14;
1341 gMC->Gsposp("CC4A", 19, "CM22",kXMC4D,kYMC4Fm,kZMCm, 0, "ONLY", tpar, 3);
1342 gMC->Gsposp("CC4A", 20, "CM22",-kXMC4D,kYMC4Fp,kZMCp, 0, "ONLY", tpar, 3);
1343 gMC->Gsposp("CC4A", 21, "CM22",kXMC4D,-kYMC4Fm,kZMCm, 0, "ONLY", tpar, 3);
1344 gMC->Gsposp("CC4A", 22, "CM22",-kXMC4D,-kYMC4Fp,kZMCp, 0, "ONLY", tpar, 3);
1345
1346
1347// Positioning second plane of station 2 in ALICE
1348
1349 gMC->Gspos("CM22", 1, "ALIC", 0., 0., zpos4, 0, "ONLY");
1350
1351// End of geometry definition for the second plane of station 2
1352
1353// End of trigger geometry definition
1354
1355}
1356
1357
1358
1359//___________________________________________
1360void AliMUONv1::CreateMaterials()
1361{
1362 // *** DEFINITION OF AVAILABLE MUON MATERIALS ***
1363 //
1364 // Ar-CO2 gas
1365 Float_t ag1[3] = { 39.95,12.01,16. };
1366 Float_t zg1[3] = { 18.,6.,8. };
1367 Float_t wg1[3] = { .8,.0667,.13333 };
1368 Float_t dg1 = .001821;
1369 //
1370 // Ar-buthane-freon gas -- trigger chambers
1371 Float_t atr1[4] = { 39.95,12.01,1.01,19. };
1372 Float_t ztr1[4] = { 18.,6.,1.,9. };
1373 Float_t wtr1[4] = { .56,.1262857,.2857143,.028 };
1374 Float_t dtr1 = .002599;
1375 //
1376 // Ar-CO2 gas
1377 Float_t agas[3] = { 39.95,12.01,16. };
1378 Float_t zgas[3] = { 18.,6.,8. };
1379 Float_t wgas[3] = { .74,.086684,.173316 };
1380 Float_t dgas = .0018327;
1381 //
1382 // Ar-Isobutane gas (80%+20%) -- tracking
1383 Float_t ag[3] = { 39.95,12.01,1.01 };
1384 Float_t zg[3] = { 18.,6.,1. };
1385 Float_t wg[3] = { .8,.057,.143 };
1386 Float_t dg = .0019596;
1387 //
1388 // Ar-Isobutane-Forane-SF6 gas (49%+7%+40%+4%) -- trigger
1389 Float_t atrig[5] = { 39.95,12.01,1.01,19.,32.066 };
1390 Float_t ztrig[5] = { 18.,6.,1.,9.,16. };
1391 Float_t wtrig[5] = { .49,1.08,1.5,1.84,0.04 };
1392 Float_t dtrig = .0031463;
1393 //
1394 // bakelite
1395
1396 Float_t abak[3] = {12.01 , 1.01 , 16.};
1397 Float_t zbak[3] = {6. , 1. , 8.};
1398 Float_t wbak[3] = {6. , 6. , 1.};
1399 Float_t dbak = 1.4;
1400
1401 Float_t epsil, stmin, deemax, tmaxfd, stemax;
1402
1403 Int_t iSXFLD = gAlice->Field()->Integ();
1404 Float_t sXMGMX = gAlice->Field()->Max();
1405 //
1406 // --- Define the various materials for GEANT ---
1407 AliMaterial(9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
1408 AliMaterial(10, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
1409 AliMaterial(15, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500);
1410 AliMixture(19, "Bakelite$", abak, zbak, dbak, -3, wbak);
1411 AliMixture(20, "ArC4H10 GAS$", ag, zg, dg, 3, wg);
1412 AliMixture(21, "TRIG GAS$", atrig, ztrig, dtrig, -5, wtrig);
1413 AliMixture(22, "ArCO2 80%$", ag1, zg1, dg1, 3, wg1);
1414 AliMixture(23, "Ar-freon $", atr1, ztr1, dtr1, 4, wtr1);
1415 AliMixture(24, "ArCO2 GAS$", agas, zgas, dgas, 3, wgas);
1416
1417 epsil = .001; // Tracking precision,
1418 stemax = -1.; // Maximum displacement for multiple scat
1419 tmaxfd = -20.; // Maximum angle due to field deflection
1420 deemax = -.3; // Maximum fractional energy loss, DLS
1421 stmin = -.8;
1422 //
1423 // Air
1424 AliMedium(1, "AIR_CH_US ", 15, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
1425 //
1426 // Aluminum
1427
1428 AliMedium(4, "ALU_CH_US ", 9, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1429 fMaxDestepAlu, epsil, stmin);
1430 AliMedium(5, "ALU_CH_US ", 10, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1431 fMaxDestepAlu, epsil, stmin);
1432 //
1433 // Ar-isoC4H10 gas
1434
1435 AliMedium(6, "AR_CH_US ", 20, 1, iSXFLD, sXMGMX, tmaxfd, fMaxStepGas,
1436 fMaxDestepGas, epsil, stmin);
1437//
1438 // Ar-Isobuthane-Forane-SF6 gas
1439
1440 AliMedium(7, "GAS_CH_TRIGGER ", 21, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
1441
1442 AliMedium(8, "BAKE_CH_TRIGGER ", 19, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1443 fMaxDestepAlu, epsil, stmin);
1444
1445 AliMedium(9, "ARG_CO2 ", 22, 1, iSXFLD, sXMGMX, tmaxfd, fMaxStepGas,
1446 fMaxDestepAlu, epsil, stmin);
1447}
1448
1449//___________________________________________
1450
1451void AliMUONv1::Init()
1452{
1453 //
1454 // Initialize Tracking Chambers
1455 //
1456
1457 printf("\n\n\n Start Init for version 1 - CPC chamber type\n\n\n");
1458
1459 for (Int_t i=0; i<kNCH; i++) {
1460 ( (AliMUONChamber*) (*fChambers)[i])->Init();
1461 }
1462
1463 //
1464 // Set the chamber (sensitive region) GEANT identifier
1465 AliMC* gMC = AliMC::GetMC();
1466 ((AliMUONChamber*)(*fChambers)[0])->SetGid(gMC->VolId("C01G"));
1467 ((AliMUONChamber*)(*fChambers)[1])->SetGid(gMC->VolId("C02G"));
1468 ((AliMUONChamber*)(*fChambers)[2])->SetGid(gMC->VolId("C03G"));
1469 ((AliMUONChamber*)(*fChambers)[3])->SetGid(gMC->VolId("C04G"));
1470 ((AliMUONChamber*)(*fChambers)[4])->SetGid(gMC->VolId("C05G"));
1471 ((AliMUONChamber*)(*fChambers)[5])->SetGid(gMC->VolId("C06G"));
1472 ((AliMUONChamber*)(*fChambers)[6])->SetGid(gMC->VolId("C07G"));
1473 ((AliMUONChamber*)(*fChambers)[7])->SetGid(gMC->VolId("C08G"));
1474 ((AliMUONChamber*)(*fChambers)[8])->SetGid(gMC->VolId("C09G"));
1475 ((AliMUONChamber*)(*fChambers)[9])->SetGid(gMC->VolId("C10G"));
1476 ((AliMUONChamber*)(*fChambers)[10])->SetGid(gMC->VolId("CG1A"));
1477 ((AliMUONChamber*)(*fChambers)[11])->SetGid(gMC->VolId("CG2A"));
1478 ((AliMUONChamber*)(*fChambers)[12])->SetGid(gMC->VolId("CG3A"));
1479 ((AliMUONChamber*)(*fChambers)[13])->SetGid(gMC->VolId("CG4A"));
1480
1481 printf("\n\n\n Finished Init for version 0 - CPC chamber type\n\n\n");
1482
1483 //cp
1484 printf("\n\n\n Start Init for Trigger Circuits\n\n\n");
1485 for (Int_t i=0; i<kNTriggerCircuit; i++) {
1486 ( (AliMUONTriggerCircuit*) (*fTriggerCircuits)[i])->Init(i);
1487 }
1488 printf(" Finished Init for Trigger Circuits\n\n\n");
1489 //cp
1490
1491}
1492
1493//___________________________________________
1494void AliMUONv1::StepManager()
1495{
1496 Int_t copy, id;
1497 static Int_t idvol;
1498 static Int_t vol[2];
1499 Int_t ipart;
1500 TLorentzVector pos;
1501 TLorentzVector mom;
1502 Float_t theta,phi;
1503 Float_t destep, step;
1504
1505 static Float_t eloss, eloss2, xhit, yhit, tof, tlength;
1506 const Float_t kBig=1.e10;
1507
1508 // modifs perso
1509 static Float_t hits[15];
1510
1511 TClonesArray &lhits = *fHits;
1512
1513 //
1514 // Set maximum step size for gas
1515 // numed=gMC->GetMedium();
1516 //
1517 // Only charged tracks
1518 if( !(gMC->TrackCharge()) ) return;
1519 //
1520 // Only gas gap inside chamber
1521 // Tag chambers and record hits when track enters
1522 idvol=-1;
1523 id=gMC->CurrentVolID(copy);
1524
1525 for (Int_t i=1; i<=kNCH; i++) {
1526 if(id==((AliMUONChamber*)(*fChambers)[i-1])->GetGid()){
1527 vol[0]=i;
1528 idvol=i-1;
1529 }
1530 }
1531 if (idvol == -1) return;
1532 //
1533 // Get current particle id (ipart), track position (pos) and momentum (mom)
1534 gMC->TrackPosition(pos);
1535 gMC->TrackMomentum(mom);
1536
1537 ipart = gMC->TrackPid();
1538 //Int_t ipart1 = gMC->IdFromPDG(ipart);
1539 //printf("ich, ipart %d %d \n",vol[0],ipart1);
1540
1541 //
1542 // momentum loss and steplength in last step
1543 destep = gMC->Edep();
1544 step = gMC->TrackStep();
1545
1546 //
1547 // record hits when track enters ...
1548 if( gMC->IsTrackEntering()) {
1549 gMC->SetMaxStep(fMaxStepGas);
1550 Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
1551 Double_t rt = TMath::Sqrt(tc);
1552 Double_t pmom = TMath::Sqrt(tc+mom[2]*mom[2]);
1553 Double_t tx=mom[0]/pmom;
1554 Double_t ty=mom[1]/pmom;
1555 Double_t tz=mom[2]/pmom;
1556 Double_t s=((AliMUONChamber*)(*fChambers)[idvol])
1557 ->ResponseModel()
1558 ->Pitch()/tz;
1559 theta = Float_t(TMath::ATan2(rt,Double_t(mom[2])))*kRaddeg;
1560 phi = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg;
1561 hits[0] = Float_t(ipart); // Geant3 particle type
1562 hits[1] = pos[0]+s*tx; // X-position for hit
1563 hits[2] = pos[1]+s*ty; // Y-position for hit
1564 hits[3] = pos[2]+s*tz; // Z-position for hit
1565 hits[4] = theta; // theta angle of incidence
1566 hits[5] = phi; // phi angle of incidence
1567 hits[8] = (Float_t) fNPadHits; // first padhit
1568 hits[9] = -1; // last pad hit
1569
1570 // modifs perso
1571 hits[10] = mom[3]; // hit momentum P
1572 hits[11] = mom[0]; // Px/P
1573 hits[12] = mom[1]; // Py/P
1574 hits[13] = mom[2]; // Pz/P
1575 // fin modifs perso
1576 tof=gMC->TrackTime();
1577 hits[14] = tof; // Time of flight
1578 // phi angle of incidence
1579 tlength = 0;
1580 eloss = 0;
1581 eloss2 = 0;
1582 xhit = pos[0];
1583 yhit = pos[1];
1584 // Only if not trigger chamber
1585 if(idvol<10) {
1586 //
1587 // Initialize hit position (cursor) in the segmentation model
1588 ((AliMUONChamber*) (*fChambers)[idvol])
1589 ->SigGenInit(pos[0], pos[1], pos[2]);
1590 } else {
1591 //geant3->Gpcxyz();
1592 //printf("In the Trigger Chamber #%d\n",idvol-9);
1593 }
1594 }
1595 eloss2+=destep;
1596
1597 //
1598 // Calculate the charge induced on a pad (disintegration) in case
1599 //
1600 // Mip left chamber ...
1601 if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
1602 gMC->SetMaxStep(kBig);
1603 eloss += destep;
1604 tlength += step;
1605
1606 Float_t x0,y0;
1607
1608 if(idvol<10) {
1609// tracking chambers
1610 x0 = 0.5*(xhit+pos[0]);
1611 y0 = 0.5*(yhit+pos[1]);
1612 } else {
1613// trigger chambers
1614 x0=xhit;
1615 y0=yhit;
1616 }
1617
1618
1619 if (eloss >0) MakePadHits(x0,y0,eloss,tof,idvol);
1620
1621
1622 hits[6]=tlength;
1623 hits[7]=eloss2;
1624 if (fNPadHits > (Int_t)hits[8]) {
1625 hits[8]= hits[8]+1;
1626 hits[9]= (Float_t) fNPadHits;
1627 }
1628
1629 new(lhits[fNhits++])
1630 AliMUONHit(fIshunt,gAlice->CurrentTrack(),vol,hits);
1631 eloss = 0;
1632 //
1633 // Check additional signal generation conditions
1634 // defined by the segmentation
1635 // model (boundary crossing conditions)
1636 } else if
1637 (((AliMUONChamber*) (*fChambers)[idvol])
1638 ->SigGenCond(pos[0], pos[1], pos[2]))
1639 {
1640 ((AliMUONChamber*) (*fChambers)[idvol])
1641 ->SigGenInit(pos[0], pos[1], pos[2]);
1642// printf("\n-> MakePadHits, reason special %d",ipart);
1643 if (eloss > 0 && idvol < 10)
1644 MakePadHits(0.5*(xhit+pos[0]),0.5*(yhit+pos[1]),eloss,tof,idvol);
1645 xhit = pos[0];
1646 yhit = pos[1];
1647 eloss = destep;
1648 tlength += step ;
1649 //
1650 // nothing special happened, add up energy loss
1651 } else {
1652 eloss += destep;
1653 tlength += step ;
1654 }
1655}
1656
1657