1 ///////////////////////////////////////////////////////////////////////////////
3 // Time Projection Chamber version 1 -- detailed TPC and fast simulation //
7 <img src="gif/AliTPCv1Class.gif">
12 ///////////////////////////////////////////////////////////////////////////////
15 #include <TGeometry.h>
27 #include "AliTPCParam.h"
32 //_____________________________________________________________________________
33 AliTPCv1::AliTPCv1(const char *name, const char *title)
34 :AliTPC(name, title) {
36 // Standard constructor for Time Projection Chamber
41 //_____________________________________________________________________________
42 void AliTPCv1::CreateGeometry()
45 // Creates geometry for Time Projection Chamber version 1
46 // Detailed geometry -- Fast simulation
51 <img src="gif/AliTPCv1.gif">
56 <img src="gif/AliTPCv1Tree.gif">
60 AliMC* pMC = AliMC::GetMC();
62 Int_t *idtmed = gAlice->Idtmed();
65 AliTPCParam * fTPCParam = &(fDigParam->GetParam());
67 Float_t tana, rlsl, wlsl, rssl, rlsu, wssl, wlsu,
68 rssu, wssu, alpha, x, y, z, sec_thick;
70 Float_t r1, r2, x1, z0, z1, x2, theta1, theta2, theta3, dm[21];
81 Float_t thu, opu, phi1, phi2, phi3;
83 // ----------------------------------------------------
84 // FIELD CAGE WITH ENDCAPS - CARBON FIBER
85 // THIS IS ALSO A TPC MOTHER VOLUME
86 // ----------------------------------------------------
91 pMC->Gsvolu("TPC ", "TUBE", idtmed[407], dm, 3);
93 // -------------------------------------------------------
94 // drift gas Ne/CO2 (90/10 volume) - nonsensitive
95 // field cage thickness = 0.52% X0
96 // ----------------------------------------------------
100 <img src="gif/spec_tgas1.gif">
108 pMC->Gsvolu("TGAS", "TUBE", idtmed[402], dm, 3);
110 // ------------------------------------------------------
111 // "side" gas volume (the same as drift gas),
112 // here the readout chambers are positioned
113 // ------------------------------------------------------
117 <img src="gif/spec_tpsg1.gif">
124 pMC->Gsvolu("TPSG", "TUBE", idtmed[401], dm, 3);
125 // ------------------------------------------------------
126 // HV midplane - 20 microns of mylar
127 // -----------------------------------------------------
130 pMC->Gsvolu("TPHV", "TUBE", idtmed[405], dm, 3);
132 // ====================================================
133 // lower and upper readout chambers
134 // ====================================================
135 // sectors opening angles in degrees
136 // ---------------------------------------------------
139 thl = TMath::Tan(opl * .5 * kDegrad);
140 thu = TMath::Tan(opu * .5 * kDegrad);
141 // ---------------------------------------------------
142 // S and L-sectors radii
143 // ---------------------------------------------------
148 // --------------------------------------------------
150 // --------------------------------------------------
155 // ---------------------------------------------------
156 // Sector thickness 25% of X0 (Al)
157 // ---------------------------------------------------
159 // ---------------------------------------------------
160 // S-sectors (lower sectors)
161 // ---------------------------------------------------
164 dm[2] = sec_thick * .5;
165 dm[3] = (rssu - rssl) * .5;
171 <img src="gif/spec_trcs1.gif">
176 pMC->Gsvolu("TRCS", "TRD1", idtmed[399], dm, 4);
177 // -----------------------------------------------------
178 // S-sectors --> "gas sectors"
179 // -----------------------------------------------------
183 <img src="gif/spec_tsga1.gif">
187 dm[2] = (250.-0.001)/2.;
188 pMC->Gsvolu("TSGA", "TRD1", idtmed[402], dm, 4);
189 // ---------------------------------------------------
190 // L-sectors (upper sectors)
191 // ---------------------------------------------------
194 dm[2] = sec_thick * .5;
195 dm[3] = (rlsu - rlsl) * .5;
199 pMC->Gsvolu("TRCL", "TRD1", idtmed[399], dm, 4);
200 // -----------------------------------------------------
201 // L-sectors - "gas sectors"
202 // -----------------------------------------------------
203 dm[2] = (250.-0.001)/2.;
204 pMC->Gsvolu("TLGA", "TRD1", idtmed[402], dm, 4);
205 // -----------------------------------------------------
206 // thin sensitive strips (100 microns) placed at a center
207 // of each pad row in the "drift gas sector"
208 // -----------------------------------------------------
209 pMC->Gsvolu("TSST", "TRD1", idtmed[403], dm, 0);
212 z0 = rssl + (rssu - rssl) * .5;
214 for (iss = 0; iss < fTPCParam->GetNRowLow(); ++iss) {
215 r1 = fTPCParam->GetPadRowRadiiLow(iss);
216 r2 = r1 + dm[3] * 2.;
217 dm[0] = r1 * thl - 2.63;
218 dm[1] = r2 * thl - 2.63;
222 pMC->Gsposp("TSST", iss+1, "TSGA", 0, 0, zz, 0, "ONLY", dm, 4);
224 // -----------------------------------------------------
225 // thin sensitive strips (100 microns) placed at a center
226 // of each pad row in the "drift gas sector"
227 // -----------------------------------------------------
228 pMC->Gsvolu("TLST", "TRD1", idtmed[403], dm, 0);
230 z0 = rlsl+ (rlsu - rlsl) * .5;
232 for (ils = 0; ils < fTPCParam->GetNRowUp(); ++ils) {
233 r1 = fTPCParam->GetPadRowRadiiUp(ils);
234 r2 = r1 + dm[3] * 2.;
235 dm[0] = r1 * thu - 2.63;
236 dm[1] = r2 * thu - 2.63;
238 zz = -z0 + r1 +dm[3];
240 pMC->Gsposp("TLST", ils+1, "TLGA", 0, 0, zz, 0, "ONLY", dm, 4);
242 // ------------------------------------------------
243 // positioning of lower sectors (1-12)*2
244 // rotation matrices 1-12
245 // ------------------------------------------------
247 z1 = -z_side + sec_thick * .5;
249 for (il = 0; il < 12; ++il) {
250 phi1 = il * opl + 270;
261 AliMatrix(idrotm[idr], theta1, phi1, theta2, phi2, theta3, phi3);
263 alpha = il * opl * kDegrad;
264 x = x0l * TMath::Cos(alpha);
265 y = x0l * TMath::Sin(alpha);
267 pMC->Gspos("TSGA", il+1, "TGAS", x, y, z, idrotm[idr], "ONLY");
268 pMC->Gspos("TSGA", il+13,"TGAS", x, y, -z, idrotm[idr], "ONLY");
269 pMC->Gspos("TRCS", il+1, "TPSG", x, y, z1, idrotm[idr], "ONLY");
272 // ----------------------------------------------------
273 // positioning of upper sectors (1-24)*2
274 // rotation matrices 13-36
275 // ----------------------------------------------------
276 for (iu = 1; iu <= 24; ++iu) {
277 phi1 = (iu - 1) * opu + 270.;
284 phi3 = (iu - 1) * opu;
288 AliMatrix(idrotm[idr], theta1, phi1, theta2, phi2, theta3, phi3);
290 alpha = (iu - 1) * opu * kDegrad;
291 x = x0u * TMath::Cos(alpha);
292 y = x0u * TMath::Sin(alpha);
294 pMC->Gspos("TLGA", iu, "TGAS", x, y, z, idrotm[idr], "ONLY");
295 pMC->Gspos("TLGA", iu+24, "TGAS", x, y, -z, idrotm[idr], "ONLY");
297 pMC->Gspos("TRCL", iu, "TPSG", x, y, z1, idrotm[idr], "ONLY");
299 // --------------------------------------------------------
300 // Spoke wheel structures
301 // --------------------------------------------------------
302 pMC->Gsvolu("TSWS", "TUBE", idtmed[399], dm, 0);
310 pMC->Gsposp("TSWS", 1, "TPSG", 0, 0, z0, 0, "ONLY", dm, 3);
315 pMC->Gsposp("TSWS", 2, "TPSG", 0, 0, z0, 0, "ONLY", dm, 3);
320 pMC->Gsposp("TSWS", 3, "TPSG", 0, 0, z0, 0, "ONLY", dm, 3);
322 // -------------------------------------------------------
323 // this volumes are to avoid overlaping
324 // -------------------------------------------------------
330 pMC->Gsposp("TSWS", 4, "TPC ", 0, 0, z0, 0, "ONLY", dm, 3);
331 pMC->Gsposp("TSWS", 5, "TPC ", 0, 0, -z0, 0, "ONLY", dm, 3);
335 pMC->Gsposp("TSWS", 6, "TPC ", 0, 0, z0, 0, "ONLY", dm, 3);
336 pMC->Gsposp("TSWS", 7, "TPC ", 0, 0, -z0, 0, "ONLY", dm, 3);
339 dm[1] = 257.+0.09776;
344 pMC->Gsposp("TSWS", 8, "TPC ", 0, 0, z0, 0, "ONLY", dm, 3);
345 pMC->Gsposp("TSWS", 9, "TPC ", 0, 0, -z0, 0, "ONLY", dm, 3);
346 // ==========================================================
348 // ==========================================================
349 // ----------------------------------------------------------
350 // Large wheel -> positioned in the TPC
351 // ----------------------------------------------------------
352 dm[0] = 257.+0.09776;
355 pMC->Gsvolu("TPW1", "TUBE", idtmed[399], dm, 3);
361 pMC->Gsvolu("TPW2", "TUBE", idtmed[498], dm, 3);
363 pMC->Gspos("TPW2", 1, "TPW1", 0, 0, 0, 0, "ONLY");
365 pMC->Gspos("TPW1", 1, "TPC ", 0, 0, z0, 0, "ONLY");
366 pMC->Gspos("TPW1", 2, "TPC ", 0, 0, -z0, 0, "ONLY");
367 // -----------------------------------------------------------
368 // Small wheel -> positioned in the TPSG
369 // -----------------------------------------------------------
374 pMC->Gsvolu("TPW3", "TUBE", idtmed[399], dm, 3);
380 pMC->Gsvolu("TPW4", "TUBE", idtmed[401], dm, 3);
382 pMC->Gspos("TPW4", 1, "TPW3", 0, 0, 0, 0, "ONLY");
386 pMC->Gspos("TPW3", 1, "TPSG", 0, 0, z0, 0, "ONLY");
387 // ---------------------------------------------------------
388 // spokes, inner and outer, also the inner ring
389 // ---------------------------------------------------------
393 <img src="gif/spec_tspo1.gif">
397 dm[0] = 0.5*(135.9-82.1);
403 pMC->Gsvolu("TSPI", "BOX ", idtmed[399], dm, 3);
408 pMC->Gsvolu("TSP1", "BOX ", idtmed[498], dm, 3);
410 pMC->Gspos("TSP1", 1, "TSPI", 0, 0, 0, 0, "ONLY");
412 dm[0] = 0.5*(256.9-142.1);
418 pMC->Gsvolu("TSPO", "BOX ", idtmed[399], dm, 3);
423 pMC->Gsvolu("TSP2", "BOX ", idtmed[498], dm, 3);
425 pMC->Gspos("TSP2", 1, "TSPO", 0, 0, 0, 0, "ONLY");
426 // --------------------------------------------------------
431 pMC->Gsvolu("TSWH", "TUBE", idtmed[399], dm, 3);
437 pMC->Gsvolu("TSW1", "TUBE", idtmed[498], dm, 3);
439 pMC->Gspos("TSW1", 1, "TSWH", 0, 0, 0, 0, "ONLY");
441 z0 = z_side - .16168 - 2.;
442 // --------------------------------------------------------
443 pMC->Gspos("TSWH", 1, "TPSG", 0, 0, z0, 0, "ONLY");
444 // -------------------------------------------------------
445 // posiioning of the inner spokes
446 // -------------------------------------------------------
447 for (il = 1; il <= 6; ++il) {
448 phi1 = opl * .5 + (il - 1) * 2. * opl;
450 phi2 = opl * .5 + 90. + (il - 1) * 2. * opl;
458 alpha = phi1 * kDegrad;
459 x = x1 * TMath::Cos(alpha);
460 y = x1 * TMath::Sin(alpha);
464 AliMatrix(idrotm[idr], theta1, phi1, theta2, phi2, theta3, phi3);
465 pMC->Gspos("TSPI", il, "TPSG", x, y, z0, idrotm[idr], "ONLY");
468 for (iu = 1; iu <= 12; ++iu) {
469 phi1 = opu * .5 + (iu - 1) * 2. * opu;
471 phi2 = opu * .5 + 90. + (iu - 1) * 2. * opu;
479 alpha = phi1 * kDegrad;
480 x = x2 * TMath::Cos(alpha);
481 y = x2 * TMath::Sin(alpha);
485 AliMatrix(idrotm[idr], theta1, phi1, theta2, phi2, theta3, phi3);
486 pMC->Gspos("TSPO", iu, "TPSG", x, y, z0, idrotm[idr], "ONLY");
488 // --------------------------------------------------------
489 // endcap cover (C, 0.86% X0)
490 // --------------------------------------------------------
495 pMC->Gsvolu("TCOV", "TUBE", idtmed[407], dm, 3);
499 pMC->Gspos("TCOV", 1, "TPSG", 0, 0, z0, 0, "ONLY");
500 // --------------------------------------------------------
501 // put the readout chambers into the TPC
502 // --------------------------------------------------------
510 AliMatrix(idrotm[55], theta1, phi1, theta2, phi2, theta3, phi3);
514 pMC->Gspos("TPSG", 1, "TPC ", 0, 0, z0, 0, "ONLY");
515 pMC->Gspos("TPSG", 2, "TPC ", 0, 0, -z0, idrotm[55], "ONLY");
516 // ---------------------------------------------------------
517 // outer gas insulation (CO2)
518 // ---------------------------------------------------------
519 dm[0] = 257.+0.09776;
520 dm[1] = 278.-0.25004;
523 pMC->Gsvolu("TPOI", "TUBE", idtmed[406], dm, 3);
525 pMC->Gspos("TPHV", 1, "TGAS", 0, 0, 0, 0, "ONLY");
526 pMC->Gspos("TGAS", 1, "TPC ", 0, 0, 0, 0, "ONLY");
527 pMC->Gspos("TPOI", 1, "TPC ", 0, 0, 0, 0, "ONLY");
529 pMC->Gspos("TPC ", 1, "ALIC", 0, 0, 0, 0, "ONLY");
530 // ======================================================
531 // all volumes below are positioned in ALIC
532 // ======================================================
533 // ------------------------------------------------------
534 // the last parts of the smaller wheel (TSWS)
535 // ------------------------------------------------------
542 pMC->Gsposp("TSWS", 10, "TPC ", 0, 0, z0, 0, "ONLY", dm, 3);
543 pMC->Gsposp("TSWS", 11, "TPC ", 0, 0, -z0, 0, "ONLY", dm, 3);
549 pMC->Gsposp("TSWS", 12, "TPC ", 0, 0, z0, 0, "ONLY", dm, 3);
550 pMC->Gsposp("TSWS", 13, "TPC ", 0, 0, -z0, 0, "ONLY", dm, 3);
551 // ----------------------------------------------------
552 // Inner vessel (PCON)
553 // This volume is to be positioned directly in ALIC
554 // ----------------------------------------------------
558 <img src="gif/spec_tpiv1.gif">
582 pMC->Gsvolu("TPIV", "PCON", idtmed[407], dm, 15);
583 // --------------------------------------------------------
584 // fill the inner vessel with CO2, (HV kDegrader)
585 // cone parts have different thickness
586 // than the central barrel, according to the TP
587 // --------------------------------------------------------
594 dm[3] = -(250.-0.2162);
595 dm[4] = (185.5-0.2126)*tana+0.2126;
614 dm[18] = (250.-0.2162);
615 dm[19] = (185.5-0.2126)*tana+0.2126;
618 pMC->Gsvolu("TPVD", "PCON", idtmed[406], dm, 21);
620 pMC->Gspos("TPVD", 1, "TPIV", 0, 0, 0, 0, "ONLY");
622 pMC->Gspos("TPIV", 1, "ALIC", 0, 0, 0, 0, "ONLY");
623 // ---------------------------------------------------
625 // ---------------------------------------------------
626 pMC->Gsord("TGAS", 6);
627 pMC->Gsord("TPSG", 6);
628 pMC->Gsord("TSGA", 3);
629 pMC->Gsord("TLGA", 3);
632 //_____________________________________________________________________________
633 void AliTPCv1::DrawDetector()
636 // Draw a shaded view of the Time Projection Chamber version 1
639 AliMC* pMC = AliMC::GetMC();
641 // Set everything unseen
642 pMC->Gsatt("*", "seen", -1);
644 // Set ALIC mother transparent
645 pMC->Gsatt("ALIC","SEEN",0);
647 // Set the volumes visible
648 pMC->Gsatt("TPC","SEEN",0);
649 pMC->Gsatt("TGAS","SEEN",0);
650 pMC->Gsatt("TPSG","SEEN",0);
651 pMC->Gsatt("TPHV","SEEN",1);
652 pMC->Gsatt("TRCS","SEEN",1);
653 pMC->Gsatt("TRCL","SEEN",1);
654 pMC->Gsatt("TSST","SEEN",1);
655 pMC->Gsatt("TLST","SEEN",1);
656 pMC->Gsatt("TSWS","SEEN",1);
657 pMC->Gsatt("TPW1","SEEN",1);
658 pMC->Gsatt("TPW2","SEEN",1);
659 pMC->Gsatt("TPW3","SEEN",1);
660 pMC->Gsatt("TPW4","SEEN",1);
661 pMC->Gsatt("TSPI","SEEN",1);
662 pMC->Gsatt("TSP1","SEEN",0);
663 pMC->Gsatt("TSPO","SEEN",1);
664 pMC->Gsatt("TSP2","SEEN",0);
665 pMC->Gsatt("TSWH","SEEN",1);
666 pMC->Gsatt("TSW1","SEEN",1);
667 pMC->Gsatt("TCOV","SEEN",0);
668 pMC->Gsatt("TPOI","SEEN",1);
669 pMC->Gsatt("TPIV","SEEN",1);
670 pMC->Gsatt("TPVD","SEEN",1);
672 pMC->Gdopt("hide", "on");
673 pMC->Gdopt("shad", "on");
674 pMC->Gsatt("*", "fill", 7);
675 pMC->SetClipBox(".");
676 pMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
678 pMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .025, .025);
679 pMC->Gdhead(1111, "Time Projection Chamber");
680 pMC->Gdman(18, 4, "MAN");
681 pMC->Gdopt("hide","off");
684 //_____________________________________________________________________________
685 void AliTPCv1::CreateMaterials()
688 // Define materials for Time Projection Chamber
690 AliTPC::CreateMaterials();
693 //_____________________________________________________________________________
694 void AliTPCv1::Init()
697 // Initialises TPC detector after it has been created
699 AliMC* pMC=AliMC::GetMC();
700 fIdSens1=pMC->VolId("TLST");
701 fIdSens2=pMC->VolId("TSST");
703 printf("TPC version 1 initialized\n");
706 //_____________________________________________________________________________
707 void AliTPCv1::StepManager()
710 // Called at every step in the Time Projection Chamber
715 TClonesArray &lhits = *fHits;
716 AliMC* pMC=AliMC::GetMC();
718 if(pMC->TrackCharge() && pMC->TrackEntering()) {
720 // Only entering charged tracks
721 if((id=pMC->CurrentVol(0, copy))==fIdSens1) {
723 id=pMC->CurrentVolOff(1,0,copy);
725 } else if(id==fIdSens2) {
727 id=pMC->CurrentVolOff(1,0,copy);
730 pMC->TrackPosition(hits);
732 new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);