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