]>
Commit | Line | Data |
---|---|---|
4c039060 | 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$ | |
d183a600 | 18 | Revision 1.13 1999/10/04 13:39:54 fca |
19 | Correct array index problem | |
20 | ||
cdde5b1e | 21 | Revision 1.12 1999/09/29 09:24:34 fca |
22 | Introduction of the Copyright and cvs Log | |
23 | ||
4c039060 | 24 | */ |
25 | ||
fe4da5cc | 26 | /////////////////////////////////////////////////////////////////////////////// |
27 | // // | |
28 | // Time Projection Chamber version 1 -- detailed TPC and fast simulation // | |
29 | // // | |
30 | //Begin_Html | |
31 | /* | |
1439f98e | 32 | <img src="picts/AliTPCv1Class.gif"> |
fe4da5cc | 33 | */ |
34 | //End_Html | |
35 | // // | |
36 | // // | |
37 | /////////////////////////////////////////////////////////////////////////////// | |
38 | ||
39 | #include <TMath.h> | |
40 | #include <TGeometry.h> | |
41 | #include <TNode.h> | |
42 | #include <TBRIK.h> | |
43 | #include <TTUBE.h> | |
44 | #include "AliTPCv1.h" | |
45 | #include "AliRun.h" | |
46 | #include <iostream.h> | |
47 | #include <fstream.h> | |
48 | ||
49 | #include "AliMC.h" | |
50 | #include "AliConst.h" | |
51 | ||
8c555625 | 52 | #include "AliTPCParam.h" |
53 | #include "AliTPCD.h" | |
54 | ||
fe4da5cc | 55 | ClassImp(AliTPCv1) |
56 | ||
57 | //_____________________________________________________________________________ | |
58 | AliTPCv1::AliTPCv1(const char *name, const char *title) | |
59 | :AliTPC(name, title) { | |
60 | // | |
61 | // Standard constructor for Time Projection Chamber | |
62 | // | |
63 | fIdSens1=fIdSens2=0; | |
64 | } | |
65 | ||
66 | //_____________________________________________________________________________ | |
67 | void AliTPCv1::CreateGeometry() | |
68 | { | |
69 | // | |
70 | // Creates geometry for Time Projection Chamber version 1 | |
71 | // Detailed geometry -- Fast simulation | |
72 | // Origin M.Kowalski | |
73 | // | |
74 | //Begin_Html | |
75 | /* | |
1439f98e | 76 | <img src="picts/AliTPCv1.gif"> |
fe4da5cc | 77 | */ |
78 | //End_Html | |
79 | //Begin_Html | |
80 | /* | |
1439f98e | 81 | <img src="picts/AliTPCv1Tree.gif"> |
fe4da5cc | 82 | */ |
83 | //End_Html | |
84 | ||
1283eee5 | 85 | AliTPCParam * fTPCParam = &(fDigParam->GetParam()); |
8c555625 | 86 | |
1283eee5 | 87 | Int_t *idtmed = fIdtmed->GetArray(); |
8c555625 | 88 | |
1283eee5 | 89 | Float_t dm[21]; |
62a73ee5 | 90 | Int_t idrotm[120]; |
1283eee5 | 91 | |
92 | Int_t nRotMat = 0; | |
93 | ||
94 | ||
fe4da5cc | 95 | // ---------------------------------------------------- |
1283eee5 | 96 | // FIELD CAGE WITH ENDCAPS - G10 |
fe4da5cc | 97 | // THIS IS ALSO A TPC MOTHER VOLUME |
98 | // ---------------------------------------------------- | |
1283eee5 | 99 | |
fe4da5cc | 100 | dm[0] = 76.; |
101 | dm[1] = 278.; | |
102 | dm[2] = 275.; | |
1283eee5 | 103 | |
104 | gMC->Gsvolu("TPC ", "TUBE", idtmed[8], dm, 3); | |
105 | ||
106 | //----------------------------------------------------- | |
107 | // Endcap cover c-fibre 0.86% X0 | |
108 | //----------------------------------------------------- | |
109 | ||
110 | dm[0] = 78.; | |
111 | dm[1] = 258.; | |
112 | dm[2] = 0.95; | |
113 | ||
114 | gMC->Gsvolu("TPEC","TUBE",idtmed[10],dm,3); | |
115 | ||
116 | //----------------------------------------------------- | |
117 | // Drift gas , leave 2 cm at the outer radius | |
118 | // and inner raddius | |
119 | //----------------------------------------------------- | |
120 | ||
121 | dm[0] = 78.; | |
122 | dm[1] = 258.; | |
fe4da5cc | 123 | dm[2] = 250.; |
fe4da5cc | 124 | |
1283eee5 | 125 | gMC->Gsvolu("TGAS", "TUBE", idtmed[3], dm, 3); |
126 | ||
127 | ||
128 | //------------------------------------------------------ | |
129 | // membrane holder - carbon fiber | |
130 | //------------------------------------------------------ | |
131 | ||
132 | ||
133 | gMC->Gsvolu("TPMH","TUBE",idtmed[6],dm,0); | |
134 | ||
135 | dm[0] = 252.; | |
136 | dm[1] = 258.; | |
137 | dm[2] = 0.2; | |
138 | ||
139 | gMC->Gsposp("TPMH",1,"TGAS",0.,0.,0.,0,"ONLY",dm,3); | |
140 | ||
141 | dm[0] = 78.; | |
cdde5b1e | 142 | dm[1] = 82.; |
1283eee5 | 143 | dm[2] = 0.1; |
144 | ||
145 | gMC->Gsposp("TPMH",2,"TGAS",0.,0.,0.,0,"ONLY",dm,3); | |
146 | ||
147 | //---------------------------------------------------------- | |
148 | // HV membrane - 25 microns of mylar | |
149 | //---------------------------------------------------------- | |
150 | ||
151 | dm[0] = 82.; | |
152 | dm[1] = 252.; | |
153 | dm[2] = 0.00125; | |
154 | ||
155 | gMC->Gsvolu("TPHV","TUBE",idtmed[5],dm,3); | |
156 | ||
157 | gMC->Gspos("TPHV",1,"TGAS",0.,0.,0.,0,"ONLY"); | |
158 | ||
159 | gMC->Gspos("TGAS",1,"TPC ",0.,0.,0.,0,"ONLY"); | |
160 | ||
161 | //---------------------------------------------------------- | |
162 | // "side" gas volume, the same as the drift gas | |
163 | // the readout chambers are placed there. | |
164 | //---------------------------------------------------------- | |
165 | ||
166 | dm[0] = 78.; | |
167 | dm[1] = 258.; | |
168 | dm[2] = 0.5*(275. - 250.); | |
169 | ||
170 | gMC->Gsvolu("TPSG", "TUBE", idtmed[2], dm, 3); | |
171 | ||
172 | Float_t z_side = dm[2]; // 1/2 of the side gas thickness | |
173 | ||
174 | //----------------------------------------------------------- | |
175 | // Readout chambers , 25% of X0, I use Al as the material | |
176 | //----------------------------------------------------------- | |
177 | ||
178 | Float_t InnerOpenAngle = fTPCParam->GetInnerAngle(); | |
179 | Float_t OuterOpenAngle = fTPCParam->GetOuterAngle(); | |
180 | ||
181 | Float_t InnerAngleShift = fTPCParam->GetInnerAngleShift(); | |
182 | Float_t OuterAngleShift = fTPCParam->GetOuterAngleShift(); | |
183 | ||
184 | ||
185 | Int_t nInnerSector = fTPCParam->GetNInnerSector()/2; | |
186 | Int_t nOuterSector = fTPCParam->GetNOuterSector()/2; | |
187 | ||
188 | ||
189 | Float_t InSecLowEdge = fTPCParam->GetInSecLowEdge(); | |
190 | Float_t InSecUpEdge = fTPCParam->GetInSecUpEdge(); | |
191 | ||
192 | Float_t OuSecLowEdge = fTPCParam->GetOuSecLowEdge(); | |
193 | Float_t OuSecUpEdge = fTPCParam->GetOuSecUpEdge(); | |
194 | ||
195 | Float_t SecThick = 2.225; // Al | |
196 | ||
197 | Float_t edge = fTPCParam->GetEdge(); | |
198 | ||
199 | // S (Inner) sectors | |
200 | ||
201 | dm[0] = InSecLowEdge*TMath::Tan(0.5*InnerOpenAngle)-edge; | |
202 | dm[1] = InSecUpEdge*TMath::Tan(0.5*InnerOpenAngle)-edge; | |
203 | dm[2] = 0.5*SecThick; | |
204 | dm[3] = 0.5*(InSecUpEdge-InSecLowEdge); | |
205 | ||
206 | Float_t xCenterS = InSecLowEdge+dm[3]; | |
207 | ||
208 | gMC->Gsvolu("TRCS", "TRD1", idtmed[0], dm, 4); | |
209 | ||
210 | // L (Outer) sectors | |
211 | ||
212 | dm[0] = OuSecLowEdge*TMath::Tan(0.5*OuterOpenAngle)-edge; | |
213 | dm[1] = OuSecUpEdge*TMath::Tan(0.5*OuterOpenAngle)-edge; | |
214 | dm[2] = 0.5*SecThick; | |
215 | dm[3] = 0.5*(OuSecUpEdge-OuSecLowEdge); | |
216 | ||
217 | Float_t xCenterL = OuSecLowEdge+dm[3]; | |
218 | ||
219 | gMC->Gsvolu("TRCL", "TRD1", idtmed[0], dm, 4); | |
220 | ||
221 | Float_t z1 = -z_side + SecThick*0.5; | |
222 | ||
223 | //------------------------------------------------------------------ | |
224 | // S sectors - "gas sectors" (TRD1) | |
225 | //------------------------------------------------------------------ | |
226 | ||
227 | dm[0] = InSecLowEdge*TMath::Tan(0.5*InnerOpenAngle)-0.01; | |
228 | dm[1] = InSecUpEdge*TMath::Tan(0.5*InnerOpenAngle)-0.01; | |
229 | dm[2] = 0.5*(250. - 0.001); | |
230 | dm[3] = 0.5*(InSecUpEdge-InSecLowEdge); | |
231 | ||
232 | gMC->Gsvolu("TSGA", "TRD1", idtmed[3], dm, 4); // nonsensitive | |
233 | ||
234 | //------------------------------------------------------------------ | |
235 | // sensitive strips - "pad rows" | |
236 | //------------------------------------------------------------------ | |
237 | ||
238 | Int_t ns; | |
239 | Float_t r1,r2,zz; | |
240 | ||
241 | Float_t StripThick = 0.01; // 100 microns | |
242 | Float_t dead = fTPCParam->GetDeadZone(); | |
243 | ||
244 | gMC->Gsvolu("TSST", "TRD1", idtmed[4], dm, 0); | |
245 | ||
246 | dm[2] = 0.5*(250. - 0.002); | |
247 | dm[3] = 0.5 * StripThick; | |
248 | ||
8c555625 | 249 | |
1283eee5 | 250 | // S-sector |
8c555625 | 251 | |
1283eee5 | 252 | for (ns = 0; ns < fTPCParam->GetNRowLow(); ns++) { |
253 | ||
254 | r1 = fTPCParam->GetPadRowRadiiLow(ns); | |
255 | r2 = r1 + StripThick; | |
256 | dm[0] = r1 * TMath::Tan(0.5*InnerOpenAngle) - dead; | |
257 | dm[1] = r2 * TMath::Tan(0.5*InnerOpenAngle) - dead; | |
258 | ||
259 | zz = -InSecLowEdge -0.5*(InSecUpEdge-InSecLowEdge); | |
260 | zz += r1; | |
261 | zz += dm[3]; | |
262 | ||
263 | gMC->Gsposp("TSST", ns+1, "TSGA", 0., 0., zz, 0, "ONLY", dm, 4); | |
264 | ||
8c555625 | 265 | |
fe4da5cc | 266 | } |
8c555625 | 267 | |
1283eee5 | 268 | //----------------------------------------------------------------- |
269 | // L sectors - "gas sectors" (PGON to avoid overlaps) | |
270 | //----------------------------------------------------------------- | |
271 | ||
272 | dm[0] = 360.*kDegrad - 0.5*OuterOpenAngle; | |
273 | dm[0] *= kRaddeg; | |
274 | dm[0] = (Float_t)TMath::Nint(dm[0]); | |
275 | ||
276 | dm[1] = OuterOpenAngle*kRaddeg; | |
277 | dm[1] = (Float_t)TMath::Nint(dm[1]); | |
278 | ||
279 | dm[2] = 1.; | |
280 | dm[3] = 4.; | |
281 | ||
282 | dm[4] = 0.002; | |
283 | dm[5] = OuSecLowEdge; | |
284 | dm[6] = 252.*TMath::Cos(0.5*OuterOpenAngle)-0.002; | |
285 | ||
286 | dm[7] = dm[4]+0.2; | |
287 | dm[8] = dm[5]; | |
288 | dm[9] = dm[6]; | |
289 | ||
290 | dm[10] = dm[7]; | |
291 | dm[11] = OuSecLowEdge; | |
292 | dm[12] = OuSecUpEdge; | |
293 | ||
294 | dm[13] = 250.; | |
295 | dm[14] = dm[11]; | |
296 | dm[15] = dm[12]; | |
297 | ||
298 | gMC->Gsvolu("TLGA","PGON",idtmed[3],dm,16); | |
299 | ||
300 | //------------------------------------------------------------------ | |
301 | // sensitive strips - "pad rows" | |
302 | //------------------------------------------------------------------ | |
303 | ||
304 | Float_t rmax = dm[6]; | |
305 | ||
306 | // L-sectors | |
307 | ||
308 | gMC->Gsvolu("TLST", "PGON", idtmed[4], dm, 0); | |
309 | ||
310 | dm[0] = 360.*kDegrad - 0.5*OuterOpenAngle; | |
311 | dm[0] *= kRaddeg; | |
312 | dm[0] = (Float_t)TMath::Nint(dm[0]); | |
313 | ||
314 | dm[1] = OuterOpenAngle*kRaddeg; | |
315 | dm[1] = (Float_t)TMath::Nint(dm[1]); | |
316 | ||
317 | dm[2] = 1.; | |
318 | dm[3] = 2.; | |
319 | ||
320 | dm[7] = 250.; | |
321 | ||
322 | Float_t xx = dead/TMath::Tan(0.5*OuterOpenAngle); | |
323 | ||
324 | for(ns=0;ns<fTPCParam->GetNRowUp();ns++){ | |
325 | ||
326 | r1 = fTPCParam->GetPadRowRadiiUp(ns)-xx; | |
327 | r2 = r1 + StripThick; | |
8c555625 | 328 | |
1283eee5 | 329 | dm[5] = r1; |
330 | dm[6] = r2; | |
331 | ||
332 | dm[8] = r1; | |
333 | dm[9] = r2; | |
334 | ||
335 | if(r2+xx < rmax){ | |
336 | dm[4] = 0.002; | |
337 | } | |
338 | else{ | |
339 | dm[4] = 0.202; | |
340 | } | |
341 | ||
342 | gMC->Gsposp("TLST",ns+1,"TLGA",xx,0.,0.,0,"ONLY",dm,10); | |
8c555625 | 343 | |
fe4da5cc | 344 | } |
fe4da5cc | 345 | |
1283eee5 | 346 | //------------------------------------------------------------------ |
347 | // Positioning of the S-sector readout chambers | |
348 | //------------------------------------------------------------------ | |
349 | ||
350 | Float_t zs = 0.5*(250.+0.002); | |
351 | ||
352 | Float_t theta1,theta2,theta3; | |
353 | Float_t phi1,phi2,phi3; | |
354 | Float_t alpha; | |
355 | Float_t x,y; | |
356 | ||
357 | for(ns=0;ns<nInnerSector;ns++){ | |
358 | ||
359 | phi1 = ns * InnerOpenAngle + 270.*kDegrad + InnerAngleShift; | |
360 | phi1 *= kRaddeg; // in degrees | |
361 | ||
362 | phi1 = (Float_t)TMath::Nint(phi1); | |
363 | ||
364 | if (phi1 > 360.) phi1 -= 360.; | |
62a73ee5 | 365 | |
1283eee5 | 366 | |
fe4da5cc | 367 | theta1 = 90.; |
368 | phi2 = 90.; | |
369 | theta2 = 180.; | |
1283eee5 | 370 | phi3 = ns * InnerOpenAngle + InnerAngleShift; |
371 | phi3 *= kRaddeg; // in degrees | |
372 | ||
373 | phi3 = (Float_t)TMath::Nint(phi3); | |
374 | ||
375 | if(phi3 > 360.) phi3 -= 360.; | |
376 | ||
fe4da5cc | 377 | theta3 = 90.; |
1283eee5 | 378 | |
379 | alpha = phi3*kDegrad; | |
380 | ||
381 | x = xCenterS * TMath::Cos(alpha); | |
382 | y = xCenterS * TMath::Sin(alpha); | |
383 | ||
384 | AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3); | |
385 | ||
386 | gMC->Gspos("TRCS", ns+1, "TPSG", x, y, z1, idrotm[nRotMat], "ONLY"); | |
387 | ||
388 | gMC->Gspos("TSGA",ns+1,"TGAS",x,y,zs,idrotm[nRotMat], "ONLY"); | |
389 | gMC->Gspos("TSGA",ns+1+nInnerSector,"TGAS",x,y,-zs,idrotm[nRotMat], "ONLY"); | |
390 | ||
391 | nRotMat++; | |
392 | ||
393 | } | |
fe4da5cc | 394 | |
1283eee5 | 395 | //------------------------------------------------------------------- |
396 | // Positioning of the L-sectors readout chambers | |
397 | //------------------------------------------------------------------- | |
fe4da5cc | 398 | |
1283eee5 | 399 | for(ns=0;ns<nOuterSector;ns++){ |
400 | phi1 = ns * OuterOpenAngle + 270.*kDegrad + OuterAngleShift; | |
401 | phi1 *= kRaddeg; // in degrees | |
fe4da5cc | 402 | |
1283eee5 | 403 | phi1 = (Float_t)TMath::Nint(phi1); |
fe4da5cc | 404 | |
1283eee5 | 405 | |
406 | if (phi1 > 360.) phi1 -= 360.; | |
407 | ||
fe4da5cc | 408 | theta1 = 90.; |
409 | phi2 = 90.; | |
410 | theta2 = 180.; | |
1283eee5 | 411 | phi3 = ns * OuterOpenAngle+OuterAngleShift; |
412 | phi3 *= kRaddeg; // in degrees | |
413 | ||
414 | phi3 = (Float_t)TMath::Nint(phi3); | |
415 | ||
416 | ||
417 | if(phi3 > 360.) phi3 -= 360.; | |
418 | ||
fe4da5cc | 419 | theta3 = 90.; |
1283eee5 | 420 | |
421 | alpha = phi3*kDegrad; | |
422 | ||
423 | x = xCenterL * TMath::Cos(alpha); | |
424 | y = xCenterL * TMath::Sin(alpha); | |
425 | ||
426 | AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3); | |
427 | ||
428 | ||
429 | gMC->Gspos("TRCL", ns+1, "TPSG", x, y, z1, idrotm[nRotMat], "ONLY"); | |
430 | ||
431 | nRotMat++; | |
432 | ||
fe4da5cc | 433 | } |
fe4da5cc | 434 | |
1283eee5 | 435 | //------------------------------------------------------------------- |
436 | // Positioning of the L-sectors (gas sectors) | |
437 | //------------------------------------------------------------------- | |
438 | ||
439 | for(ns=0;ns<nOuterSector;ns++){ | |
440 | ||
441 | phi1 = ns*OuterOpenAngle + OuterAngleShift; | |
442 | phi1 *= kRaddeg; | |
443 | ||
444 | phi1 = (Float_t)TMath::Nint(phi1); | |
445 | if(phi1>360.) phi1 -= 360.; | |
446 | ||
447 | theta1 = 90.; | |
448 | ||
449 | phi2 = 90. + phi1; | |
450 | if(phi2>360.) phi2 -= 360.; | |
451 | ||
452 | theta2 = 90.; | |
453 | ||
454 | phi3 = 0.; | |
455 | theta3 = 0.; | |
456 | ||
457 | alpha = phi1*kDegrad; | |
458 | ||
459 | ||
460 | AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3); | |
461 | ||
462 | ||
463 | gMC->Gspos("TLGA",ns+1,"TGAS" ,0.,0.,0.,idrotm[nRotMat],"ONLY"); | |
464 | ||
465 | nRotMat++; | |
466 | ||
467 | // reflection !! | |
468 | ||
469 | phi3 = 0.; | |
470 | theta3 = 180.; | |
471 | ||
472 | AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3); | |
473 | ||
474 | gMC->Gspos("TLGA",ns+1+nOuterSector,"TGAS" ,0.,0.,0.,idrotm[nRotMat],"ONLY"); | |
475 | ||
476 | nRotMat++; | |
477 | } | |
fe4da5cc | 478 | |
1283eee5 | 479 | Float_t z0 = z_side - 0.95; |
480 | ||
481 | gMC->Gspos("TPEC",1,"TPSG",0.,0.,z0,0,"ONLY"); | |
482 | ||
fe4da5cc | 483 | // ========================================================== |
484 | // wheels | |
485 | // ========================================================== | |
1283eee5 | 486 | |
487 | // | |
488 | // auxilary structures | |
489 | // | |
490 | ||
491 | ||
492 | gMC->Gsvolu("TPWI","TUBE",idtmed[24],dm,0); // "air" | |
493 | ||
fe4da5cc | 494 | // ---------------------------------------------------------- |
495 | // Large wheel -> positioned in the TPC | |
496 | // ---------------------------------------------------------- | |
1283eee5 | 497 | |
498 | ||
499 | z0 = 263.5; // TPC length - 1/2 spoke wheel width | |
500 | ||
501 | dm[0] = 258.; | |
fe4da5cc | 502 | dm[1] = 278.; |
503 | dm[2] = 11.5; | |
fe4da5cc | 504 | |
1283eee5 | 505 | gMC->Gsvolu("TPWL", "TUBE", idtmed[0], dm, 3); |
506 | ||
507 | dm[0] = dm[0]+2.; | |
508 | dm[1] = 278.; | |
509 | dm[2] = dm[2]-2.; | |
510 | ||
511 | gMC->Gsposp("TPWI",1,"TPWL",0.,0.,0.,0,"ONLY",dm,3); | |
512 | ||
513 | gMC->Gspos("TPWL", 1, "TPC ", 0, 0, z0, 0, "ONLY"); | |
514 | gMC->Gspos("TPWL", 2, "TPC ", 0, 0, -z0, 0, "ONLY"); | |
515 | ||
516 | // | |
517 | // Outer vessel + CO2 HV degrader | |
518 | // | |
519 | ||
520 | dm[0] = 260.; | |
521 | dm[1] = 278.; | |
522 | dm[2] = 252.; | |
523 | ||
524 | gMC->Gsvolu("TPCO","TUBE",idtmed[12],dm,3); | |
525 | ||
526 | dm[0] = 275.; | |
fe4da5cc | 527 | dm[1] = 278.; |
fe4da5cc | 528 | |
1283eee5 | 529 | gMC->Gsvolu("TPOV","TUBE",idtmed[10],dm,3); |
530 | ||
531 | gMC->Gspos("TPOV",1,"TPCO",0.,0.,0.,0,"ONLY"); | |
532 | ||
533 | ||
534 | // G10 plugs | |
535 | ||
536 | dm[0] = 258.; | |
537 | dm[1] = 260.; | |
538 | dm[2] = 1.; | |
539 | ||
540 | gMC->Gsvolu("TPG1","TUBE",idtmed[8],dm,3); | |
541 | gMC->Gspos("TPG1",1,"TPCO",0.,0.,251.,0,"ONLY"); | |
542 | gMC->Gspos("TPG1",2,"TPCO",0.,0.,-251.,0,"ONLY"); | |
543 | ||
544 | gMC->Gspos("TPCO",1,"TPC ",0.,0.,0.,0,"ONLY"); | |
545 | ||
546 | ||
547 | //---------------------------------------------------------- | |
548 | // Small wheel -> positioned in "side gas | |
549 | //---------------------------------------------------------- | |
550 | ||
551 | dm[0] = 78.; | |
fe4da5cc | 552 | dm[1] = 82.; |
553 | dm[2] = 11.5; | |
1283eee5 | 554 | |
555 | gMC->Gsvolu("TPWS", "TUBE", idtmed[0], dm, 3); | |
556 | ||
557 | dm[0] = 78.; | |
558 | dm[1] = dm[1]-2; | |
559 | dm[2] = dm[2]-2.; | |
560 | ||
561 | gMC->Gsvolu("TPW1", "TUBE", idtmed[2], dm, 3); | |
fe4da5cc | 562 | |
1283eee5 | 563 | gMC->Gspos("TPW1", 1, "TPWS", 0., 0., 0., 0, "ONLY"); |
564 | ||
565 | z0 = 1.; // spoke wheel is shifted w.r.t. center of the "side gas" | |
566 | ||
567 | gMC->Gspos("TPWS", 1, "TPSG", 0, 0, z0, 0, "ONLY"); | |
568 | ||
569 | ||
570 | // to avoid overlaps | |
571 | ||
572 | dm[0] = 76.; | |
573 | dm[1] = 78.; | |
574 | dm[2] = 11.5; | |
575 | ||
576 | gMC->Gsvolu("TPS1","TUBE",idtmed[0],dm,3); | |
577 | ||
fe4da5cc | 578 | dm[2] = 9.5; |
1283eee5 | 579 | |
580 | gMC->Gsvolu("TPS2","TUBE",idtmed[24],dm,3); | |
581 | ||
582 | gMC->Gspos("TPS2",1,"TPS1",0.,0.,0.,0,"ONLY"); | |
583 | ||
584 | z0= 263.5; | |
fe4da5cc | 585 | |
1283eee5 | 586 | gMC->Gspos("TPS1",1,"TPC ",0.,0.,z0,0,"ONLY"); |
587 | gMC->Gspos("TPS1",2,"TPC ",0.,0.,-z0,0,"ONLY"); | |
588 | ||
589 | // G10 plug | |
590 | ||
591 | dm[0] = 76.; | |
7d7bb9e5 | 592 | dm[1] = 78.; |
593 | dm[2] = 1.; | |
1283eee5 | 594 | |
595 | gMC->Gsvolu("TPG2","TUBE",idtmed[8],dm,3); | |
596 | ||
597 | z0 = 251.; | |
598 | ||
599 | gMC->Gspos("TPG2",1,"TPC ",0.,0.,z0,0,"ONLY"); | |
600 | gMC->Gspos("TPG2",2,"TPC ",0.,0.,-z0,0,"ONLY"); | |
601 | ||
602 | ||
603 | //--------------------------------------------------------- | |
604 | // central wheel 6 (radial direction) x 4 (along z) cm2 | |
605 | //--------------------------------------------------------- | |
606 | ||
607 | dm[0] = 140.; | |
608 | dm[1] = 146.; | |
fe4da5cc | 609 | dm[2] = 2.; |
1283eee5 | 610 | |
611 | gMC->Gsvolu("TPWC","TUBE",idtmed[0],dm,3); | |
612 | ||
613 | dm[0] = dm[0] + 2.; | |
614 | dm[1] = dm[1] - 2.; | |
615 | dm[2] = dm[2] - 1.; | |
616 | ||
617 | gMC->Gsposp("TPWI",2,"TPWC",0.,0.,0.,0,"ONLY",dm,3); | |
618 | ||
619 | z0 = z_side - 1.9 - 2.; | |
620 | ||
621 | gMC->Gspos("TPWC",1,"TPSG",0.,0.,z0,0,"ONLY"); | |
622 | ||
623 | // | |
624 | ||
625 | gMC->Gsvolu("TPSE","BOX ",idtmed[24],dm,0); // "empty" part of the spoke | |
626 | ||
627 | ||
628 | //--------------------------------------------------------- | |
629 | // inner spokes (nSectorInner) | |
630 | //--------------------------------------------------------- | |
631 | ||
632 | dm[0] = 0.5*(139.9-82.1); | |
fe4da5cc | 633 | dm[1] = 3.; |
634 | dm[2] = 2.; | |
1283eee5 | 635 | |
636 | Float_t x1 = dm[0]+82.; | |
637 | ||
638 | gMC->Gsvolu("TPSI","BOX",idtmed[0],dm,3); | |
639 | ||
640 | dm[1] = dm[1]-1.; | |
641 | dm[2] = dm[2]-1.; | |
642 | ||
643 | gMC->Gsposp("TPSE",1,"TPSI",0.,0.,0.,0,"ONLY",dm,3); | |
644 | ||
645 | for(ns=0;ns<nInnerSector;ns++){ | |
646 | ||
647 | phi1 = 0.5*InnerOpenAngle + ns*InnerOpenAngle + InnerAngleShift; | |
648 | theta1=90.; | |
649 | phi1 *=kRaddeg; | |
650 | ||
651 | phi1 = (Float_t)TMath::Nint(phi1); | |
652 | if(phi1>360.) phi1 -= 360.; | |
653 | ||
654 | phi2 = phi1+90.; | |
655 | if(phi2>360.) phi2 -= 360.; | |
656 | theta2=90.; | |
657 | phi3=0.; | |
658 | theta3=0.; | |
659 | ||
fe4da5cc | 660 | alpha = phi1 * kDegrad; |
661 | x = x1 * TMath::Cos(alpha); | |
1283eee5 | 662 | y = x1 * TMath::Sin(alpha); |
663 | ||
664 | AliMatrix(idrotm[nRotMat],theta1,phi1,theta2,phi2,theta3,phi3); | |
665 | ||
666 | gMC->Gspos("TPSI",ns+1,"TPSG",x,y,z0,idrotm[nRotMat],"ONLY"); | |
667 | ||
668 | nRotMat++; | |
669 | ||
fe4da5cc | 670 | } |
1283eee5 | 671 | |
672 | //------------------------------------------------------------- | |
673 | // outer spokes (nSectorOuter) | |
674 | //------------------------------------------------------------- | |
675 | ||
676 | dm[0] = 0.5*(257.9-146.1); | |
677 | dm[1] = 3.; | |
678 | dm[2] = 2.; | |
679 | ||
680 | x1 = dm[0] + 146.; | |
681 | ||
682 | gMC->Gsvolu("TPSO","BOX ",idtmed[0],dm,3); | |
683 | ||
684 | dm[1] = dm[1] - 1.; | |
685 | dm[2] = dm[2] - 1.; | |
686 | ||
687 | gMC->Gsposp("TPSE",2,"TPSO",0.,0.,0.,0,"ONLY",dm,3); | |
688 | ||
689 | for(ns=0;ns<nOuterSector;ns++){ | |
690 | ||
691 | phi1 = 0.5*OuterOpenAngle + ns*OuterOpenAngle + OuterAngleShift; | |
692 | theta1=90.; | |
693 | phi1 *=kRaddeg; | |
694 | ||
695 | phi1 = (Float_t)TMath::Nint(phi1); | |
696 | if(phi1>360.) phi1 -= 360.; | |
697 | ||
698 | phi2 = phi1+90.; | |
699 | if(phi2>360.) phi2 -= 360.; | |
700 | theta2=90.; | |
701 | phi3=0.; | |
702 | theta3=0.; | |
703 | ||
fe4da5cc | 704 | alpha = phi1 * kDegrad; |
1283eee5 | 705 | x = x1 * TMath::Cos(alpha); |
706 | y = x1 * TMath::Sin(alpha); | |
707 | ||
708 | AliMatrix(idrotm[nRotMat],theta1,phi1,theta2,phi2,theta3,phi3); | |
709 | ||
710 | gMC->Gspos("TPSO",ns+1,"TPSG",x,y,z0,idrotm[nRotMat],"ONLY"); | |
711 | ||
712 | nRotMat++; | |
713 | ||
714 | } | |
fe4da5cc | 715 | |
1283eee5 | 716 | |
fe4da5cc | 717 | |
fe4da5cc | 718 | // -------------------------------------------------------- |
719 | // put the readout chambers into the TPC | |
720 | // -------------------------------------------------------- | |
1283eee5 | 721 | |
fe4da5cc | 722 | theta1 = 90.; |
723 | phi1 = 0.; | |
724 | theta2 = 90.; | |
725 | phi2 = 270.; | |
726 | theta3 = 180.; | |
727 | phi3 = 0.; | |
728 | ||
1283eee5 | 729 | AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3); |
fe4da5cc | 730 | |
731 | z0 = z_side + 250.; | |
732 | ||
cfce8870 | 733 | gMC->Gspos("TPSG", 1, "TPC ", 0, 0, z0, 0, "ONLY"); |
1283eee5 | 734 | gMC->Gspos("TPSG", 2, "TPC ", 0, 0, -z0, idrotm[nRotMat], "ONLY"); |
fe4da5cc | 735 | |
cfce8870 | 736 | gMC->Gspos("TPC ", 1, "ALIC", 0, 0, 0, 0, "ONLY"); |
fe4da5cc | 737 | |
1283eee5 | 738 | //---------------------------------------------------- |
739 | // Inner vessel and HV degrader | |
740 | //---------------------------------------------------- | |
fe4da5cc | 741 | |
fe4da5cc | 742 | dm[0] = 0.; |
743 | dm[1] = 360.; | |
744 | dm[2] = 4.; | |
745 | ||
746 | dm[3] = -250.; | |
1283eee5 | 747 | dm[4] = 74.4; |
fe4da5cc | 748 | dm[5] = 76.; |
1283eee5 | 749 | |
fe4da5cc | 750 | dm[6] = -64.5; |
751 | dm[7] = 50.; | |
752 | dm[8] = 76.; | |
1283eee5 | 753 | |
d183a600 | 754 | dm[9] = 64.5; |
fe4da5cc | 755 | dm[10] = 50.; |
756 | dm[11] = 76.; | |
1283eee5 | 757 | |
fe4da5cc | 758 | dm[12] = 250.; |
1283eee5 | 759 | dm[13] = 74.4; |
fe4da5cc | 760 | dm[14] = 76.; |
1283eee5 | 761 | |
762 | gMC->Gsvolu("TPVD", "PCON", idtmed[12], dm, 15); // CO2 | |
763 | ||
764 | // cone parts | |
fe4da5cc | 765 | |
766 | dm[0] = 0.; | |
767 | dm[1] = 360.; | |
1283eee5 | 768 | dm[2] = 2.; |
769 | ||
770 | dm[3] = 64.5; | |
771 | dm[4] = 50.; | |
772 | dm[5] = 51.6; | |
773 | ||
774 | dm[6] = 250.; | |
775 | dm[7] = 74.4; | |
776 | dm[8] = 76.; | |
777 | ||
778 | ||
779 | gMC->Gsvolu("TIVC","PCON",idtmed[11],dm,9); // C-fibre | |
780 | ||
781 | gMC->Gspos("TIVC",1,"TPVD",0.,0.,0.,0,"ONLY"); | |
782 | gMC->Gspos("TIVC",2,"TPVD",0.,0.,0.,idrotm[nRotMat],"ONLY"); | |
783 | ||
784 | // barrel part | |
785 | ||
786 | dm[0] = 50.; | |
787 | dm[1] = 50.5; | |
788 | dm[2] = 32.25; | |
789 | ||
790 | gMC->Gsvolu("TIVB","TUBE",idtmed[9],dm,3); | |
791 | ||
792 | gMC->Gspos("TIVB",1,"TPVD",0.,0.,0.,0,"ONLY"); | |
793 | ||
794 | gMC->Gspos("TPVD",1,"ALIC",0.,0.,0.,0,"ONLY"); | |
795 | ||
fe4da5cc | 796 | |
1283eee5 | 797 | |
fe4da5cc | 798 | |
1283eee5 | 799 | |
fe4da5cc | 800 | // --------------------------------------------------- |
801 | // volumes ordering | |
802 | // --------------------------------------------------- | |
cfce8870 | 803 | gMC->Gsord("TGAS", 6); |
804 | gMC->Gsord("TPSG", 6); | |
805 | gMC->Gsord("TSGA", 3); | |
8022212f | 806 | gMC->Gsord("TLGA", 4); |
1283eee5 | 807 | |
808 | } // end of function | |
809 | ||
fe4da5cc | 810 | |
811 | //_____________________________________________________________________________ | |
8c555625 | 812 | void AliTPCv1::DrawDetector() |
fe4da5cc | 813 | { |
814 | // | |
815 | // Draw a shaded view of the Time Projection Chamber version 1 | |
816 | // | |
817 | ||
fe4da5cc | 818 | // Set everything unseen |
cfce8870 | 819 | gMC->Gsatt("*", "seen", -1); |
fe4da5cc | 820 | // |
821 | // Set ALIC mother transparent | |
cfce8870 | 822 | gMC->Gsatt("ALIC","SEEN",0); |
fe4da5cc | 823 | // |
824 | // Set the volumes visible | |
cfce8870 | 825 | gMC->Gsatt("TPC","SEEN",0); |
826 | gMC->Gsatt("TGAS","SEEN",0); | |
827 | gMC->Gsatt("TPSG","SEEN",0); | |
828 | gMC->Gsatt("TPHV","SEEN",1); | |
1283eee5 | 829 | gMC->Gsatt("TPMH","SEEN",1); |
830 | gMC->Gsatt("TPEC","SEEN",0); | |
cfce8870 | 831 | gMC->Gsatt("TRCS","SEEN",1); |
832 | gMC->Gsatt("TRCL","SEEN",1); | |
1283eee5 | 833 | gMC->Gsatt("TPWL","SEEN",1); |
834 | gMC->Gsatt("TPWI","SEEN",1); | |
835 | gMC->Gsatt("TPWS","SEEN",1); | |
cfce8870 | 836 | gMC->Gsatt("TPW1","SEEN",1); |
1283eee5 | 837 | gMC->Gsatt("TPS1","SEEN",1); |
838 | gMC->Gsatt("TPS2","SEEN",1); | |
839 | gMC->Gsatt("TPG1","SEEN",1); | |
840 | gMC->Gsatt("TPG2","SEEN",1); | |
841 | gMC->Gsatt("TPWC","SEEN",1); | |
842 | gMC->Gsatt("TPSI","SEEN",1); | |
843 | gMC->Gsatt("TPSO","SEEN",1); | |
844 | gMC->Gsatt("TPCO","SEEN",1); | |
845 | gMC->Gsatt("TPOV","SEEN",1); | |
cfce8870 | 846 | gMC->Gsatt("TPVD","SEEN",1); |
fe4da5cc | 847 | // |
cfce8870 | 848 | gMC->Gdopt("hide", "on"); |
849 | gMC->Gdopt("shad", "on"); | |
850 | gMC->Gsatt("*", "fill", 7); | |
851 | gMC->SetClipBox("."); | |
852 | gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000); | |
853 | gMC->DefaultRange(); | |
854 | gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .025, .025); | |
855 | gMC->Gdhead(1111, "Time Projection Chamber"); | |
856 | gMC->Gdman(18, 4, "MAN"); | |
857 | gMC->Gdopt("hide","off"); | |
fe4da5cc | 858 | } |
859 | ||
860 | //_____________________________________________________________________________ | |
861 | void AliTPCv1::CreateMaterials() | |
862 | { | |
863 | // | |
864 | // Define materials for Time Projection Chamber | |
865 | // | |
866 | AliTPC::CreateMaterials(); | |
867 | } | |
868 | ||
869 | //_____________________________________________________________________________ | |
870 | void AliTPCv1::Init() | |
871 | { | |
872 | // | |
873 | // Initialises TPC detector after it has been created | |
874 | // | |
cfce8870 | 875 | |
1283eee5 | 876 | fIdSens1=gMC->VolId("TLST"); // L-sector |
877 | fIdSens2=gMC->VolId("TSST"); // S-sector | |
fe4da5cc | 878 | |
879 | printf("TPC version 1 initialized\n"); | |
880 | } | |
881 | ||
882 | //_____________________________________________________________________________ | |
883 | void AliTPCv1::StepManager() | |
884 | { | |
885 | // | |
886 | // Called at every step in the Time Projection Chamber | |
887 | // | |
0a6d8768 | 888 | Int_t copy, id, i; |
fe4da5cc | 889 | Float_t hits[4]; |
890 | Int_t vol[2]; | |
0a6d8768 | 891 | TLorentzVector p; |
fe4da5cc | 892 | TClonesArray &lhits = *fHits; |
cfce8870 | 893 | |
1283eee5 | 894 | AliTPCParam *fTPCParam = &(fDigParam->GetParam()); |
895 | ||
fe4da5cc | 896 | // |
1283eee5 | 897 | |
0a6d8768 | 898 | if(gMC->TrackCharge() && gMC->IsTrackEntering()) { |
fe4da5cc | 899 | // |
900 | // Only entering charged tracks | |
1283eee5 | 901 | // |
0a6d8768 | 902 | if((id=gMC->CurrentVolID(copy))==fIdSens1) { |
1283eee5 | 903 | |
904 | // L | |
905 | ||
906 | vol[1]=copy-1; // row | |
0a6d8768 | 907 | id=gMC->CurrentVolOffID(1,copy); |
1283eee5 | 908 | vol[0]=copy+fTPCParam->GetNInnerSector()-1; // sector |
fe4da5cc | 909 | } else if(id==fIdSens2) { |
1283eee5 | 910 | |
911 | // S | |
912 | ||
913 | vol[1]=copy-1; // row | |
914 | id=gMC->CurrentVolOffID(1,copy); // sector | |
915 | vol[0]=copy-1; | |
fe4da5cc | 916 | } else return; |
1283eee5 | 917 | |
0a6d8768 | 918 | gMC->TrackPosition(p); |
919 | for(i=0;i<3;++i) hits[i]=p[i]; | |
fe4da5cc | 920 | hits[3]=0; |
921 | new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits); | |
922 | } | |
923 | } | |
1283eee5 | 924 | |
925 | ||
926 |