1 ///////////////////////////////////////////////////////////////////////////////
3 // Time Projection Chamber version 1 -- detailed TPC and fast simulation //
7 <img src="gif/AliTPCv1Class.gif">
12 ///////////////////////////////////////////////////////////////////////////////
15 #include <TGeometry.h>
29 //_____________________________________________________________________________
30 AliTPCv1::AliTPCv1(const char *name, const char *title)
31 :AliTPC(name, title) {
33 // Standard constructor for Time Projection Chamber
38 //_____________________________________________________________________________
39 void AliTPCv1::CreateGeometry()
42 // Creates geometry for Time Projection Chamber version 1
43 // Detailed geometry -- Fast simulation
48 <img src="gif/AliTPCv1.gif">
53 <img src="gif/AliTPCv1Tree.gif">
57 AliMC* pMC = AliMC::GetMC();
59 Int_t *idtmed = gAlice->Idtmed();
61 Float_t padl, tana, rlsl, wlsl, rssl, rlsu, wssl, wlsu,
62 rssu, wssu, alpha, x, y, z, sec_thick;
64 Float_t r1, r2, x1, z0, z1, x2, theta1, theta2, theta3, dm[21];
75 Float_t thu, opu, dzz, phi1, phi2, phi3;
77 // ----------------------------------------------------
78 // FIELD CAGE WITH ENDCAPS - CARBON FIBER
79 // THIS IS ALSO A TPC MOTHER VOLUME
80 // ----------------------------------------------------
85 pMC->Gsvolu("TPC ", "TUBE", idtmed[407], dm, 3);
87 // -------------------------------------------------------
88 // drift gas Ne/CO2 (90/10 volume) - nonsensitive
89 // field cage thickness = 0.52% X0
90 // ----------------------------------------------------
94 <img src="gif/spec_tgas1.gif">
102 pMC->Gsvolu("TGAS", "TUBE", idtmed[402], dm, 3);
104 // ------------------------------------------------------
105 // "side" gas volume (the same as drift gas),
106 // here the readout chambers are positioned
107 // ------------------------------------------------------
111 <img src="gif/spec_tpsg1.gif">
118 pMC->Gsvolu("TPSG", "TUBE", idtmed[401], dm, 3);
119 // ------------------------------------------------------
120 // HV midplane - 20 microns of mylar
121 // -----------------------------------------------------
124 pMC->Gsvolu("TPHV", "TUBE", idtmed[405], dm, 3);
126 // ====================================================
127 // lower and upper readout chambers
128 // ====================================================
129 // sectors opening angles in degrees
130 // ---------------------------------------------------
133 thl = TMath::Tan(opl * .5 * kDegrad);
134 thu = TMath::Tan(opu * .5 * kDegrad);
135 // ---------------------------------------------------
136 // S and L-sectors radii
137 // ---------------------------------------------------
142 // --------------------------------------------------
144 // --------------------------------------------------
149 // ---------------------------------------------------
150 // Sector thickness 25% of X0 (Al)
151 // ---------------------------------------------------
153 // ---------------------------------------------------
154 // S-sectors (lower sectors)
155 // ---------------------------------------------------
158 dm[2] = sec_thick * .5;
159 dm[3] = (rssu - rssl) * .5;
165 <img src="gif/spec_trcs1.gif">
170 pMC->Gsvolu("TRCS", "TRD1", idtmed[399], dm, 4);
171 // -----------------------------------------------------
172 // S-sectors --> "gas sectors"
173 // -----------------------------------------------------
177 <img src="gif/spec_tsga1.gif">
181 dm[2] = (250.-0.001)/2.;
182 pMC->Gsvolu("TSGA", "TRD1", idtmed[402], dm, 4);
183 // ---------------------------------------------------
184 // L-sectors (upper sectors)
185 // ---------------------------------------------------
188 dm[2] = sec_thick * .5;
189 dm[3] = (rlsu - rlsl) * .5;
193 pMC->Gsvolu("TRCL", "TRD1", idtmed[399], dm, 4);
194 // -----------------------------------------------------
195 // L-sectors - "gas sectors"
196 // -----------------------------------------------------
197 dm[2] = (250.-0.001)/2.;
198 pMC->Gsvolu("TLGA", "TRD1", idtmed[402], dm, 4);
199 // -----------------------------------------------------
200 // thin sensitive strips (100 microns) placed at a center
201 // of each pad row (23 rows) in the "drift gas sector"
202 // -----------------------------------------------------
203 pMC->Gsvolu("TSST", "TRD1", idtmed[403], dm, 0);
207 z0 = (rssu - rssl) * .5;
208 dzz = (rssu - rssl - padl * 22.) * .5;
211 for (iss = 0; iss < 23; ++iss) {
212 r1 = rssl + dzz + iss * padl - dm[3];
213 r2 = r1 + dm[3] * 2.;
214 dm[0] = r1 * thl - 1.1;
215 dm[1] = r2 * thl - 1.1;
216 zz = z0 + iss * padl;
217 pMC->Gsposp("TSST", iss+1, "TSGA", 0, 0, zz, 0, "ONLY", dm, 4);
219 // -----------------------------------------------------
220 // thin sensitive strips (100 microns) placed at a center
221 // of each pad row (52 rows) in the "drift gas sector"
222 // -----------------------------------------------------
223 pMC->Gsvolu("TLST", "TRD1", idtmed[403], dm, 0);
226 z0 = (rlsu - rlsl) * .5;
227 dzz = (rlsu - rlsl - padl * 51.) * .5;
230 for (ils = 0; ils < 52; ++ils) {
231 r1 = rlsl + dzz + ils * padl - dm[3];
232 r2 = r1 + dm[3] * 2.;
233 dm[0] = r1 * thu - 1.1;
234 dm[1] = r2 * thu - 1.1;
235 zz = z0 + ils * padl;
236 pMC->Gsposp("TLST", ils+1, "TLGA", 0, 0, zz, 0, "ONLY", dm, 4);
238 // ------------------------------------------------
239 // positioning of lower sectors (1-12)*2
240 // rotation matrices 1-12
241 // ------------------------------------------------
243 z1 = -z_side + sec_thick * .5;
245 for (il = 0; il < 12; ++il) {
246 phi1 = il * opl + 270;
257 AliMatrix(idrotm[idr], theta1, phi1, theta2, phi2, theta3, phi3);
259 alpha = il * opl * kDegrad;
260 x = x0l * TMath::Cos(alpha);
261 y = x0l * TMath::Sin(alpha);
263 pMC->Gspos("TSGA", il+1, "TGAS", x, y, z, idrotm[idr], "ONLY");
264 pMC->Gspos("TSGA", il+13,"TGAS", x, y, -z, idrotm[idr], "ONLY");
265 pMC->Gspos("TRCS", il+1, "TPSG", x, y, z1, idrotm[idr], "ONLY");
268 // ----------------------------------------------------
269 // positioning of upper sectors (1-24)*2
270 // rotation matrices 13-36
271 // ----------------------------------------------------
272 for (iu = 1; iu <= 24; ++iu) {
273 phi1 = (iu - 1) * opu + 270.;
280 phi3 = (iu - 1) * opu;
284 AliMatrix(idrotm[idr], theta1, phi1, theta2, phi2, theta3, phi3);
286 alpha = (iu - 1) * opu * kDegrad;
287 x = x0u * TMath::Cos(alpha);
288 y = x0u * TMath::Sin(alpha);
290 pMC->Gspos("TLGA", iu, "TGAS", x, y, z, idrotm[idr], "ONLY");
291 pMC->Gspos("TLGA", iu+24, "TGAS", x, y, -z, idrotm[idr], "ONLY");
293 pMC->Gspos("TRCL", iu, "TPSG", x, y, z1, idrotm[idr], "ONLY");
295 // --------------------------------------------------------
296 // Spoke wheel structures
297 // --------------------------------------------------------
298 pMC->Gsvolu("TSWS", "TUBE", idtmed[399], dm, 0);
306 pMC->Gsposp("TSWS", 1, "TPSG", 0, 0, z0, 0, "ONLY", dm, 3);
311 pMC->Gsposp("TSWS", 2, "TPSG", 0, 0, z0, 0, "ONLY", dm, 3);
316 pMC->Gsposp("TSWS", 3, "TPSG", 0, 0, z0, 0, "ONLY", dm, 3);
318 // -------------------------------------------------------
319 // this volumes are to avoid overlaping
320 // -------------------------------------------------------
326 pMC->Gsposp("TSWS", 4, "TPC ", 0, 0, z0, 0, "ONLY", dm, 3);
327 pMC->Gsposp("TSWS", 5, "TPC ", 0, 0, -z0, 0, "ONLY", dm, 3);
331 pMC->Gsposp("TSWS", 6, "TPC ", 0, 0, z0, 0, "ONLY", dm, 3);
332 pMC->Gsposp("TSWS", 7, "TPC ", 0, 0, -z0, 0, "ONLY", dm, 3);
335 dm[1] = 257.+0.09776;
340 pMC->Gsposp("TSWS", 8, "TPC ", 0, 0, z0, 0, "ONLY", dm, 3);
341 pMC->Gsposp("TSWS", 9, "TPC ", 0, 0, -z0, 0, "ONLY", dm, 3);
342 // ==========================================================
344 // ==========================================================
345 // ----------------------------------------------------------
346 // Large wheel -> positioned in the TPC
347 // ----------------------------------------------------------
348 dm[0] = 257.+0.09776;
351 pMC->Gsvolu("TPW1", "TUBE", idtmed[399], dm, 3);
357 pMC->Gsvolu("TPW2", "TUBE", idtmed[498], dm, 3);
359 pMC->Gspos("TPW2", 1, "TPW1", 0, 0, 0, 0, "ONLY");
361 pMC->Gspos("TPW1", 1, "TPC ", 0, 0, z0, 0, "ONLY");
362 pMC->Gspos("TPW1", 2, "TPC ", 0, 0, -z0, 0, "ONLY");
363 // -----------------------------------------------------------
364 // Small wheel -> positioned in the TPSG
365 // -----------------------------------------------------------
370 pMC->Gsvolu("TPW3", "TUBE", idtmed[399], dm, 3);
376 pMC->Gsvolu("TPW4", "TUBE", idtmed[401], dm, 3);
378 pMC->Gspos("TPW4", 1, "TPW3", 0, 0, 0, 0, "ONLY");
382 pMC->Gspos("TPW3", 1, "TPSG", 0, 0, z0, 0, "ONLY");
383 // ---------------------------------------------------------
384 // spokes, inner and outer, also the inner ring
385 // ---------------------------------------------------------
389 <img src="gif/spec_tspo1.gif">
393 dm[0] = 0.5*(135.9-82.1);
399 pMC->Gsvolu("TSPI", "BOX ", idtmed[399], dm, 3);
404 pMC->Gsvolu("TSP1", "BOX ", idtmed[498], dm, 3);
406 pMC->Gspos("TSP1", 1, "TSPI", 0, 0, 0, 0, "ONLY");
408 dm[0] = 0.5*(256.9-142.1);
414 pMC->Gsvolu("TSPO", "BOX ", idtmed[399], dm, 3);
419 pMC->Gsvolu("TSP2", "BOX ", idtmed[498], dm, 3);
421 pMC->Gspos("TSP2", 1, "TSPO", 0, 0, 0, 0, "ONLY");
422 // --------------------------------------------------------
427 pMC->Gsvolu("TSWH", "TUBE", idtmed[399], dm, 3);
433 pMC->Gsvolu("TSW1", "TUBE", idtmed[498], dm, 3);
435 pMC->Gspos("TSW1", 1, "TSWH", 0, 0, 0, 0, "ONLY");
437 z0 = z_side - .16168 - 2.;
438 // --------------------------------------------------------
439 pMC->Gspos("TSWH", 1, "TPSG", 0, 0, z0, 0, "ONLY");
440 // -------------------------------------------------------
441 // posiioning of the inner spokes
442 // -------------------------------------------------------
443 for (il = 1; il <= 6; ++il) {
444 phi1 = opl * .5 + (il - 1) * 2. * opl;
446 phi2 = opl * .5 + 90. + (il - 1) * 2. * opl;
454 alpha = phi1 * kDegrad;
455 x = x1 * TMath::Cos(alpha);
456 y = x1 * TMath::Sin(alpha);
460 AliMatrix(idrotm[idr], theta1, phi1, theta2, phi2, theta3, phi3);
461 pMC->Gspos("TSPI", il, "TPSG", x, y, z0, idrotm[idr], "ONLY");
464 for (iu = 1; iu <= 12; ++iu) {
465 phi1 = opu * .5 + (iu - 1) * 2. * opu;
467 phi2 = opu * .5 + 90. + (iu - 1) * 2. * opu;
475 alpha = phi1 * kDegrad;
476 x = x2 * TMath::Cos(alpha);
477 y = x2 * TMath::Sin(alpha);
481 AliMatrix(idrotm[idr], theta1, phi1, theta2, phi2, theta3, phi3);
482 pMC->Gspos("TSPO", iu, "TPSG", x, y, z0, idrotm[idr], "ONLY");
484 // --------------------------------------------------------
485 // endcap cover (C, 0.86% X0)
486 // --------------------------------------------------------
491 pMC->Gsvolu("TCOV", "TUBE", idtmed[407], dm, 3);
495 pMC->Gspos("TCOV", 1, "TPSG", 0, 0, z0, 0, "ONLY");
496 // --------------------------------------------------------
497 // put the readout chambers into the TPC
498 // --------------------------------------------------------
506 AliMatrix(idrotm[55], theta1, phi1, theta2, phi2, theta3, phi3);
510 pMC->Gspos("TPSG", 1, "TPC ", 0, 0, z0, 0, "ONLY");
511 pMC->Gspos("TPSG", 2, "TPC ", 0, 0, -z0, idrotm[55], "ONLY");
512 // ---------------------------------------------------------
513 // outer gas insulation (CO2)
514 // ---------------------------------------------------------
515 dm[0] = 257.+0.09776;
516 dm[1] = 278.-0.25004;
519 pMC->Gsvolu("TPOI", "TUBE", idtmed[406], dm, 3);
521 pMC->Gspos("TPHV", 1, "TGAS", 0, 0, 0, 0, "ONLY");
522 pMC->Gspos("TGAS", 1, "TPC ", 0, 0, 0, 0, "ONLY");
523 pMC->Gspos("TPOI", 1, "TPC ", 0, 0, 0, 0, "ONLY");
525 pMC->Gspos("TPC ", 1, "ALIC", 0, 0, 0, 0, "ONLY");
526 // ======================================================
527 // all volumes below are positioned in ALIC
528 // ======================================================
529 // ------------------------------------------------------
530 // the last parts of the smaller wheel (TSWS)
531 // ------------------------------------------------------
538 pMC->Gsposp("TSWS", 10, "TPC ", 0, 0, z0, 0, "ONLY", dm, 3);
539 pMC->Gsposp("TSWS", 11, "TPC ", 0, 0, -z0, 0, "ONLY", dm, 3);
545 pMC->Gsposp("TSWS", 12, "TPC ", 0, 0, z0, 0, "ONLY", dm, 3);
546 pMC->Gsposp("TSWS", 13, "TPC ", 0, 0, -z0, 0, "ONLY", dm, 3);
547 // ----------------------------------------------------
548 // Inner vessel (PCON)
549 // This volume is to be positioned directly in ALIC
550 // ----------------------------------------------------
554 <img src="gif/spec_tpiv1.gif">
578 pMC->Gsvolu("TPIV", "PCON", idtmed[407], dm, 15);
579 // --------------------------------------------------------
580 // fill the inner vessel with CO2, (HV kDegrader)
581 // cone parts have different thickness
582 // than the central barrel, according to the TP
583 // --------------------------------------------------------
590 dm[3] = -(250.-0.2162);
591 dm[4] = (185.5-0.2126)*tana+0.2126;
610 dm[18] = (250.-0.2162);
611 dm[19] = (185.5-0.2126)*tana+0.2126;
614 pMC->Gsvolu("TPVD", "PCON", idtmed[406], dm, 21);
616 pMC->Gspos("TPVD", 1, "TPIV", 0, 0, 0, 0, "ONLY");
618 pMC->Gspos("TPIV", 1, "ALIC", 0, 0, 0, 0, "ONLY");
619 // ---------------------------------------------------
621 // ---------------------------------------------------
622 pMC->Gsord("TGAS", 6);
623 pMC->Gsord("TPSG", 6);
624 pMC->Gsord("TSGA", 3);
625 pMC->Gsord("TLGA", 3);
628 //_____________________________________________________________________________
629 void AliTPCv1::DrawDetector()
632 // Draw a shaded view of the Time Projection Chamber version 1
635 AliMC* pMC = AliMC::GetMC();
637 // Set everything unseen
638 pMC->Gsatt("*", "seen", -1);
640 // Set ALIC mother transparent
641 pMC->Gsatt("ALIC","SEEN",0);
643 // Set the volumes visible
644 pMC->Gsatt("TPC","SEEN",0);
645 pMC->Gsatt("TGAS","SEEN",0);
646 pMC->Gsatt("TPSG","SEEN",0);
647 pMC->Gsatt("TPHV","SEEN",1);
648 pMC->Gsatt("TRCS","SEEN",1);
649 pMC->Gsatt("TRCL","SEEN",1);
650 pMC->Gsatt("TSST","SEEN",1);
651 pMC->Gsatt("TLST","SEEN",1);
652 pMC->Gsatt("TSWS","SEEN",1);
653 pMC->Gsatt("TPW1","SEEN",1);
654 pMC->Gsatt("TPW2","SEEN",1);
655 pMC->Gsatt("TPW3","SEEN",1);
656 pMC->Gsatt("TPW4","SEEN",1);
657 pMC->Gsatt("TSPI","SEEN",1);
658 pMC->Gsatt("TSP1","SEEN",0);
659 pMC->Gsatt("TSPO","SEEN",1);
660 pMC->Gsatt("TSP2","SEEN",0);
661 pMC->Gsatt("TSWH","SEEN",1);
662 pMC->Gsatt("TSW1","SEEN",1);
663 pMC->Gsatt("TCOV","SEEN",0);
664 pMC->Gsatt("TPOI","SEEN",1);
665 pMC->Gsatt("TPIV","SEEN",1);
666 pMC->Gsatt("TPVD","SEEN",1);
668 pMC->Gdopt("hide", "on");
669 pMC->Gdopt("shad", "on");
670 pMC->Gsatt("*", "fill", 7);
671 pMC->SetClipBox(".");
672 pMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
674 pMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .025, .025);
675 pMC->Gdhead(1111, "Time Projection Chamber");
676 pMC->Gdman(18, 4, "MAN");
677 pMC->Gdopt("hide","off");
680 //_____________________________________________________________________________
681 void AliTPCv1::CreateMaterials()
684 // Define materials for Time Projection Chamber
686 AliTPC::CreateMaterials();
689 //_____________________________________________________________________________
690 void AliTPCv1::Init()
693 // Initialises TPC detector after it has been created
695 AliMC* pMC=AliMC::GetMC();
696 fIdSens1=pMC->VolId("TLST");
697 fIdSens2=pMC->VolId("TSST");
699 printf("TPC version 1 initialized\n");
702 //_____________________________________________________________________________
703 void AliTPCv1::StepManager()
706 // Called at every step in the Time Projection Chamber
711 TClonesArray &lhits = *fHits;
712 AliMC* pMC=AliMC::GetMC();
714 if(pMC->TrackCharge() && pMC->TrackEntering()) {
716 // Only entering charged tracks
717 if((id=pMC->CurrentVol(0, copy))==fIdSens1) {
719 id=pMC->CurrentVolOff(1,0,copy);
721 } else if(id==fIdSens2) {
723 id=pMC->CurrentVolOff(1,0,copy);
726 pMC->TrackPosition(hits);
728 new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);