]>
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]; |
62a73ee5 | 65 | Int_t idrotm[120]; |
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.; | |
62a73ee5 | 340 | |
1283eee5 | 341 | |
fe4da5cc | 342 | theta1 = 90.; |
343 | phi2 = 90.; | |
344 | theta2 = 180.; | |
1283eee5 | 345 | phi3 = ns * InnerOpenAngle + InnerAngleShift; |
346 | phi3 *= kRaddeg; // in degrees | |
347 | ||
348 | phi3 = (Float_t)TMath::Nint(phi3); | |
349 | ||
350 | if(phi3 > 360.) phi3 -= 360.; | |
351 | ||
fe4da5cc | 352 | theta3 = 90.; |
1283eee5 | 353 | |
354 | alpha = phi3*kDegrad; | |
355 | ||
356 | x = xCenterS * TMath::Cos(alpha); | |
357 | y = xCenterS * TMath::Sin(alpha); | |
358 | ||
359 | AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3); | |
360 | ||
361 | gMC->Gspos("TRCS", ns+1, "TPSG", x, y, z1, idrotm[nRotMat], "ONLY"); | |
362 | ||
363 | gMC->Gspos("TSGA",ns+1,"TGAS",x,y,zs,idrotm[nRotMat], "ONLY"); | |
364 | gMC->Gspos("TSGA",ns+1+nInnerSector,"TGAS",x,y,-zs,idrotm[nRotMat], "ONLY"); | |
365 | ||
366 | nRotMat++; | |
367 | ||
368 | } | |
fe4da5cc | 369 | |
1283eee5 | 370 | //------------------------------------------------------------------- |
371 | // Positioning of the L-sectors readout chambers | |
372 | //------------------------------------------------------------------- | |
fe4da5cc | 373 | |
1283eee5 | 374 | for(ns=0;ns<nOuterSector;ns++){ |
375 | phi1 = ns * OuterOpenAngle + 270.*kDegrad + OuterAngleShift; | |
376 | phi1 *= kRaddeg; // in degrees | |
fe4da5cc | 377 | |
1283eee5 | 378 | phi1 = (Float_t)TMath::Nint(phi1); |
fe4da5cc | 379 | |
1283eee5 | 380 | |
381 | if (phi1 > 360.) phi1 -= 360.; | |
382 | ||
fe4da5cc | 383 | theta1 = 90.; |
384 | phi2 = 90.; | |
385 | theta2 = 180.; | |
1283eee5 | 386 | phi3 = ns * OuterOpenAngle+OuterAngleShift; |
387 | phi3 *= kRaddeg; // in degrees | |
388 | ||
389 | phi3 = (Float_t)TMath::Nint(phi3); | |
390 | ||
391 | ||
392 | if(phi3 > 360.) phi3 -= 360.; | |
393 | ||
fe4da5cc | 394 | theta3 = 90.; |
1283eee5 | 395 | |
396 | alpha = phi3*kDegrad; | |
397 | ||
398 | x = xCenterL * TMath::Cos(alpha); | |
399 | y = xCenterL * TMath::Sin(alpha); | |
400 | ||
401 | AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3); | |
402 | ||
403 | ||
404 | gMC->Gspos("TRCL", ns+1, "TPSG", x, y, z1, idrotm[nRotMat], "ONLY"); | |
405 | ||
406 | nRotMat++; | |
407 | ||
fe4da5cc | 408 | } |
fe4da5cc | 409 | |
1283eee5 | 410 | //------------------------------------------------------------------- |
411 | // Positioning of the L-sectors (gas sectors) | |
412 | //------------------------------------------------------------------- | |
413 | ||
414 | for(ns=0;ns<nOuterSector;ns++){ | |
415 | ||
416 | phi1 = ns*OuterOpenAngle + OuterAngleShift; | |
417 | phi1 *= kRaddeg; | |
418 | ||
419 | phi1 = (Float_t)TMath::Nint(phi1); | |
420 | if(phi1>360.) phi1 -= 360.; | |
421 | ||
422 | theta1 = 90.; | |
423 | ||
424 | phi2 = 90. + phi1; | |
425 | if(phi2>360.) phi2 -= 360.; | |
426 | ||
427 | theta2 = 90.; | |
428 | ||
429 | phi3 = 0.; | |
430 | theta3 = 0.; | |
431 | ||
432 | alpha = phi1*kDegrad; | |
433 | ||
434 | ||
435 | AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3); | |
436 | ||
437 | ||
438 | gMC->Gspos("TLGA",ns+1,"TGAS" ,0.,0.,0.,idrotm[nRotMat],"ONLY"); | |
439 | ||
440 | nRotMat++; | |
441 | ||
442 | // reflection !! | |
443 | ||
444 | phi3 = 0.; | |
445 | theta3 = 180.; | |
446 | ||
447 | AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3); | |
448 | ||
449 | gMC->Gspos("TLGA",ns+1+nOuterSector,"TGAS" ,0.,0.,0.,idrotm[nRotMat],"ONLY"); | |
450 | ||
451 | nRotMat++; | |
452 | } | |
fe4da5cc | 453 | |
1283eee5 | 454 | Float_t z0 = z_side - 0.95; |
455 | ||
456 | gMC->Gspos("TPEC",1,"TPSG",0.,0.,z0,0,"ONLY"); | |
457 | ||
fe4da5cc | 458 | // ========================================================== |
459 | // wheels | |
460 | // ========================================================== | |
1283eee5 | 461 | |
462 | // | |
463 | // auxilary structures | |
464 | // | |
465 | ||
466 | ||
467 | gMC->Gsvolu("TPWI","TUBE",idtmed[24],dm,0); // "air" | |
468 | ||
fe4da5cc | 469 | // ---------------------------------------------------------- |
470 | // Large wheel -> positioned in the TPC | |
471 | // ---------------------------------------------------------- | |
1283eee5 | 472 | |
473 | ||
474 | z0 = 263.5; // TPC length - 1/2 spoke wheel width | |
475 | ||
476 | dm[0] = 258.; | |
fe4da5cc | 477 | dm[1] = 278.; |
478 | dm[2] = 11.5; | |
fe4da5cc | 479 | |
1283eee5 | 480 | gMC->Gsvolu("TPWL", "TUBE", idtmed[0], dm, 3); |
481 | ||
482 | dm[0] = dm[0]+2.; | |
483 | dm[1] = 278.; | |
484 | dm[2] = dm[2]-2.; | |
485 | ||
486 | gMC->Gsposp("TPWI",1,"TPWL",0.,0.,0.,0,"ONLY",dm,3); | |
487 | ||
488 | gMC->Gspos("TPWL", 1, "TPC ", 0, 0, z0, 0, "ONLY"); | |
489 | gMC->Gspos("TPWL", 2, "TPC ", 0, 0, -z0, 0, "ONLY"); | |
490 | ||
491 | // | |
492 | // Outer vessel + CO2 HV degrader | |
493 | // | |
494 | ||
495 | dm[0] = 260.; | |
496 | dm[1] = 278.; | |
497 | dm[2] = 252.; | |
498 | ||
499 | gMC->Gsvolu("TPCO","TUBE",idtmed[12],dm,3); | |
500 | ||
501 | dm[0] = 275.; | |
fe4da5cc | 502 | dm[1] = 278.; |
fe4da5cc | 503 | |
1283eee5 | 504 | gMC->Gsvolu("TPOV","TUBE",idtmed[10],dm,3); |
505 | ||
506 | gMC->Gspos("TPOV",1,"TPCO",0.,0.,0.,0,"ONLY"); | |
507 | ||
508 | ||
509 | // G10 plugs | |
510 | ||
511 | dm[0] = 258.; | |
512 | dm[1] = 260.; | |
513 | dm[2] = 1.; | |
514 | ||
515 | gMC->Gsvolu("TPG1","TUBE",idtmed[8],dm,3); | |
516 | gMC->Gspos("TPG1",1,"TPCO",0.,0.,251.,0,"ONLY"); | |
517 | gMC->Gspos("TPG1",2,"TPCO",0.,0.,-251.,0,"ONLY"); | |
518 | ||
519 | gMC->Gspos("TPCO",1,"TPC ",0.,0.,0.,0,"ONLY"); | |
520 | ||
521 | ||
522 | //---------------------------------------------------------- | |
523 | // Small wheel -> positioned in "side gas | |
524 | //---------------------------------------------------------- | |
525 | ||
526 | dm[0] = 78.; | |
fe4da5cc | 527 | dm[1] = 82.; |
528 | dm[2] = 11.5; | |
1283eee5 | 529 | |
530 | gMC->Gsvolu("TPWS", "TUBE", idtmed[0], dm, 3); | |
531 | ||
532 | dm[0] = 78.; | |
533 | dm[1] = dm[1]-2; | |
534 | dm[2] = dm[2]-2.; | |
535 | ||
536 | gMC->Gsvolu("TPW1", "TUBE", idtmed[2], dm, 3); | |
fe4da5cc | 537 | |
1283eee5 | 538 | gMC->Gspos("TPW1", 1, "TPWS", 0., 0., 0., 0, "ONLY"); |
539 | ||
540 | z0 = 1.; // spoke wheel is shifted w.r.t. center of the "side gas" | |
541 | ||
542 | gMC->Gspos("TPWS", 1, "TPSG", 0, 0, z0, 0, "ONLY"); | |
543 | ||
544 | ||
545 | // to avoid overlaps | |
546 | ||
547 | dm[0] = 76.; | |
548 | dm[1] = 78.; | |
549 | dm[2] = 11.5; | |
550 | ||
551 | gMC->Gsvolu("TPS1","TUBE",idtmed[0],dm,3); | |
552 | ||
fe4da5cc | 553 | dm[2] = 9.5; |
1283eee5 | 554 | |
555 | gMC->Gsvolu("TPS2","TUBE",idtmed[24],dm,3); | |
556 | ||
557 | gMC->Gspos("TPS2",1,"TPS1",0.,0.,0.,0,"ONLY"); | |
558 | ||
559 | z0= 263.5; | |
fe4da5cc | 560 | |
1283eee5 | 561 | gMC->Gspos("TPS1",1,"TPC ",0.,0.,z0,0,"ONLY"); |
562 | gMC->Gspos("TPS1",2,"TPC ",0.,0.,-z0,0,"ONLY"); | |
563 | ||
564 | // G10 plug | |
565 | ||
566 | dm[0] = 76.; | |
7d7bb9e5 | 567 | dm[1] = 78.; |
568 | dm[2] = 1.; | |
1283eee5 | 569 | |
570 | gMC->Gsvolu("TPG2","TUBE",idtmed[8],dm,3); | |
571 | ||
572 | z0 = 251.; | |
573 | ||
574 | gMC->Gspos("TPG2",1,"TPC ",0.,0.,z0,0,"ONLY"); | |
575 | gMC->Gspos("TPG2",2,"TPC ",0.,0.,-z0,0,"ONLY"); | |
576 | ||
577 | ||
578 | //--------------------------------------------------------- | |
579 | // central wheel 6 (radial direction) x 4 (along z) cm2 | |
580 | //--------------------------------------------------------- | |
581 | ||
582 | dm[0] = 140.; | |
583 | dm[1] = 146.; | |
fe4da5cc | 584 | dm[2] = 2.; |
1283eee5 | 585 | |
586 | gMC->Gsvolu("TPWC","TUBE",idtmed[0],dm,3); | |
587 | ||
588 | dm[0] = dm[0] + 2.; | |
589 | dm[1] = dm[1] - 2.; | |
590 | dm[2] = dm[2] - 1.; | |
591 | ||
592 | gMC->Gsposp("TPWI",2,"TPWC",0.,0.,0.,0,"ONLY",dm,3); | |
593 | ||
594 | z0 = z_side - 1.9 - 2.; | |
595 | ||
596 | gMC->Gspos("TPWC",1,"TPSG",0.,0.,z0,0,"ONLY"); | |
597 | ||
598 | // | |
599 | ||
600 | gMC->Gsvolu("TPSE","BOX ",idtmed[24],dm,0); // "empty" part of the spoke | |
601 | ||
602 | ||
603 | //--------------------------------------------------------- | |
604 | // inner spokes (nSectorInner) | |
605 | //--------------------------------------------------------- | |
606 | ||
607 | dm[0] = 0.5*(139.9-82.1); | |
fe4da5cc | 608 | dm[1] = 3.; |
609 | dm[2] = 2.; | |
1283eee5 | 610 | |
611 | Float_t x1 = dm[0]+82.; | |
612 | ||
613 | gMC->Gsvolu("TPSI","BOX",idtmed[0],dm,3); | |
614 | ||
615 | dm[1] = dm[1]-1.; | |
616 | dm[2] = dm[2]-1.; | |
617 | ||
618 | gMC->Gsposp("TPSE",1,"TPSI",0.,0.,0.,0,"ONLY",dm,3); | |
619 | ||
620 | for(ns=0;ns<nInnerSector;ns++){ | |
621 | ||
622 | phi1 = 0.5*InnerOpenAngle + ns*InnerOpenAngle + InnerAngleShift; | |
623 | theta1=90.; | |
624 | phi1 *=kRaddeg; | |
625 | ||
626 | phi1 = (Float_t)TMath::Nint(phi1); | |
627 | if(phi1>360.) phi1 -= 360.; | |
628 | ||
629 | phi2 = phi1+90.; | |
630 | if(phi2>360.) phi2 -= 360.; | |
631 | theta2=90.; | |
632 | phi3=0.; | |
633 | theta3=0.; | |
634 | ||
fe4da5cc | 635 | alpha = phi1 * kDegrad; |
636 | x = x1 * TMath::Cos(alpha); | |
1283eee5 | 637 | y = x1 * TMath::Sin(alpha); |
638 | ||
639 | AliMatrix(idrotm[nRotMat],theta1,phi1,theta2,phi2,theta3,phi3); | |
640 | ||
641 | gMC->Gspos("TPSI",ns+1,"TPSG",x,y,z0,idrotm[nRotMat],"ONLY"); | |
642 | ||
643 | nRotMat++; | |
644 | ||
fe4da5cc | 645 | } |
1283eee5 | 646 | |
647 | //------------------------------------------------------------- | |
648 | // outer spokes (nSectorOuter) | |
649 | //------------------------------------------------------------- | |
650 | ||
651 | dm[0] = 0.5*(257.9-146.1); | |
652 | dm[1] = 3.; | |
653 | dm[2] = 2.; | |
654 | ||
655 | x1 = dm[0] + 146.; | |
656 | ||
657 | gMC->Gsvolu("TPSO","BOX ",idtmed[0],dm,3); | |
658 | ||
659 | dm[1] = dm[1] - 1.; | |
660 | dm[2] = dm[2] - 1.; | |
661 | ||
662 | gMC->Gsposp("TPSE",2,"TPSO",0.,0.,0.,0,"ONLY",dm,3); | |
663 | ||
664 | for(ns=0;ns<nOuterSector;ns++){ | |
665 | ||
666 | phi1 = 0.5*OuterOpenAngle + ns*OuterOpenAngle + OuterAngleShift; | |
667 | theta1=90.; | |
668 | phi1 *=kRaddeg; | |
669 | ||
670 | phi1 = (Float_t)TMath::Nint(phi1); | |
671 | if(phi1>360.) phi1 -= 360.; | |
672 | ||
673 | phi2 = phi1+90.; | |
674 | if(phi2>360.) phi2 -= 360.; | |
675 | theta2=90.; | |
676 | phi3=0.; | |
677 | theta3=0.; | |
678 | ||
fe4da5cc | 679 | alpha = phi1 * kDegrad; |
1283eee5 | 680 | x = x1 * TMath::Cos(alpha); |
681 | y = x1 * TMath::Sin(alpha); | |
682 | ||
683 | AliMatrix(idrotm[nRotMat],theta1,phi1,theta2,phi2,theta3,phi3); | |
684 | ||
685 | gMC->Gspos("TPSO",ns+1,"TPSG",x,y,z0,idrotm[nRotMat],"ONLY"); | |
686 | ||
687 | nRotMat++; | |
688 | ||
689 | } | |
fe4da5cc | 690 | |
1283eee5 | 691 | |
fe4da5cc | 692 | |
fe4da5cc | 693 | // -------------------------------------------------------- |
694 | // put the readout chambers into the TPC | |
695 | // -------------------------------------------------------- | |
1283eee5 | 696 | |
fe4da5cc | 697 | theta1 = 90.; |
698 | phi1 = 0.; | |
699 | theta2 = 90.; | |
700 | phi2 = 270.; | |
701 | theta3 = 180.; | |
702 | phi3 = 0.; | |
703 | ||
1283eee5 | 704 | AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3); |
fe4da5cc | 705 | |
706 | z0 = z_side + 250.; | |
707 | ||
cfce8870 | 708 | gMC->Gspos("TPSG", 1, "TPC ", 0, 0, z0, 0, "ONLY"); |
1283eee5 | 709 | gMC->Gspos("TPSG", 2, "TPC ", 0, 0, -z0, idrotm[nRotMat], "ONLY"); |
fe4da5cc | 710 | |
cfce8870 | 711 | gMC->Gspos("TPC ", 1, "ALIC", 0, 0, 0, 0, "ONLY"); |
fe4da5cc | 712 | |
1283eee5 | 713 | //---------------------------------------------------- |
714 | // Inner vessel and HV degrader | |
715 | //---------------------------------------------------- | |
fe4da5cc | 716 | |
fe4da5cc | 717 | dm[0] = 0.; |
718 | dm[1] = 360.; | |
719 | dm[2] = 4.; | |
720 | ||
721 | dm[3] = -250.; | |
1283eee5 | 722 | dm[4] = 74.4; |
fe4da5cc | 723 | dm[5] = 76.; |
1283eee5 | 724 | |
fe4da5cc | 725 | dm[6] = -64.5; |
726 | dm[7] = 50.; | |
727 | dm[8] = 76.; | |
1283eee5 | 728 | |
729 | dm[9] = -64.5; | |
fe4da5cc | 730 | dm[10] = 50.; |
731 | dm[11] = 76.; | |
1283eee5 | 732 | |
fe4da5cc | 733 | dm[12] = 250.; |
1283eee5 | 734 | dm[13] = 74.4; |
fe4da5cc | 735 | dm[14] = 76.; |
1283eee5 | 736 | |
737 | gMC->Gsvolu("TPVD", "PCON", idtmed[12], dm, 15); // CO2 | |
738 | ||
739 | // cone parts | |
fe4da5cc | 740 | |
741 | dm[0] = 0.; | |
742 | dm[1] = 360.; | |
1283eee5 | 743 | dm[2] = 2.; |
744 | ||
745 | dm[3] = 64.5; | |
746 | dm[4] = 50.; | |
747 | dm[5] = 51.6; | |
748 | ||
749 | dm[6] = 250.; | |
750 | dm[7] = 74.4; | |
751 | dm[8] = 76.; | |
752 | ||
753 | ||
754 | gMC->Gsvolu("TIVC","PCON",idtmed[11],dm,9); // C-fibre | |
755 | ||
756 | gMC->Gspos("TIVC",1,"TPVD",0.,0.,0.,0,"ONLY"); | |
757 | gMC->Gspos("TIVC",2,"TPVD",0.,0.,0.,idrotm[nRotMat],"ONLY"); | |
758 | ||
759 | // barrel part | |
760 | ||
761 | dm[0] = 50.; | |
762 | dm[1] = 50.5; | |
763 | dm[2] = 32.25; | |
764 | ||
765 | gMC->Gsvolu("TIVB","TUBE",idtmed[9],dm,3); | |
766 | ||
767 | gMC->Gspos("TIVB",1,"TPVD",0.,0.,0.,0,"ONLY"); | |
768 | ||
769 | gMC->Gspos("TPVD",1,"ALIC",0.,0.,0.,0,"ONLY"); | |
770 | ||
fe4da5cc | 771 | |
1283eee5 | 772 | |
fe4da5cc | 773 | |
1283eee5 | 774 | |
fe4da5cc | 775 | // --------------------------------------------------- |
776 | // volumes ordering | |
777 | // --------------------------------------------------- | |
cfce8870 | 778 | gMC->Gsord("TGAS", 6); |
779 | gMC->Gsord("TPSG", 6); | |
780 | gMC->Gsord("TSGA", 3); | |
8022212f | 781 | gMC->Gsord("TLGA", 4); |
1283eee5 | 782 | |
783 | } // end of function | |
784 | ||
fe4da5cc | 785 | |
786 | //_____________________________________________________________________________ | |
8c555625 | 787 | void AliTPCv1::DrawDetector() |
fe4da5cc | 788 | { |
789 | // | |
790 | // Draw a shaded view of the Time Projection Chamber version 1 | |
791 | // | |
792 | ||
fe4da5cc | 793 | // Set everything unseen |
cfce8870 | 794 | gMC->Gsatt("*", "seen", -1); |
fe4da5cc | 795 | // |
796 | // Set ALIC mother transparent | |
cfce8870 | 797 | gMC->Gsatt("ALIC","SEEN",0); |
fe4da5cc | 798 | // |
799 | // Set the volumes visible | |
cfce8870 | 800 | gMC->Gsatt("TPC","SEEN",0); |
801 | gMC->Gsatt("TGAS","SEEN",0); | |
802 | gMC->Gsatt("TPSG","SEEN",0); | |
803 | gMC->Gsatt("TPHV","SEEN",1); | |
1283eee5 | 804 | gMC->Gsatt("TPMH","SEEN",1); |
805 | gMC->Gsatt("TPEC","SEEN",0); | |
cfce8870 | 806 | gMC->Gsatt("TRCS","SEEN",1); |
807 | gMC->Gsatt("TRCL","SEEN",1); | |
1283eee5 | 808 | gMC->Gsatt("TPWL","SEEN",1); |
809 | gMC->Gsatt("TPWI","SEEN",1); | |
810 | gMC->Gsatt("TPWS","SEEN",1); | |
cfce8870 | 811 | gMC->Gsatt("TPW1","SEEN",1); |
1283eee5 | 812 | gMC->Gsatt("TPS1","SEEN",1); |
813 | gMC->Gsatt("TPS2","SEEN",1); | |
814 | gMC->Gsatt("TPG1","SEEN",1); | |
815 | gMC->Gsatt("TPG2","SEEN",1); | |
816 | gMC->Gsatt("TPWC","SEEN",1); | |
817 | gMC->Gsatt("TPSI","SEEN",1); | |
818 | gMC->Gsatt("TPSO","SEEN",1); | |
819 | gMC->Gsatt("TPCO","SEEN",1); | |
820 | gMC->Gsatt("TPOV","SEEN",1); | |
cfce8870 | 821 | gMC->Gsatt("TPVD","SEEN",1); |
fe4da5cc | 822 | // |
cfce8870 | 823 | gMC->Gdopt("hide", "on"); |
824 | gMC->Gdopt("shad", "on"); | |
825 | gMC->Gsatt("*", "fill", 7); | |
826 | gMC->SetClipBox("."); | |
827 | gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000); | |
828 | gMC->DefaultRange(); | |
829 | gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .025, .025); | |
830 | gMC->Gdhead(1111, "Time Projection Chamber"); | |
831 | gMC->Gdman(18, 4, "MAN"); | |
832 | gMC->Gdopt("hide","off"); | |
fe4da5cc | 833 | } |
834 | ||
835 | //_____________________________________________________________________________ | |
836 | void AliTPCv1::CreateMaterials() | |
837 | { | |
838 | // | |
839 | // Define materials for Time Projection Chamber | |
840 | // | |
841 | AliTPC::CreateMaterials(); | |
842 | } | |
843 | ||
844 | //_____________________________________________________________________________ | |
845 | void AliTPCv1::Init() | |
846 | { | |
847 | // | |
848 | // Initialises TPC detector after it has been created | |
849 | // | |
cfce8870 | 850 | |
1283eee5 | 851 | fIdSens1=gMC->VolId("TLST"); // L-sector |
852 | fIdSens2=gMC->VolId("TSST"); // S-sector | |
fe4da5cc | 853 | |
854 | printf("TPC version 1 initialized\n"); | |
855 | } | |
856 | ||
857 | //_____________________________________________________________________________ | |
858 | void AliTPCv1::StepManager() | |
859 | { | |
860 | // | |
861 | // Called at every step in the Time Projection Chamber | |
862 | // | |
0a6d8768 | 863 | Int_t copy, id, i; |
fe4da5cc | 864 | Float_t hits[4]; |
865 | Int_t vol[2]; | |
0a6d8768 | 866 | TLorentzVector p; |
fe4da5cc | 867 | TClonesArray &lhits = *fHits; |
cfce8870 | 868 | |
1283eee5 | 869 | AliTPCParam *fTPCParam = &(fDigParam->GetParam()); |
870 | ||
fe4da5cc | 871 | // |
1283eee5 | 872 | |
0a6d8768 | 873 | if(gMC->TrackCharge() && gMC->IsTrackEntering()) { |
fe4da5cc | 874 | // |
875 | // Only entering charged tracks | |
1283eee5 | 876 | // |
0a6d8768 | 877 | if((id=gMC->CurrentVolID(copy))==fIdSens1) { |
1283eee5 | 878 | |
879 | // L | |
880 | ||
881 | vol[1]=copy-1; // row | |
0a6d8768 | 882 | id=gMC->CurrentVolOffID(1,copy); |
1283eee5 | 883 | vol[0]=copy+fTPCParam->GetNInnerSector()-1; // sector |
fe4da5cc | 884 | } else if(id==fIdSens2) { |
1283eee5 | 885 | |
886 | // S | |
887 | ||
888 | vol[1]=copy-1; // row | |
889 | id=gMC->CurrentVolOffID(1,copy); // sector | |
890 | vol[0]=copy-1; | |
fe4da5cc | 891 | } else return; |
1283eee5 | 892 | |
0a6d8768 | 893 | gMC->TrackPosition(p); |
894 | for(i=0;i<3;++i) hits[i]=p[i]; | |
fe4da5cc | 895 | hits[3]=0; |
896 | new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits); | |
897 | } | |
898 | } | |
1283eee5 | 899 | |
900 | ||
901 |