]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONv1.cxx
Improved inner circular region of station 3 and 5 (A. de Falco).
[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 *
2c799aa2 12 * about the suitability of this software for any purpeateose. It is *
a9e2aefa 13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/*
17$Log$
a083207d 18Revision 1.17 2000/11/24 12:57:10 morsch
19New version of geometry for stations 3-5 "Slats" (A. de Falco)
20 - sensitive region at station 3 inner radius
21 - improved volume tree structure
22
3c084d9f 23Revision 1.16 2000/11/08 13:01:40 morsch
24Chamber half-planes of stations 3-5 at different z-positions.
25
e1ad7d45 26Revision 1.15 2000/11/06 11:39:02 morsch
27Bug in StepManager() corrected.
28
e3cf5faa 29Revision 1.14 2000/11/06 09:16:50 morsch
30Avoid overlap of slat volumes.
31
2c799aa2 32Revision 1.13 2000/10/26 07:33:44 morsch
33Correct x-position of slats in station 5.
34
8013c580 35Revision 1.12 2000/10/25 19:55:35 morsch
36Switches for each station individually for debug and lego.
37
b17c0c87 38Revision 1.11 2000/10/22 16:44:01 morsch
39Update of slat geometry for stations 3,4,5 (A. deFalco)
40
f9f7c205 41Revision 1.10 2000/10/12 16:07:04 gosset
42StepManager:
43* SigGenCond only called for tracking chambers,
44 hence no more division by 0,
45 and may use last ALIROOT/dummies.C with exception handling;
46* "10" replaced by "AliMUONConstants::NTrackingCh()".
47
a75f073c 48Revision 1.9 2000/10/06 15:37:22 morsch
49Problems with variable redefinition in for-loop solved.
50Variable names starting with u-case letters changed to l-case.
51
6c5ddcfa 52Revision 1.8 2000/10/06 09:06:31 morsch
53Include Slat chambers (stations 3-5) into geometry (A. de Falco)
54
1e8fff9c 55Revision 1.7 2000/10/02 21:28:09 fca
56Removal of useless dependecies via forward declarations
57
94de3818 58Revision 1.6 2000/10/02 17:20:45 egangler
59Cleaning of the code (continued ) :
60-> coding conventions
61-> void Streamers
62-> some useless includes removed or replaced by "class" statement
63
8c449e83 64Revision 1.5 2000/06/28 15:16:35 morsch
65(1) Client code adapted to new method signatures in AliMUONSegmentation (see comments there)
66to allow development of slat-muon chamber simulation and reconstruction code in the MUON
67framework. The changes should have no side effects (mostly dummy arguments).
68(2) Hit disintegration uses 3-dim hit coordinates to allow simulation
69of chambers with overlapping modules (MakePadHits, Disintegration).
70
802a864d 71Revision 1.4 2000/06/26 14:02:38 morsch
72Add class AliMUONConstants with MUON specific constants using static memeber data and access methods.
73
f665c1ea 74Revision 1.3 2000/06/22 14:10:05 morsch
75HP scope problems corrected (PH)
76
e17592e9 77Revision 1.2 2000/06/15 07:58:49 morsch
78Code from MUON-dev joined
79
a9e2aefa 80Revision 1.1.2.14 2000/06/14 14:37:25 morsch
81Initialization of TriggerCircuit added (PC)
82
83Revision 1.1.2.13 2000/06/09 21:55:47 morsch
84Most coding rule violations corrected.
85
86Revision 1.1.2.12 2000/05/05 11:34:29 morsch
87Log inside comments.
88
89Revision 1.1.2.11 2000/05/05 10:06:48 morsch
90Coding Rule violations regarding trigger section corrected (CP)
91Log messages included.
92*/
93
94/////////////////////////////////////////////////////////
95// Manager and hits classes for set:MUON version 0 //
96/////////////////////////////////////////////////////////
97
98#include <TTUBE.h>
99#include <TNode.h>
100#include <TRandom.h>
101#include <TLorentzVector.h>
102#include <iostream.h>
103
104#include "AliMUONv1.h"
105#include "AliRun.h"
106#include "AliMC.h"
94de3818 107#include "AliMagF.h"
a9e2aefa 108#include "AliCallf77.h"
109#include "AliConst.h"
110#include "AliMUONChamber.h"
111#include "AliMUONHit.h"
112#include "AliMUONPadHit.h"
f665c1ea 113#include "AliMUONConstants.h"
8c449e83 114#include "AliMUONTriggerCircuit.h"
a9e2aefa 115
116ClassImp(AliMUONv1)
117
118//___________________________________________
119AliMUONv1::AliMUONv1() : AliMUON()
120{
121// Constructor
122 fChambers = 0;
123}
124
125//___________________________________________
126AliMUONv1::AliMUONv1(const char *name, const char *title)
127 : AliMUON(name,title)
128{
129// Constructor
130}
131
132//___________________________________________
133void AliMUONv1::CreateGeometry()
134{
135//
136// Note: all chambers have the same structure, which could be
137// easily parameterised. This was intentionally not done in order
138// to give a starting point for the implementation of the actual
139// design of each station.
140 Int_t *idtmed = fIdtmed->GetArray()-1099;
141
142// Distance between Stations
143//
144 Float_t bpar[3];
145 Float_t tpar[3];
146 Float_t pgpar[10];
147 Float_t zpos1, zpos2, zfpos;
148 Float_t dframep=.001; // Value for station 3 should be 6 ...
149 Float_t dframep1=.001;
150// Bool_t frames=kTRUE;
151 Bool_t frames=kFALSE;
152
153 Float_t dframez=0.9;
154 Float_t dr;
155 Float_t dstation;
156
157//
158// Rotation matrices in the x-y plane
159 Int_t idrotm[1199];
160// phi= 0 deg
161 AliMatrix(idrotm[1100], 90., 0., 90., 90., 0., 0.);
162// phi= 90 deg
163 AliMatrix(idrotm[1101], 90., 90., 90., 180., 0., 0.);
164// phi= 180 deg
165 AliMatrix(idrotm[1102], 90., 180., 90., 270., 0., 0.);
166// phi= 270 deg
167 AliMatrix(idrotm[1103], 90., 270., 90., 0., 0., 0.);
168//
169 Float_t phi=2*TMath::Pi()/12/2;
170
171//
172// pointer to the current chamber
173// pointer to the current chamber
174 Int_t idAlu1=idtmed[1103];
175 Int_t idAlu2=idtmed[1104];
176// Int_t idAlu1=idtmed[1100];
177// Int_t idAlu2=idtmed[1100];
178 Int_t idAir=idtmed[1100];
179 Int_t idGas=idtmed[1105];
180
181
182 AliMUONChamber *iChamber, *iChamber1, *iChamber2;
b17c0c87 183 Int_t stations[5] = {1, 1, 1, 1, 1};
184
185 if (stations[0]) {
186
a9e2aefa 187//********************************************************************
188// Station 1 **
189//********************************************************************
190// CONCENTRIC
191 // indices 1 and 2 for first and second chambers in the station
192 // iChamber (first chamber) kept for other quanties than Z,
193 // assumed to be the same in both chambers
194 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[0];
195 iChamber2 =(AliMUONChamber*) (*fChambers)[1];
196 zpos1=iChamber1->Z();
197 zpos2=iChamber2->Z();
198 dstation = zpos2 - zpos1;
199 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
200
201//
202// Mother volume
203 tpar[0] = iChamber->RInner()-dframep1;
204 tpar[1] = (iChamber->ROuter()+dframep1)/TMath::Cos(phi);
2c799aa2 205 tpar[2] = dstation/5;
a9e2aefa 206
207 gMC->Gsvolu("C01M", "TUBE", idAir, tpar, 3);
208 gMC->Gsvolu("C02M", "TUBE", idAir, tpar, 3);
209 gMC->Gspos("C01M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
1e8fff9c 210 gMC->Gspos("C02M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
a9e2aefa 211// Aluminium frames
212// Outer frames
213 pgpar[0] = 360/12/2;
214 pgpar[1] = 360.;
215 pgpar[2] = 12.;
216 pgpar[3] = 2;
217 pgpar[4] = -dframez/2;
218 pgpar[5] = iChamber->ROuter();
219 pgpar[6] = pgpar[5]+dframep1;
220 pgpar[7] = +dframez/2;
221 pgpar[8] = pgpar[5];
222 pgpar[9] = pgpar[6];
223 gMC->Gsvolu("C01O", "PGON", idAlu1, pgpar, 10);
224 gMC->Gsvolu("C02O", "PGON", idAlu1, pgpar, 10);
225 gMC->Gspos("C01O",1,"C01M", 0.,0.,-zfpos, 0,"ONLY");
226 gMC->Gspos("C01O",2,"C01M", 0.,0.,+zfpos, 0,"ONLY");
227 gMC->Gspos("C02O",1,"C02M", 0.,0.,-zfpos, 0,"ONLY");
228 gMC->Gspos("C02O",2,"C02M", 0.,0.,+zfpos, 0,"ONLY");
229//
230// Inner frame
231 tpar[0]= iChamber->RInner()-dframep1;
232 tpar[1]= iChamber->RInner();
233 tpar[2]= dframez/2;
234 gMC->Gsvolu("C01I", "TUBE", idAlu1, tpar, 3);
235 gMC->Gsvolu("C02I", "TUBE", idAlu1, tpar, 3);
236
237 gMC->Gspos("C01I",1,"C01M", 0.,0.,-zfpos, 0,"ONLY");
238 gMC->Gspos("C01I",2,"C01M", 0.,0.,+zfpos, 0,"ONLY");
239 gMC->Gspos("C02I",1,"C02M", 0.,0.,-zfpos, 0,"ONLY");
240 gMC->Gspos("C02I",2,"C02M", 0.,0.,+zfpos, 0,"ONLY");
241//
242// Frame Crosses
243 if (frames) {
244
245 bpar[0] = (iChamber->ROuter() - iChamber->RInner())/2;
246 bpar[1] = dframep1/2;
247 bpar[2] = dframez/2;
248 gMC->Gsvolu("C01B", "BOX", idAlu1, bpar, 3);
249 gMC->Gsvolu("C02B", "BOX", idAlu1, bpar, 3);
250
251 gMC->Gspos("C01B",1,"C01M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
252 idrotm[1100],"ONLY");
253 gMC->Gspos("C01B",2,"C01M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
254 idrotm[1100],"ONLY");
255 gMC->Gspos("C01B",3,"C01M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
256 idrotm[1101],"ONLY");
257 gMC->Gspos("C01B",4,"C01M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
258 idrotm[1101],"ONLY");
259 gMC->Gspos("C01B",5,"C01M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
260 idrotm[1100],"ONLY");
261 gMC->Gspos("C01B",6,"C01M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
262 idrotm[1100],"ONLY");
263 gMC->Gspos("C01B",7,"C01M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
264 idrotm[1101],"ONLY");
265 gMC->Gspos("C01B",8,"C01M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
266 idrotm[1101],"ONLY");
267
268 gMC->Gspos("C02B",1,"C02M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
269 idrotm[1100],"ONLY");
270 gMC->Gspos("C02B",2,"C02M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
271 idrotm[1100],"ONLY");
272 gMC->Gspos("C02B",3,"C02M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
273 idrotm[1101],"ONLY");
274 gMC->Gspos("C02B",4,"C02M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
275 idrotm[1101],"ONLY");
276 gMC->Gspos("C02B",5,"C02M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
277 idrotm[1100],"ONLY");
278 gMC->Gspos("C02B",6,"C02M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
279 idrotm[1100],"ONLY");
280 gMC->Gspos("C02B",7,"C02M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
281 idrotm[1101],"ONLY");
282 gMC->Gspos("C02B",8,"C02M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
283 idrotm[1101],"ONLY");
284 }
285//
286// Chamber Material represented by Alu sheet
287 tpar[0]= iChamber->RInner();
288 tpar[1]= iChamber->ROuter();
289 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
290 gMC->Gsvolu("C01A", "TUBE", idAlu2, tpar, 3);
291 gMC->Gsvolu("C02A", "TUBE",idAlu2, tpar, 3);
292 gMC->Gspos("C01A", 1, "C01M", 0., 0., 0., 0, "ONLY");
293 gMC->Gspos("C02A", 1, "C02M", 0., 0., 0., 0, "ONLY");
294//
295// Sensitive volumes
296 // tpar[2] = iChamber->DGas();
297 tpar[2] = iChamber->DGas()/2;
298 gMC->Gsvolu("C01G", "TUBE", idtmed[1108], tpar, 3);
299 gMC->Gsvolu("C02G", "TUBE", idtmed[1108], tpar, 3);
300 gMC->Gspos("C01G", 1, "C01A", 0., 0., 0., 0, "ONLY");
301 gMC->Gspos("C02G", 1, "C02A", 0., 0., 0., 0, "ONLY");
302//
303// Frame Crosses to be placed inside gas
304 if (frames) {
305
306 dr = (iChamber->ROuter() - iChamber->RInner());
307 bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
308 bpar[1] = dframep1/2;
309 bpar[2] = iChamber->DGas()/2;
310 gMC->Gsvolu("C01F", "BOX", idAlu1, bpar, 3);
311 gMC->Gsvolu("C02F", "BOX", idAlu1, bpar, 3);
312
313 gMC->Gspos("C01F",1,"C01G", +iChamber->RInner()+bpar[0] , 0, 0,
314 idrotm[1100],"ONLY");
315 gMC->Gspos("C01F",2,"C01G", -iChamber->RInner()-bpar[0] , 0, 0,
316 idrotm[1100],"ONLY");
317 gMC->Gspos("C01F",3,"C01G", 0, +iChamber->RInner()+bpar[0] , 0,
318 idrotm[1101],"ONLY");
319 gMC->Gspos("C01F",4,"C01G", 0, -iChamber->RInner()-bpar[0] , 0,
320 idrotm[1101],"ONLY");
321
322 gMC->Gspos("C02F",1,"C02G", +iChamber->RInner()+bpar[0] , 0, 0,
323 idrotm[1100],"ONLY");
324 gMC->Gspos("C02F",2,"C02G", -iChamber->RInner()-bpar[0] , 0, 0,
325 idrotm[1100],"ONLY");
326 gMC->Gspos("C02F",3,"C02G", 0, +iChamber->RInner()+bpar[0] , 0,
327 idrotm[1101],"ONLY");
328 gMC->Gspos("C02F",4,"C02G", 0, -iChamber->RInner()-bpar[0] , 0,
329 idrotm[1101],"ONLY");
330 }
b17c0c87 331 }
332 if (stations[1]) {
333
a9e2aefa 334//********************************************************************
335// Station 2 **
336//********************************************************************
337 // indices 1 and 2 for first and second chambers in the station
338 // iChamber (first chamber) kept for other quanties than Z,
339 // assumed to be the same in both chambers
340 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[2];
341 iChamber2 =(AliMUONChamber*) (*fChambers)[3];
342 zpos1=iChamber1->Z();
343 zpos2=iChamber2->Z();
344 dstation = zpos2 - zpos1;
345 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
346
347//
348// Mother volume
349 tpar[0] = iChamber->RInner()-dframep;
350 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
2c799aa2 351 tpar[2] = dstation/5;
a9e2aefa 352
353 gMC->Gsvolu("C03M", "TUBE", idAir, tpar, 3);
354 gMC->Gsvolu("C04M", "TUBE", idAir, tpar, 3);
355 gMC->Gspos("C03M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
356 gMC->Gspos("C04M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
1e8fff9c 357
a9e2aefa 358// Aluminium frames
359// Outer frames
360 pgpar[0] = 360/12/2;
361 pgpar[1] = 360.;
362 pgpar[2] = 12.;
363 pgpar[3] = 2;
364 pgpar[4] = -dframez/2;
365 pgpar[5] = iChamber->ROuter();
366 pgpar[6] = pgpar[5]+dframep;
367 pgpar[7] = +dframez/2;
368 pgpar[8] = pgpar[5];
369 pgpar[9] = pgpar[6];
370 gMC->Gsvolu("C03O", "PGON", idAlu1, pgpar, 10);
371 gMC->Gsvolu("C04O", "PGON", idAlu1, pgpar, 10);
372 gMC->Gspos("C03O",1,"C03M", 0.,0.,-zfpos, 0,"ONLY");
373 gMC->Gspos("C03O",2,"C03M", 0.,0.,+zfpos, 0,"ONLY");
374 gMC->Gspos("C04O",1,"C04M", 0.,0.,-zfpos, 0,"ONLY");
375 gMC->Gspos("C04O",2,"C04M", 0.,0.,+zfpos, 0,"ONLY");
376//
377// Inner frame
378 tpar[0]= iChamber->RInner()-dframep;
379 tpar[1]= iChamber->RInner();
380 tpar[2]= dframez/2;
381 gMC->Gsvolu("C03I", "TUBE", idAlu1, tpar, 3);
382 gMC->Gsvolu("C04I", "TUBE", idAlu1, tpar, 3);
383
384 gMC->Gspos("C03I",1,"C03M", 0.,0.,-zfpos, 0,"ONLY");
385 gMC->Gspos("C03I",2,"C03M", 0.,0.,+zfpos, 0,"ONLY");
386 gMC->Gspos("C04I",1,"C04M", 0.,0.,-zfpos, 0,"ONLY");
387 gMC->Gspos("C04I",2,"C04M", 0.,0.,+zfpos, 0,"ONLY");
388//
389// Frame Crosses
390 if (frames) {
391
392 bpar[0] = (iChamber->ROuter() - iChamber->RInner())/2;
393 bpar[1] = dframep/2;
394 bpar[2] = dframez/2;
395 gMC->Gsvolu("C03B", "BOX", idAlu1, bpar, 3);
396 gMC->Gsvolu("C04B", "BOX", idAlu1, bpar, 3);
397
398 gMC->Gspos("C03B",1,"C03M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
399 idrotm[1100],"ONLY");
400 gMC->Gspos("C03B",2,"C03M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
401 idrotm[1100],"ONLY");
402 gMC->Gspos("C03B",3,"C03M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
403 idrotm[1101],"ONLY");
404 gMC->Gspos("C03B",4,"C03M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
405 idrotm[1101],"ONLY");
406 gMC->Gspos("C03B",5,"C03M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
407 idrotm[1100],"ONLY");
408 gMC->Gspos("C03B",6,"C03M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
409 idrotm[1100],"ONLY");
410 gMC->Gspos("C03B",7,"C03M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
411 idrotm[1101],"ONLY");
412 gMC->Gspos("C03B",8,"C03M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
413 idrotm[1101],"ONLY");
414
415 gMC->Gspos("C04B",1,"C04M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
416 idrotm[1100],"ONLY");
417 gMC->Gspos("C04B",2,"C04M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
418 idrotm[1100],"ONLY");
419 gMC->Gspos("C04B",3,"C04M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
420 idrotm[1101],"ONLY");
421 gMC->Gspos("C04B",4,"C04M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
422 idrotm[1101],"ONLY");
423 gMC->Gspos("C04B",5,"C04M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
424 idrotm[1100],"ONLY");
425 gMC->Gspos("C04B",6,"C04M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
426 idrotm[1100],"ONLY");
427 gMC->Gspos("C04B",7,"C04M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
428 idrotm[1101],"ONLY");
429 gMC->Gspos("C04B",8,"C04M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
430 idrotm[1101],"ONLY");
431 }
432//
433// Chamber Material represented by Alu sheet
434 tpar[0]= iChamber->RInner();
435 tpar[1]= iChamber->ROuter();
436 tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
437 gMC->Gsvolu("C03A", "TUBE", idAlu2, tpar, 3);
438 gMC->Gsvolu("C04A", "TUBE", idAlu2, tpar, 3);
439 gMC->Gspos("C03A", 1, "C03M", 0., 0., 0., 0, "ONLY");
440 gMC->Gspos("C04A", 1, "C04M", 0., 0., 0., 0, "ONLY");
441//
442// Sensitive volumes
443 // tpar[2] = iChamber->DGas();
444 tpar[2] = iChamber->DGas()/2;
445 gMC->Gsvolu("C03G", "TUBE", idGas, tpar, 3);
446 gMC->Gsvolu("C04G", "TUBE", idGas, tpar, 3);
447 gMC->Gspos("C03G", 1, "C03A", 0., 0., 0., 0, "ONLY");
448 gMC->Gspos("C04G", 1, "C04A", 0., 0., 0., 0, "ONLY");
449
450 if (frames) {
451//
452// Frame Crosses to be placed inside gas
453 dr = (iChamber->ROuter() - iChamber->RInner());
454 bpar[0] = TMath::Sqrt(dr*dr-dframep*dframep/4)/2;
455 bpar[1] = dframep/2;
456 bpar[2] = iChamber->DGas()/2;
457 gMC->Gsvolu("C03F", "BOX", idAlu1, bpar, 3);
458 gMC->Gsvolu("C04F", "BOX", idAlu1, bpar, 3);
459
460 gMC->Gspos("C03F",1,"C03G", +iChamber->RInner()+bpar[0] , 0, 0,
461 idrotm[1100],"ONLY");
462 gMC->Gspos("C03F",2,"C03G", -iChamber->RInner()-bpar[0] , 0, 0,
463 idrotm[1100],"ONLY");
464 gMC->Gspos("C03F",3,"C03G", 0, +iChamber->RInner()+bpar[0] , 0,
465 idrotm[1101],"ONLY");
466 gMC->Gspos("C03F",4,"C03G", 0, -iChamber->RInner()-bpar[0] , 0,
467 idrotm[1101],"ONLY");
468
469 gMC->Gspos("C04F",1,"C04G", +iChamber->RInner()+bpar[0] , 0, 0,
470 idrotm[1100],"ONLY");
471 gMC->Gspos("C04F",2,"C04G", -iChamber->RInner()-bpar[0] , 0, 0,
472 idrotm[1100],"ONLY");
473 gMC->Gspos("C04F",3,"C04G", 0, +iChamber->RInner()+bpar[0] , 0,
474 idrotm[1101],"ONLY");
475 gMC->Gspos("C04F",4,"C04G", 0, -iChamber->RInner()-bpar[0] , 0,
476 idrotm[1101],"ONLY");
477 }
b17c0c87 478 }
1e8fff9c 479 // define the id of tracking media:
480 Int_t idCopper = idtmed[1110];
481 Int_t idGlass = idtmed[1111];
482 Int_t idCarbon = idtmed[1112];
483 Int_t idRoha = idtmed[1113];
484
1e8fff9c 485 // sensitive area: 40*40 cm**2
6c5ddcfa 486 const Float_t sensLength = 40.;
487 const Float_t sensHeight = 40.;
488 const Float_t sensWidth = 0.5; // according to TDR fig 2.120
489 const Int_t sensMaterial = idGas;
1e8fff9c 490 const Float_t yOverlap = 1.5;
491
492 // PCB dimensions in cm; width: 30 mum copper
6c5ddcfa 493 const Float_t pcbLength = sensLength;
494 const Float_t pcbHeight = 60.;
495 const Float_t pcbWidth = 0.003;
496 const Int_t pcbMaterial = idCopper;
1e8fff9c 497
498 // Insulating material: 200 mum glass fiber glued to pcb
6c5ddcfa 499 const Float_t insuLength = pcbLength;
500 const Float_t insuHeight = pcbHeight;
501 const Float_t insuWidth = 0.020;
502 const Int_t insuMaterial = idGlass;
1e8fff9c 503
504 // Carbon fiber panels: 200mum carbon/epoxy skin
6c5ddcfa 505 const Float_t panelLength = sensLength;
506 const Float_t panelHeight = sensHeight;
507 const Float_t panelWidth = 0.020;
508 const Int_t panelMaterial = idCarbon;
1e8fff9c 509
510 // rohacell between the two carbon panels
6c5ddcfa 511 const Float_t rohaLength = sensLength;
512 const Float_t rohaHeight = sensHeight;
513 const Float_t rohaWidth = 0.5;
514 const Int_t rohaMaterial = idRoha;
1e8fff9c 515
516 // Frame around the slat: 2 sticks along length,2 along height
517 // H: the horizontal ones
6c5ddcfa 518 const Float_t hFrameLength = pcbLength;
519 const Float_t hFrameHeight = 1.5;
520 const Float_t hFrameWidth = sensWidth;
521 const Int_t hFrameMaterial = idGlass;
1e8fff9c 522
523 // V: the vertical ones
6c5ddcfa 524 const Float_t vFrameLength = 4.0;
525 const Float_t vFrameHeight = sensHeight + hFrameHeight;
526 const Float_t vFrameWidth = sensWidth;
527 const Int_t vFrameMaterial = idGlass;
1e8fff9c 528
529 // B: the horizontal border filled with rohacell
6c5ddcfa 530 const Float_t bFrameLength = hFrameLength;
531 const Float_t bFrameHeight = (pcbHeight - sensHeight)/2. - hFrameHeight;
532 const Float_t bFrameWidth = hFrameWidth;
533 const Int_t bFrameMaterial = idRoha;
1e8fff9c 534
535 // NULOC: 30 mum copper + 200 mum vetronite (same radiation length as 14mum copper)
6c5ddcfa 536 const Float_t nulocLength = 2.5;
537 const Float_t nulocHeight = 7.5;
538 const Float_t nulocWidth = 0.0030 + 0.0014; // equivalent copper width of vetronite;
539 const Int_t nulocMaterial = idCopper;
1e8fff9c 540
6c5ddcfa 541 const Float_t slatHeight = pcbHeight;
542 const Float_t slatWidth = sensWidth + 2.*(pcbWidth + insuWidth +
543 2.* panelWidth + rohaWidth);
544 const Int_t slatMaterial = idAir;
545 const Float_t dSlatLength = vFrameLength; // border on left and right
1e8fff9c 546
1e8fff9c 547 Float_t spar[3];
b17c0c87 548 Int_t i, j;
549
3c084d9f 550 // the panel volume contains the rohacell
551
552 Float_t twidth = 2 * panelWidth + rohaWidth;
553 Float_t panelpar[3] = { panelLength/2., panelHeight/2., twidth/2. };
b17c0c87 554 Float_t rohapar[3] = { rohaLength/2., rohaHeight/2., rohaWidth/2. };
3c084d9f 555
556 // insulating material contains PCB-> gas-> 2 borders filled with rohacell
557
558 twidth = 2*(insuWidth + pcbWidth) + sensWidth;
559 Float_t insupar[3] = { insuLength/2., insuHeight/2., twidth/2. };
560 twidth -= 2 * insuWidth;
561 Float_t pcbpar[3] = { pcbLength/2., pcbHeight/2., twidth/2. };
562 Float_t senspar[3] = { sensLength/2., sensHeight/2., sensWidth/2. };
563 Float_t theight = 2*hFrameHeight + sensHeight;
564 Float_t hFramepar[3]={hFrameLength/2., theight/2., hFrameWidth/2.};
b17c0c87 565 Float_t bFramepar[3]={bFrameLength/2., bFrameHeight/2., bFrameWidth/2.};
3c084d9f 566 Float_t vFramepar[3]={vFrameLength/2., vFrameHeight/2., vFrameWidth/2.};
b17c0c87 567 Float_t nulocpar[3]={nulocLength/2., nulocHeight/2., nulocWidth/2.};
b17c0c87 568 Float_t xx;
569 Float_t xxmax = (bFrameLength - nulocLength)/2.;
570 Int_t index=0;
571
572 if (stations[2]) {
573
574//********************************************************************
575// Station 3 **
576//********************************************************************
577 // indices 1 and 2 for first and second chambers in the station
578 // iChamber (first chamber) kept for other quanties than Z,
579 // assumed to be the same in both chambers
580 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[4];
581 iChamber2 =(AliMUONChamber*) (*fChambers)[5];
582 zpos1=iChamber1->Z();
583 zpos2=iChamber2->Z();
584 dstation = zpos2 - zpos1;
585
586 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
587//
588// Mother volume
589 tpar[0] = iChamber->RInner()-dframep;
590 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
3c084d9f 591 tpar[2] = dstation/4;
b17c0c87 592 gMC->Gsvolu("C05M", "TUBE", idAir, tpar, 3);
593 gMC->Gsvolu("C06M", "TUBE", idAir, tpar, 3);
594 gMC->Gspos("C05M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
595 gMC->Gspos("C06M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
596
597 // volumes for slat geometry (xx=5,..,10 chamber id):
598 // Sxx0 Sxx1 Sxx2 Sxx3 --> Slat Mother volumes
599 // SxxG --> Sensitive volume (gas)
600 // SxxP --> PCB (copper)
601 // SxxI --> Insulator (vetronite)
602 // SxxC --> Carbon panel
603 // SxxR --> Rohacell
604 // SxxH, SxxV --> Horizontal and Vertical frames (vetronite)
605
606 // slat dimensions: slat is a MOTHER volume!!! made of air
607
a083207d 608 const Int_t nSlats3 = 5; // number of slats per quadrant
609 const Int_t nPCB3[nSlats3] = {3,3,4,3,2}; // n PCB per slat
610 const Float_t xpos3[nSlats3] = {30., 40., 0., 0., 0.};
b17c0c87 611 Float_t slatLength3[nSlats3];
612
613 // create and position the slat (mother) volumes
614
6c5ddcfa 615 char volNam5[5];
616 char volNam6[5];
f9f7c205 617 Float_t xSlat3;
b17c0c87 618
6c5ddcfa 619 for (i = 0; i<nSlats3; i++){
3c084d9f 620 slatLength3[i] = pcbLength * nPCB3[i] + 2. * dSlatLength;
a083207d 621 xSlat3 = slatLength3[i]/2. - vFrameLength/2. + xpos3[i];
622 if (i==1) slatLength3[i] -= 2. *dSlatLength; // frame out in PCB with circular border
623 Float_t ySlat31 = sensHeight * i - yOverlap * i;
624 Float_t ySlat32 = -sensHeight * i + yOverlap * i;
3c084d9f 625 spar[0] = slatLength3[i]/2.;
626 spar[1] = slatHeight/2.;
627 spar[2] = slatWidth/2. * 1.01;
628 Float_t dzCh3=spar[2] * 1.01;
629 // zSlat to be checked (odd downstream or upstream?)
630 Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2];
631 sprintf(volNam5,"S05%d",i);
632 gMC->Gsvolu(volNam5,"BOX",slatMaterial,spar,3);
633 gMC->Gspos(volNam5, i*4+1,"C05M", xSlat3, ySlat31, zSlat+2.*dzCh3, 0, "ONLY");
634 gMC->Gspos(volNam5, i*4+2,"C05M",-xSlat3, ySlat31, zSlat-2.*dzCh3, 0, "ONLY");
a083207d 635 if (i>0) {
636 gMC->Gspos(volNam5, i*4+3,"C05M", xSlat3, ySlat32, zSlat+2.*dzCh3, 0, "ONLY");
637 gMC->Gspos(volNam5, i*4+4,"C05M",-xSlat3, ySlat32, zSlat-2.*dzCh3, 0, "ONLY");
638 }
3c084d9f 639 sprintf(volNam6,"S06%d",i);
640 gMC->Gsvolu(volNam6,"BOX",slatMaterial,spar,3);
641 gMC->Gspos(volNam6, i*4+1,"C06M", xSlat3, ySlat31, zSlat+2.*dzCh3, 0, "ONLY");
642 gMC->Gspos(volNam6, i*4+2,"C06M",-xSlat3, ySlat31, zSlat-2.*dzCh3, 0, "ONLY");
a083207d 643 if (i>0) {
644 gMC->Gspos(volNam6, i*4+3,"C06M", xSlat3, ySlat32, zSlat+2.*dzCh3, 0, "ONLY");
645 gMC->Gspos(volNam6, i*4+4,"C06M",-xSlat3, ySlat32, zSlat-2.*dzCh3, 0, "ONLY");
646 }
3c084d9f 647 }
1e8fff9c 648
649 // create the panel volume
b17c0c87 650
6c5ddcfa 651 gMC->Gsvolu("S05C","BOX",panelMaterial,panelpar,3);
652 gMC->Gsvolu("S06C","BOX",panelMaterial,panelpar,3);
1e8fff9c 653
654 // create the rohacell volume
b17c0c87 655
6c5ddcfa 656 gMC->Gsvolu("S05R","BOX",rohaMaterial,rohapar,3);
657 gMC->Gsvolu("S06R","BOX",rohaMaterial,rohapar,3);
1e8fff9c 658
3c084d9f 659 // create the insulating material volume
660
661 gMC->Gsvolu("S05I","BOX",insuMaterial,insupar,3);
662 gMC->Gsvolu("S06I","BOX",insuMaterial,insupar,3);
663
664 // create the PCB volume
665
666 gMC->Gsvolu("S05P","BOX",pcbMaterial,pcbpar,3);
667 gMC->Gsvolu("S06P","BOX",pcbMaterial,pcbpar,3);
668
669 // create the sensitive volumes,
670 gMC->Gsvolu("S05G","BOX",sensMaterial,0,0);
671 gMC->Gsvolu("S06G","BOX",sensMaterial,0,0);
672
673
1e8fff9c 674 // create the vertical frame volume
b17c0c87 675
6c5ddcfa 676 gMC->Gsvolu("S05V","BOX",vFrameMaterial,vFramepar,3);
677 gMC->Gsvolu("S06V","BOX",vFrameMaterial,vFramepar,3);
1e8fff9c 678
679 // create the horizontal frame volume
b17c0c87 680
6c5ddcfa 681 gMC->Gsvolu("S05H","BOX",hFrameMaterial,hFramepar,3);
682 gMC->Gsvolu("S06H","BOX",hFrameMaterial,hFramepar,3);
1e8fff9c 683
684 // create the horizontal border volume
b17c0c87 685
6c5ddcfa 686 gMC->Gsvolu("S05B","BOX",bFrameMaterial,bFramepar,3);
687 gMC->Gsvolu("S06B","BOX",bFrameMaterial,bFramepar,3);
1e8fff9c 688
b17c0c87 689 index=0;
6c5ddcfa 690 for (i = 0; i<nSlats3; i++){
691 sprintf(volNam5,"S05%d",i);
692 sprintf(volNam6,"S06%d",i);
f9f7c205 693 Float_t xvFrame = (slatLength3[i] - vFrameLength)/2.;
3c084d9f 694 // position the vertical frames
a083207d 695 if (i!=1) {
3c084d9f 696 gMC->Gspos("S05V",2*i-1,volNam5, xvFrame, 0., 0. , 0, "ONLY");
697 gMC->Gspos("S05V",2*i ,volNam5,-xvFrame, 0., 0. , 0, "ONLY");
698 gMC->Gspos("S06V",2*i-1,volNam6, xvFrame, 0., 0. , 0, "ONLY");
699 gMC->Gspos("S06V",2*i ,volNam6,-xvFrame, 0., 0. , 0, "ONLY");
700 }
701 // position the panels and the insulating material
6c5ddcfa 702 for (j=0; j<nPCB3[i]; j++){
1e8fff9c 703 index++;
6c5ddcfa 704 Float_t xx = sensLength * (-nPCB3[i]/2.+j+.5);
3c084d9f 705
706 Float_t zPanel = spar[2] - panelpar[2];
707 gMC->Gspos("S05C",2*index-1,volNam5, xx, 0., zPanel , 0, "ONLY");
708 gMC->Gspos("S05C",2*index ,volNam5, xx, 0.,-zPanel , 0, "ONLY");
709 gMC->Gspos("S06C",2*index-1,volNam6, xx, 0., zPanel , 0, "ONLY");
710 gMC->Gspos("S06C",2*index ,volNam6, xx, 0.,-zPanel , 0, "ONLY");
711
712 gMC->Gspos("S05I",index,volNam5, xx, 0., 0 , 0, "ONLY");
713 gMC->Gspos("S06I",index,volNam6, xx, 0., 0 , 0, "ONLY");
1e8fff9c 714 }
a9e2aefa 715 }
a9e2aefa 716
3c084d9f 717 // position the rohacell volume inside the panel volume
718 gMC->Gspos("S05R",1,"S05C",0.,0.,0.,0,"ONLY");
719 gMC->Gspos("S06R",1,"S06C",0.,0.,0.,0,"ONLY");
720
721 // position the PCB volume inside the insulating material volume
722 gMC->Gspos("S05P",1,"S05I",0.,0.,0.,0,"ONLY");
723 gMC->Gspos("S06P",1,"S06I",0.,0.,0.,0,"ONLY");
724 // position the horizontal frame volume inside the PCB volume
725 gMC->Gspos("S05H",1,"S05P",0.,0.,0.,0,"ONLY");
726 gMC->Gspos("S06H",1,"S06P",0.,0.,0.,0,"ONLY");
727 // position the sensitive volume inside the horizontal frame volume
728 gMC->Gsposp("S05G",1,"S05H",0.,0.,0.,0,"ONLY",senspar,3);
729 gMC->Gsposp("S06G",1,"S06H",0.,0.,0.,0,"ONLY",senspar,3);
730 // position the border volumes inside the PCB volume
731 Float_t yborder = ( pcbHeight - bFrameHeight ) / 2.;
732 gMC->Gspos("S05B",1,"S05P",0., yborder,0.,0,"ONLY");
733 gMC->Gspos("S05B",2,"S05P",0.,-yborder,0.,0,"ONLY");
734 gMC->Gspos("S06B",1,"S06P",0., yborder,0.,0,"ONLY");
735 gMC->Gspos("S06B",2,"S06P",0.,-yborder,0.,0,"ONLY");
736
1e8fff9c 737 // create the NULOC volume and position it in the horizontal frame
b17c0c87 738
6c5ddcfa 739 gMC->Gsvolu("S05N","BOX",nulocMaterial,nulocpar,3);
740 gMC->Gsvolu("S06N","BOX",nulocMaterial,nulocpar,3);
6c5ddcfa 741 index = 0;
6c5ddcfa 742 for (xx = -xxmax; xx<=xxmax; xx+=3*nulocLength) {
1e8fff9c 743 index++;
6c5ddcfa 744 gMC->Gspos("S05N",2*index-1,"S05B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
745 gMC->Gspos("S05N",2*index ,"S05B", xx, 0., bFrameWidth/4., 0, "ONLY");
746 gMC->Gspos("S06N",2*index-1,"S06B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
747 gMC->Gspos("S06N",2*index ,"S06B", xx, 0., bFrameWidth/4., 0, "ONLY");
1e8fff9c 748 }
3c084d9f 749
750 // position the volumes approximating the circular section of the pipe
a083207d 751 Float_t yoffs = sensHeight/2. - yOverlap;
3c084d9f 752 Float_t epsilon = 0.001;
753 Int_t ndiv=6;
754 Float_t divpar[3];
755 Double_t dydiv= sensHeight/ndiv;
a083207d 756 Double_t ydiv = yoffs -dydiv - yOverlap/2.;
3c084d9f 757 Int_t imax=0;
758 // for (Int_t islat=0; islat<nSlats3; islat++) imax += nPCB3[islat];
759 imax = 1;
760 Float_t rmin = 35.;
a083207d 761 Float_t z1 = spar[2], z2=2*spar[2]*1.01;
3c084d9f 762 for (Int_t idiv=0;idiv<ndiv; idiv++){
763 ydiv+= dydiv;
a083207d 764 Float_t xdiv =2;
3c084d9f 765 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
766 divpar[0] = (pcbLength-xdiv)/2.;
767 divpar[1] = dydiv/2. - epsilon;
768 divpar[2] = sensWidth/2.;
769 Float_t xvol=(pcbLength+xdiv)/2.;
a083207d 770 Float_t yvol=ydiv + dydiv/2.;
3c084d9f 771 gMC->Gsposp("S05G",imax+4*idiv+1,"C05M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
772 gMC->Gsposp("S06G",imax+4*idiv+1,"C06M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
a083207d 773 gMC->Gsposp("S05G",imax+4*idiv+2,"C05M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
774 gMC->Gsposp("S06G",imax+4*idiv+2,"C06M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
775 gMC->Gsposp("S05G",imax+4*idiv+3,"C05M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
776 gMC->Gsposp("S06G",imax+4*idiv+3,"C06M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
777 gMC->Gsposp("S05G",imax+4*idiv+4,"C05M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
778 gMC->Gsposp("S06G",imax+4*idiv+4,"C06M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
3c084d9f 779 }
b17c0c87 780 }
b17c0c87 781
a9e2aefa 782
3c084d9f 783 if (stations[3]) {
784
a9e2aefa 785//********************************************************************
786// Station 4 **
787//********************************************************************
788 // indices 1 and 2 for first and second chambers in the station
789 // iChamber (first chamber) kept for other quanties than Z,
790 // assumed to be the same in both chambers
791 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[6];
792 iChamber2 =(AliMUONChamber*) (*fChambers)[7];
793 zpos1=iChamber1->Z();
794 zpos2=iChamber2->Z();
795 dstation = zpos2 - zpos1;
796 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
797
798//
799// Mother volume
800 tpar[0] = iChamber->RInner()-dframep;
801 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
3c084d9f 802 tpar[2] = 3.252;
a9e2aefa 803
804 gMC->Gsvolu("C07M", "TUBE", idAir, tpar, 3);
805 gMC->Gsvolu("C08M", "TUBE", idAir, tpar, 3);
806 gMC->Gspos("C07M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
807 gMC->Gspos("C08M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
1e8fff9c 808
a9e2aefa 809
f9f7c205 810 const Int_t nSlats4 = 6; // number of slats per quadrant
a083207d 811 const Int_t nPCB4[nSlats4] = {4,4,5,4,4,3}; // n PCB per slat
812 const Float_t xpos4[nSlats4] = {37.5, 40., 0., 0., 0., 0.};
6c5ddcfa 813 Float_t slatLength4[nSlats4];
1e8fff9c 814
815 // create and position the slat (mother) volumes
816
6c5ddcfa 817 char volNam7[5];
818 char volNam8[5];
1e8fff9c 819 Float_t xSlat4;
f9f7c205 820 Float_t ySlat4;
1e8fff9c 821
6c5ddcfa 822 for (i = 0; i<nSlats4; i++){
a083207d 823 slatLength4[i] = pcbLength * nPCB4[i] + 2. * dSlatLength;
824 xSlat4 = slatLength4[i]/2. - vFrameLength/2. + xpos4[i];
825 if (i==1) slatLength4[i] -= 2. *dSlatLength; // frame out in PCB with circular border
826 ySlat4 = sensHeight * i - yOverlap *i;
827
828 spar[0] = slatLength4[i]/2.;
829 spar[1] = slatHeight/2.;
830 spar[2] = slatWidth/2.*1.01;
831 Float_t dzCh4=spar[2]*1.01;
832 // zSlat to be checked (odd downstream or upstream?)
833 Float_t zSlat = (i%2 ==0)? spar[2] : -spar[2];
834 sprintf(volNam7,"S07%d",i);
835 gMC->Gsvolu(volNam7,"BOX",slatMaterial,spar,3);
836 gMC->Gspos(volNam7, i*4+1,"C07M", xSlat4, ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
837 gMC->Gspos(volNam7, i*4+2,"C07M",-xSlat4, ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
838 if (i>0) {
839 gMC->Gspos(volNam7, i*4+3,"C07M", xSlat4,-ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
840 gMC->Gspos(volNam7, i*4+4,"C07M",-xSlat4,-ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
841 }
842 sprintf(volNam8,"S08%d",i);
843 gMC->Gsvolu(volNam8,"BOX",slatMaterial,spar,3);
844 gMC->Gspos(volNam8, i*4+1,"C08M", xSlat4, ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
845 gMC->Gspos(volNam8, i*4+2,"C08M",-xSlat4, ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
846 if (i>0) {
847 gMC->Gspos(volNam8, i*4+3,"C08M", xSlat4,-ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
848 gMC->Gspos(volNam8, i*4+4,"C08M",-xSlat4,-ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
849 }
a9e2aefa 850 }
a083207d 851
3c084d9f 852
853 // create the panel volume
1e8fff9c 854
3c084d9f 855 gMC->Gsvolu("S07C","BOX",panelMaterial,panelpar,3);
856 gMC->Gsvolu("S08C","BOX",panelMaterial,panelpar,3);
a9e2aefa 857
3c084d9f 858 // create the rohacell volume
859
860 gMC->Gsvolu("S07R","BOX",rohaMaterial,rohapar,3);
861 gMC->Gsvolu("S08R","BOX",rohaMaterial,rohapar,3);
1e8fff9c 862
1e8fff9c 863 // create the insulating material volume
864
6c5ddcfa 865 gMC->Gsvolu("S07I","BOX",insuMaterial,insupar,3);
866 gMC->Gsvolu("S08I","BOX",insuMaterial,insupar,3);
1e8fff9c 867
3c084d9f 868 // create the PCB volume
1e8fff9c 869
3c084d9f 870 gMC->Gsvolu("S07P","BOX",pcbMaterial,pcbpar,3);
871 gMC->Gsvolu("S08P","BOX",pcbMaterial,pcbpar,3);
1e8fff9c 872
3c084d9f 873 // create the sensitive volumes,
874
875 gMC->Gsvolu("S07G","BOX",sensMaterial,0,0);
876 gMC->Gsvolu("S08G","BOX",sensMaterial,0,0);
1e8fff9c 877
878 // create the vertical frame volume
879
6c5ddcfa 880 gMC->Gsvolu("S07V","BOX",vFrameMaterial,vFramepar,3);
881 gMC->Gsvolu("S08V","BOX",vFrameMaterial,vFramepar,3);
1e8fff9c 882
883 // create the horizontal frame volume
884
6c5ddcfa 885 gMC->Gsvolu("S07H","BOX",hFrameMaterial,hFramepar,3);
886 gMC->Gsvolu("S08H","BOX",hFrameMaterial,hFramepar,3);
1e8fff9c 887
888 // create the horizontal border volume
889
6c5ddcfa 890 gMC->Gsvolu("S07B","BOX",bFrameMaterial,bFramepar,3);
891 gMC->Gsvolu("S08B","BOX",bFrameMaterial,bFramepar,3);
3c084d9f 892
893 index=0;
6c5ddcfa 894 for (i = 0; i<nSlats4; i++){
895 sprintf(volNam7,"S07%d",i);
896 sprintf(volNam8,"S08%d",i);
897 Float_t xvFrame = (slatLength4[i] - vFrameLength)/2.;
3c084d9f 898 // position the vertical frames
a083207d 899 if (i!=1) {
900 gMC->Gspos("S07V",2*i-1,volNam7, xvFrame, 0., 0. , 0, "ONLY");
901 gMC->Gspos("S07V",2*i ,volNam7,-xvFrame, 0., 0. , 0, "ONLY");
902 gMC->Gspos("S08V",2*i-1,volNam8, xvFrame, 0., 0. , 0, "ONLY");
903 gMC->Gspos("S08V",2*i ,volNam8,-xvFrame, 0., 0. , 0, "ONLY");
904 }
3c084d9f 905 // position the panels and the insulating material
6c5ddcfa 906 for (j=0; j<nPCB4[i]; j++){
1e8fff9c 907 index++;
6c5ddcfa 908 Float_t xx = sensLength * (-nPCB4[i]/2.+j+.5);
3c084d9f 909
910 Float_t zPanel = spar[2] - panelpar[2];
911 gMC->Gspos("S07C",2*index-1,volNam7, xx, 0., zPanel , 0, "ONLY");
912 gMC->Gspos("S07C",2*index ,volNam7, xx, 0.,-zPanel , 0, "ONLY");
913 gMC->Gspos("S08C",2*index-1,volNam8, xx, 0., zPanel , 0, "ONLY");
914 gMC->Gspos("S08C",2*index ,volNam8, xx, 0.,-zPanel , 0, "ONLY");
915
916 gMC->Gspos("S07I",index,volNam7, xx, 0., 0 , 0, "ONLY");
917 gMC->Gspos("S08I",index,volNam8, xx, 0., 0 , 0, "ONLY");
1e8fff9c 918 }
a9e2aefa 919 }
1e8fff9c 920
3c084d9f 921 // position the rohacell volume inside the panel volume
922 gMC->Gspos("S07R",1,"S07C",0.,0.,0.,0,"ONLY");
923 gMC->Gspos("S08R",1,"S08C",0.,0.,0.,0,"ONLY");
924
925 // position the PCB volume inside the insulating material volume
926 gMC->Gspos("S07P",1,"S07I",0.,0.,0.,0,"ONLY");
927 gMC->Gspos("S08P",1,"S08I",0.,0.,0.,0,"ONLY");
928 // position the horizontal frame volume inside the PCB volume
929 gMC->Gspos("S07H",1,"S07P",0.,0.,0.,0,"ONLY");
930 gMC->Gspos("S08H",1,"S08P",0.,0.,0.,0,"ONLY");
931 // position the sensitive volume inside the horizontal frame volume
932 gMC->Gsposp("S07G",1,"S07H",0.,0.,0.,0,"ONLY",senspar,3);
933 gMC->Gsposp("S08G",1,"S08H",0.,0.,0.,0,"ONLY",senspar,3);
3c084d9f 934 // position the border volumes inside the PCB volume
935 Float_t yborder = ( pcbHeight - bFrameHeight ) / 2.;
936 gMC->Gspos("S07B",1,"S07P",0., yborder,0.,0,"ONLY");
937 gMC->Gspos("S07B",2,"S07P",0.,-yborder,0.,0,"ONLY");
938 gMC->Gspos("S08B",1,"S08P",0., yborder,0.,0,"ONLY");
939 gMC->Gspos("S08B",2,"S08P",0.,-yborder,0.,0,"ONLY");
940
1e8fff9c 941 // create the NULOC volume and position it in the horizontal frame
3c084d9f 942
6c5ddcfa 943 gMC->Gsvolu("S07N","BOX",nulocMaterial,nulocpar,3);
944 gMC->Gsvolu("S08N","BOX",nulocMaterial,nulocpar,3);
3c084d9f 945 index = 0;
6c5ddcfa 946 for (xx = -xxmax; xx<=xxmax; xx+=3*nulocLength) {
1e8fff9c 947 index++;
6c5ddcfa 948 gMC->Gspos("S07N",2*index-1,"S07B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
949 gMC->Gspos("S07N",2*index ,"S07B", xx, 0., bFrameWidth/4., 0, "ONLY");
950 gMC->Gspos("S08N",2*index-1,"S08B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
951 gMC->Gspos("S08N",2*index ,"S08B", xx, 0., bFrameWidth/4., 0, "ONLY");
1e8fff9c 952 }
a083207d 953
954 // position the volumes approximating the circular section of the pipe
955 Float_t yoffs = sensHeight/2. - yOverlap/2.;
956 Float_t epsilon = 0.001;
957 Int_t ndiv=6;
958 Float_t divpar[3];
959 Double_t dydiv= sensHeight/ndiv;
960 Double_t ydiv = yoffs -dydiv - yOverlap/2.;
961 Int_t imax=0;
962 // for (Int_t islat=0; islat<nSlats3; islat++) imax += nPCB3[islat];
963 imax = 1;
964 Float_t rmin = 40.;
965 Float_t z1 = -spar[2], z2=2*spar[2]*1.01;
966 for (Int_t idiv=0;idiv<ndiv; idiv++){
967 ydiv+= dydiv;
968 Float_t xdiv =2;
969 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
970 divpar[0] = (pcbLength-xdiv)/2.;
971 divpar[1] = dydiv/2. - epsilon;
972 divpar[2] = sensWidth/2.;
973 Float_t xvol=(pcbLength+xdiv)/2.;
974 Float_t yvol=ydiv + dydiv/2.;
975 gMC->Gsposp("S07G",imax+4*idiv+1,"C07M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
976 gMC->Gsposp("S08G",imax+4*idiv+1,"C08M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
977 gMC->Gsposp("S07G",imax+4*idiv+2,"C07M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
978 gMC->Gsposp("S08G",imax+4*idiv+2,"C08M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
979 gMC->Gsposp("S07G",imax+4*idiv+3,"C07M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
980 gMC->Gsposp("S08G",imax+4*idiv+3,"C08M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
981 gMC->Gsposp("S07G",imax+4*idiv+4,"C07M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
982 gMC->Gsposp("S08G",imax+4*idiv+4,"C08M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
983 }
984
985
986
987
988
b17c0c87 989 }
3c084d9f 990
b17c0c87 991 if (stations[4]) {
992
1e8fff9c 993
a9e2aefa 994//********************************************************************
995// Station 5 **
996//********************************************************************
997 // indices 1 and 2 for first and second chambers in the station
998 // iChamber (first chamber) kept for other quanties than Z,
999 // assumed to be the same in both chambers
1000 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[8];
1001 iChamber2 =(AliMUONChamber*) (*fChambers)[9];
1002 zpos1=iChamber1->Z();
1003 zpos2=iChamber2->Z();
1004 dstation = zpos2 - zpos1;
1005 zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
3c084d9f 1006
a9e2aefa 1007//
1008// Mother volume
1009 tpar[0] = iChamber->RInner()-dframep;
1010 tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
3c084d9f 1011 tpar[2] = dstation/5.;
a9e2aefa 1012
1013 gMC->Gsvolu("C09M", "TUBE", idAir, tpar, 3);
1014 gMC->Gsvolu("C10M", "TUBE", idAir, tpar, 3);
1015 gMC->Gspos("C09M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
1016 gMC->Gspos("C10M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
a9e2aefa 1017
a9e2aefa 1018
1e8fff9c 1019 const Int_t nSlats5 = 7; // number of slats per quadrant
a083207d 1020 const Int_t nPCB5[nSlats5] = {5,5,6,6,5,4,3}; // n PCB per slat
1021 const Float_t xpos5[nSlats5] = {37.5, 40., 0., 0., 0., 0., 0.};
6c5ddcfa 1022 Float_t slatLength5[nSlats5];
6c5ddcfa 1023 char volNam9[5];
1024 char volNam10[5];
f9f7c205 1025 Float_t xSlat5;
1026 Float_t ySlat5;
1e8fff9c 1027
6c5ddcfa 1028 for (i = 0; i<nSlats5; i++){
1029 slatLength5[i] = pcbLength * nPCB5[i] + 2. * dSlatLength;
a083207d 1030 xSlat5 = slatLength5[i]/2. - vFrameLength/2. +xpos5[i];
1031 if (i==1) slatLength5[i] -= 2. *dSlatLength; // frame out in PCB with circular border
f9f7c205 1032 ySlat5 = sensHeight * i - yOverlap * i;
6c5ddcfa 1033 spar[0] = slatLength5[i]/2.;
1034 spar[1] = slatHeight/2.;
3c084d9f 1035 spar[2] = slatWidth/2. * 1.01;
1036 Float_t dzCh5=spar[2]*1.01;
1e8fff9c 1037 // zSlat to be checked (odd downstream or upstream?)
3c084d9f 1038 Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2];
6c5ddcfa 1039 sprintf(volNam9,"S09%d",i);
1040 gMC->Gsvolu(volNam9,"BOX",slatMaterial,spar,3);
e1ad7d45 1041 gMC->Gspos(volNam9, i*4+1,"C09M", xSlat5, ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
1042 gMC->Gspos(volNam9, i*4+2,"C09M",-xSlat5, ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
f9f7c205 1043 if (i>0) {
3c084d9f 1044 gMC->Gspos(volNam9, i*4+3,"C09M", xSlat5,-ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
1045 gMC->Gspos(volNam9, i*4+4,"C09M",-xSlat5,-ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
f9f7c205 1046 }
6c5ddcfa 1047 sprintf(volNam10,"S10%d",i);
1048 gMC->Gsvolu(volNam10,"BOX",slatMaterial,spar,3);
e1ad7d45 1049 gMC->Gspos(volNam10, i*4+1,"C10M", xSlat5, ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
1050 gMC->Gspos(volNam10, i*4+2,"C10M",-xSlat5, ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
f9f7c205 1051 if (i>0) {
3c084d9f 1052 gMC->Gspos(volNam10, i*4+3,"C10M", xSlat5,-ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
1053 gMC->Gspos(volNam10, i*4+4,"C10M",-xSlat5,-ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
f9f7c205 1054 }
a9e2aefa 1055 }
1056
1e8fff9c 1057 // create the panel volume
3c084d9f 1058
6c5ddcfa 1059 gMC->Gsvolu("S09C","BOX",panelMaterial,panelpar,3);
1060 gMC->Gsvolu("S10C","BOX",panelMaterial,panelpar,3);
3c084d9f 1061
1e8fff9c 1062 // create the rohacell volume
3c084d9f 1063
6c5ddcfa 1064 gMC->Gsvolu("S09R","BOX",rohaMaterial,rohapar,3);
1065 gMC->Gsvolu("S10R","BOX",rohaMaterial,rohapar,3);
3c084d9f 1066
1067 // create the insulating material volume
1068
1069 gMC->Gsvolu("S09I","BOX",insuMaterial,insupar,3);
1070 gMC->Gsvolu("S10I","BOX",insuMaterial,insupar,3);
1071
1072 // create the PCB volume
1073
1074 gMC->Gsvolu("S09P","BOX",pcbMaterial,pcbpar,3);
1075 gMC->Gsvolu("S10P","BOX",pcbMaterial,pcbpar,3);
1076
1077 // create the sensitive volumes,
1078
1079 gMC->Gsvolu("S09G","BOX",sensMaterial,0,0);
1080 gMC->Gsvolu("S10G","BOX",sensMaterial,0,0);
3c084d9f 1081
1e8fff9c 1082 // create the vertical frame volume
3c084d9f 1083
6c5ddcfa 1084 gMC->Gsvolu("S09V","BOX",vFrameMaterial,vFramepar,3);
1085 gMC->Gsvolu("S10V","BOX",vFrameMaterial,vFramepar,3);
1e8fff9c 1086
1087 // create the horizontal frame volume
3c084d9f 1088
6c5ddcfa 1089 gMC->Gsvolu("S09H","BOX",hFrameMaterial,hFramepar,3);
1090 gMC->Gsvolu("S10H","BOX",hFrameMaterial,hFramepar,3);
1e8fff9c 1091
1092 // create the horizontal border volume
1093
6c5ddcfa 1094 gMC->Gsvolu("S09B","BOX",bFrameMaterial,bFramepar,3);
1095 gMC->Gsvolu("S10B","BOX",bFrameMaterial,bFramepar,3);
1e8fff9c 1096
3c084d9f 1097 index=0;
6c5ddcfa 1098 for (i = 0; i<nSlats5; i++){
1099 sprintf(volNam9,"S09%d",i);
1100 sprintf(volNam10,"S10%d",i);
1101 Float_t xvFrame = (slatLength5[i] - vFrameLength)/2.;
3c084d9f 1102 // position the vertical frames
a083207d 1103 if (i!=1) {
1104 gMC->Gspos("S09V",2*i-1,volNam9, xvFrame, 0., 0. , 0, "ONLY");
1105 gMC->Gspos("S09V",2*i ,volNam9,-xvFrame, 0., 0. , 0, "ONLY");
1106 gMC->Gspos("S10V",2*i-1,volNam10, xvFrame, 0., 0. , 0, "ONLY");
1107 gMC->Gspos("S10V",2*i ,volNam10,-xvFrame, 0., 0. , 0, "ONLY");
1108 }
3c084d9f 1109
1110 // position the panels and the insulating material
6c5ddcfa 1111 for (j=0; j<nPCB5[i]; j++){
1e8fff9c 1112 index++;
3c084d9f 1113 Float_t xx = sensLength * (-nPCB5[i]/2.+j+.5);
1114
1115 Float_t zPanel = spar[2] - panelpar[2];
1116 gMC->Gspos("S09C",2*index-1,volNam9, xx, 0., zPanel , 0, "ONLY");
1117 gMC->Gspos("S09C",2*index ,volNam9, xx, 0.,-zPanel , 0, "ONLY");
1118 gMC->Gspos("S10C",2*index-1,volNam10, xx, 0., zPanel , 0, "ONLY");
1119 gMC->Gspos("S10C",2*index ,volNam10, xx, 0.,-zPanel , 0, "ONLY");
1120
1121 gMC->Gspos("S09I",index,volNam9, xx, 0., 0 , 0, "ONLY");
1122 gMC->Gspos("S10I",index,volNam10, xx, 0., 0 , 0, "ONLY");
1e8fff9c 1123 }
1124 }
1125
3c084d9f 1126 // position the rohacell volume inside the panel volume
1127 gMC->Gspos("S09R",1,"S09C",0.,0.,0.,0,"ONLY");
1128 gMC->Gspos("S10R",1,"S10C",0.,0.,0.,0,"ONLY");
1129
1130 // position the PCB volume inside the insulating material volume
1131 gMC->Gspos("S09P",1,"S09I",0.,0.,0.,0,"ONLY");
1132 gMC->Gspos("S10P",1,"S10I",0.,0.,0.,0,"ONLY");
1133 // position the horizontal frame volume inside the PCB volume
1134 gMC->Gspos("S09H",1,"S09P",0.,0.,0.,0,"ONLY");
1135 gMC->Gspos("S10H",1,"S10P",0.,0.,0.,0,"ONLY");
1136 // position the sensitive volume inside the horizontal frame volume
1137 gMC->Gsposp("S09G",1,"S09H",0.,0.,0.,0,"ONLY",senspar,3);
1138 gMC->Gsposp("S10G",1,"S10H",0.,0.,0.,0,"ONLY",senspar,3);
3c084d9f 1139 // position the border volumes inside the PCB volume
1140 Float_t yborder = ( pcbHeight - bFrameHeight ) / 2.;
1141 gMC->Gspos("S09B",1,"S09P",0., yborder,0.,0,"ONLY");
1142 gMC->Gspos("S09B",2,"S09P",0.,-yborder,0.,0,"ONLY");
1143 gMC->Gspos("S10B",1,"S10P",0., yborder,0.,0,"ONLY");
1144 gMC->Gspos("S10B",2,"S10P",0.,-yborder,0.,0,"ONLY");
1145
1e8fff9c 1146 // create the NULOC volume and position it in the horizontal frame
3c084d9f 1147
6c5ddcfa 1148 gMC->Gsvolu("S09N","BOX",nulocMaterial,nulocpar,3);
1149 gMC->Gsvolu("S10N","BOX",nulocMaterial,nulocpar,3);
3c084d9f 1150 index = 0;
6c5ddcfa 1151 for (xx = -xxmax; xx<=xxmax; xx+=3*nulocLength) {
1e8fff9c 1152 index++;
6c5ddcfa 1153 gMC->Gspos("S09N",2*index-1,"S09B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
1154 gMC->Gspos("S09N",2*index ,"S09B", xx, 0., bFrameWidth/4., 0, "ONLY");
1155 gMC->Gspos("S10N",2*index-1,"S10B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
1156 gMC->Gspos("S10N",2*index ,"S10B", xx, 0., bFrameWidth/4., 0, "ONLY");
a9e2aefa 1157 }
a083207d 1158 // position the volumes approximating the circular section of the pipe
1159 Float_t yoffs = sensHeight/2. - yOverlap/2.;
1160 Float_t epsilon = 0.001;
1161 Int_t ndiv=6;
1162 Float_t divpar[3];
1163 Double_t dydiv= sensHeight/ndiv;
1164 Double_t ydiv = yoffs -dydiv - yOverlap/2.;
1165 Int_t imax=0;
1166 // for (Int_t islat=0; islat<nSlats3; islat++) imax += nPCB3[islat];
1167 imax = 1;
1168 Float_t rmin = 40.;
1169 Float_t z1 = spar[2], z2=2*spar[2]*1.01;
1170 for (Int_t idiv=0;idiv<ndiv; idiv++){
1171 ydiv+= dydiv;
1172 Float_t xdiv =2;
1173 if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
1174 divpar[0] = (pcbLength-xdiv)/2.;
1175 divpar[1] = dydiv/2. - epsilon;
1176 divpar[2] = sensWidth/2.;
1177 Float_t xvol=(pcbLength+xdiv)/2.;
1178 Float_t yvol=ydiv + dydiv/2.;
1179 gMC->Gsposp("S09G",imax+4*idiv+1,"C09M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
1180 gMC->Gsposp("S10G",imax+4*idiv+1,"C10M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
1181 gMC->Gsposp("S09G",imax+4*idiv+2,"C09M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
1182 gMC->Gsposp("S10G",imax+4*idiv+2,"C10M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
1183 gMC->Gsposp("S09G",imax+4*idiv+3,"C09M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
1184 gMC->Gsposp("S10G",imax+4*idiv+3,"C10M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
1185 gMC->Gsposp("S09G",imax+4*idiv+4,"C09M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
1186 gMC->Gsposp("S10G",imax+4*idiv+4,"C10M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
1187 }
1188
b17c0c87 1189 }
1190
1e8fff9c 1191
a9e2aefa 1192///////////////////////////////////////
1193// GEOMETRY FOR THE TRIGGER CHAMBERS //
1194///////////////////////////////////////
1195
1196// 03/00 P. Dupieux : introduce a slighly more realistic
1197// geom. of the trigger readout planes with
1198// 2 Zpos per trigger plane (alternate
1199// between left and right of the trigger)
1200
1201// Parameters of the Trigger Chambers
1202
1203
1204 const Float_t kXMC1MIN=34.;
1205 const Float_t kXMC1MED=51.;
1206 const Float_t kXMC1MAX=272.;
1207 const Float_t kYMC1MIN=34.;
1208 const Float_t kYMC1MAX=51.;
1209 const Float_t kRMIN1=50.;
1210 const Float_t kRMAX1=62.;
1211 const Float_t kRMIN2=50.;
1212 const Float_t kRMAX2=66.;
1213
1214// zposition of the middle of the gas gap in mother vol
1215 const Float_t kZMCm=-3.6;
1216 const Float_t kZMCp=+3.6;
1217
1218
1219// TRIGGER STATION 1 - TRIGGER STATION 1 - TRIGGER STATION 1
1220
1221 // iChamber 1 and 2 for first and second chambers in the station
1222 // iChamber (first chamber) kept for other quanties than Z,
1223 // assumed to be the same in both chambers
1224 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[10];
1225 iChamber2 =(AliMUONChamber*) (*fChambers)[11];
1226
1227 // 03/00
1228 // zpos1 and zpos2 are now the middle of the first and second
1229 // plane of station 1 :
1230 // zpos1=(16075+15995)/2=16035 mm, thick/2=40 mm
1231 // zpos2=(16225+16145)/2=16185 mm, thick/2=40 mm
1232 //
1233 // zpos1m=15999 mm , zpos1p=16071 mm (middles of gas gaps)
1234 // zpos2m=16149 mm , zpos2p=16221 mm (middles of gas gaps)
1235 // rem : the total thickness accounts for 1 mm of al on both
1236 // side of the RPCs (see zpos1 and zpos2), as previously
1237
1238 zpos1=iChamber1->Z();
1239 zpos2=iChamber2->Z();
1240
1241
1242// Mother volume definition
1243 tpar[0] = iChamber->RInner();
1244 tpar[1] = iChamber->ROuter();
1245 tpar[2] = 4.0;
1246 gMC->Gsvolu("CM11", "TUBE", idAir, tpar, 3);
1247 gMC->Gsvolu("CM12", "TUBE", idAir, tpar, 3);
1248
1249// Definition of the flange between the beam shielding and the RPC
1250 tpar[0]= kRMIN1;
1251 tpar[1]= kRMAX1;
1252 tpar[2]= 4.0;
1253
1254 gMC->Gsvolu("CF1A", "TUBE", idAlu1, tpar, 3); //Al
1255 gMC->Gspos("CF1A", 1, "CM11", 0., 0., 0., 0, "MANY");
1256 gMC->Gspos("CF1A", 2, "CM12", 0., 0., 0., 0, "MANY");
1257
1258
1259// FIRST PLANE OF STATION 1
1260
1261// ratios of zpos1m/zpos1p and inverse for first plane
1262 Float_t zmp=(zpos1-3.6)/(zpos1+3.6);
1263 Float_t zpm=1./zmp;
1264
1265
1266// Definition of prototype for chambers in the first plane
1267
1268 tpar[0]= 0.;
1269 tpar[1]= 0.;
1270 tpar[2]= 0.;
1271
1272 gMC->Gsvolu("CC1A", "BOX ", idAlu1, tpar, 0); //Al
1273 gMC->Gsvolu("CB1A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1274 gMC->Gsvolu("CG1A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1275
1276// chamber type A
1277 tpar[0] = -1.;
1278 tpar[1] = -1.;
1279
1280 const Float_t kXMC1A=kXMC1MED+(kXMC1MAX-kXMC1MED)/2.;
1281 const Float_t kYMC1Am=0.;
1282 const Float_t kYMC1Ap=0.;
1283
1284 tpar[2] = 0.1;
1285 gMC->Gsposp("CG1A", 1, "CB1A", 0., 0., 0., 0, "ONLY",tpar,3);
1286 tpar[2] = 0.3;
1287 gMC->Gsposp("CB1A", 1, "CC1A", 0., 0., 0., 0, "ONLY",tpar,3);
1288
1289 tpar[2] = 0.4;
1290 tpar[0] = (kXMC1MAX-kXMC1MED)/2.;
1291 tpar[1] = kYMC1MIN;
1292
1293 gMC->Gsposp("CC1A", 1, "CM11",kXMC1A,kYMC1Am,kZMCm, 0, "ONLY", tpar, 3);
1294 gMC->Gsposp("CC1A", 2, "CM11",-kXMC1A,kYMC1Ap,kZMCp, 0, "ONLY", tpar, 3);
1295
1296// chamber type B
1297 Float_t tpar1save=tpar[1];
1298 Float_t y1msave=kYMC1Am;
1299 Float_t y1psave=kYMC1Ap;
1300
1301 tpar[0] = (kXMC1MAX-kXMC1MIN)/2.;
1302 tpar[1] = (kYMC1MAX-kYMC1MIN)/2.;
1303
1304 const Float_t kXMC1B=kXMC1MIN+tpar[0];
1305 const Float_t kYMC1Bp=(y1msave+tpar1save)*zpm+tpar[1];
1306 const Float_t kYMC1Bm=(y1psave+tpar1save)*zmp+tpar[1];
1307
1308 gMC->Gsposp("CC1A", 3, "CM11",kXMC1B,kYMC1Bp,kZMCp, 0, "ONLY", tpar, 3);
1309 gMC->Gsposp("CC1A", 4, "CM11",-kXMC1B,kYMC1Bm,kZMCm, 0, "ONLY", tpar, 3);
1310 gMC->Gsposp("CC1A", 5, "CM11",kXMC1B,-kYMC1Bp,kZMCp, 0, "ONLY", tpar, 3);
1311 gMC->Gsposp("CC1A", 6, "CM11",-kXMC1B,-kYMC1Bm,kZMCm, 0, "ONLY", tpar, 3);
1312
1313// chamber type C (end of type B !!)
1314 tpar1save=tpar[1];
1315 y1msave=kYMC1Bm;
1316 y1psave=kYMC1Bp;
1317
1318 tpar[0] = kXMC1MAX/2;
1319 tpar[1] = kYMC1MAX/2;
1320
1321 const Float_t kXMC1C=tpar[0];
1322// warning : same Z than type B
1323 const Float_t kYMC1Cp=(y1psave+tpar1save)*1.+tpar[1];
1324 const Float_t kYMC1Cm=(y1msave+tpar1save)*1.+tpar[1];
1325
1326 gMC->Gsposp("CC1A", 7, "CM11",kXMC1C,kYMC1Cp,kZMCp, 0, "ONLY", tpar, 3);
1327 gMC->Gsposp("CC1A", 8, "CM11",-kXMC1C,kYMC1Cm,kZMCm, 0, "ONLY", tpar, 3);
1328 gMC->Gsposp("CC1A", 9, "CM11",kXMC1C,-kYMC1Cp,kZMCp, 0, "ONLY", tpar, 3);
1329 gMC->Gsposp("CC1A", 10, "CM11",-kXMC1C,-kYMC1Cm,kZMCm, 0, "ONLY", tpar, 3);
1330
1331// chamber type D, E and F (same size)
1332 tpar1save=tpar[1];
1333 y1msave=kYMC1Cm;
1334 y1psave=kYMC1Cp;
1335
1336 tpar[0] = kXMC1MAX/2.;
1337 tpar[1] = kYMC1MIN;
1338
1339 const Float_t kXMC1D=tpar[0];
1340 const Float_t kYMC1Dp=(y1msave+tpar1save)*zpm+tpar[1];
1341 const Float_t kYMC1Dm=(y1psave+tpar1save)*zmp+tpar[1];
1342
1343 gMC->Gsposp("CC1A", 11, "CM11",kXMC1D,kYMC1Dm,kZMCm, 0, "ONLY", tpar, 3);
1344 gMC->Gsposp("CC1A", 12, "CM11",-kXMC1D,kYMC1Dp,kZMCp, 0, "ONLY", tpar, 3);
1345 gMC->Gsposp("CC1A", 13, "CM11",kXMC1D,-kYMC1Dm,kZMCm, 0, "ONLY", tpar, 3);
1346 gMC->Gsposp("CC1A", 14, "CM11",-kXMC1D,-kYMC1Dp,kZMCp, 0, "ONLY", tpar, 3);
1347
1348
1349 tpar1save=tpar[1];
1350 y1msave=kYMC1Dm;
1351 y1psave=kYMC1Dp;
1352 const Float_t kYMC1Ep=(y1msave+tpar1save)*zpm+tpar[1];
1353 const Float_t kYMC1Em=(y1psave+tpar1save)*zmp+tpar[1];
1354
1355 gMC->Gsposp("CC1A", 15, "CM11",kXMC1D,kYMC1Ep,kZMCp, 0, "ONLY", tpar, 3);
1356 gMC->Gsposp("CC1A", 16, "CM11",-kXMC1D,kYMC1Em,kZMCm, 0, "ONLY", tpar, 3);
1357 gMC->Gsposp("CC1A", 17, "CM11",kXMC1D,-kYMC1Ep,kZMCp, 0, "ONLY", tpar, 3);
1358 gMC->Gsposp("CC1A", 18, "CM11",-kXMC1D,-kYMC1Em,kZMCm, 0, "ONLY", tpar, 3);
1359
1360 tpar1save=tpar[1];
1361 y1msave=kYMC1Em;
1362 y1psave=kYMC1Ep;
1363 const Float_t kYMC1Fp=(y1msave+tpar1save)*zpm+tpar[1];
1364 const Float_t kYMC1Fm=(y1psave+tpar1save)*zmp+tpar[1];
1365
1366 gMC->Gsposp("CC1A", 19, "CM11",kXMC1D,kYMC1Fm,kZMCm, 0, "ONLY", tpar, 3);
1367 gMC->Gsposp("CC1A", 20, "CM11",-kXMC1D,kYMC1Fp,kZMCp, 0, "ONLY", tpar, 3);
1368 gMC->Gsposp("CC1A", 21, "CM11",kXMC1D,-kYMC1Fm,kZMCm, 0, "ONLY", tpar, 3);
1369 gMC->Gsposp("CC1A", 22, "CM11",-kXMC1D,-kYMC1Fp,kZMCp, 0, "ONLY", tpar, 3);
1370
1371// Positioning first plane in ALICE
1372 gMC->Gspos("CM11", 1, "ALIC", 0., 0., zpos1, 0, "ONLY");
1373
1374// End of geometry definition for the first plane of station 1
1375
1376
1377
1378// SECOND PLANE OF STATION 1 : proj ratio = zpos2/zpos1
1379
1380 const Float_t kZ12=zpos2/zpos1;
1381
1382// Definition of prototype for chambers in the second plane of station 1
1383
1384 tpar[0]= 0.;
1385 tpar[1]= 0.;
1386 tpar[2]= 0.;
1387
1388 gMC->Gsvolu("CC2A", "BOX ", idAlu1, tpar, 0); //Al
1389 gMC->Gsvolu("CB2A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1390 gMC->Gsvolu("CG2A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1391
1392// chamber type A
1393 tpar[0] = -1.;
1394 tpar[1] = -1.;
1395
1396 const Float_t kXMC2A=kXMC1A*kZ12;
1397 const Float_t kYMC2Am=0.;
1398 const Float_t kYMC2Ap=0.;
1399
1400 tpar[2] = 0.1;
1401 gMC->Gsposp("CG2A", 1, "CB2A", 0., 0., 0., 0, "ONLY",tpar,3);
1402 tpar[2] = 0.3;
1403 gMC->Gsposp("CB2A", 1, "CC2A", 0., 0., 0., 0, "ONLY",tpar,3);
1404
1405 tpar[2] = 0.4;
1406 tpar[0] = ((kXMC1MAX-kXMC1MED)/2.)*kZ12;
1407 tpar[1] = kYMC1MIN*kZ12;
1408
1409 gMC->Gsposp("CC2A", 1, "CM12",kXMC2A,kYMC2Am,kZMCm, 0, "ONLY", tpar, 3);
1410 gMC->Gsposp("CC2A", 2, "CM12",-kXMC2A,kYMC2Ap,kZMCp, 0, "ONLY", tpar, 3);
1411
1412
1413// chamber type B
1414
1415 tpar[0] = ((kXMC1MAX-kXMC1MIN)/2.)*kZ12;
1416 tpar[1] = ((kYMC1MAX-kYMC1MIN)/2.)*kZ12;
1417
1418 const Float_t kXMC2B=kXMC1B*kZ12;
1419 const Float_t kYMC2Bp=kYMC1Bp*kZ12;
1420 const Float_t kYMC2Bm=kYMC1Bm*kZ12;
1421 gMC->Gsposp("CC2A", 3, "CM12",kXMC2B,kYMC2Bp,kZMCp, 0, "ONLY", tpar, 3);
1422 gMC->Gsposp("CC2A", 4, "CM12",-kXMC2B,kYMC2Bm,kZMCm, 0, "ONLY", tpar, 3);
1423 gMC->Gsposp("CC2A", 5, "CM12",kXMC2B,-kYMC2Bp,kZMCp, 0, "ONLY", tpar, 3);
1424 gMC->Gsposp("CC2A", 6, "CM12",-kXMC2B,-kYMC2Bm,kZMCm, 0, "ONLY", tpar, 3);
1425
1426
1427// chamber type C (end of type B !!)
1428
1429 tpar[0] = (kXMC1MAX/2)*kZ12;
1430 tpar[1] = (kYMC1MAX/2)*kZ12;
1431
1432 const Float_t kXMC2C=kXMC1C*kZ12;
1433 const Float_t kYMC2Cp=kYMC1Cp*kZ12;
1434 const Float_t kYMC2Cm=kYMC1Cm*kZ12;
1435 gMC->Gsposp("CC2A", 7, "CM12",kXMC2C,kYMC2Cp,kZMCp, 0, "ONLY", tpar, 3);
1436 gMC->Gsposp("CC2A", 8, "CM12",-kXMC2C,kYMC2Cm,kZMCm, 0, "ONLY", tpar, 3);
1437 gMC->Gsposp("CC2A", 9, "CM12",kXMC2C,-kYMC2Cp,kZMCp, 0, "ONLY", tpar, 3);
1438 gMC->Gsposp("CC2A", 10, "CM12",-kXMC2C,-kYMC2Cm,kZMCm, 0, "ONLY", tpar, 3);
1439
1440// chamber type D, E and F (same size)
1441
1442 tpar[0] = (kXMC1MAX/2.)*kZ12;
1443 tpar[1] = kYMC1MIN*kZ12;
1444
1445 const Float_t kXMC2D=kXMC1D*kZ12;
1446 const Float_t kYMC2Dp=kYMC1Dp*kZ12;
1447 const Float_t kYMC2Dm=kYMC1Dm*kZ12;
1448 gMC->Gsposp("CC2A", 11, "CM12",kXMC2D,kYMC2Dm,kZMCm, 0, "ONLY", tpar, 3);
1449 gMC->Gsposp("CC2A", 12, "CM12",-kXMC2D,kYMC2Dp,kZMCp, 0, "ONLY", tpar, 3);
1450 gMC->Gsposp("CC2A", 13, "CM12",kXMC2D,-kYMC2Dm,kZMCm, 0, "ONLY", tpar, 3);
1451 gMC->Gsposp("CC2A", 14, "CM12",-kXMC2D,-kYMC2Dp,kZMCp, 0, "ONLY", tpar, 3);
1452
1453 const Float_t kYMC2Ep=kYMC1Ep*kZ12;
1454 const Float_t kYMC2Em=kYMC1Em*kZ12;
1455 gMC->Gsposp("CC2A", 15, "CM12",kXMC2D,kYMC2Ep,kZMCp, 0, "ONLY", tpar, 3);
1456 gMC->Gsposp("CC2A", 16, "CM12",-kXMC2D,kYMC2Em,kZMCm, 0, "ONLY", tpar, 3);
1457 gMC->Gsposp("CC2A", 17, "CM12",kXMC2D,-kYMC2Ep,kZMCp, 0, "ONLY", tpar, 3);
1458 gMC->Gsposp("CC2A", 18, "CM12",-kXMC2D,-kYMC2Em,kZMCm, 0, "ONLY", tpar, 3);
1459
1460
1461 const Float_t kYMC2Fp=kYMC1Fp*kZ12;
1462 const Float_t kYMC2Fm=kYMC1Fm*kZ12;
1463 gMC->Gsposp("CC2A", 19, "CM12",kXMC2D,kYMC2Fm,kZMCm, 0, "ONLY", tpar, 3);
1464 gMC->Gsposp("CC2A", 20, "CM12",-kXMC2D,kYMC2Fp,kZMCp, 0, "ONLY", tpar, 3);
1465 gMC->Gsposp("CC2A", 21, "CM12",kXMC2D,-kYMC2Fm,kZMCm, 0, "ONLY", tpar, 3);
1466 gMC->Gsposp("CC2A", 22, "CM12",-kXMC2D,-kYMC2Fp,kZMCp, 0, "ONLY", tpar, 3);
1467
1468// Positioning second plane of station 1 in ALICE
1469
1470 gMC->Gspos("CM12", 1, "ALIC", 0., 0., zpos2, 0, "ONLY");
1471
1472// End of geometry definition for the second plane of station 1
1473
1474
1475
1476// TRIGGER STATION 2 - TRIGGER STATION 2 - TRIGGER STATION 2
1477
1478 // 03/00
1479 // zpos3 and zpos4 are now the middle of the first and second
1480 // plane of station 2 :
1481 // zpos3=(17075+16995)/2=17035 mm, thick/2=40 mm
1482 // zpos4=(17225+17145)/2=17185 mm, thick/2=40 mm
1483 //
1484 // zpos3m=16999 mm , zpos3p=17071 mm (middles of gas gaps)
1485 // zpos4m=17149 mm , zpos4p=17221 mm (middles of gas gaps)
1486 // rem : the total thickness accounts for 1 mm of al on both
1487 // side of the RPCs (see zpos3 and zpos4), as previously
1488 iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[12];
1489 iChamber2 =(AliMUONChamber*) (*fChambers)[13];
1490 Float_t zpos3=iChamber1->Z();
1491 Float_t zpos4=iChamber2->Z();
1492
1493
1494// Mother volume definition
1495 tpar[0] = iChamber->RInner();
1496 tpar[1] = iChamber->ROuter();
1497 tpar[2] = 4.0;
1498
1499 gMC->Gsvolu("CM21", "TUBE", idAir, tpar, 3);
1500 gMC->Gsvolu("CM22", "TUBE", idAir, tpar, 3);
1501
1502// Definition of the flange between the beam shielding and the RPC
1503// ???? interface shielding
1504
1505 tpar[0]= kRMIN2;
1506 tpar[1]= kRMAX2;
1507 tpar[2]= 4.0;
1508
1509 gMC->Gsvolu("CF2A", "TUBE", idAlu1, tpar, 3); //Al
1510 gMC->Gspos("CF2A", 1, "CM21", 0., 0., 0., 0, "MANY");
1511 gMC->Gspos("CF2A", 2, "CM22", 0., 0., 0., 0, "MANY");
1512
1513
1514
1515// FIRST PLANE OF STATION 2 : proj ratio = zpos3/zpos1
1516
1517 const Float_t kZ13=zpos3/zpos1;
1518
1519// Definition of prototype for chambers in the first plane of station 2
1520 tpar[0]= 0.;
1521 tpar[1]= 0.;
1522 tpar[2]= 0.;
1523
1524 gMC->Gsvolu("CC3A", "BOX ", idAlu1, tpar, 0); //Al
1525 gMC->Gsvolu("CB3A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1526 gMC->Gsvolu("CG3A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1527
1528
1529// chamber type A
1530 tpar[0] = -1.;
1531 tpar[1] = -1.;
1532
1533 const Float_t kXMC3A=kXMC1A*kZ13;
1534 const Float_t kYMC3Am=0.;
1535 const Float_t kYMC3Ap=0.;
1536
1537 tpar[2] = 0.1;
1538 gMC->Gsposp("CG3A", 1, "CB3A", 0., 0., 0., 0, "ONLY",tpar,3);
1539 tpar[2] = 0.3;
1540 gMC->Gsposp("CB3A", 1, "CC3A", 0., 0., 0., 0, "ONLY",tpar,3);
1541
1542 tpar[2] = 0.4;
1543 tpar[0] = ((kXMC1MAX-kXMC1MED)/2.)*kZ13;
1544 tpar[1] = kYMC1MIN*kZ13;
1545 gMC->Gsposp("CC3A", 1, "CM21",kXMC3A,kYMC3Am,kZMCm, 0, "ONLY", tpar, 3);
1546 gMC->Gsposp("CC3A", 2, "CM21",-kXMC3A,kYMC3Ap,kZMCp, 0, "ONLY", tpar, 3);
1547
1548
1549// chamber type B
1550 tpar[0] = ((kXMC1MAX-kXMC1MIN)/2.)*kZ13;
1551 tpar[1] = ((kYMC1MAX-kYMC1MIN)/2.)*kZ13;
1552
1553 const Float_t kXMC3B=kXMC1B*kZ13;
1554 const Float_t kYMC3Bp=kYMC1Bp*kZ13;
1555 const Float_t kYMC3Bm=kYMC1Bm*kZ13;
1556 gMC->Gsposp("CC3A", 3, "CM21",kXMC3B,kYMC3Bp,kZMCp, 0, "ONLY", tpar, 3);
1557 gMC->Gsposp("CC3A", 4, "CM21",-kXMC3B,kYMC3Bm,kZMCm, 0, "ONLY", tpar, 3);
1558 gMC->Gsposp("CC3A", 5, "CM21",kXMC3B,-kYMC3Bp,kZMCp, 0, "ONLY", tpar, 3);
1559 gMC->Gsposp("CC3A", 6, "CM21",-kXMC3B,-kYMC3Bm,kZMCm, 0, "ONLY", tpar, 3);
1560
1561
1562// chamber type C (end of type B !!)
1563 tpar[0] = (kXMC1MAX/2)*kZ13;
1564 tpar[1] = (kYMC1MAX/2)*kZ13;
1565
1566 const Float_t kXMC3C=kXMC1C*kZ13;
1567 const Float_t kYMC3Cp=kYMC1Cp*kZ13;
1568 const Float_t kYMC3Cm=kYMC1Cm*kZ13;
1569 gMC->Gsposp("CC3A", 7, "CM21",kXMC3C,kYMC3Cp,kZMCp, 0, "ONLY", tpar, 3);
1570 gMC->Gsposp("CC3A", 8, "CM21",-kXMC3C,kYMC3Cm,kZMCm, 0, "ONLY", tpar, 3);
1571 gMC->Gsposp("CC3A", 9, "CM21",kXMC3C,-kYMC3Cp,kZMCp, 0, "ONLY", tpar, 3);
1572 gMC->Gsposp("CC3A", 10, "CM21",-kXMC3C,-kYMC3Cm,kZMCm, 0, "ONLY", tpar, 3);
1573
1574
1575// chamber type D, E and F (same size)
1576
1577 tpar[0] = (kXMC1MAX/2.)*kZ13;
1578 tpar[1] = kYMC1MIN*kZ13;
1579
1580 const Float_t kXMC3D=kXMC1D*kZ13;
1581 const Float_t kYMC3Dp=kYMC1Dp*kZ13;
1582 const Float_t kYMC3Dm=kYMC1Dm*kZ13;
1583 gMC->Gsposp("CC3A", 11, "CM21",kXMC3D,kYMC3Dm,kZMCm, 0, "ONLY", tpar, 3);
1584 gMC->Gsposp("CC3A", 12, "CM21",-kXMC3D,kYMC3Dp,kZMCp, 0, "ONLY", tpar, 3);
1585 gMC->Gsposp("CC3A", 13, "CM21",kXMC3D,-kYMC3Dm,kZMCm, 0, "ONLY", tpar, 3);
1586 gMC->Gsposp("CC3A", 14, "CM21",-kXMC3D,-kYMC3Dp,kZMCp, 0, "ONLY", tpar, 3);
1587
1588 const Float_t kYMC3Ep=kYMC1Ep*kZ13;
1589 const Float_t kYMC3Em=kYMC1Em*kZ13;
1590 gMC->Gsposp("CC3A", 15, "CM21",kXMC3D,kYMC3Ep,kZMCp, 0, "ONLY", tpar, 3);
1591 gMC->Gsposp("CC3A", 16, "CM21",-kXMC3D,kYMC3Em,kZMCm, 0, "ONLY", tpar, 3);
1592 gMC->Gsposp("CC3A", 17, "CM21",kXMC3D,-kYMC3Ep,kZMCp, 0, "ONLY", tpar, 3);
1593 gMC->Gsposp("CC3A", 18, "CM21",-kXMC3D,-kYMC3Em,kZMCm, 0, "ONLY", tpar, 3);
1594
1595 const Float_t kYMC3Fp=kYMC1Fp*kZ13;
1596 const Float_t kYMC3Fm=kYMC1Fm*kZ13;
1597 gMC->Gsposp("CC3A", 19, "CM21",kXMC3D,kYMC3Fm,kZMCm, 0, "ONLY", tpar, 3);
1598 gMC->Gsposp("CC3A", 20, "CM21",-kXMC3D,kYMC3Fp,kZMCp, 0, "ONLY", tpar, 3);
1599 gMC->Gsposp("CC3A", 21, "CM21",kXMC3D,-kYMC3Fm,kZMCm, 0, "ONLY", tpar, 3);
1600 gMC->Gsposp("CC3A", 22, "CM21",-kXMC3D,-kYMC3Fp,kZMCp, 0, "ONLY", tpar, 3);
1601
1602
1603// Positioning first plane of station 2 in ALICE
1604
1605 gMC->Gspos("CM21", 1, "ALIC", 0., 0., zpos3, 0, "ONLY");
1606
1607// End of geometry definition for the first plane of station 2
1608
1609
1610
1611
1612// SECOND PLANE OF STATION 2 : proj ratio = zpos4/zpos1
1613
1614 const Float_t kZ14=zpos4/zpos1;
1615
1616// Definition of prototype for chambers in the second plane of station 2
1617
1618 tpar[0]= 0.;
1619 tpar[1]= 0.;
1620 tpar[2]= 0.;
1621
1622 gMC->Gsvolu("CC4A", "BOX ", idAlu1, tpar, 0); //Al
1623 gMC->Gsvolu("CB4A", "BOX ", idtmed[1107], tpar, 0); //Bakelite
1624 gMC->Gsvolu("CG4A", "BOX ", idtmed[1106], tpar, 0); //Gas streamer
1625
1626// chamber type A
1627 tpar[0] = -1.;
1628 tpar[1] = -1.;
1629
1630 const Float_t kXMC4A=kXMC1A*kZ14;
1631 const Float_t kYMC4Am=0.;
1632 const Float_t kYMC4Ap=0.;
1633
1634 tpar[2] = 0.1;
1635 gMC->Gsposp("CG4A", 1, "CB4A", 0., 0., 0., 0, "ONLY",tpar,3);
1636 tpar[2] = 0.3;
1637 gMC->Gsposp("CB4A", 1, "CC4A", 0., 0., 0., 0, "ONLY",tpar,3);
1638
1639 tpar[2] = 0.4;
1640 tpar[0] = ((kXMC1MAX-kXMC1MED)/2.)*kZ14;
1641 tpar[1] = kYMC1MIN*kZ14;
1642 gMC->Gsposp("CC4A", 1, "CM22",kXMC4A,kYMC4Am,kZMCm, 0, "ONLY", tpar, 3);
1643 gMC->Gsposp("CC4A", 2, "CM22",-kXMC4A,kYMC4Ap,kZMCp, 0, "ONLY", tpar, 3);
1644
1645
1646// chamber type B
1647 tpar[0] = ((kXMC1MAX-kXMC1MIN)/2.)*kZ14;
1648 tpar[1] = ((kYMC1MAX-kYMC1MIN)/2.)*kZ14;
1649
1650 const Float_t kXMC4B=kXMC1B*kZ14;
1651 const Float_t kYMC4Bp=kYMC1Bp*kZ14;
1652 const Float_t kYMC4Bm=kYMC1Bm*kZ14;
1653 gMC->Gsposp("CC4A", 3, "CM22",kXMC4B,kYMC4Bp,kZMCp, 0, "ONLY", tpar, 3);
1654 gMC->Gsposp("CC4A", 4, "CM22",-kXMC4B,kYMC4Bm,kZMCm, 0, "ONLY", tpar, 3);
1655 gMC->Gsposp("CC4A", 5, "CM22",kXMC4B,-kYMC4Bp,kZMCp, 0, "ONLY", tpar, 3);
1656 gMC->Gsposp("CC4A", 6, "CM22",-kXMC4B,-kYMC4Bm,kZMCm, 0, "ONLY", tpar, 3);
1657
1658
1659// chamber type C (end of type B !!)
1660 tpar[0] =(kXMC1MAX/2)*kZ14;
1661 tpar[1] = (kYMC1MAX/2)*kZ14;
1662
1663 const Float_t kXMC4C=kXMC1C*kZ14;
1664 const Float_t kYMC4Cp=kYMC1Cp*kZ14;
1665 const Float_t kYMC4Cm=kYMC1Cm*kZ14;
1666 gMC->Gsposp("CC4A", 7, "CM22",kXMC4C,kYMC4Cp,kZMCp, 0, "ONLY", tpar, 3);
1667 gMC->Gsposp("CC4A", 8, "CM22",-kXMC4C,kYMC4Cm,kZMCm, 0, "ONLY", tpar, 3);
1668 gMC->Gsposp("CC4A", 9, "CM22",kXMC4C,-kYMC4Cp,kZMCp, 0, "ONLY", tpar, 3);
1669 gMC->Gsposp("CC4A", 10, "CM22",-kXMC4C,-kYMC4Cm,kZMCm, 0, "ONLY", tpar, 3);
1670
1671
1672// chamber type D, E and F (same size)
1673 tpar[0] = (kXMC1MAX/2.)*kZ14;
1674 tpar[1] = kYMC1MIN*kZ14;
1675
1676 const Float_t kXMC4D=kXMC1D*kZ14;
1677 const Float_t kYMC4Dp=kYMC1Dp*kZ14;
1678 const Float_t kYMC4Dm=kYMC1Dm*kZ14;
1679 gMC->Gsposp("CC4A", 11, "CM22",kXMC4D,kYMC4Dm,kZMCm, 0, "ONLY", tpar, 3);
1680 gMC->Gsposp("CC4A", 12, "CM22",-kXMC4D,kYMC4Dp,kZMCp, 0, "ONLY", tpar, 3);
1681 gMC->Gsposp("CC4A", 13, "CM22",kXMC4D,-kYMC4Dm,kZMCm, 0, "ONLY", tpar, 3);
1682 gMC->Gsposp("CC4A", 14, "CM22",-kXMC4D,-kYMC4Dp,kZMCp, 0, "ONLY", tpar, 3);
1683
1684 const Float_t kYMC4Ep=kYMC1Ep*kZ14;
1685 const Float_t kYMC4Em=kYMC1Em*kZ14;
1686 gMC->Gsposp("CC4A", 15, "CM22",kXMC4D,kYMC4Ep,kZMCp, 0, "ONLY", tpar, 3);
1687 gMC->Gsposp("CC4A", 16, "CM22",-kXMC4D,kYMC4Em,kZMCm, 0, "ONLY", tpar, 3);
1688 gMC->Gsposp("CC4A", 17, "CM22",kXMC4D,-kYMC4Ep,kZMCp, 0, "ONLY", tpar, 3);
1689 gMC->Gsposp("CC4A", 18, "CM22",-kXMC4D,-kYMC4Em,kZMCm, 0, "ONLY", tpar, 3);
1690
1691 const Float_t kYMC4Fp=kYMC1Fp*kZ14;
1692 const Float_t kYMC4Fm=kYMC1Fm*kZ14;
1693 gMC->Gsposp("CC4A", 19, "CM22",kXMC4D,kYMC4Fm,kZMCm, 0, "ONLY", tpar, 3);
1694 gMC->Gsposp("CC4A", 20, "CM22",-kXMC4D,kYMC4Fp,kZMCp, 0, "ONLY", tpar, 3);
1695 gMC->Gsposp("CC4A", 21, "CM22",kXMC4D,-kYMC4Fm,kZMCm, 0, "ONLY", tpar, 3);
1696 gMC->Gsposp("CC4A", 22, "CM22",-kXMC4D,-kYMC4Fp,kZMCp, 0, "ONLY", tpar, 3);
1697
1698
1699// Positioning second plane of station 2 in ALICE
1700
1701 gMC->Gspos("CM22", 1, "ALIC", 0., 0., zpos4, 0, "ONLY");
1702
1703// End of geometry definition for the second plane of station 2
1704
1705// End of trigger geometry definition
1706
1707}
1708
1709
1710
1711//___________________________________________
1712void AliMUONv1::CreateMaterials()
1713{
1714 // *** DEFINITION OF AVAILABLE MUON MATERIALS ***
1715 //
1716 // Ar-CO2 gas
1717 Float_t ag1[3] = { 39.95,12.01,16. };
1718 Float_t zg1[3] = { 18.,6.,8. };
1719 Float_t wg1[3] = { .8,.0667,.13333 };
1720 Float_t dg1 = .001821;
1721 //
1722 // Ar-buthane-freon gas -- trigger chambers
1723 Float_t atr1[4] = { 39.95,12.01,1.01,19. };
1724 Float_t ztr1[4] = { 18.,6.,1.,9. };
1725 Float_t wtr1[4] = { .56,.1262857,.2857143,.028 };
1726 Float_t dtr1 = .002599;
1727 //
1728 // Ar-CO2 gas
1729 Float_t agas[3] = { 39.95,12.01,16. };
1730 Float_t zgas[3] = { 18.,6.,8. };
1731 Float_t wgas[3] = { .74,.086684,.173316 };
1732 Float_t dgas = .0018327;
1733 //
1734 // Ar-Isobutane gas (80%+20%) -- tracking
1735 Float_t ag[3] = { 39.95,12.01,1.01 };
1736 Float_t zg[3] = { 18.,6.,1. };
1737 Float_t wg[3] = { .8,.057,.143 };
1738 Float_t dg = .0019596;
1739 //
1740 // Ar-Isobutane-Forane-SF6 gas (49%+7%+40%+4%) -- trigger
1741 Float_t atrig[5] = { 39.95,12.01,1.01,19.,32.066 };
1742 Float_t ztrig[5] = { 18.,6.,1.,9.,16. };
1743 Float_t wtrig[5] = { .49,1.08,1.5,1.84,0.04 };
1744 Float_t dtrig = .0031463;
1745 //
1746 // bakelite
1747
1748 Float_t abak[3] = {12.01 , 1.01 , 16.};
1749 Float_t zbak[3] = {6. , 1. , 8.};
1750 Float_t wbak[3] = {6. , 6. , 1.};
1751 Float_t dbak = 1.4;
1752
1753 Float_t epsil, stmin, deemax, tmaxfd, stemax;
1754
1755 Int_t iSXFLD = gAlice->Field()->Integ();
1756 Float_t sXMGMX = gAlice->Field()->Max();
1757 //
1758 // --- Define the various materials for GEANT ---
1759 AliMaterial(9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
1760 AliMaterial(10, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
1761 AliMaterial(15, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500);
1762 AliMixture(19, "Bakelite$", abak, zbak, dbak, -3, wbak);
1763 AliMixture(20, "ArC4H10 GAS$", ag, zg, dg, 3, wg);
1764 AliMixture(21, "TRIG GAS$", atrig, ztrig, dtrig, -5, wtrig);
1765 AliMixture(22, "ArCO2 80%$", ag1, zg1, dg1, 3, wg1);
1766 AliMixture(23, "Ar-freon $", atr1, ztr1, dtr1, 4, wtr1);
1767 AliMixture(24, "ArCO2 GAS$", agas, zgas, dgas, 3, wgas);
1e8fff9c 1768 // materials for slat:
1769 // Sensitive area: gas (already defined)
1770 // PCB: copper
1771 // insulating material and frame: vetronite
1772 // walls: carbon, rohacell, carbon
1773 Float_t aglass[5]={12.01, 28.09, 16., 10.8, 23.};
1774 Float_t zglass[5]={ 6., 14., 8., 5., 11.};
1775 Float_t wglass[5]={ 0.5, 0.105, 0.355, 0.03, 0.01};
1776 Float_t dglass=1.74;
1777
1778 // rohacell: C9 H13 N1 O2
1779 Float_t arohac[4] = {12.01, 1.01, 14.010, 16.};
1780 Float_t zrohac[4] = { 6., 1., 7., 8.};
1781 Float_t wrohac[4] = { 9., 13., 1., 2.};
1782 Float_t drohac = 0.03;
1783
1784 AliMaterial(31, "COPPER$", 63.54, 29., 8.96, 1.4, 0.);
1785 AliMixture(32, "Vetronite$",aglass, zglass, dglass, 5, wglass);
1786 AliMaterial(33, "Carbon$", 12.01, 6., 2.265, 18.8, 49.9);
1787 AliMixture(34, "Rohacell$", arohac, zrohac, drohac, -4, wrohac);
1788
a9e2aefa 1789
1790 epsil = .001; // Tracking precision,
1791 stemax = -1.; // Maximum displacement for multiple scat
1792 tmaxfd = -20.; // Maximum angle due to field deflection
1793 deemax = -.3; // Maximum fractional energy loss, DLS
1794 stmin = -.8;
1795 //
1796 // Air
1797 AliMedium(1, "AIR_CH_US ", 15, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
1798 //
1799 // Aluminum
1800
1801 AliMedium(4, "ALU_CH_US ", 9, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1802 fMaxDestepAlu, epsil, stmin);
1803 AliMedium(5, "ALU_CH_US ", 10, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1804 fMaxDestepAlu, epsil, stmin);
1805 //
1806 // Ar-isoC4H10 gas
1807
1808 AliMedium(6, "AR_CH_US ", 20, 1, iSXFLD, sXMGMX, tmaxfd, fMaxStepGas,
1809 fMaxDestepGas, epsil, stmin);
1810//
1811 // Ar-Isobuthane-Forane-SF6 gas
1812
1813 AliMedium(7, "GAS_CH_TRIGGER ", 21, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
1814
1815 AliMedium(8, "BAKE_CH_TRIGGER ", 19, 0, iSXFLD, sXMGMX, tmaxfd, fMaxStepAlu,
1816 fMaxDestepAlu, epsil, stmin);
1817
1818 AliMedium(9, "ARG_CO2 ", 22, 1, iSXFLD, sXMGMX, tmaxfd, fMaxStepGas,
1819 fMaxDestepAlu, epsil, stmin);
1e8fff9c 1820 // tracking media for slats: check the parameters!!
1821 AliMedium(11, "PCB_COPPER ", 31, 0, iSXFLD, sXMGMX, tmaxfd,
1822 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1823 AliMedium(12, "VETRONITE ", 32, 0, iSXFLD, sXMGMX, tmaxfd,
1824 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1825 AliMedium(13, "CARBON ", 33, 0, iSXFLD, sXMGMX, tmaxfd,
1826 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
1827 AliMedium(14, "Rohacell ", 34, 0, iSXFLD, sXMGMX, tmaxfd,
1828 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
a9e2aefa 1829}
1830
1831//___________________________________________
1832
1833void AliMUONv1::Init()
1834{
1835 //
1836 // Initialize Tracking Chambers
1837 //
1838
1839 printf("\n\n\n Start Init for version 1 - CPC chamber type\n\n\n");
e17592e9 1840 Int_t i;
f665c1ea 1841 for (i=0; i<AliMUONConstants::NCh(); i++) {
a9e2aefa 1842 ( (AliMUONChamber*) (*fChambers)[i])->Init();
1843 }
1844
1845 //
1846 // Set the chamber (sensitive region) GEANT identifier
1847 AliMC* gMC = AliMC::GetMC();
1848 ((AliMUONChamber*)(*fChambers)[0])->SetGid(gMC->VolId("C01G"));
1849 ((AliMUONChamber*)(*fChambers)[1])->SetGid(gMC->VolId("C02G"));
b17c0c87 1850
a9e2aefa 1851 ((AliMUONChamber*)(*fChambers)[2])->SetGid(gMC->VolId("C03G"));
1852 ((AliMUONChamber*)(*fChambers)[3])->SetGid(gMC->VolId("C04G"));
b17c0c87 1853
1e8fff9c 1854 ((AliMUONChamber*)(*fChambers)[4])->SetGid(gMC->VolId("S05G"));
1855 ((AliMUONChamber*)(*fChambers)[5])->SetGid(gMC->VolId("S06G"));
b17c0c87 1856
1e8fff9c 1857 ((AliMUONChamber*)(*fChambers)[6])->SetGid(gMC->VolId("S07G"));
1858 ((AliMUONChamber*)(*fChambers)[7])->SetGid(gMC->VolId("S08G"));
b17c0c87 1859
1e8fff9c 1860 ((AliMUONChamber*)(*fChambers)[8])->SetGid(gMC->VolId("S09G"));
1861 ((AliMUONChamber*)(*fChambers)[9])->SetGid(gMC->VolId("S10G"));
b17c0c87 1862
a9e2aefa 1863 ((AliMUONChamber*)(*fChambers)[10])->SetGid(gMC->VolId("CG1A"));
1864 ((AliMUONChamber*)(*fChambers)[11])->SetGid(gMC->VolId("CG2A"));
1865 ((AliMUONChamber*)(*fChambers)[12])->SetGid(gMC->VolId("CG3A"));
1866 ((AliMUONChamber*)(*fChambers)[13])->SetGid(gMC->VolId("CG4A"));
1867
1868 printf("\n\n\n Finished Init for version 0 - CPC chamber type\n\n\n");
1869
1870 //cp
1871 printf("\n\n\n Start Init for Trigger Circuits\n\n\n");
f665c1ea 1872 for (i=0; i<AliMUONConstants::NTriggerCircuit(); i++) {
a9e2aefa 1873 ( (AliMUONTriggerCircuit*) (*fTriggerCircuits)[i])->Init(i);
1874 }
1875 printf(" Finished Init for Trigger Circuits\n\n\n");
1876 //cp
1877
1878}
1879
1880//___________________________________________
1881void AliMUONv1::StepManager()
1882{
1883 Int_t copy, id;
1884 static Int_t idvol;
1885 static Int_t vol[2];
1886 Int_t ipart;
1887 TLorentzVector pos;
1888 TLorentzVector mom;
1889 Float_t theta,phi;
1890 Float_t destep, step;
1891
1e8fff9c 1892 static Float_t eloss, eloss2, xhit, yhit, zhit, tof, tlength;
a9e2aefa 1893 const Float_t kBig=1.e10;
a9e2aefa 1894 // modifs perso
1895 static Float_t hits[15];
1896
1897 TClonesArray &lhits = *fHits;
1898
1899 //
1900 // Set maximum step size for gas
1901 // numed=gMC->GetMedium();
1902 //
1903 // Only charged tracks
1904 if( !(gMC->TrackCharge()) ) return;
1905 //
1906 // Only gas gap inside chamber
1907 // Tag chambers and record hits when track enters
1908 idvol=-1;
1909 id=gMC->CurrentVolID(copy);
1910
f665c1ea 1911 for (Int_t i=1; i<=AliMUONConstants::NCh(); i++) {
a9e2aefa 1912 if(id==((AliMUONChamber*)(*fChambers)[i-1])->GetGid()){
1913 vol[0]=i;
1914 idvol=i-1;
1915 }
1916 }
1917 if (idvol == -1) return;
1918 //
1919 // Get current particle id (ipart), track position (pos) and momentum (mom)
1920 gMC->TrackPosition(pos);
1921 gMC->TrackMomentum(mom);
1922
1923 ipart = gMC->TrackPid();
1924 //Int_t ipart1 = gMC->IdFromPDG(ipart);
1925 //printf("ich, ipart %d %d \n",vol[0],ipart1);
1926
1927 //
1928 // momentum loss and steplength in last step
1929 destep = gMC->Edep();
1930 step = gMC->TrackStep();
1931
1932 //
1933 // record hits when track enters ...
1934 if( gMC->IsTrackEntering()) {
1935 gMC->SetMaxStep(fMaxStepGas);
1936 Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
1937 Double_t rt = TMath::Sqrt(tc);
1938 Double_t pmom = TMath::Sqrt(tc+mom[2]*mom[2]);
1939 Double_t tx=mom[0]/pmom;
1940 Double_t ty=mom[1]/pmom;
1941 Double_t tz=mom[2]/pmom;
1942 Double_t s=((AliMUONChamber*)(*fChambers)[idvol])
1943 ->ResponseModel()
1944 ->Pitch()/tz;
1945 theta = Float_t(TMath::ATan2(rt,Double_t(mom[2])))*kRaddeg;
1946 phi = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg;
1947 hits[0] = Float_t(ipart); // Geant3 particle type
1948 hits[1] = pos[0]+s*tx; // X-position for hit
1949 hits[2] = pos[1]+s*ty; // Y-position for hit
1950 hits[3] = pos[2]+s*tz; // Z-position for hit
1951 hits[4] = theta; // theta angle of incidence
1952 hits[5] = phi; // phi angle of incidence
1953 hits[8] = (Float_t) fNPadHits; // first padhit
1954 hits[9] = -1; // last pad hit
1955
1956 // modifs perso
1957 hits[10] = mom[3]; // hit momentum P
1958 hits[11] = mom[0]; // Px/P
1959 hits[12] = mom[1]; // Py/P
1960 hits[13] = mom[2]; // Pz/P
1961 // fin modifs perso
1962 tof=gMC->TrackTime();
1963 hits[14] = tof; // Time of flight
1964 // phi angle of incidence
1965 tlength = 0;
1966 eloss = 0;
1967 eloss2 = 0;
1968 xhit = pos[0];
1969 yhit = pos[1];
1e8fff9c 1970 zhit = pos[2];
a9e2aefa 1971 // Only if not trigger chamber
1e8fff9c 1972
1973
1974
1975
a75f073c 1976 if(idvol<AliMUONConstants::NTrackingCh()) {
a9e2aefa 1977 //
1978 // Initialize hit position (cursor) in the segmentation model
1979 ((AliMUONChamber*) (*fChambers)[idvol])
1980 ->SigGenInit(pos[0], pos[1], pos[2]);
1981 } else {
1982 //geant3->Gpcxyz();
1983 //printf("In the Trigger Chamber #%d\n",idvol-9);
1984 }
1985 }
1986 eloss2+=destep;
1987
1988 //
1989 // Calculate the charge induced on a pad (disintegration) in case
1990 //
1991 // Mip left chamber ...
1992 if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
1993 gMC->SetMaxStep(kBig);
1994 eloss += destep;
1995 tlength += step;
1996
802a864d 1997 Float_t x0,y0,z0;
1998 Float_t localPos[3];
1999 Float_t globalPos[3] = {pos[0], pos[1], pos[2]};
802a864d 2000 gMC->Gmtod(globalPos,localPos,1);
2001
a75f073c 2002 if(idvol<AliMUONConstants::NTrackingCh()) {
a9e2aefa 2003// tracking chambers
2004 x0 = 0.5*(xhit+pos[0]);
2005 y0 = 0.5*(yhit+pos[1]);
1e8fff9c 2006 z0 = 0.5*(zhit+pos[2]);
2007 // z0 = localPos[2];
a9e2aefa 2008 } else {
2009// trigger chambers
2010 x0=xhit;
2011 y0=yhit;
1e8fff9c 2012// z0=yhit;
802a864d 2013 z0=0.;
a9e2aefa 2014 }
2015
1e8fff9c 2016
802a864d 2017 if (eloss >0) MakePadHits(x0,y0,z0,eloss,tof,idvol);
a9e2aefa 2018
2019
2020 hits[6]=tlength;
2021 hits[7]=eloss2;
2022 if (fNPadHits > (Int_t)hits[8]) {
2023 hits[8]= hits[8]+1;
2024 hits[9]= (Float_t) fNPadHits;
2025 }
2026
2027 new(lhits[fNhits++])
2028 AliMUONHit(fIshunt,gAlice->CurrentTrack(),vol,hits);
2029 eloss = 0;
2030 //
2031 // Check additional signal generation conditions
2032 // defined by the segmentation
a75f073c 2033 // model (boundary crossing conditions)
2034 // only for tracking chambers
a9e2aefa 2035 } else if
a75f073c 2036 ((idvol < AliMUONConstants::NTrackingCh()) &&
2037 ((AliMUONChamber*) (*fChambers)[idvol])->SigGenCond(pos[0], pos[1], pos[2]))
a9e2aefa 2038 {
2039 ((AliMUONChamber*) (*fChambers)[idvol])
2040 ->SigGenInit(pos[0], pos[1], pos[2]);
802a864d 2041
2042 Float_t localPos[3];
2043 Float_t globalPos[3] = {pos[0], pos[1], pos[2]};
2044 gMC->Gmtod(globalPos,localPos,1);
2045
2046
a75f073c 2047 if (eloss > 0 && idvol < AliMUONConstants::NTrackingCh())
1e8fff9c 2048 MakePadHits(0.5*(xhit+pos[0]),0.5*(yhit+pos[1]),pos[2],eloss,tof,idvol);
a9e2aefa 2049 xhit = pos[0];
2050 yhit = pos[1];
1e8fff9c 2051 zhit = pos[2];
a9e2aefa 2052 eloss = destep;
2053 tlength += step ;
2054 //
2055 // nothing special happened, add up energy loss
2056 } else {
2057 eloss += destep;
2058 tlength += step ;
2059 }
2060}
2061
2062