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