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