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