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