Geometry corrected for an overlap
[u/mrichter/AliRoot.git] / TPC / AliTPCv0.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
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  **************************************************************************/
15
16 /*
17 $Log$
18 Revision 1.29  2002/11/21 22:43:32  alibrary
19 Removing AliMC and AliMCProcess
20
21 Revision 1.28  2002/10/23 07:17:34  alibrary
22 Introducing Riostream.h
23
24 Revision 1.27  2001/06/12 07:07:41  kowal2
25 New files for folder and stack
26
27 Revision 1.26  2001/05/08 16:03:06  kowal2
28 Geometry update according to the latest technical spec.
29
30 Revision 1.25  2001/04/27 15:23:06  kowal2
31 Correct materian in the central part of the inner containment vessel
32
33 Revision 1.24  2001/04/26 06:15:11  kowal2
34 Corrected bug in the inner containment vessel (cones)
35
36 Revision 1.23  2001/04/24 11:17:33  kowal2
37 New TPC geometry.
38
39 Revision 1.22  2001/03/13 13:07:33  kowal2
40 Corrected bug in the TPC mother volume geometry.
41 Thanks to A. Morsch
42
43 Revision 1.21  2000/11/14 10:48:57  kowal2
44 Correct material used for TSA4. Thanks to J. Barbosa.
45
46 Revision 1.20  2000/11/06 17:24:10  kowal2
47 Corrected bug in the outer containment vessel and
48 the outer field cage geometry.
49 Thanks to J. Barbosa.
50
51 Revision 1.19  2000/11/02 16:55:24  kowal2
52 Corrected bug in the inner containment vessel geometry.
53 Thanks to J. Belikov
54
55 Revision 1.18  2000/11/02 07:24:11  kowal2
56 Correction in the TPC geometry.
57 Changes due to the new hit structure.
58
59 Revision 1.17  2000/07/10 20:57:39  hristov
60 Update of TPC code and macros by M.Kowalski
61
62 Revision 1.16  2000/06/30 12:07:50  kowal2
63 Updated from the TPC-PreRelease branch
64
65 Revision 1.15.2.4  2000/06/26 07:39:42  kowal2
66 Changes to obey the coding rules
67
68 Revision 1.15.2.3  2000/06/25 08:38:41  kowal2
69 Splitted from AliTPCtracking
70
71 Revision 1.15.2.2  2000/06/16 12:58:13  kowal2
72 Changed parameter settings
73
74 Revision 1.15.2.1  2000/06/09 07:15:07  kowal2
75
76 Defaults loaded automatically (hard-wired)
77 Optional parameters can be set via macro called in the constructor
78
79 Revision 1.15  2000/05/15 10:00:30  kowal2
80 Corrected bug in the TPC geometry, thanks to Ivana Hrivnacova
81
82 Revision 1.14  2000/04/17 09:37:33  kowal2
83 removed obsolete AliTPCDigitsDisplay.C
84
85 Revision 1.13.8.2  2000/04/10 08:33:44  kowal2
86
87 Updated readout chambers
88
89 Revision 1.13.8.1  2000/04/10 07:56:53  kowal2
90 Not used anymore - removed
91
92 Revision 1.13  1999/11/04 17:28:06  fca
93 Correct barrel part of HV Degrader
94
95 Revision 1.12  1999/10/08 06:27:23  fca
96 Corrected bug in the HV degrader geometry, thanks to G.Tabary
97
98 Revision 1.11  1999/10/04 13:39:54  fca
99 Correct array index problem
100
101 Revision 1.10  1999/09/29 09:24:34  fca
102 Introduction of the Copyright and cvs Log
103
104 */
105 //
106
107 ///////////////////////////////////////////////////////////////////////////////
108 //                                                                           //
109 //  Time Projection Chamber version 0 -- "coarse" TPC                        //
110 //                                                                           //
111 //Begin_Html
112 /*
113 <img src="picts/AliTPCv0Class.gif">
114 */
115 //End_Html
116 //                                                                           //
117 //                                                                           //
118 ///////////////////////////////////////////////////////////////////////////////
119
120 #include <TMath.h>
121 #include <TGeometry.h>
122 #include <TNode.h>
123 #include <TTUBE.h>
124 #include "AliTPCv0.h"
125 #include "AliRun.h"
126 #include <Riostream.h>
127 #include <Riostream.h>
128 #include "AliConst.h"
129
130 #include "AliTPCParamSR.h"
131 #include "AliTPCDigitsArray.h"
132
133 ClassImp(AliTPCv0)
134  
135 //_____________________________________________________________________________
136 AliTPCv0::AliTPCv0(const char *name, const char *title) 
137          :AliTPC(name, title)
138 {
139   //
140   // Standard creator for TPC version 0
141   //
142
143   SetGasMixt(2,20,10,-1,0.9,0.1,0.);
144
145   if (fTPCParam)
146      fTPCParam->Write(fTPCParam->GetTitle());
147 }
148
149 //_____________________________________________________________________________
150 void AliTPCv0::CreateGeometry()
151 {
152
153   //
154   // Creation of the TPC version 0, i.e. no sensitive volumes,
155   // only the material distribution
156   //
157   //Begin_Html
158   /*
159     <img src="picts/AliTPC.gif">
160   */
161   //End_Html
162   //Begin_Html
163   /*
164     <img src="picts/AliTPCv0Tree.gif">
165   */
166   //End_Html
167
168   //---------------------------------------------------------------
169   //  TPC geometry
170   //
171   //  Origin: Marek Kowalski, INP Cracow
172   //  Marek.Kowalski@ifj.edu.pl
173   //---------------------------------------------------------------
174   Float_t dm[50];
175
176   Int_t *idtmed = fIdtmed->GetArray(); // TPC media
177
178   Int_t idrotm[120]; // rotation matrices
179
180   Int_t nRotMat = 0; // actual number of rotation matrices
181
182
183   //
184   //  Mother volume TPC (Air) - all volumes will be positioned in it
185   //
186
187   dm[0]=0.;
188   dm[1]=360.;
189   dm[2]=8.;
190
191   //
192
193   dm[3]=-283.7;
194   dm[4]=65.6;
195   dm[5]=278.;
196
197   //
198
199   dm[6]=-253.6;
200   dm[7]=65.6;
201   dm[8]=278.;
202
203   //
204
205   dm[9]=-73.3;
206   dm[10]=60.9;
207   dm[11]=278.;  
208
209   //
210
211   dm[12]=-73.3;
212   dm[13]=56.9;
213   dm[14]=278.;
214
215   //
216
217   dm[15]=73.3;
218   dm[16]=56.9;
219   dm[17]=278.;
220
221   //
222
223   dm[18]=73.3;
224   dm[19]=60.9;
225   dm[20]=278.;
226
227   //
228
229   dm[21]=253.6;
230   dm[22]=65.6;
231   dm[23]=278.;
232
233   //
234
235   dm[24]=283.7;
236   dm[25]=65.6;
237   dm[26]=278.;
238   
239   gMC->Gsvolu("TPC ","PCON",idtmed[0],dm,27);
240
241   // outer part
242
243   //-------------------------------------------------------------------
244   //   Tpc Outer INsulator (CO2) - contains cont. vessel and field cage
245   //-------------------------------------------------------------------
246
247   dm[0]= 0.;
248   dm[1]= 360.;
249   dm[2]= 6.;
250
251   //
252
253   dm[3]=-253.6;
254   dm[4]=258.;
255   dm[5]=275.5;
256
257   //
258
259   dm[6]=-250.6;
260   dm[7]=258.;
261   dm[8]=275.5; 
262
263   //
264
265   dm[9]=-250.6;
266   dm[10]=258.;
267   dm[11]=278.;
268
269   //
270
271   dm[12]=253.6;
272   dm[13]=258.;
273   dm[14]=278.; 
274
275   //
276
277   dm[15]=253.6;
278   dm[16]=264.8;
279   dm[17]=278.;  
280
281   //
282
283   dm[18]=256.6;
284   dm[19]=264.8;
285   dm[20]=278.;
286
287   gMC->Gsvolu("TOIN","PCON",idtmed[3],dm,21);
288
289   //----------------------------------------------------------------
290   // Tpc Outer Contaiment Vessel  
291   //  mother volume - Al, daughters - composite (sandwich)
292   //----------------------------------------------------------------
293
294   dm[0]=0.;
295   dm[1]=360.;
296   dm[2]=6.;
297
298   //
299
300   dm[3]=-250.6;
301   dm[4]=270.4;
302   dm[5]=278.;
303
304   //
305
306   dm[6]=-247.6;
307   dm[7]=270.4;
308   dm[8]=278.; 
309
310   //
311
312   dm[9]=-247.6;
313   dm[10]=274.8124;
314   dm[11]=278.;
315
316   //
317
318   dm[12]=253.6;
319   dm[13]=274.8124;
320   dm[14]=278.;
321
322   //
323
324   dm[15]=253.6;
325   dm[16]=264.8;
326   dm[17]=278.;
327
328   //
329
330   dm[18]=256.6;
331   dm[19]=264.8;
332   dm[20]=278.;
333
334   gMC->Gsvolu("TOCV","PCON",idtmed[4],dm,21);
335
336   // Daughter volumes - sandwich
337
338   // Tpc SAndwich 1 - Al
339
340   dm[0]=274.8124;
341   dm[1]=278.;
342   dm[2]=252.1;
343
344   gMC->Gsvolu("TSA1","TUBE",idtmed[4],dm,3);
345
346   // Tpc SAndwich 2 - epoxy glue (I use Lexan)
347
348   dm[0] += 5.e-3;
349   dm[1] -= 5.e-3;
350
351   gMC->Gsvolu("TSA2","TUBE",idtmed[14],dm,3);
352
353   // Tpc SAndwich 3 - Tedlar
354
355   dm[0] += 0.01;
356   dm[1] -= 0.01;
357   
358   gMC->Gsvolu("TSA3","TUBE",idtmed[9],dm,3);
359
360
361   // Tpc SAndwich 4 - fiber glass (G10)
362
363   dm[0] += 3.8e-3;
364   dm[1] -= 3.8e-3;
365
366   gMC->Gsvolu("TSA4","TUBE",idtmed[12],dm,3);  
367
368   // Tpc SAndwich 5 - NOMEX honeycomb
369
370   dm[0] += 0.075;
371   dm[1] -= 0.075;   
372   
373   gMC->Gsvolu("TSA5","TUBE",idtmed[6],dm,3);
374
375   // 5->4->3->2->1->TCOV
376
377
378   gMC->Gspos("TSA5",1,"TSA4",0.,0.,0.,0,"ONLY");
379   gMC->Gspos("TSA4",1,"TSA3",0.,0.,0.,0,"ONLY");
380   gMC->Gspos("TSA3",1,"TSA2",0.,0.,0.,0,"ONLY");
381   gMC->Gspos("TSA2",1,"TSA1",0.,0.,0.,0,"ONLY");  
382
383   gMC->Gspos("TSA1",1,"TOCV",0.,0.,3.,0,"ONLY");
384
385   // TCOV-> TOIN
386
387   gMC->Gspos("TOCV",1,"TOIN",0.,0.,0.,0,"ONLY");
388
389   //-------------------------------------------------------
390   //  Tpc Outer Field Cage
391   //  mother volume - Al, daughters - composite (sandwich)
392   //-------------------------------------------------------
393
394   dm[0]=0.;
395   dm[1]=360.;
396   dm[2]=6.;
397
398   //
399
400   dm[3]=-253.6;
401   dm[4]=258.;
402   dm[5]=275.5;
403
404   //
405
406   dm[6]=-250.6;
407   dm[7]=258.;
408   dm[8]=275.5;
409
410   //
411
412   dm[9]=-250.6;
413   dm[10]=258.;
414   dm[11]=260.0476;
415
416   //
417
418   dm[12]=250.6;
419   dm[13]=258.;
420   dm[14]=260.0476;
421
422   //
423
424   dm[15]=250.6;
425   dm[16]=258.;
426   dm[17]=269.6;
427
428   //
429
430   dm[18]=253.6;
431   dm[19]=258.;
432   dm[20]=269.6;
433
434   gMC->Gsvolu("TOFC","PCON",idtmed[4],dm,21);
435
436   // Daughter volumes 
437
438   // Tpc SAndwich 6 - Tedlar
439
440   dm[0]= 258.;
441   dm[1]= 260.0476;
442   dm[2]= 252.1;
443
444   gMC->Gsvolu("TSA6","TUBE",idtmed[9],dm,3);
445
446   // Tpc SAndwich 7 - fiber glass
447
448   dm[0] += 3.8e-3;
449   dm[1] -= 3.8e-3;
450
451   gMC->Gsvolu("TSA7","TUBE",idtmed[12],dm,3);
452
453
454   // Tpc SAndwich 8 - NOMEX
455
456   dm[0] += 0.02;
457   dm[1] -= 0.02;
458
459   gMC->Gsvolu("TSA8","TUBE",idtmed[6],dm,3);    
460
461   // 8->7->6->TOFC
462
463   gMC->Gspos("TSA8",1,"TSA7",0.,0.,0.,0,"ONLY");
464   gMC->Gspos("TSA7",1,"TSA6",0.,0.,0.,0,"ONLY"); 
465   gMC->Gspos("TSA6",1,"TOFC",0.,0.,0.,0,"ONLY");
466
467   // TOFC->TOIN
468
469   gMC->Gspos("TOFC",1,"TOIN",0.,0.,0.,0,"ONLY");
470
471   // TOIN->TPC
472
473   gMC->Gspos("TOIN",1,"TPC ",0.,0.,0.,0,"ONLY");
474
475   // inner part
476
477   //--------------------------------------------------------------------
478   // Tpc Inner INsulator (CO2) - inner f.c. will be placed there
479   // Inner containment vessel will be placed directly in the TPC
480   //-------------------------------------------------------------------- 
481
482   dm[0]=0.;
483   dm[1]=360.;
484   dm[2]=4.;
485
486   // 
487
488   dm[3]=-253.6;
489   dm[4]=65.9;
490   dm[5]=79.2;
491
492   //
493
494   dm[6]=-73.3;
495   dm[7]=61.2;
496   dm[8]=79.2;  
497
498   //
499
500   dm[9]=73.3;
501   dm[10]=61.2;
502   dm[11]=79.2;
503
504   //
505
506   dm[12]=253.6;
507   dm[13]=65.9;
508   dm[14]=79.2;
509
510   gMC->Gsvolu("TIIN","PCON",idtmed[3],dm,15);
511
512   // the middle part of the F.C. is thinner - carve out the strip - Ne-CO2
513
514   dm[0]=79.16;
515   dm[1]=79.2;
516   dm[2]=88.;
517
518   gMC->Gsvolu("TII1","TUBE",idtmed[1],dm,3);
519
520   gMC->Gspos("TII1",1,"TIIN",0.,0.,0.,0,"ONLY");
521
522   //-----------------------------------------------------
523   // Tpc Inner Field Cage
524   // mother volume - Al, daughters - composite (sandwich)
525   //------------------------------------------------------
526
527   dm[0]=0.;
528   dm[1]=360.;
529   dm[2]=10.;
530
531   //
532
533   dm[3]=-253.6;
534   dm[4]=70.3;
535   dm[5]=79.2;
536
537   //
538
539   dm[6]=-250.6;
540   dm[7]=70.3;
541   dm[8]=79.2;
542
543   //
544
545   dm[9]=-250.6;
546   dm[10]=77.0524;
547   dm[11]=79.2;
548
549   //
550
551   dm[12]=-88.;
552   dm[13]=77.0524;
553   dm[14]=79.2;
554
555   //
556
557   dm[15]=-88.;
558   dm[16]=77.0924;
559   dm[17]=79.16;
560
561   //
562
563   dm[18]=88.;
564   dm[19]=77.0924;
565   dm[20]=79.16;
566
567   //
568
569   dm[21]=88.;
570   dm[22]=77.0524;
571   dm[23]=79.2;
572
573   //
574
575   dm[24]=250.6;
576   dm[25]=77.0524;
577   dm[26]=79.2;
578
579   //
580
581   dm[27]=250.6;
582   dm[28]=70.3;
583   dm[29]=79.2;
584
585   //
586
587   dm[30]=253.6;
588   dm[31]=70.3;
589   dm[32]=79.2;
590
591   gMC->Gsvolu("TIFC","PCON",idtmed[4],dm,33);
592
593   // daughter volumes - central part
594
595   // Tpc Sandwich 9 -Tedlar
596
597   dm[0]=77.0924;
598   dm[1]=79.16;
599   dm[2]=88.;
600
601   gMC->Gsvolu("TSA9","TUBE",idtmed[9],dm,3); 
602
603   // Tpc Sandwich 10 - fiber glass (G10) 
604
605   dm[0] += 3.8e-3;
606   dm[1] -= 3.8e-3;
607
608   gMC->Gsvolu("TS10","TUBE",idtmed[12],dm,3);
609
610   // Tpc Sandwich 11 - NOMEX
611
612   dm[0] += 0.03;
613   dm[1] -= 0.03; 
614
615   gMC->Gsvolu("TS11","TUBE",idtmed[6],dm,3);
616
617   // 11->10->9->TIFC
618
619   gMC->Gspos("TS11",1,"TS10",0.,0.,0.,0,"ONLY");
620   gMC->Gspos("TS10",1,"TSA9",0.,0.,0.,0,"ONLY");
621
622   gMC->Gspos("TSA9",1,"TIFC",0.,0.,0.,0,"ONLY");
623
624   // daughter volumes - outer parts (reinforced)
625
626   // Tpc Sandwich 12 -Tedlar
627
628   dm[0]=77.0524;
629   dm[1]=79.2;
630   dm[2]=82.05;
631
632   gMC->Gsvolu("TS12","TUBE",idtmed[9],dm,3);
633
634   // Tpc Sandwich 13 - fiber glass (G10) 
635
636   dm[0] += 3.8e-3;
637   dm[1] -= 3.8e-3;
638
639   gMC->Gsvolu("TS13","TUBE",idtmed[12],dm,3);
640
641   // Tpc Sandwich 14 - NOMEX
642
643   dm[0] += 0.07;
644   dm[1] -= 0.07;  
645
646   gMC->Gsvolu("TS14","TUBE",idtmed[6],dm,3);
647
648   // 14->13->12->TIFC
649
650   gMC->Gspos("TS14",1,"TS13",0.,0.,0.,0,"ONLY");
651   gMC->Gspos("TS13",1,"TS12",0.,0.,0.,0,"ONLY"); 
652
653   gMC->Gspos("TS12",1,"TIFC",0.,0.,170.05,0,"ONLY");
654   gMC->Gspos("TS12",2,"TIFC",0.,0.,-170.05,0,"ONLY"); 
655
656   // place this inside the inner insulator
657
658   gMC->Gspos("TIFC",1,"TIIN",0.,0.,0.,0,"ONLY");
659
660   // and now in the TPC...
661
662   gMC->Gspos("TIIN",1,"TPC ",0.,0.,0.,0,"ONLY");
663
664   //---------------------------------------------------------
665   // Tpc Inner Containment vessel - Cones
666   //---------------------------------------------------------
667
668   dm[0]=0.;
669   dm[1]=360.;
670   dm[2]=8.;
671
672   //
673
674   dm[3]=71.8;
675   dm[4]=56.9;
676   dm[5]=59.4;
677
678   //
679
680   dm[6]=73.;
681   dm[7]=56.9;
682   dm[8]=59.4;
683
684   //
685
686   dm[9]=73.;
687   dm[10]=56.9;
688   dm[11]=61.2;
689
690   //
691
692   dm[12]=73.3;
693   dm[13]=56.9;
694   dm[14]=61.2;
695
696   //
697    
698   dm[15]=73.3;
699   dm[16]=60.9;
700   dm[17]=61.2;
701
702   // 
703
704   dm[18]=253.6;
705   dm[19]=65.6;
706   dm[20]=65.9; 
707
708   //
709
710   dm[21]=253.6;
711   dm[22]=65.6;
712   dm[23]=74.6;
713
714   //
715
716   dm[24]=256.6;
717   dm[25]=65.6;
718   dm[26]=74.6;
719
720   gMC->Gsvolu("TICC","PCON",idtmed[4],dm,27);
721
722   Float_t phi1,phi2,phi3,theta1,theta2,theta3; // rotation angles
723
724   // reflection matrix
725   
726   theta1 = 90.;
727   phi1   = 0.;
728   theta2 = 90.;
729   phi2   = 270.;
730   theta3 = 180.;
731   phi3   = 0.;
732
733   AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
734
735   gMC->Gspos("TICC",1,"TPC ",0.,0.,0.,0,"ONLY");
736   gMC->Gspos("TICC",2,"TPC ",0.,0.,0.,idrotm[nRotMat],"ONLY");
737
738
739   //---------------------------------------------------------
740   // Tpc Inner Containment vessel - Middle part -Al
741   //---------------------------------------------------------
742
743   dm[0]=0.;
744   dm[1]=360.;
745   dm[2]=6.;
746
747   //
748
749   dm[3]=-71.6;
750   dm[4]=60.2;
751   dm[5]=61.2;
752
753   //
754
755   dm[6]=-69.1;
756   dm[7]=60.2;
757   dm[8]=61.2;
758
759   //
760
761   dm[9]=-69.1;
762   dm[10]=60.6224;
763   dm[11]=61.2;  
764
765   //
766
767   dm[12]=69.1;
768   dm[13]=60.6224;
769   dm[14]=61.2;
770
771   //
772
773   dm[15]=69.1;
774   dm[16]=60.2;
775   dm[17]=61.2;
776
777   //
778
779   dm[18]=71.6;
780   dm[19]=60.2;
781   dm[20]=61.2;
782
783   gMC->Gsvolu("TICM","PCON",idtmed[4],dm,21);
784
785   // Tpc Sandwich 15 - Al
786
787   dm[0]=60.6224;
788   dm[1]=61.2;
789   dm[2]=70.1;
790
791   gMC->Gsvolu("TS15","TUBE",idtmed[4],dm,3);
792
793   // Tpc Sandwich 16 -  epoxy glue
794
795   dm[0] += 5.e-3;
796   dm[1] -= 5.e-3;
797
798   gMC->Gsvolu("TS16","TUBE",idtmed[14],dm,3);
799
800   // Tpc Sandwich 17 - Tedlar
801
802   dm[0] += 0.01;
803   dm[1] -= 0.01;
804
805   gMC->Gsvolu("TS17","TUBE",idtmed[9],dm,3);
806
807   // Tpc Sandwich 18 - carbon fiber 
808
809   dm[0] += 3.8e-3;
810   dm[1] -= 3.8e-3;
811
812   gMC->Gsvolu("TS18","TUBE",idtmed[15],dm,3);  
813
814   // Tpc Sandwich 19 - Nomex
815
816   dm[0] += 0.02;
817   dm[1] -= 0.02;
818
819   gMC->Gsvolu("TS19","TUBE",idtmed[6],dm,3); 
820
821   // 19->18->17->16->15-> TICM
822
823   gMC->Gspos("TS19",1,"TS18",0.,0.,0.,0,"ONLY"); 
824   gMC->Gspos("TS18",1,"TS17",0.,0.,0.,0,"ONLY");
825   gMC->Gspos("TS17",1,"TS16",0.,0.,0.,0,"ONLY");
826   gMC->Gspos("TS16",1,"TS15",0.,0.,0.,0,"ONLY");
827
828   gMC->Gspos("TS15",1,"TICM ",0.,0.,0.,0,"ONLY");
829  
830
831   // TPc inner cont. vessel Joints
832
833   dm[0]=60.2;
834   dm[1]=61.2;
835   dm[2]=0.5;
836
837   gMC->Gsvolu("TPJ1","TUBE",idtmed[4],dm,3);
838
839   gMC->Gspos("TPJ1",1,"TPC ",0.,0.,72.3,0,"ONLY");
840   gMC->Gspos("TPJ1",2,"TPC ",0.,0.,-72.3,0,"ONLY");
841
842   //
843
844   dm[0]=0.;
845   dm[1]=360.;
846   dm[2]=4.;
847
848   //
849
850   dm[3]=70.8;
851   dm[4]=58.4;
852   dm[5]=60.1;
853
854   //
855
856   dm[6]=71.2;
857   dm[7]=58.4;
858   dm[8]=60.1;
859
860   //
861
862   dm[9]=71.2;
863   dm[10]=58.4;
864   dm[11]=59.4;
865
866   //
867
868   dm[12]=71.6;
869   dm[13]=58.4;
870   dm[14]=59.4;
871
872   gMC->Gsvolu("TPJ2","PCON",idtmed[4],dm,15);
873
874   gMC->Gspos("TPJ2",1,"TPC ",0.,0.,0.,0,"ONLY");
875   gMC->Gspos("TPJ2",2,"TPC ",0.,0.,0.,idrotm[nRotMat],"ONLY");
876
877
878
879   // Tpc Inner Containment vessel Seal (Viton, I use Lexan for a time being)
880
881   dm[0]=58.4;
882   dm[1]=61.2;
883   dm[2]=0.1;
884
885   gMC->Gsvolu("TICS","TUBE",idtmed[14],dm,3);
886
887   gMC->Gspos("TICS",1,"TPC ",0.,0.,71.7,0,"ONLY");
888   gMC->Gspos("TICS",2,"TPC ",0.,0.,-71.7,0,"ONLY"); 
889
890   // TICM -> TPC
891
892   gMC->Gspos("TICM",1,"TPC ",0.,0.,0.,0,"ONLY");
893
894   //
895
896   nRotMat++; // prepare for the next rotation matrix 
897
898   //---------------------------------------------------------
899   //  Tpc Dift Gas volume Nonsensitive (Ne-CO2 90/10)
900   //  and its daughters (HV membrane, rods, readout chambers)
901   //---------------------------------------------------------
902
903   dm[0]= 79.2;
904   dm[1]= 258.0;
905   dm[2]= 253.6;
906
907   gMC->Gsvolu("TDGN","TUBE",idtmed[1],dm,3); 
908
909   // sector opening angles
910
911   Float_t innerOpenAngle = fTPCParam->GetInnerAngle();
912
913   // sector angle shift
914
915   Float_t innerAngleShift = fTPCParam->GetInnerAngleShift();
916
917   // number of sectors
918
919   Int_t nInnerSector = fTPCParam->GetNInnerSector()/2;
920   Int_t nOuterSector = fTPCParam->GetNOuterSector()/2;
921
922   // All above parameters are identical for inner and outer
923   // sectors. The distinction is kept for the historical reasons
924   // and eventually will disappear.
925
926   Float_t tanAlpha = TMath::Tan(0.5*innerOpenAngle);
927   Float_t cosAlpha = TMath::Sqrt(1.+tanAlpha*tanAlpha);
928   Float_t space;
929
930   //-------------------------------------------------------------------------
931   //   Tpc Inner Readout Chambers 
932   //-------------------------------------------------------------------------
933
934   dm[0]= 14.483;
935   dm[1]= 23.3345; 
936   dm[2]= 1.6; // thickness
937   dm[3]= 25.1;
938
939   gMC->Gsvolu("TIRC","TRD1",idtmed[4],dm,4);
940
941   // this volume will be positioned in the empty space
942   // of the end-cap to avoid overlaps
943
944   dm[0]= 13.7305;
945   dm[1]= 21.1895;
946   dm[2]= 2.25;
947   dm[3]= 21.15;
948
949   gMC->Gsvolu("TIC1","TRD1",idtmed[4],dm,4);
950
951
952   //------------------------------------------------
953   // Tpc Inner readout chamber Pad Plane
954   //------------------------------------------------
955
956   dm[0]= 14.483;
957   dm[1]= 23.3345;
958   dm[2]= 0.5;
959   dm[3]= 25.1;
960
961   gMC->Gsvolu("TIPP","TRD1",idtmed[12],dm,4);
962
963   // 
964
965   dm[0] -= 1.218511934;
966   dm[1] -= 1.218511934;
967   dm[2] = 0.35;
968
969   gMC->Gsvolu("TIC3","TRD1",idtmed[1],dm,4);
970
971   gMC->Gspos("TIC3",1,"TIPP",0.,0.15,0.,0,"ONLY");
972
973   gMC->Gspos("TIPP",1,"TIRC",0.,1.1,0.,0,"ONLY");
974
975
976   //----------------------------------------------
977   // Tpc Readout Chambers Empty spaces - for both
978   // inner and outer sectors
979   //----------------------------------------------
980
981   gMC->Gsvolu("TRCE","TRD1",idtmed[0],dm,0);
982
983   // Inner sector - 4 spaces
984
985
986   dm[3] = 4.7625;
987   dm[0] = 12.472;
988
989   Float_t rr = 90.52;
990   Float_t zz;
991
992   zz= -12.7875;
993   
994   space = rr*tanAlpha-dm[0];
995
996   for(Int_t nsLow=0;nsLow<4;nsLow++){
997
998     rr += 9.525;
999     dm[1]= rr*tanAlpha - space;  
1000
1001     dm[2]=0.8;
1002
1003     gMC->Gsposp("TRCE",nsLow+1,"TIRC",0.,-0.8,zz,0,"ONLY",dm,4);
1004
1005     //
1006
1007     dm[2] = 1.2;
1008
1009     gMC->Gsposp("TRCE",nsLow+5,"TIC1",0.,1.05,zz-2.1,0,"ONLY",dm,4);
1010
1011     rr += 0.4;
1012     dm[0] = rr*tanAlpha - space;
1013     zz += (0.4+9.525); 
1014
1015   }
1016
1017   dm[0]= 12.472;
1018   // dm[1] - this is the dm[1] from the previous TRCE
1019   dm[2]= 1.05;
1020   dm[3]= 19.65;
1021
1022   gMC->Gsposp("TRCE",9,"TIC1",0.,-1.2,0.,0,"ONLY",dm,4);   
1023
1024   //
1025   // TPc Space for Connectors
1026   //
1027
1028   dm[0]= .3;
1029   dm[1]= .3;
1030   dm[2]= 4.5;
1031
1032   gMC->Gsvolu("TPSC","BOX ",idtmed[0],dm,3);
1033
1034   // TPC Connectors
1035
1036   dm[0]= .25;
1037   dm[1]= .15;
1038   dm[2]= 3.75;
1039
1040   gMC->Gsvolu("TPCC","BOX ",idtmed[13],dm,3); 
1041
1042   gMC->Gspos("TPCC",1,"TPSC",0.,0.15,0.,0,"ONLY");
1043
1044   zz = -12.7875;
1045
1046
1047   Float_t alpha;
1048   Float_t astep;
1049
1050   // inner part of the inner sector - 2 x 20 holes
1051   
1052   astep = 20.00096874/19.;
1053
1054   alpha = 10.00048437-astep;
1055
1056   Float_t x1,x2;
1057
1058     x1 = 13.31175725;
1059     x1 -= 0.996357832; 
1060
1061     x2 = 15.06180253;
1062     x2 -= 1.163028812;
1063
1064   Int_t ncon;
1065
1066   for(ncon=0;ncon<20;ncon++){
1067
1068     phi1 = 0.;
1069     theta1 = 90.+alpha;
1070     phi2=90.;
1071     theta2 = 90.;
1072     phi3 = (alpha>0) ? 0. : 180.;
1073     theta3 = TMath::Abs(alpha);
1074
1075     AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1076
1077  
1078
1079     gMC->Gspos("TPSC",ncon+1,"TIRC",x1,0.3,-12.7875,idrotm[nRotMat],"ONLY");
1080     gMC->Gspos("TPSC",ncon+21,"TIRC",x2,0.3,-2.8625,idrotm[nRotMat],"ONLY");
1081
1082
1083     x1 -= 1.296357833;
1084     x2 -= 1.463028812;
1085
1086     alpha -= astep;   
1087     nRotMat++; 
1088
1089   }
1090
1091   // outer part of the inner sector - 2 x 25 holes
1092
1093    astep = 20.00096874/24.; 
1094    alpha = 10.00048437-astep;
1095
1096    x1 = 16.81184781;
1097    x1 -= 1.016295986;
1098
1099    x2 = 18.5618931;
1100    x2 -= 1.150914854;
1101
1102   for(ncon=0;ncon<25;ncon++){
1103
1104     phi1 = 0.;
1105     theta1 = 90.+alpha;
1106     phi2=90.;
1107     theta2 = 90.;
1108     phi3 = (alpha>0) ? 0. : 180.;
1109     theta3 = TMath::Abs(alpha);
1110
1111     AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1112
1113  
1114
1115     gMC->Gspos("TPSC",ncon+41,"TIRC",x1,0.3,7.0625,idrotm[nRotMat],"ONLY");
1116     gMC->Gspos("TPSC",ncon+66,"TIRC",x2,0.3,16.9875,idrotm[nRotMat],"ONLY");
1117
1118
1119     x1 -= 1.316295986;
1120     x2 -= 1.450914854;
1121
1122     alpha -= astep;   
1123     nRotMat++; 
1124
1125   }  
1126
1127   //--------------------------------------------------------------------------
1128   //  TPC Outer Readout Chambers
1129   //  this is NOT a final design
1130   //--------------------------------------------------------------------------
1131
1132   dm[0]= 23.3875;
1133   dm[1]= 43.524;
1134   dm[2]= 1.5; //thickness
1135   dm[3]= 57.1;
1136
1137   gMC->Gsvolu("TORC","TRD1",idtmed[4],dm,4);
1138
1139   //------------------------------------------------
1140   // Tpc Outer readout chamber Pad Plane
1141   //------------------------------------------------
1142
1143   dm[2]= 0.5;
1144
1145   gMC->Gsvolu("TOPP","TRD1",idtmed[12],dm,4);
1146
1147   dm[0] -= 1.218511934;
1148   dm[1] -= 1.218511934;
1149   dm[2] = 0.35;
1150
1151   gMC->Gsvolu("TOC3","TRD1",idtmed[1],dm,4);
1152
1153   gMC->Gspos("TOC3",1,"TOPP",0.,0.15,0.,0,"ONLY");
1154
1155   gMC->Gspos("TOPP",1,"TORC",0.,1.0,0.,0,"ONLY");
1156
1157   // empty space
1158
1159   dm[0]= 21.035;
1160   dm[1]= 38.7205;
1161   dm[2]= 0.7; 
1162   dm[3]= 50.15;
1163
1164   gMC->Gsposp("TRCE",10,"TORC",0.,-0.8,-2.15,0,"ONLY",dm,4);  
1165
1166   dm[0]= 22.2935;
1167   dm[1]= 40.5085;
1168   dm[2]= 2.25;
1169   dm[3]= 51.65;
1170
1171   gMC->Gsvolu("TOC1","TRD1",idtmed[4],dm,4);
1172
1173   dm[0]= 21.35;
1174   dm[1]= 38.7205;
1175   dm[2]= 2.25;
1176   dm[3]= 50.15;
1177
1178   gMC->Gsposp("TRCE",11,"TOC1",0.,0.,0.,0,"ONLY",dm,4);
1179
1180   //-----------------------------------------------
1181   // Tpc Services Support Wheel
1182   //-----------------------------------------------
1183
1184   dm[0]=0.;
1185   dm[1]=360.;
1186   dm[2]=18.;
1187   dm[3]=2.;
1188
1189   dm[4]= -5.;
1190   dm[5]= 77.017;
1191   dm[6]= 255.267;
1192
1193   dm[7]= 5.;
1194   dm[8]= dm[5];
1195   dm[9]= dm[6];
1196
1197   gMC->Gsvolu("TSSW","PGON",idtmed[4],dm,10);
1198
1199   // Tpc Services Wheel Cover
1200
1201   dm[4]= -0.5;
1202   dm[7]= 0.5;
1203
1204   gMC->Gsvolu("TSWC","PGON",idtmed[4],dm,10);
1205
1206   // Tpc Service wheel Cover Empty space
1207    
1208   dm[0]= 10.99;
1209   dm[1]= 39.599;
1210   dm[2]= .5;
1211   dm[3]= 81.125;
1212
1213   gMC->Gsvolu("TSCE","TRD1",idtmed[0],dm,4);
1214
1215   // Tpc services Wheel Empty Spaces
1216
1217   dm[0]= 13.18017507;
1218   dm[1]= 44.61045938;
1219   dm[2]= 4.;
1220   dm[3]= 89.125;
1221
1222   gMC->Gsvolu("TWES","TRD1",idtmed[0],dm,4);
1223
1224   // Tpc Services Wheel Bars
1225
1226   gMC->Gsvolu("TSWB","TRD1",idtmed[4],dm,0);
1227
1228   // bars-> TWES
1229
1230   dm[2]= 4.;
1231   dm[3]= .4;
1232
1233   dm[0]= 13.8149522;
1234   dm[1]= 13.95601379;
1235   
1236   gMC->Gsposp("TSWB",1,"TWES",0.,0.,-85.125,0,"ONLY",dm,4);
1237
1238   dm[0]= 43.83462067; 
1239   dm[1]= 43.97568225;
1240
1241   gMC->Gsposp("TSWB",2,"TWES",0.,0.,85.125,0,"ONLY",dm,4);
1242
1243   // TPc ELectronics - right now 30% X0 Si
1244
1245   dm[0]= 14.03813696;
1246   dm[1]= 43.3524075;
1247   dm[2]= 1.404;
1248   dm[3]= 83.125;
1249
1250   gMC->Gsvolu("TPEL","TRD1",idtmed[11],dm,4);
1251   gMC->Gspos("TPEL",1,"TWES",0.,0.,0.,0,"ONLY");
1252
1253   //--------------------------------------------------------------------------
1254   //  End caps
1255   //--------------------------------------------------------------------------
1256
1257   // TPc Main Wheel - Al
1258
1259   dm[0]= 74.9;
1260   dm[1]= 264.4;
1261   dm[2]= 3.0;
1262
1263   gMC->Gsvolu("TPMW","TUBE",idtmed[4],dm,3);
1264
1265   //--------------------------------------------------------------------------
1266   //  Tpc Empty Space for the Readout chambers
1267   //--------------------------------------------------------------------------  
1268
1269   Float_t rLow= 86.2;
1270   Float_t rUp= 243.5;
1271   Float_t dR = 0.5*(rUp-rLow);
1272
1273   space= 1.5/cosAlpha; // wheel ribs are 3.0 cm wide
1274
1275   dm[0]= rLow*tanAlpha-space;
1276   dm[1]= rUp*tanAlpha-space;
1277   dm[2] = 3.0;
1278   dm[3]= dR;
1279
1280   gMC->Gsvolu("TESR","TRD1",idtmed[0],dm,4);
1281
1282   // TIC1->TESR
1283
1284   gMC->Gspos("TIC1",1,"TESR",0.,0.75,-dR+23.97,0,"ONLY");
1285
1286   // TOC1->TESR
1287
1288   gMC->Gspos("TOC1",1,"TESR",0.,0.75,dR-55.02,0,"ONLY");
1289
1290   // Tpc Empty Space Bars - Al (daughters of TESR)
1291
1292   Float_t zBar;
1293
1294   gMC->Gsvolu("TESB","TRD1",idtmed[4],dm,0);
1295
1296   // lower bar
1297
1298   dm[0]= rLow*tanAlpha-space;
1299   dm[1]= 88.7*tanAlpha-space;
1300   dm[2]= 2.25;
1301   dm[3]= 1.275;
1302
1303   zBar = -dR+dm[3];
1304
1305   gMC->Gsposp("TESB",1,"TESR",0.,0.75,zBar,0,"ONLY",dm,4);
1306
1307   // middle bar
1308
1309   dm[0]= 131.65*tanAlpha-space;
1310   dm[1]= 136.5*tanAlpha-space;
1311   dm[3]= 2.425;
1312
1313   zBar = -dR +131.65+dm[3]-rLow;
1314
1315   gMC->Gsposp("TESB",2,"TESR",0.,0.75,zBar,0,"ONLY",dm,4);  
1316
1317   // upper bar
1318
1319   dm[0]= 240.4*tanAlpha-space;
1320   dm[1]= rUp*tanAlpha-space;
1321   dm[3]= 1.55;
1322
1323   zBar = dR-dm[3];
1324
1325   gMC->Gsposp("TESB",3,"TESR",0.,0.75,zBar,0,"ONLY",dm,4);
1326
1327   //  positioning of the empty spaces into the main wheel
1328
1329   Float_t rCenter,xc,yc;
1330   Float_t rInner,rOuter; // center of the inner and outer chamber
1331
1332   rCenter = rLow+dR;
1333
1334   rInner = 108.07;
1335   rOuter = 190.68;
1336
1337
1338   for(Int_t ns=0; ns<nInnerSector;ns++){
1339
1340     phi1 = ns * innerOpenAngle + innerAngleShift;
1341     phi1 *= kRaddeg; // in degrees
1342
1343     phi1 = (Float_t)TMath::Nint(phi1) + 270.;
1344
1345     if (phi1 > 360.) phi1 -= 360.;
1346
1347     theta1 = 90.;
1348     phi2   = 90.;
1349     theta2 = 180.;
1350     phi3   = ns * innerOpenAngle + innerAngleShift;
1351     phi3 *= kRaddeg; // in degrees
1352
1353     phi3 = (Float_t)TMath::Nint(phi3);
1354       
1355     if(phi3 > 360.) phi3 -= 360.;
1356
1357     theta3 = 90.;
1358
1359     // "holes"->End plate
1360
1361     xc = rCenter*TMath::Cos(phi3*kDegrad);
1362     yc = rCenter*TMath::Sin(phi3*kDegrad);
1363
1364     AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1365
1366     gMC->Gspos("TESR",ns+1,"TPMW",xc,yc,0.,idrotm[nRotMat],"ONLY");
1367
1368     // TSCE->TSWC (services wheel volumes)
1369
1370     xc = 166.142*TMath::Cos(phi3*kDegrad);
1371     yc = 166.142*TMath::Sin(phi3*kDegrad);
1372
1373     gMC->Gspos("TSCE",ns+1,"TSWC",xc,yc,0.,idrotm[nRotMat],"ONLY");
1374     gMC->Gspos("TWES",ns+1,"TSSW",xc,yc,0.,idrotm[nRotMat],"ONLY");
1375
1376
1377     // readout chambers->TDGN (drift gas)
1378
1379     xc = rInner*TMath::Cos(phi3*kDegrad);
1380     yc = rInner*TMath::Sin(phi3*kDegrad);
1381
1382     gMC->Gspos("TIRC",ns+1,"TDGN",xc,yc,252.,idrotm[nRotMat],"ONLY");
1383      
1384     xc = rOuter*TMath::Cos(phi3*kDegrad);
1385     yc = rOuter*TMath::Sin(phi3*kDegrad);
1386
1387     gMC->Gspos("TORC",ns+1,"TDGN",xc,yc,252.1,idrotm[nRotMat],"ONLY");
1388
1389     nRotMat++;
1390
1391     theta2 = 0.; // reflection
1392
1393     AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1394
1395     xc = rInner*TMath::Cos(phi3*kDegrad);
1396     yc = rInner*TMath::Sin(phi3*kDegrad);
1397
1398     gMC->Gspos("TIRC",ns+nInnerSector+1,"TDGN",xc,yc,-252.,idrotm[nRotMat],"ONLY");
1399
1400     xc = rOuter*TMath::Cos(phi3*kDegrad);
1401     yc = rOuter*TMath::Sin(phi3*kDegrad);
1402
1403     gMC->Gspos("TORC",ns+nOuterSector+1,"TDGN",xc,yc,-252.1,idrotm[nRotMat],"ONLY");
1404
1405     nRotMat++;
1406
1407   } 
1408   // TPMW->TPC
1409
1410   gMC->Gspos("TPMW",1,"TPC ",0.,0.,256.6,0,"ONLY");
1411   gMC->Gspos("TPMW",2,"TPC ",0.,0.,-256.6,idrotm[0],"ONLY");
1412
1413   //---------------------------------------------------------
1414   //  Tpc High Voltage Membrane - 100 microns of mylar
1415   //---------------------------------------------------------
1416
1417   dm[0]=82.8;
1418   dm[1]=252.;
1419   dm[2]=0.005;
1420
1421   gMC->Gsvolu("THVM","TUBE",idtmed[8],dm,3);
1422
1423   gMC->Gspos("THVM",1,"TDGN",0.,0.,0.,0,"ONLY");
1424
1425   // Tpc High Voltage membrane Holders
1426
1427   gMC->Gsvolu("THVH","TUBE",idtmed[4],dm,0);
1428
1429   
1430
1431   // inner
1432
1433   dm[0]=79.3;
1434   dm[1]=82.8;
1435   dm[2]=0.2;
1436
1437   gMC->Gsposp("THVH",1,"TDGN",0.,0.,0.,0,"ONLY",dm,3);
1438   
1439   // outer
1440
1441   dm[0]= 252.;
1442   dm[1]= 257.9;
1443   dm[2]= 0.4;
1444
1445   gMC->Gsposp("THVH",2,"TDGN",0.,0.,0.,0,"ONLY",dm,3);
1446
1447   //----------------------------------------------------------
1448   // TPc Support Rods - MAKROLON
1449   //----------------------------------------------------------
1450
1451   dm[0]= 0.9;
1452   dm[1]= 1.2;
1453
1454   gMC->Gsvolu("TPSR","TUBE",idtmed[7],dm,0); // inner and outer rods differ
1455
1456
1457   for(Int_t nrod=0;nrod<18;nrod++){
1458     Float_t angle=innerOpenAngle*(Float_t)nrod;
1459
1460     xc=81.5*TMath::Cos(angle);
1461     yc=81.5*TMath::Sin(angle); 
1462
1463     dm[2]=126.7;
1464
1465     gMC->Gsposp("TPSR",nrod+1,"TDGN",xc,yc,126.9,0,"ONLY",dm,3); 
1466     gMC->Gsposp("TPSR",nrod+19,"TDGN",xc,yc,-126.9,0,"ONLY",dm,3);
1467
1468     dm[2]=126.6;
1469
1470     xc=254.25*TMath::Cos(angle);
1471     yc=254.25*TMath::Sin(angle);   
1472       
1473     // rod number 54 contans the HV cable
1474
1475     if(nrod<17) {
1476       gMC->Gsposp("TPSR",nrod+37,"TDGN",xc,yc,127.,0,"ONLY",dm,3);
1477       gMC->Gsposp("TPSR",nrod+54,"TDGN",xc,yc,-127.,0,"ONLY",dm,3);
1478     }
1479     
1480   }
1481
1482   //----------------------------------------------------------
1483   // Tpc High Voltage Rod - MAKROLON + Copper cable
1484   //----------------------------------------------------------
1485
1486   // rod with cable (Left)
1487
1488   dm[0]=0.;
1489   dm[1]=2.25;
1490   dm[2]=126.6;
1491
1492   gMC->Gsvolu("THVL","TUBE",idtmed[7],dm,3);
1493
1494   // HV cable
1495  
1496   dm[0]=0.;
1497   dm[1]=0.3;
1498   dm[2]=126.6;
1499
1500   gMC->Gsvolu("THVC","TUBE",idtmed[10],dm,3);  
1501
1502   // empty space
1503
1504   dm[0]=0.3;
1505   dm[1]=1.;
1506   dm[2]=126.6;
1507
1508   gMC->Gsvolu("THVE","TUBE",idtmed[1],dm,3);
1509
1510   gMC->Gspos("THVC",1,"THVL",0.,0.,0.,0,"ONLY");
1511   gMC->Gspos("THVE",1,"THVL",0.,0.,0.,0,"ONLY");
1512
1513   // rod without cable
1514
1515   dm[0]=1.8;
1516   dm[1]=2.25;
1517   dm[2]=126.6;
1518
1519   gMC->Gsvolu("THVR","TUBE",idtmed[7],dm,3);
1520
1521   gMC->Gspos("THVL",1,"TDGN",xc,yc,-127.,0,"ONLY");  
1522   gMC->Gspos("THVR",1,"TDGN",xc,yc,127.,0,"ONLY");
1523
1524   gMC->Gspos("TDGN",1,"TPC ",0.,0.,0.,0,"ONLY"); 
1525  
1526   // services wheel cover -> wheel
1527
1528
1529   gMC->Gspos("TSWC",1,"TSSW",0.,0.,4.5,0,"ONLY");
1530   gMC->Gspos("TSWC",2,"TSSW",0.,0.,-4.5,0,"ONLY");
1531
1532
1533   // put the wheel into the TPC
1534
1535   gMC->Gspos("TSSW",1,"TPC ",0.,0.,278.7,0,"ONLY");
1536   gMC->Gspos("TSSW",2,"TPC ",0.,0.,-278.7,0,"ONLY");
1537
1538   //
1539
1540   gMC->Gsord("TPMW",6);
1541   gMC->Gsord("TSSW",6);
1542   gMC->Gsord("TSWC",6);
1543
1544   // put the TPC into ALIC (main mother volume)
1545
1546   gMC->Gspos("TPC ",1,"ALIC",0.,0.,0.,0,"ONLY");
1547
1548 } // end of function
1549
1550
1551 //_____________________________________________________________________________
1552 void AliTPCv0::CreateMaterials()
1553 {
1554   //
1555   // Define materials for the TPC
1556   //
1557   AliTPC::CreateMaterials();
1558 }
1559
1560 //_____________________________________________________________________________
1561 void AliTPCv0::DrawDetector()
1562 {
1563   //
1564   // Draw a shaded view of the Time Projection Chamber version 0
1565   //
1566
1567   // Set everything unseen
1568   gMC->Gsatt("*", "seen", -1);
1569   // 
1570   // Set ALIC mother transparent
1571   gMC->Gsatt("ALIC","SEEN",0);
1572   //
1573   // Set the volumes visible
1574   gMC->Gsatt("TPC ","SEEN",0);
1575   gMC->Gsatt("TOIN","SEEN",1);
1576   gMC->Gsatt("TOIN","COLO",7);
1577   gMC->Gsatt("TOCV","SEEN",1);
1578   gMC->Gsatt("TOCV","COLO",4);
1579   gMC->Gsatt("TSA1","SEEN",0);
1580   gMC->Gsatt("TSA2","SEEN",0);
1581   gMC->Gsatt("TSA3","SEEN",0);
1582   gMC->Gsatt("TSA4","SEEN",0);  
1583   gMC->Gsatt("TSA5","SEEN",0);
1584   gMC->Gsatt("TOFC","SEEN",1);
1585   gMC->Gsatt("TOFC","COLO",4);
1586   gMC->Gsatt("TSA6","SEEN",0);
1587   gMC->Gsatt("TSA7","SEEN",0);
1588   gMC->Gsatt("TSA8","SEEN",0);    
1589   gMC->Gsatt("TIIN","SEEN",1);
1590   gMC->Gsatt("TIIN","COLO",7);
1591   gMC->Gsatt("TII1","SEEN",0);
1592   gMC->Gsatt("TIFC","SEEN",1);
1593   gMC->Gsatt("TIFC","COLO",4);
1594   gMC->Gsatt("TSA9","SEEN",0); 
1595   gMC->Gsatt("TS10","SEEN",0);
1596   gMC->Gsatt("TS11","SEEN",0);
1597   gMC->Gsatt("TS12","SEEN",0);
1598   gMC->Gsatt("TS13","SEEN",0);
1599   gMC->Gsatt("TS14","SEEN",0);
1600   gMC->Gsatt("TICC","SEEN",0);
1601   gMC->Gsatt("TICM","SEEN",0);
1602   gMC->Gsatt("TS15","SEEN",0);
1603   gMC->Gsatt("TS16","SEEN",0);
1604   gMC->Gsatt("TS17","SEEN",0);
1605   gMC->Gsatt("TS18","SEEN",0);  
1606   gMC->Gsatt("TS19","SEEN",0); 
1607   gMC->Gsatt("TPJ1","SEEN",0);
1608   gMC->Gsatt("TPJ2","SEEN",0);
1609   gMC->Gsatt("TICS","SEEN",0);
1610   gMC->Gsatt("TDGN","SEEN",0); 
1611   gMC->Gsatt("TIRC","SEEN",0);
1612   gMC->Gsatt("TIC1","SEEN",1);
1613   gMC->Gsatt("TIPP","SEEN",0);
1614   gMC->Gsatt("TIC3","SEEN",0);
1615   gMC->Gsatt("TRCE","SEEN",0);
1616   gMC->Gsatt("TPSC","SEEN",0);
1617   gMC->Gsatt("TPCC","SEEN",0); 
1618   gMC->Gsatt("TORC","SEEN",0);
1619   gMC->Gsatt("TOPP","SEEN",0);
1620   gMC->Gsatt("TOC3","SEEN",0);
1621   gMC->Gsatt("TOC1","SEEN",1);
1622   gMC->Gsatt("TSSW","SEEN",1);
1623   gMC->Gsatt("TSWC","SEEN",1);
1624   gMC->Gsatt("TSSW","COLO",3);
1625   gMC->Gsatt("TSWC","COLO",3);
1626   gMC->Gsatt("TSCE","COLO",6);
1627   gMC->Gsatt("TSCE","SEEN",1);
1628   gMC->Gsatt("TWES","SEEN",0);
1629   gMC->Gsatt("TSWB","SEEN",0);
1630   gMC->Gsatt("TPEL","SEEN",0);
1631   gMC->Gsatt("TPMW","SEEN",1);
1632   gMC->Gsatt("TESR","SEEN",1);
1633   gMC->Gsatt("TPMW","COLO",12);
1634   gMC->Gsatt("TIC1","COLO",5);
1635   gMC->Gsatt("TOC1","COLO",5);
1636   gMC->Gsatt("TESB","SEEN",0);
1637   gMC->Gsatt("THVM","SEEN",1);
1638   gMC->Gsatt("THVM","COLO",11);
1639   gMC->Gsatt("THVH","SEEN",0);
1640   gMC->Gsatt("TPSR","SEEN",0); 
1641   gMC->Gsatt("THVL","SEEN",0);
1642   gMC->Gsatt("THVC","SEEN",0);  
1643   gMC->Gsatt("THVE","SEEN",0);
1644   gMC->Gsatt("THVR","SEEN",0);
1645
1646   //
1647   gMC->Gdopt("hide", "on");
1648   gMC->Gdopt("shad", "on");
1649   gMC->Gsatt("*", "fill", 7);
1650   gMC->SetClipBox(".");
1651   gMC->SetClipBox("TPMW",-300,300,-300,300,254.,270.);
1652   gMC->SetClipBox("TESR",-300,300,-300,300,254.,270.);
1653   gMC->SetClipBox("TSSW",-300,300,-300,300,283.,284.);
1654   gMC->SetClipBox("TSWC",-300,300,-300,300,283.,284.);
1655   gMC->SetClipBox("*", 0, 300, -300, 300, -290, 290);
1656   gMC->DefaultRange();
1657   gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .025, .025);
1658   gMC->Gdhead(1111, "Time Projection Chamber");
1659   gMC->Gdman(18, 4, "MAN");
1660   gMC->Gdopt("hide","off");
1661 }
1662
1663 //_____________________________________________________________________________
1664 void AliTPCv0::Init()
1665 {
1666   //
1667   // Initialise Time Projection Chamber version 0
1668   //
1669  
1670   printf("%s: *** TPC version 0 initialized***\n",ClassName()); 
1671
1672   //  printf("TPC version 0 initialized\n");
1673 }
1674
1675 //_____________________________________________________________________________
1676 void AliTPCv0::StepManager()
1677 {
1678   //
1679   // Procedure called at each step in the TPC
1680   //
1681 }