1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 Revision 1.13.8.2 2000/04/10 08:33:44 kowal2
20 Updated readout chambers
22 Revision 1.13.8.1 2000/04/10 07:56:53 kowal2
23 Not used anymore - removed
25 Revision 1.13 1999/11/04 17:28:06 fca
26 Correct barrel part of HV Degrader
28 Revision 1.12 1999/10/08 06:27:23 fca
29 Corrected bug in the HV degrader geometry, thanks to G.Tabary
31 Revision 1.11 1999/10/04 13:39:54 fca
32 Correct array index problem
34 Revision 1.10 1999/09/29 09:24:34 fca
35 Introduction of the Copyright and cvs Log
39 ///////////////////////////////////////////////////////////////////////////////
41 // Time Projection Chamber version 0 -- "coarse" TPC //
45 <img src="picts/AliTPCv0Class.gif">
50 ///////////////////////////////////////////////////////////////////////////////
53 #include <TGeometry.h>
63 #include "AliTPCParam.h"
64 #include "AliTPCDigitsArray.h"
68 //_____________________________________________________________________________
69 AliTPCv0::AliTPCv0(const char *name, const char *title)
73 // Standard creator for TPC version 0
77 //_____________________________________________________________________________
78 void AliTPCv0::CreateGeometry()
81 // Creation of the TPC coarse geometry (version 0)
82 // Origin Marek Kowalski Cracow
86 <img src="picts/AliTPCv0.gif">
91 <img src="picts/AliTPCv0Tree.gif">
96 Int_t *idtmed = fIdtmed->GetArray();
104 // ----------------------------------------------------
105 // FIELD CAGE WITH ENDCAPS - G10
106 // THIS IS ALSO A TPC MOTHER VOLUME
107 // ----------------------------------------------------
113 gMC->Gsvolu("TPC ", "TUBE", idtmed[8], dm, 3);
115 //-----------------------------------------------------
116 // Endcap cover c-fibre 0.86% X0
117 //-----------------------------------------------------
123 gMC->Gsvolu("TPEC","TUBE",idtmed[10],dm,3);
125 //-----------------------------------------------------
126 // Drift gas , leave 2 cm at the outer radius
128 //-----------------------------------------------------
134 gMC->Gsvolu("TGAS", "TUBE", idtmed[3], dm, 3);
137 //------------------------------------------------------
138 // membrane holder - carbon fiber
139 //------------------------------------------------------
142 gMC->Gsvolu("TPMH","TUBE",idtmed[6],dm,0);
148 gMC->Gsposp("TPMH",1,"TGAS",0.,0.,0.,0,"ONLY",dm,3);
154 gMC->Gsposp("TPMH",2,"TGAS",0.,0.,0.,0,"ONLY",dm,3);
156 //----------------------------------------------------------
157 // HV membrane - 25 microns of mylar
158 //----------------------------------------------------------
164 gMC->Gsvolu("TPHV","TUBE",idtmed[5],dm,3);
166 gMC->Gspos("TPHV",1,"TGAS",0.,0.,0.,0,"ONLY");
168 gMC->Gspos("TGAS",1,"TPC ",0.,0.,0.,0,"ONLY");
170 //----------------------------------------------------------
171 // "side" gas volume, the same as the drift gas
172 // the readout chambers are placed there.
173 //----------------------------------------------------------
177 dm[2] = 0.5*(275. - 250.);
179 gMC->Gsvolu("TPSG", "TUBE", idtmed[2], dm, 3);
181 Float_t z_side = dm[2]; // 1/2 of the side gas thickness
183 //-----------------------------------------------------------
184 // Readout chambers , 25% of X0, I use Al as the material
185 //-----------------------------------------------------------
187 Float_t InnerOpenAngle = fTPCParam->GetInnerAngle();
188 Float_t OuterOpenAngle = fTPCParam->GetOuterAngle();
190 Float_t InnerAngleShift = fTPCParam->GetInnerAngleShift();
191 Float_t OuterAngleShift = fTPCParam->GetOuterAngleShift();
194 Int_t nInnerSector = fTPCParam->GetNInnerSector()/2;
195 Int_t nOuterSector = fTPCParam->GetNOuterSector()/2;
198 Float_t InSecLowEdge = fTPCParam->GetInnerRadiusLow();
199 Float_t InSecUpEdge = fTPCParam->GetInnerRadiusUp();
201 Float_t OuSecLowEdge = fTPCParam->GetOuterRadiusLow();
202 Float_t OuSecUpEdge = fTPCParam->GetOuterRadiusUp();
204 Float_t SecThick = 2.225; // Al
209 Float_t LowEdge = fTPCParam->GetInnerFrameSpace();
211 dm[0] = InSecLowEdge*TMath::Tan(0.5*InnerOpenAngle)-LowEdge;
212 dm[1] = InSecUpEdge*TMath::Tan(0.5*InnerOpenAngle)-LowEdge;
214 dm[3] = 0.5*(InSecUpEdge-InSecLowEdge);
216 Float_t xCenterS = InSecLowEdge+dm[3];
218 gMC->Gsvolu("TRCS", "TRD1", idtmed[0], dm, 4);
222 Float_t UpEdge = fTPCParam->GetOuterFrameSpace();
224 dm[0] = OuSecLowEdge*TMath::Tan(0.5*OuterOpenAngle)-UpEdge;
225 dm[1] = OuSecUpEdge*TMath::Tan(0.5*OuterOpenAngle)-UpEdge;
227 dm[3] = 0.5*(OuSecUpEdge-OuSecLowEdge);
229 Float_t xCenterL = OuSecLowEdge+dm[3];
231 gMC->Gsvolu("TRCL", "TRD1", idtmed[0], dm, 4);
233 Float_t z1 = -z_side + SecThick*0.5;
235 //------------------------------------------------------------------
236 // Positioning of the S-sector readout chambers
237 //------------------------------------------------------------------
240 Float_t theta1,theta2,theta3;
241 Float_t phi1,phi2,phi3;
245 for(ns=0;ns<nInnerSector;ns++){
247 phi1 = ns * InnerOpenAngle + 270.*kDegrad + InnerAngleShift;
248 phi1 *= kRaddeg; // in degrees
250 phi1 = (Float_t)TMath::Nint(phi1);
252 if (phi1 > 360.) phi1 -= 360.;
257 phi3 = ns * InnerOpenAngle + InnerAngleShift;
258 phi3 *= kRaddeg; // in degrees
260 phi3 = (Float_t)TMath::Nint(phi3);
262 if(phi3 > 360.) phi3 -= 360.;
266 alpha = phi3*kDegrad;
268 x = xCenterS * TMath::Cos(alpha);
269 y = xCenterS * TMath::Sin(alpha);
271 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
273 gMC->Gspos("TRCS", ns+1, "TPSG", x, y, z1, idrotm[nRotMat], "ONLY");
279 //-------------------------------------------------------------------
280 // Positioning of the L-sectors readout chambers
281 //-------------------------------------------------------------------
283 for(ns=0;ns<nOuterSector;ns++){
284 phi1 = ns * OuterOpenAngle + 270.*kDegrad + OuterAngleShift;
285 phi1 *= kRaddeg; // in degrees
287 phi1 = (Float_t)TMath::Nint(phi1);
290 if (phi1 > 360.) phi1 -= 360.;
295 phi3 = ns * OuterOpenAngle+OuterAngleShift;
296 phi3 *= kRaddeg; // in degrees
298 phi3 = (Float_t)TMath::Nint(phi3);
301 if(phi3 > 360.) phi3 -= 360.;
305 alpha = phi3*kDegrad;
307 x = xCenterL * TMath::Cos(alpha);
308 y = xCenterL * TMath::Sin(alpha);
310 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
313 gMC->Gspos("TRCL", ns+1, "TPSG", x, y, z1, idrotm[nRotMat], "ONLY");
319 Float_t z0 = z_side - 0.95;
321 gMC->Gspos("TPEC",1,"TPSG",0.,0.,z0,0,"ONLY");
323 // ==========================================================
325 // ==========================================================
328 // auxilary structures
332 gMC->Gsvolu("TPWI","TUBE",idtmed[24],dm,0); // "air"
334 // ----------------------------------------------------------
335 // Large wheel -> positioned in the TPC
336 // ----------------------------------------------------------
339 z0 = 263.5; // TPC length - 1/2 spoke wheel width
345 gMC->Gsvolu("TPWL", "TUBE", idtmed[0], dm, 3);
351 gMC->Gsposp("TPWI",1,"TPWL",0.,0.,0.,0,"ONLY",dm,3);
353 gMC->Gspos("TPWL", 1, "TPC ", 0, 0, z0, 0, "ONLY");
354 gMC->Gspos("TPWL", 2, "TPC ", 0, 0, -z0, 0, "ONLY");
357 // Outer vessel + CO2 HV degrader
364 gMC->Gsvolu("TPCO","TUBE",idtmed[12],dm,3);
369 gMC->Gsvolu("TPOV","TUBE",idtmed[10],dm,3);
371 gMC->Gspos("TPOV",1,"TPCO",0.,0.,0.,0,"ONLY");
380 gMC->Gsvolu("TPG1","TUBE",idtmed[8],dm,3);
381 gMC->Gspos("TPG1",1,"TPCO",0.,0.,251.,0,"ONLY");
382 gMC->Gspos("TPG1",2,"TPCO",0.,0.,-251.,0,"ONLY");
384 gMC->Gspos("TPCO",1,"TPC ",0.,0.,0.,0,"ONLY");
387 //----------------------------------------------------------
388 // Small wheel -> positioned in "side gas
389 //----------------------------------------------------------
395 gMC->Gsvolu("TPWS", "TUBE", idtmed[0], dm, 3);
401 gMC->Gsvolu("TPW1", "TUBE", idtmed[2], dm, 3);
403 gMC->Gspos("TPW1", 1, "TPWS", 0., 0., 0., 0, "ONLY");
405 z0 = 1.; // spoke wheel is shifted w.r.t. center of the "side gas"
407 gMC->Gspos("TPWS", 1, "TPSG", 0, 0, z0, 0, "ONLY");
416 gMC->Gsvolu("TPS1","TUBE",idtmed[0],dm,3);
420 gMC->Gsvolu("TPS2","TUBE",idtmed[24],dm,3);
422 gMC->Gspos("TPS2",1,"TPS1",0.,0.,0.,0,"ONLY");
426 gMC->Gspos("TPS1",1,"TPC ",0.,0.,z0,0,"ONLY");
427 gMC->Gspos("TPS1",2,"TPC ",0.,0.,-z0,0,"ONLY");
435 gMC->Gsvolu("TPG2","TUBE",idtmed[8],dm,3);
439 gMC->Gspos("TPG2",1,"TPC ",0.,0.,z0,0,"ONLY");
440 gMC->Gspos("TPG2",2,"TPC ",0.,0.,-z0,0,"ONLY");
443 //---------------------------------------------------------
444 // central wheel 6 (radial direction) x 4 (along z) cm2
445 //---------------------------------------------------------
451 gMC->Gsvolu("TPWC","TUBE",idtmed[0],dm,3);
457 gMC->Gsposp("TPWI",2,"TPWC",0.,0.,0.,0,"ONLY",dm,3);
459 z0 = z_side - 1.9 - 2.;
461 gMC->Gspos("TPWC",1,"TPSG",0.,0.,z0,0,"ONLY");
465 gMC->Gsvolu("TPSE","BOX ",idtmed[24],dm,0); // "empty" part of the spoke
468 //---------------------------------------------------------
469 // inner spokes (nSectorInner)
470 //---------------------------------------------------------
472 dm[0] = 0.5*(139.9-82.1);
476 Float_t x1 = dm[0]+82.;
478 gMC->Gsvolu("TPSI","BOX",idtmed[0],dm,3);
483 gMC->Gsposp("TPSE",1,"TPSI",0.,0.,0.,0,"ONLY",dm,3);
485 for(ns=0;ns<nInnerSector;ns++){
487 phi1 = 0.5*InnerOpenAngle + ns*InnerOpenAngle + InnerAngleShift;
491 phi1 = (Float_t)TMath::Nint(phi1);
494 if(phi2>360.) phi2 -= 360.;
499 alpha = phi1 * kDegrad;
500 x = x1 * TMath::Cos(alpha);
501 y = x1 * TMath::Sin(alpha);
503 AliMatrix(idrotm[nRotMat],theta1,phi1,theta2,phi2,theta3,phi3);
505 gMC->Gspos("TPSI",ns+1,"TPSG",x,y,z0,idrotm[nRotMat],"ONLY");
511 //-------------------------------------------------------------
512 // outer spokes (nSectorOuter)
513 //-------------------------------------------------------------
515 dm[0] = 0.5*(257.9-146.1);
521 gMC->Gsvolu("TPSO","BOX ",idtmed[0],dm,3);
526 gMC->Gsposp("TPSE",2,"TPSO",0.,0.,0.,0,"ONLY",dm,3);
528 for(ns=0;ns<nOuterSector;ns++){
530 phi1 = 0.5*OuterOpenAngle + ns*OuterOpenAngle + OuterAngleShift;
534 phi1 = (Float_t)TMath::Nint(phi1);
537 if(phi2>360.) phi2 -= 360.;
542 alpha = phi1 * kDegrad;
543 x = x1 * TMath::Cos(alpha);
544 y = x1 * TMath::Sin(alpha);
546 AliMatrix(idrotm[nRotMat],theta1,phi1,theta2,phi2,theta3,phi3);
548 gMC->Gspos("TPSO",ns+1,"TPSG",x,y,z0,idrotm[nRotMat],"ONLY");
556 // --------------------------------------------------------
557 // put the readout chambers into the TPC
558 // --------------------------------------------------------
567 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
571 gMC->Gspos("TPSG", 1, "TPC ", 0, 0, z0, 0, "ONLY");
572 gMC->Gspos("TPSG", 2, "TPC ", 0, 0, -z0, idrotm[nRotMat], "ONLY");
574 gMC->Gspos("TPC ", 1, "ALIC", 0, 0, 0, 0, "ONLY");
576 //----------------------------------------------------
577 // Inner vessel and HV degrader
578 //----------------------------------------------------
600 gMC->Gsvolu("TPVD", "PCON", idtmed[12], dm, 15); // CO2
617 gMC->Gsvolu("TIVC","PCON",idtmed[11],dm,9); // C-fibre
619 gMC->Gspos("TIVC",1,"TPVD",0.,0.,0.,0,"ONLY");
620 gMC->Gspos("TIVC",2,"TPVD",0.,0.,0.,idrotm[nRotMat],"ONLY");
628 gMC->Gsvolu("TIVB","TUBE",idtmed[9],dm,3);
630 gMC->Gspos("TIVB",1,"TPVD",0.,0.,0.,0,"ONLY");
632 gMC->Gspos("TPVD",1,"ALIC",0.,0.,0.,0,"ONLY");
638 // ---------------------------------------------------
640 // ---------------------------------------------------
641 gMC->Gsord("TPSG", 6);
646 //_____________________________________________________________________________
647 void AliTPCv0::CreateMaterials()
650 // Define materials for the TPC
652 AliTPC::CreateMaterials();
655 //_____________________________________________________________________________
656 void AliTPCv0::DrawDetector()
659 // Draw a shaded view of the Time Projection Chamber version 0
662 // Set everything unseen
663 gMC->Gsatt("*", "seen", -1);
665 // Set ALIC mother transparent
666 gMC->Gsatt("ALIC","SEEN",0);
668 // Set the volumes visible
669 gMC->Gsatt("TPC","SEEN",0);
670 gMC->Gsatt("TGAS","SEEN",0);
671 gMC->Gsatt("TPSG","SEEN",0);
672 gMC->Gsatt("TPHV","SEEN",1);
673 gMC->Gsatt("TPMH","SEEN",1);
674 gMC->Gsatt("TPEC","SEEN",0);
675 gMC->Gsatt("TRCS","SEEN",1);
676 gMC->Gsatt("TRCL","SEEN",1);
677 gMC->Gsatt("TPWL","SEEN",1);
678 gMC->Gsatt("TPWI","SEEN",1);
679 gMC->Gsatt("TPWS","SEEN",1);
680 gMC->Gsatt("TPW1","SEEN",1);
681 gMC->Gsatt("TPS1","SEEN",1);
682 gMC->Gsatt("TPS2","SEEN",1);
683 gMC->Gsatt("TPG1","SEEN",1);
684 gMC->Gsatt("TPG2","SEEN",1);
685 gMC->Gsatt("TPWC","SEEN",1);
686 gMC->Gsatt("TPSI","SEEN",1);
687 gMC->Gsatt("TPSO","SEEN",1);
688 gMC->Gsatt("TPCO","SEEN",1);
689 gMC->Gsatt("TPOV","SEEN",1);
690 gMC->Gsatt("TPVD","SEEN",1);
692 gMC->Gdopt("hide", "on");
693 gMC->Gdopt("shad", "on");
694 gMC->Gsatt("*", "fill", 7);
695 gMC->SetClipBox(".");
696 gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
698 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .025, .025);
699 gMC->Gdhead(1111, "Time Projection Chamber");
700 gMC->Gdman(18, 4, "MAN");
701 gMC->Gdopt("hide","off");
704 //_____________________________________________________________________________
705 void AliTPCv0::Init()
708 // Initialise Time Projection Chamber version 0
710 printf("TPC version 0 initialized\n");
713 //_____________________________________________________________________________
714 void AliTPCv0::StepManager()
717 // Procedure called at each step in the TPC