]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSvPPRcoarseasymm.cxx
changes to be compliant with Eff C++ rules
[u/mrichter/AliRoot.git] / ITS / AliITSvPPRcoarseasymm.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 /* $Id$ */
17
18 ///////////////////////////////////////////////////////////////////////////////
19 //                                                                           //
20 //  Inner Traking System version PPR coarse asymmetric                                         //
21 //  This class contains the base procedures for the Inner Tracking System    //
22 //                                                                           //
23 // Authors: R. Barbera
24 // version 6.
25 // Created  2000.
26 //
27 //  NOTE: THIS IS THE COARSE ASYMMETRIC PPR geometry of the ITS. 
28 // THIS WILL NOT WORK
29 // with the geometry or module classes or any analysis classes. You are 
30 // strongly encouraged to uses AliITSv5.
31 //                                                                           //
32 ///////////////////////////////////////////////////////////////////////////////
33 #include <Riostream.h> 
34 #include <TMath.h>
35 #include <TNode.h>
36 #include <TObjArray.h>
37 #include <TRandom.h>
38 #include <TTUBE.h>
39 #include <TVector.h>
40 #include <TVirtualMC.h>
41 #include <TGeometry.h>
42
43
44 #include "AliMagF.h"
45 #include "AliConst.h"
46 #include "AliITShit.h"
47 #include "AliITSvPPRcoarseasymm.h"
48 #include "AliMagF.h"
49 #include "AliRun.h"
50
51 ClassImp(AliITSvPPRcoarseasymm)
52  
53 //_____________________________________________________________________________
54 AliITSvPPRcoarseasymm::AliITSvPPRcoarseasymm():
55 fMajorVersion(9),
56 fMinorVersion(0),
57 fRails(0),
58 fSuppMat(0) {
59 ////////////////////////////////////////////////////////////////////////
60 //    Standard default constructor for the ITS version 6.
61 ////////////////////////////////////////////////////////////////////////
62
63     fIdN = 0;
64     fIdName = 0;
65     fIdSens    = 0;
66 }
67 //_____________________________________________________________________________
68 AliITSvPPRcoarseasymm::AliITSvPPRcoarseasymm(const char *name, const char *title) : AliITS(name, title),
69 fMajorVersion(9),
70 fMinorVersion(0),
71 fRails(0),
72 fSuppMat(0) {
73 ////////////////////////////////////////////////////////////////////////
74 //    Standard constructor for the ITS version 6.
75 ////////////////////////////////////////////////////////////////////////
76
77     fIdN = 6;
78     fIdName = new TString[fIdN];
79     fIdName[0] = "ITS1";
80     fIdName[1] = "ITS2";
81     fIdName[2] = "ITS3";
82     fIdName[3] = "ITS4";
83     fIdName[4] = "ITS5";
84     fIdName[5] = "ITS6";
85     fIdSens    = new Int_t[fIdN];
86     for (Int_t i=0;i<fIdN;i++) fIdSens[i]=0;
87 }
88 //____________________________________________________________________________
89 AliITSvPPRcoarseasymm::AliITSvPPRcoarseasymm(const AliITSvPPRcoarseasymm &s) :
90  AliITS(s),
91 fMajorVersion(s.fMajorVersion),
92 fMinorVersion(s.fMinorVersion),
93 fRails(s.fRails),
94 fSuppMat(s.fSuppMat){
95 ////////////////////////////////////////////////////////////////////////
96 //     Copy Constructor for ITS version 6.
97 ////////////////////////////////////////////////////////////////////////
98 }
99 //_____________________________________________________________________________
100 AliITSvPPRcoarseasymm& AliITSvPPRcoarseasymm::operator=(const AliITSvPPRcoarseasymm &source){
101 ////////////////////////////////////////////////////////////////////////
102 //    Assignment operator for the ITS version 6.
103 ////////////////////////////////////////////////////////////////////////
104   if(&source == this) return *this;
105     Warning("= operator","Not allowed to copy AliITSvPPRcoarseasymm");
106   return *this;
107 }
108 //_____________________________________________________________________________
109 AliITSvPPRcoarseasymm::~AliITSvPPRcoarseasymm() {
110 ////////////////////////////////////////////////////////////////////////
111 //    Standard destructor for the ITS version 6.
112 ////////////////////////////////////////////////////////////////////////
113 }
114
115 //__________________________________________________________________________
116 void AliITSvPPRcoarseasymm::BuildGeometry(){
117 ////////////////////////////////////////////////////////////////////////
118 //    Geometry builder for the ITS version 6.
119 ////////////////////////////////////////////////////////////////////////
120     TNode *node, *top;
121     const Int_t kColorITS=kYellow;
122     //
123     top = gAlice->GetGeometry()->GetNode("alice");
124
125     new TTUBE("S_layer1","Layer1 of ITS","void",3.8095,3.8095+1.03*9.36/100.,14.35);
126     top->cd();
127     node = new TNode("Layer1","Layer1","S_layer1",0,0,0,"");
128     node->SetLineColor(kColorITS);
129     fNodes->Add(node);
130
131     new TTUBE("S_layer2","Layer2 of ITS","void",7.,7.+1.03*9.36/100.,14.35);
132     top->cd();
133     node = new TNode("Layer2","Layer2","S_layer2",0,0,0,"");
134     node->SetLineColor(kColorITS);
135     fNodes->Add(node);
136
137     new TTUBE("S_layer3","Layer3 of ITS","void",15.,15.+0.94*9.36/100.,25.1);
138     top->cd();
139     node = new TNode("Layer3","Layer3","S_layer3",0,0,0,"");
140     node->SetLineColor(kColorITS);
141     fNodes->Add(node);
142
143     new TTUBE("S_layer4","Layer4 of ITS","void",24.1,24.1+0.95*9.36/100.,32.1);
144     top->cd();
145     node = new TNode("Layer4","Layer4","S_layer4",0,0,0,"");
146     node->SetLineColor(kColorITS);
147     fNodes->Add(node);
148
149     new TTUBE("S_layer5","Layer5 of ITS","void",38.5,38.5+0.91*9.36/100.,49.405);
150     top->cd();
151     node = new TNode("Layer5","Layer5","S_layer5",0,0,0,"");
152     node->SetLineColor(kColorITS);
153     fNodes->Add(node);
154
155     new TTUBE("S_layer6","Layer6 of ITS","void",43.5765,43.5765+0.87*9.36/100.,55.27);
156     top->cd();
157     node = new TNode("Layer6","Layer6","S_layer6",0,0,0,"");
158     node->SetLineColor(kColorITS);
159     fNodes->Add(node);
160 }
161 //_____________________________________________________________________________
162 void AliITSvPPRcoarseasymm::CreateGeometry(){
163 ////////////////////////////////////////////////////////////////////////
164 //    This routine defines and Creates the geometry for version 6 of the ITS.
165 ////////////////////////////////////////////////////////////////////////
166   
167   //INNER RADII OF THE SILICON LAYERS 
168   Float_t rl[6]    = { 3.8095,7.,15.,24.,38.5,43.5765 };   
169   //THICKNESSES OF LAYERS (in % radiation length)
170   Float_t drl[6]   = { 1.03,1.03,0.94,0.95,0.91,0.87 };   
171   //HALF LENGTHS OF LAYERS  
172   Float_t dzl[6]   = { 14.35,14.35,25.1,32.1,49.405,55.27 };
173   //LENGTHS OF END-LADDER BOXES (ALL INCLUDED)
174   Float_t dzb[6]   = { 12.4,12.4,13.5,15.,7.5,7.5 };   
175   //THICKNESSES OF END-LADDER BOXES (ALL INCLUDED)
176   Float_t drb[6]   = { rl[1]-rl[0],0.2,5.,5.,4.,4. };        
177
178  
179   Float_t dits[3], rlim, zmax;
180   Float_t zpos;
181   Float_t pcits[100], ztpc;
182   Int_t idrotm[1999], i;
183   Float_t dgh[100];
184   
185   Int_t rails = 1;       // flag for rails (1 --> rails in; 0 --> rails out)
186   Int_t suppmat = 0;     // flag to change the material of the services
187                          // supports (=0 copper, =1 aluminum, =2 carbon)  
188   rails = GetRails();
189   
190   if(rails != 0 && rails != 1) {
191      cout << "ITS - WARNING: the switch for rails is not set neither to 0 (rails out) nor to 1 (rails in)." 
192      " The default value of 1 (rails in) will be used." << endl;
193   }  
194   
195   if (rails == 0 ) {
196      cout << "ITS: Rails are out." << endl; 
197   } else {
198      cout << "ITS: Rails are in." << endl;
199   }      
200   
201   suppmat = GetSupportMaterial();   
202   
203   if (suppmat != 0 && suppmat != 1 && suppmat != 2) {
204      cout << "ITS - WARNING: the flag for the material of services supports is not set neither to 0 (copper) nor to 1 (aluminum) nor to 2 (carbon)." 
205      " The default value of 0 (copper) will be used." << endl;
206   }  
207   
208   if (suppmat == 0) {
209      cout << "ITS: The material of the services supports is copper." << endl; 
210   } else if (suppmat == 1){
211      cout << "ITS: The material of the services supports is aluminum." << endl;
212   } else {
213      cout << "ITS: The material of the services supports is carbon." << endl;
214   }      
215       
216
217   Int_t *idtmed = fIdtmed->GetArray()-199;
218   
219   //     CONVERT INTO CM (RL(SI)=9.36 CM) 
220   for (i = 0; i < 6; ++i) {
221     drl[i] = drl[i] / 100. * 9.36;
222   }
223     
224   //     FIELD CAGE HALF LENGTH 
225   
226   rlim  = 50.;
227   zmax  = 74.;
228   ztpc = 284.;
229   
230   // --- Define ghost volume containing the whole ITS (including services) 
231   //     and fill it with air 
232   
233   dgh[0] = 0.;
234   dgh[1] = 360.;
235   dgh[2] = 16.;
236   dgh[3] = -ztpc-5.-0.1;
237   dgh[4] = 46;   
238   dgh[5] = 85.;
239   dgh[6] = -ztpc;
240   dgh[7] = 46;   
241   dgh[8] = 85.;
242   dgh[9] = -ztpc;
243   dgh[10] = 46;  
244   dgh[11] = rlim+6;
245   dgh[12] = -97.5;
246   dgh[13] = 46;  
247   dgh[14] = rlim+6;
248   dgh[15] = -zmax;
249   dgh[16] = 46;  
250   dgh[17] = rlim+6;
251   dgh[18] = -48;   
252   dgh[19] = 6;
253   dgh[20] = rlim+6;
254   dgh[21] = -28.6;   
255   dgh[22] = 6;
256   dgh[23] = rlim+6;    
257   dgh[24] = -27.6;  
258   dgh[25] = 3.295;
259   dgh[26] = rlim+6; 
260   dgh[27] = 27.6;   
261   dgh[28] = 3.295;
262   dgh[29] = rlim+6;
263   dgh[30] = 28.6;   
264   dgh[31] = 6;
265   dgh[32] = rlim+6;
266   dgh[33] = 48;   
267   dgh[34] = 6;
268   dgh[35] = rlim+6;  
269   dgh[36] = zmax;
270   dgh[37] = 46;
271   dgh[38] = rlim+6;
272   dgh[39] = 97.5;
273   dgh[40] = 46;  
274   dgh[41] = rlim+6;
275   dgh[42] = ztpc;
276   dgh[43] = 62;     
277   dgh[44] = 62+4.;  
278   dgh[45] = ztpc;
279   dgh[46] = 62;     
280   dgh[47] = 85.;
281   dgh[48] = ztpc+4.+0.1;
282   dgh[49] = 62.4;
283   dgh[50] = 85.;
284   gMC->Gsvolu("ITSV", "PCON", idtmed[275], dgh, 51);
285   
286   // --- Place the ghost volume in its mother volume (ALIC) and make it 
287   //     invisible 
288   
289   gMC->Gspos("ITSV", 1, "ALIC", 0., 0., 0., 0, "ONLY");
290   //gMC->Gsatt("ITSV", "SEEN", 0); 
291
292
293   // --- Define ghost volume containing the six layers and fill it with air 
294   
295   dgh[0] = 0.;
296   dgh[1] = 360.;
297   dgh[2] = 8.;
298   dgh[3] = -zmax;  
299   dgh[4] = 46.;
300   dgh[5] = rlim;
301   dgh[6] = -47.5;    
302   dgh[7] = 6.005;
303   dgh[8] = rlim;
304   dgh[9] = -28.5;    
305   dgh[10] = 6.005;
306   dgh[11] = rlim;  
307   dgh[12] = -27.5;   
308   dgh[13] = 3.3;
309   dgh[14] = rlim;
310   dgh[15] = 27.5;    
311   dgh[16] = 3.3;
312   dgh[17] = rlim;
313   dgh[18] = 28.5;    
314   dgh[19] = 6.005;
315   dgh[20] = rlim;
316   dgh[21] = 47.5;    
317   dgh[22] = 6.005;
318   dgh[23] = rlim;
319   dgh[24] = zmax;    
320   dgh[25] = 46.;
321   dgh[26] = rlim;
322   gMC->Gsvolu("ITSD", "PCON", idtmed[275], dgh, 27);
323   
324   // --- Place the ghost volume in its mother volume (ITSV) and make it 
325   //     invisible 
326   
327   gMC->Gspos("ITSD", 1, "ITSV", 0., 0., 0., 0, "ONLY");
328   //gMC->Gsatt("ITSD", "SEEN", 0);
329   
330
331   //     ITS LAYERS (SILICON) 
332   
333   dits[0] = rl[0];
334   dits[1] = rl[0] + drl[0];
335   dits[2] = dzl[0];
336   gMC->Gsvolu("ITS1", "TUBE", idtmed[199], dits, 3);
337   gMC->Gspos("ITS1", 1, "ITSD", 0., 0., 0., 0, "ONLY");
338   
339   dits[0] = rl[1];
340   dits[1] = rl[1] + drl[1];
341   dits[2] = dzl[1];
342   gMC->Gsvolu("ITS2", "TUBE", idtmed[199], dits, 3);
343   gMC->Gspos("ITS2", 1, "ITSD", 0., 0., 0., 0, "ONLY");
344   
345   dits[0] = rl[2];
346   dits[1] = rl[2] + drl[2];
347   dits[2] = dzl[2];
348   gMC->Gsvolu("ITS3", "TUBE", idtmed[224], dits, 3);
349   gMC->Gspos("ITS3", 1, "ITSD", 0., 0., 0., 0, "ONLY");
350   
351   dits[0] = rl[3];
352   dits[1] = rl[3] + drl[3];
353   dits[2] = dzl[3];
354   gMC->Gsvolu("ITS4", "TUBE", idtmed[224], dits, 3);
355   gMC->Gspos("ITS4", 1, "ITSD", 0., 0., 0., 0, "ONLY");
356   
357   dits[0] = rl[4];
358   dits[1] = rl[4] + drl[4];
359   dits[2] = dzl[4];
360   gMC->Gsvolu("ITS5", "TUBE", idtmed[249], dits, 3);
361   gMC->Gspos("ITS5", 1, "ITSD", 0., 0., 0., 0, "ONLY");
362   
363   dits[0] = rl[5];
364   dits[1] = rl[5] + drl[5];
365   dits[2] = dzl[5];
366   gMC->Gsvolu("ITS6", "TUBE", idtmed[249], dits, 3);
367   gMC->Gspos("ITS6", 1, "ITSD", 0., 0., 0., 0, "ONLY");
368   
369   // END-LADDER ELECTRONICS BOXES AND CABLES FOR SPD
370   
371   gMC->Gsvolu("IEL1", "TUBE", idtmed[208], dits, 0); 
372   for (i = 0; i < 2; i++) {
373     dits[0] = rl[i];
374     dits[1] = dits[0] + drb[i];
375     dits[2] = dzb[i] / 2.;
376     zpos = dzl[i] + dits[2];
377     gMC->Gsposp("IEL1", i+1, "ITSD", 0., 0., zpos, 0, "ONLY", dits, 3);
378     gMC->Gsposp("IEL1", i+1+6, "ITSD", 0., 0.,-zpos, 0, "ONLY", dits, 3);
379   }
380   
381   // END-LADDER ELECTRONICS BOXES AND CABLES FOR SDD
382   
383   gMC->Gsvolu("IEL2", "TUBE", idtmed[237], dits, 0); 
384   for (i = 2; i < 3; i++) {
385     dits[0] = rl[i]-2.5;
386     dits[1] = dits[0] + drb[i];
387     dits[2] = dzb[i] / 2.;
388     zpos = dzl[i] + dits[2];
389     gMC->Gsposp("IEL2", i+1, "ITSD", 0., 0., zpos, 0, "ONLY", dits, 3);
390     gMC->Gsposp("IEL2", i+1+6, "ITSD", 0., 0.,-zpos, 0, "ONLY", dits, 3);
391   }
392   for (i = 3; i < 4; i++) {
393     dits[0] = rl[i]-1.4;
394     dits[1] = dits[0] + drb[i];
395     dits[2] = dzb[i] / 2.;
396     zpos = dzl[i] + dits[2];
397     gMC->Gsposp("IEL2", i+1, "ITSD", 0., 0., zpos, 0, "ONLY", dits, 3);
398     gMC->Gsposp("IEL2", i+1+6, "ITSD", 0., 0.,-zpos, 0, "ONLY", dits, 3);
399   }
400   
401   // END-LADDER ELECTRONICS BOXES AND CABLES FOR SSD
402   
403   gMC->Gsvolu("IEL3", "TUBE", idtmed[263], dits, 0); 
404   for (i = 4; i < 5; i++) {
405     dits[0] = rl[i]+1.4;
406     dits[1] = dits[0] + drb[i];
407     dits[2] = dzb[i] / 2.;
408     zpos = dzl[i] + dits[2];
409     gMC->Gsposp("IEL3", i+1, "ITSD", 0., 0., zpos, 0, "ONLY", dits, 3);
410     gMC->Gsposp("IEL3", i+1+6, "ITSD", 0., 0.,-zpos, 0, "ONLY", dits, 3);
411   }    
412   for (i = 5; i < 6; i++) {
413     dits[0] = rl[i]+0.4235;
414     dits[1] = dits[0] + drb[i];
415     dits[2] = dzb[i] / 2.;
416     zpos = dzl[i] + dits[2];
417     gMC->Gsposp("IEL3", i+1, "ITSD", 0., 0., zpos, 0, "ONLY", dits, 3);
418     gMC->Gsposp("IEL3", i+1+6, "ITSD", 0., 0.,-zpos, 0, "ONLY", dits, 3);
419   }        
420
421   //    DEFINE THERMAL SCREEN FOR SPD
422   
423   pcits[0] = 8.3;
424   pcits[1] = 8.5;
425   pcits[2] = 42.5;
426   gMC->Gsvolu("ICY1", "TUBE", idtmed[274], pcits, 3);   
427   gMC->Gspos("ICY1", 1, "ITSD", 0., 0., 0., 0, "ONLY");
428
429   //    DEFINE END CONES FOR SDD
430   
431   pcits[0] = (59.-42.5)/2.;
432   pcits[1] = 8.5;
433   pcits[2] = 8.5+0.1;
434   pcits[3] = 28.;
435   pcits[4] = 28.+0.1;  
436   gMC->Gsvolu("ICO1", "CONE", idtmed[238], pcits, 5);    
437   AliMatrix(idrotm[200], 90., 0., 90., 90., 180., 0.);
438   gMC->Gspos("ICO1", 1, "ITSD", 0., 0., 42.5+pcits[0], 0, "ONLY");
439   gMC->Gspos("ICO1", 2, "ITSD", 0., 0., -(42.5+pcits[0]), idrotm[200], "ONLY");
440
441   //    DEFINE CYLINDER BETWEEN SDD AND SSD
442   
443   pcits[0] = (59.5-0.13/2.)/2.;
444   pcits[1] = (59.5+0.13/2.)/2.;
445   pcits[2] = 57.;
446   gMC->Gsvolu("ICY2", "TUBE", idtmed[274], pcits, 3);   
447   gMC->Gspos("ICY2", 1, "ITSD", 0., 0., 0., 0, "ONLY"); 
448
449   //    DEFINE END CONES FOR SSD
450   
451   pcits[0] = (74.-59.)/2.;
452   pcits[1] = 28.;
453   pcits[2] = 28.+0.1;
454   pcits[3] = 47.;
455   pcits[4] = 47.+0.1;
456   gMC->Gsvolu("ICO2", "CONE", idtmed[264], pcits, 5);    
457   gMC->Gspos("ICO2", 1, "ITSD", 0., 0., 59.+pcits[0], 0, "ONLY");
458   gMC->Gspos("ICO2", 2, "ITSD", 0., 0., -(59.+pcits[0]), idrotm[200], "ONLY");
459   
460     
461   // ****************************  SERVICES  *********************************
462   
463
464   
465   // --- DEFINE CABLES AT THE END OF THE ITS CONES - COPPER PART
466   //     UPPER PART
467   
468   dgh[0] = 46.;    
469   dgh[1] = 46.+1.0;  
470   dgh[2] = 9.5;
471   dgh[3] = 12.;
472   dgh[4] = 168.;
473   
474   if (suppmat == 0) {
475      gMC->Gsvolu("I1CU", "TUBS", idtmed[279], dgh, 5);    // copper
476   } else if (suppmat == 1) {
477      gMC->Gsvolu("I1CU", "TUBS", idtmed[285], dgh, 5);    // aluminum
478   } else {
479      gMC->Gsvolu("I1CU", "TUBS", idtmed[274], dgh, 5);    // carbon
480   }     
481   gMC->Gspos("I1CU", 1, "ITSV", 0., 0., 83.5, 0, "ONLY");
482   gMC->Gspos("I1CU", 2, "ITSV", 0., 0., -83.5, idrotm[200], "ONLY");
483   
484   // --- DEFINE CABLES AT THE END OF THE ITS CONES - COPPER PART
485   //     LOWER PART
486   
487   dgh[0] = 46.;    
488   dgh[1] = 46.+1.0;  
489   dgh[2] = 9.5;
490   dgh[3] = 192.;
491   dgh[4] = 348.;
492   
493   if (suppmat == 0) {
494      gMC->Gsvolu("I2CU", "TUBS", idtmed[279], dgh, 5);    // copper
495   } else if (suppmat == 1) {
496      gMC->Gsvolu("I2CU", "TUBS", idtmed[285], dgh, 5);    // aluminum
497   } else {
498      gMC->Gsvolu("I2CU", "TUBS", idtmed[274], dgh, 5);    // carbon
499   }     
500   gMC->Gspos("I2CU", 1, "ITSV", 0., 0., 83.5, 0, "ONLY");
501   gMC->Gspos("I2CU", 2, "ITSV", 0., 0., -83.5, idrotm[200], "ONLY");
502
503
504   // --- DEFINE CABLES AT THE END OF THE ITS CONES - CARBON PART
505   //     UPPER PART
506   
507   dgh[0] = 46.+1.0;  
508   dgh[1] = 46.+1.0+1.5;   
509   dgh[2] = 9.5;
510   dgh[3] = 12.;
511   dgh[4] = 168.;
512   
513   gMC->Gsvolu("I1CC", "TUBS", idtmed[274], dgh, 5);  
514   gMC->Gspos("I1CC", 1, "ITSV", 0., 0., 83.5, 0, "ONLY");
515   gMC->Gspos("I1CC", 2, "ITSV", 0., 0., -83.5, idrotm[200], "ONLY");  
516   
517   // --- DEFINE CABLES AT THE END OF THE ITS CONES - CARBON PART
518   //     LOWER PART
519   
520   dgh[0] = 46.+1.0;  
521   dgh[1] = 46.+1.0+1.5;   
522   dgh[2] = 9.5;
523   dgh[3] = 192.;
524   dgh[4] = 348.;
525   
526   gMC->Gsvolu("I2CC", "TUBS", idtmed[274], dgh, 5);  
527   gMC->Gspos("I2CC", 1, "ITSV", 0., 0., 83.5, 0, "ONLY");
528   gMC->Gspos("I2CC", 2, "ITSV", 0., 0., -83.5, idrotm[200], "ONLY");  
529
530   // --- DEFINE PATCH PANELS AT THE END OF THE ITS CONES
531   //    UPPER PART
532     
533   dgh[0] = 46.;  
534   dgh[1] = 56.;
535   dgh[2] = 2.25;
536   dgh[3] = 12.;
537   dgh[4] = 168.;
538   
539   gMC->Gsvolu("IPA1", "TUBS", idtmed[285], dgh, 5);  
540   gMC->Gspos("IPA1", 1, "ITSV", 0., 0., 95.25, 0, "ONLY");  
541   gMC->Gspos("IPA1", 2, "ITSV", 0., 0., -95.25, idrotm[200], "ONLY"); 
542
543
544   // --- DEFINE PATCH PANELS AT THE END OF THE ITS CONES
545   //     LOWER PART
546     
547   dgh[0] = 46.;  
548   dgh[1] = 56.;
549   dgh[2] = 2.25;
550   dgh[3] = 192.;
551   dgh[4] = 348.;
552   
553   gMC->Gsvolu("IPA2", "TUBS", idtmed[285], dgh, 5);  
554   gMC->Gspos("IPA2", 1, "ITSV", 0., 0., 95.25, 0, "ONLY");  
555   gMC->Gspos("IPA2", 2, "ITSV", 0., 0., -95.25, idrotm[200], "ONLY"); 
556
557
558   // --- DEFINE CABLES/COOLING BELOW THE TPC ON THE ABSORBER SIDE - COPPER PART
559   //     UPPER PART
560   
561   dgh[0] = (ztpc-97.5)/2.;
562   dgh[1] = 46.2;     
563   dgh[2] = 46.2+1.0;  
564   dgh[3] = 62.3;     
565   dgh[4] = 62.3+1.0;   
566   dgh[5] = 12.;    
567   dgh[6] = 168.;
568   if (suppmat == 0) {
569      gMC->Gsvolu("ICU1", "CONS", idtmed[279], dgh, 7);    // copper
570   } else if (suppmat == 1) {
571      gMC->Gsvolu("ICU1", "CONS", idtmed[285], dgh, 7);    // aluminum  
572   } else {
573      gMC->Gsvolu("ICU1", "CONS", idtmed[274], dgh, 7);    // carbon
574   }
575   gMC->Gspos("ICU1", 1, "ITSV", 0., 0., 97.5+dgh[0], 0, "ONLY");   
576   
577   // --- DEFINE CABLES/COOLING BELOW THE TPC ON THE ABSORBER SIDE - COPPER PART
578   //     LOWER PART
579   
580   dgh[0] = (ztpc-97.5)/2.;
581   dgh[1] = 46.2;      
582   dgh[2] = 46.2+1.0;  
583   dgh[3] = 62.3;      
584   dgh[4] = 62.3+1.0;  
585   dgh[5] = 192.;    
586   dgh[6] = 348.;
587   if (suppmat == 0) {
588      gMC->Gsvolu("ICU2", "CONS", idtmed[279], dgh, 7);    // copper
589   } else if (suppmat == 1) {
590      gMC->Gsvolu("ICU2", "CONS", idtmed[285], dgh, 7);    // aluminum  
591   } else {
592      gMC->Gsvolu("ICU2", "CONS", idtmed[274], dgh, 7);    // carbon
593   }
594   gMC->Gspos("ICU2", 1, "ITSV", 0., 0., 97.5+dgh[0], 0, "ONLY");  
595
596
597    // --- DEFINE CABLES/COOLING BELOW THE TPC ON THE ABSORBER SIDE - CARBON PART
598    //     UPPER PART
599   
600   dgh[0] = (ztpc-97.5)/2.;
601   dgh[1] = 46.2+1.0;      
602   dgh[2] = 46.2+1.0+1.5;  
603   dgh[3] = 62.3+1.0;      
604   dgh[4] = 62.3+1.0+1.5;  
605   dgh[5] = 12.;    
606   dgh[6] = 168.;  
607   gMC->Gsvolu("ICC1", "CONS", idtmed[274], dgh, 7);    
608   gMC->Gspos("ICC1", 1, "ITSV", 0., 0., 97.5+dgh[0], 0, "ONLY");   
609   
610   // --- DEFINE CABLES/COOLING BELOW THE TPC ON THE ABSORBER SIDE - CARBON PART
611   //     LOWER PART
612   
613   dgh[0] = (ztpc-97.5)/2.;
614   dgh[1] = 46.2+1.0;    
615   dgh[2] = 46.2+1.0+1.5;
616   dgh[3] = 62.3+1.0;    
617   dgh[4] = 62.3+1.0+1.5;
618   dgh[5] = 192.;    
619   dgh[6] = 348.;  
620   gMC->Gsvolu("ICC2", "CONS", idtmed[274], dgh, 7);    
621   gMC->Gspos("ICC2", 1, "ITSV", 0., 0., 97.5+dgh[0], 0, "ONLY");  
622    
623   // --- DEFINE CABLES/COOLING BEHIND THE TPC ON THE ABSORBER SIDE - COPPER PART
624   //     UPPER PART
625     
626   dgh[0] = 62.1; 
627   dgh[1] = 74.5;
628   dgh[2] = 0.5;
629   dgh[3] = 12.;
630   dgh[4] = 168.;
631   if (suppmat == 0) {
632      gMC->Gsvolu("ICU3", "TUBS", idtmed[279], dgh, 5);    // copper
633   } else if (suppmat == 1) {
634      gMC->Gsvolu("ICU3", "TUBS", idtmed[285], dgh, 5);    // aluminum
635   } else {
636      gMC->Gsvolu("ICU3", "TUBS", idtmed[274], dgh, 5);    // carbon
637     }
638   gMC->Gspos("ICU3", 1, "ITSV", 0., 0., ztpc+1.5+dgh[2], 0, "ONLY");  
639
640   // --- DEFINE CABLES/COOLING BEHIND THE TPC ON THE ABSORBER SIDE - COPPER PART
641   //     LOWER PART
642   
643   dgh[0] = 62.1;  
644   dgh[1] = 74.5;
645   dgh[2] = 0.5;
646   dgh[3] = 192.;
647   dgh[4] = 348.;
648   if (suppmat == 0) {
649      gMC->Gsvolu("ICU4", "TUBS", idtmed[279], dgh, 5);    // copper
650   } else if (suppmat == 1) {
651      gMC->Gsvolu("ICU4", "TUBS", idtmed[285], dgh, 5);    // aluminum
652   } else {
653      gMC->Gsvolu("ICU4", "TUBS", idtmed[274], dgh, 5);    // carbon
654   }
655   gMC->Gspos("ICU4", 1, "ITSV", 0., 0., ztpc+1.5+dgh[2], 0, "ONLY");     
656      
657   // --- DEFINE CABLES/COOLING BEHIND THE TPC ON THE ABSORBER SIDE - CARBON PART
658   //     UPPER PART
659
660   dgh[0] = 62.1;  
661   dgh[1] = 74.5;
662   dgh[2] = 0.75;
663   dgh[3] = 12.;
664   dgh[4] = 168.;
665   gMC->Gsvolu("ICC3", "TUBS", idtmed[274], dgh, 5);    
666   gMC->Gspos("ICC3", 1, "ITSV", 0., 0., ztpc+dgh[2], 0, "ONLY");   
667     
668   // --- DEFINE CABLES/COOLING BEHIND THE TPC ON THE ABSORBER SIDE - CARBON PART
669   //     LOWER PART
670
671   dgh[0] = 62.1;  
672   dgh[1] = 74.5;
673   dgh[2] = 0.75;
674   dgh[3] = 192.;
675   dgh[4] = 348.;
676   gMC->Gsvolu("ICC4", "TUBS", idtmed[274], dgh, 5);    
677   gMC->Gspos("ICC4", 1, "ITSV", 0., 0., ztpc+dgh[2], 0, "ONLY");  
678   
679   // --- DEFINE CABLES/COOLING BELOW THE TPC ON THE OTHER SIDE W.R.T.
680   //     THE ABSORBER - COPPER PART - UPPER PART
681   
682   dgh[0] = 46.;      
683   dgh[1] = 46.+1.0;  
684   dgh[2] = (ztpc-97.5+1.5)/2.;
685   dgh[3] = 12.;
686   dgh[4] = 168.;
687   if (suppmat == 0) {
688      gMC->Gsvolu("ICU5", "TUBS", idtmed[279], dgh, 5);   // copper
689   } else if (suppmat == 1) {
690      gMC->Gsvolu("ICU5", "TUBS", idtmed[285], dgh, 5);   // aluminum
691   } else {
692      gMC->Gsvolu("ICU5", "TUBS", idtmed[274], dgh, 5);   // carbon
693   }
694   gMC->Gspos("ICU5", 1, "ITSV", 0., 0., -97.5-dgh[2], 0, "ONLY");  
695   
696   // --- DEFINE CABLES/COOLING BELOW THE TPC ON THE OTHER SIDE W.R.T.
697   //     THE ABSORBER - COPPER PART - LOWER PART
698   
699   dgh[0] = 46.;  
700   dgh[1] = 46.+1.0;  
701   dgh[2] = (ztpc-97.5+1.5)/2.;
702   dgh[3] = 192.;
703   dgh[4] = 348.;  
704   if (suppmat == 0) {
705      gMC->Gsvolu("ICU6", "TUBS", idtmed[279], dgh, 5);   // copper
706   } else if (suppmat == 1) {
707      gMC->Gsvolu("ICU6", "TUBS", idtmed[285], dgh, 5);   // aluminum
708   } else {
709      gMC->Gsvolu("ICU6", "TUBS", idtmed[274], dgh, 5);   // carbon
710   }
711   gMC->Gspos("ICU6", 1, "ITSV", 0., 0., -97.5-dgh[2], 0, "ONLY");    
712   
713   // --- DEFINE CABLES/COOLING BELOW THE TPC ON THE OTHER SIDE W.R.T.
714   //     THE ABSORBER - CARBON PART - UPPER PART
715   
716   dgh[0] = 46.+1.0;  
717   dgh[1] = 46.+1.0+1.5; 
718   dgh[2] = (ztpc-97.5)/2.;
719   dgh[3] = 12.;
720   dgh[4] = 168.;  
721   gMC->Gsvolu("ICC5", "TUBS", idtmed[274], dgh, 5);   
722   gMC->Gspos("ICC5", 1, "ITSV", 0., 0., -97.5-dgh[2], 0, "ONLY");   
723   
724   // --- DEFINE CABLES/COOLING BELOW THE TPC ON THE OTHER SIDE W.R.T.
725   //     THE ABSORBER - CARBON PART - LOWER PART
726   
727   dgh[0] = 46.+1.0;   
728   dgh[1] = 46.+1.0+1.5;  
729   dgh[2] = (ztpc-97.5)/2.;
730   dgh[3] = 192.;
731   dgh[4] = 348.;  
732   gMC->Gsvolu("ICC6", "TUBS", idtmed[274], dgh, 5);   
733   gMC->Gspos("ICC6", 1, "ITSV", 0., 0., -97.5-dgh[2], 0, "ONLY");      
734
735   // --- DEFINE CABLES/COOLING BEHIND THE TPC ON OTHER SIDE W.R.T. THE ABSORBER
736   //     COPPER PART - UPPER PART
737     
738   dgh[0] = 46.;   
739   dgh[1] = 74.5;
740   dgh[2] = 0.5;
741   dgh[3] = 12.;
742   dgh[4] = 168.;  
743   if (suppmat == 0) {
744      gMC->Gsvolu("ICU7", "TUBS", idtmed[279], dgh, 5);   // copper
745   } else if (suppmat == 1) {
746      gMC->Gsvolu("ICU7", "TUBS", idtmed[285], dgh, 5);   // aluminum
747   } else {
748      gMC->Gsvolu("ICU7", "TUBS", idtmed[274], dgh, 5);   // carbon
749   }
750   gMC->Gspos("ICU7", 1, "ITSV", 0., 0., -(ztpc+1.5+dgh[2]), 0, "ONLY");  
751   
752   // --- DEFINE CABLES/COOLING BEHIND THE TPC ON OTHER SIDE W.R.T. THE ABSORBER
753   //     COPPER PART - LOWER PART
754     
755   dgh[0] = 46.; 
756   dgh[1] = 74.5;
757   dgh[2] = 0.5;
758   dgh[3] = 192.;
759   dgh[4] = 348.;   
760   if (suppmat == 0) {
761      gMC->Gsvolu("ICU8", "TUBS", idtmed[279], dgh, 5);   // copper
762   } else if (suppmat == 1) {
763      gMC->Gsvolu("ICU8", "TUBS", idtmed[285], dgh, 5);   // aluminum
764   } else {
765      gMC->Gsvolu("ICU8", "TUBS", idtmed[274], dgh, 5);   // carbon
766   }
767   gMC->Gspos("ICU8", 1, "ITSV", 0., 0., -(ztpc+1.5+dgh[2]), 0, "ONLY");      
768     
769   // --- DEFINE CABLES/COOLING BEHIND THE TPC ON OTHER SIDE W.R.T. THE ABSORBER
770   //     CARBON PART - UPPER PART
771   
772   dgh[0] = 46.+1.0;  
773   dgh[1] = 74.5;
774   dgh[2] = 0.75;
775   dgh[3] = 12.;
776   dgh[4] = 168.;   
777   gMC->Gsvolu("ICC7", "TUBS", idtmed[274], dgh, 5);   
778   gMC->Gspos("ICC7", 1, "ITSV", 0., 0., -(ztpc+dgh[2]), 0, "ONLY"); 
779   
780   // --- DEFINE CABLES/COOLING BEHIND THE TPC ON OTHER SIDE W.R.T. THE ABSORBER
781   //     CARBON PART - LOWER PART
782   
783   dgh[0] = 46.+1.0;  
784   dgh[1] = 74.5;
785   dgh[2] = 0.75;
786   dgh[3] = 192.;
787   dgh[4] = 348.;     
788   gMC->Gsvolu("ICC8", "TUBS", idtmed[274], dgh, 5);   
789   gMC->Gspos("ICC8", 1, "ITSV", 0., 0., -(ztpc+dgh[2]), 0, "ONLY");        
790     
791   // --- DEFINE HOOK TO THE TPC ON OTHER SIDE W.R.T. THE ABSORBER - UPPER PART
792   
793   dgh[0] = 74.5;
794   dgh[1] = 79.5;
795   dgh[2] = 2.5;
796   dgh[3] = 12.;
797   dgh[4] = 168.;    
798   gMC->Gsvolu("IHK1", "TUBS", idtmed[284], dgh, 5);  
799   gMC->Gspos("IHK1", 1, "ITSV", 0., 0., -ztpc-dgh[2], 0, "ONLY");   
800   
801   // --- DEFINE HOOK TO THE TPC ON OTHER SIDE W.R.T. THE ABSORBER - LOWER PART
802   
803   dgh[0] = 74.5;
804   dgh[1] = 79.5;
805   dgh[2] = 2.5;
806   dgh[3] = 192.;
807   dgh[4] = 348.;    
808   gMC->Gsvolu("IHK2", "TUBS", idtmed[284], dgh, 5);  
809   gMC->Gspos("IHK2", 1, "ITSV", 0., 0., -ztpc-dgh[2], 0, "ONLY");      
810   
811   // --- DEFINE RAILS BETWEEN THE ITS AND THE TPC
812   
813   if (rails == 1) {
814   
815      dgh[0] = 2.;          
816      dgh[1] = 8.;           
817      dgh[2] = 190.;         
818      gMC->Gsvolu("IRA1", "BOX ", idtmed[239], dgh, 3);
819      gMC->Gspos("IRA1", 1, "ITSV", 53.5, 0., -69.5, 0, "ONLY");   
820      gMC->Gsvolu("IRA2", "BOX ", idtmed[239], dgh, 3);    
821      gMC->Gspos("IRA2", 1, "ITSV", -53.5, 0., -69.5, 0, "ONLY");    
822
823      dgh[0] = 2.-0.5;    // 0.5 was determined in such a way that the aluminum area is 20.9 cm^2      
824      dgh[1] = 8.-0.5;    // 0.5 was determined in such a way that the aluminum area is 20.9 cm^2       
825      dgh[2] = 190.;         
826      gMC->Gsvolu("IRA3", "BOX ", idtmed[275], dgh, 3);   
827      gMC->Gspos("IRA3", 1, "IRA1", 0., 0., 0., 0, "ONLY");   
828      gMC->Gsvolu("IRA4", "BOX ", idtmed[275], dgh, 3);     
829      gMC->Gspos("IRA4", 1, "IRA2", 0., 0., 0., 0, "ONLY");    
830
831   }
832
833   // --- DEFINE CYLINDERS HOLDING RAILS BETWEEN THE ITS AND THE TPC
834   
835   dgh[0] = 56.9;    
836   dgh[1] = 59.;
837   dgh[2] = 0.6;    
838   gMC->Gsvolu("ICYL", "TUBE", idtmed[285], dgh, 3);   
839   gMC->Gspos("ICYL", 1, "ALIC", 0., 0., 74.1, 0, "ONLY");       
840   gMC->Gspos("ICYL", 2, "ALIC", 0., 0., -74.1, idrotm[200], "ONLY");  
841
842   // --- DEFINE SUPPORTS FOR RAILS ATTACHED TO THE CYLINDERS
843
844   dgh[0] = 0.;        
845   dgh[1] = 3.;         
846   dgh[2] = 5.;  // 5. comes from the fact that the volume has to be 567.6/2 cm^3       
847   gMC->Gsvolu("ISR1", "TUBE", idtmed[286], dgh, 3);   
848   gMC->Gspos("ISR1", 1, "ITSV", 53.4292, 10.7053, 79.75, 0, "ONLY");    
849   gMC->Gspos("ISR1", 2, "ITSV", 53.4292, -10.7053, 79.75, 0, "ONLY");   
850   gMC->Gspos("ISR1", 3, "ITSV", -53.4292, 10.7053, 79.75, 0, "ONLY"); 
851   gMC->Gspos("ISR1", 4, "ITSV", -53.4292, -10.7053, 79.75, 0, "ONLY");  
852   gMC->Gspos("ISR1", 5, "ITSV", 53.4292, 10.7053, -79.75, 0, "ONLY");   
853   gMC->Gspos("ISR1", 6, "ITSV", 53.4292, -10.7053, -79.75, 0, "ONLY");   
854   gMC->Gspos("ISR1", 7, "ITSV", -53.4292, 10.7053, -79.75, 0, "ONLY"); 
855   gMC->Gspos("ISR1", 8, "ITSV", -53.4292, -10.7053, -79.75, 0, "ONLY");         
856   
857   // --- DEFINE SUPPORTS FOR RAILS ATTACHED TO THE ABSORBER
858
859   dgh[0] = 5.;        
860   dgh[1] = 12.;         
861   dgh[2] = 5.;         
862   gMC->Gsvolu("ISR2", "BOX ", idtmed[285], dgh, 3);   
863   gMC->Gspos("ISR2", 1, "ALIC", 53.5, 0., 125.5, 0, "ONLY");
864   gMC->Gsvolu("ISR3", "BOX ", idtmed[285], dgh, 3);   
865   gMC->Gspos("ISR3", 1, "ALIC", -53.5, 0., 125.5, 0, "ONLY");  
866   
867   dgh[0] = 5.-2.;        
868   dgh[1] = 12.-2.;         
869   dgh[2] = 5.;         
870   gMC->Gsvolu("ISR4", "BOX ", idtmed[275], dgh, 3);   
871   gMC->Gspos("ISR4", 1, "ISR2", 0., 0., 0., 0, "ONLY");     
872   gMC->Gsvolu("ISR5", "BOX ", idtmed[275], dgh, 3);   
873   gMC->Gspos("ISR5", 1, "ISR3", 0., 0., 0., 0, "ONLY");
874   
875   // --- DEFINE SUPPORTS TO ATTACH THE ITS TO THE TPC
876   
877   dgh[0] = 0.;        
878   dgh[1] = 5.;         
879   dgh[2] = 2.;         
880   gMC->Gsvolu("ISR6", "TUBE", idtmed[285], dgh, 3);   
881   gMC->Gspos("ISR6", 1, "ALIC", 0., 54., 77., 0, "ONLY"); 
882   gMC->Gspos("ISR6", 2, "ALIC", 0., 54., -77., 0, "ONLY"); 
883   gMC->Gspos("ISR6", 3, "ALIC", 0., -54., -77., 0, "ONLY");                   
884     
885     
886   // --- Outputs the geometry tree in the EUCLID/CAD format 
887   
888   if (fEuclidOut) {
889     gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
890   }
891 }
892 //_____________________________________________________________________________
893 void AliITSvPPRcoarseasymm::CreateMaterials(){
894 ////////////////////////////////////////////////////////////////////////
895   //
896   // Create ITS materials
897   //     This function defines the default materials used in the Geant
898   // Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
899   // AliITSvPPRcoarseasymm.
900   // In general it is automatically replaced by
901   // the CreateMaterials routine defined in AliITSv?. Should the function
902   // CreateMaterials not exist for the geometry version you are using this
903   // one is used. See the definition found in AliITSv5 or the other routine
904   // for a complete definition.
905   //
906   // Water H2O
907   Float_t awat[2]  = { 1.00794,15.9994 };
908   Float_t zwat[2]  = { 1.,8. };
909   Float_t wwat[2]  = { 2.,1. };
910   Float_t denswat  = 1.;
911   // Freon
912   Float_t afre[2]  = { 12.011,18.9984032 };
913   Float_t zfre[2]  = { 6.,9. };
914   Float_t wfre[2]  = { 5.,12. };
915   Float_t densfre  = 1.5;
916   // Ceramics
917   //     94.4% Al2O3 , 2.8% SiO2 , 2.3% MnO , 0.5% Cr2O3 
918   Float_t acer[5]  = { 26.981539,15.9994,28.0855,54.93805,51.9961 };
919   Float_t zcer[5]  = { 13.,8.,14.,25.,      24. };
920   Float_t wcer[5]  = { .49976,1.01233,.01307,       .01782,.00342 };
921   Float_t denscer  = 3.6;
922   //
923   //     60% SiO2 , 40% G10FR4 
924   // PC board
925   Float_t apcb[3]  = { 28.0855,15.9994,17.749 };
926   Float_t zpcb[3]  = { 14.,8.,8.875 };
927   Float_t wpcb[3]  = { .28,.32,.4 };
928   Float_t denspcb  = 1.8;
929   // POLYETHYL
930   Float_t apoly[2] = { 12.01,1. };
931   Float_t zpoly[2] = { 6.,1. };
932   Float_t wpoly[2] = { .33,.67 };
933   // old SERVICES
934   Float_t zserv[4] = { 1.,6.,26.,29. };
935   Float_t aserv[4] = { 1.,12.,55.8,63.5 };
936   Float_t wserv[4] = { .014,.086,.42,.48 };
937   // Stainless steel
938   Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
939   Float_t zsteel[4] = { 26.,24.,28.,14. };
940   Float_t wsteel[4] = { .715,.18,.1,.005 };
941   
942   
943   Int_t  isxfld  = gAlice->Field()->Integ();
944   Float_t sxmgmx = gAlice->Field()->Max();
945   
946   
947   // --- Define the various materials for GEANT --- 
948   
949   //  200-224 --> Silicon Pixel Detectors (detectors, chips, buses, cooling,..)
950   
951   AliMaterial(0, "SPD Si$",      28.0855, 14., 2.33, 9.36, 999.);
952   AliMaterial(1, "SPD Si chip$", 28.0855, 14., 2.33, 9.36, 999.);
953   AliMaterial(2, "SPD Si bus$",  28.0855, 14., 2.33, 9.36, 999.);
954   AliMaterial(3, "SPD C$",       12.011,   6., 2.265,18.8, 999.);
955   // v. dens 
956   AliMaterial(4, "SPD Air$",    14.61, 7.3, .001205, 30423., 999.);
957   AliMaterial(5, "SPD Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
958   AliMaterial(6, "SPD Al$",     26.981539, 13., 2.6989, 8.9, 999.);
959   AliMixture( 7, "SPD Water $", awat, zwat, denswat, -2, wwat);
960   AliMixture( 8, "SPD Freon$",  afre, zfre, densfre, -2, wfre);
961   AliMaterial(9, "SPD End ladder$", 55.845, 26., 7.87/10., 1.76*10., 999.); 
962   //AliMaterial(9, "SPD End ladder$", 55.845, 26., -7.87/10., -1.76*10., 999.);   
963   AliMaterial(10, "SPD cone$",28.0855, 14., 2.33, 9.36, 999.);       // check !!!!
964   // ** 
965   AliMedium(0, "SPD Si$",        0, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
966   AliMedium(1, "SPD Si chip$",   1, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
967   AliMedium(2, "SPD Si bus$",    2, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
968   AliMedium(3, "SPD C$",         3, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
969   AliMedium(4, "SPD Air$",       4, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
970   AliMedium(5, "SPD Vacuum$",    5, 0,isxfld,sxmgmx, 10.,1.00, .1, .100,10.00);
971   AliMedium(6, "SPD Al$",        6, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
972   AliMedium(7, "SPD Water $",    7, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
973   AliMedium(8, "SPD Freon$",     8, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
974   AliMedium(9, "SPD End ladder$",9, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
975   AliMedium(10, "SPD cone$",    10, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);   
976   
977   //  225-249 --> Silicon Drift Detectors (detectors, chips, buses, cooling,..)
978   
979   AliMaterial(25, "SDD Si$",      28.0855, 14., 2.33,  9.36, 999.);
980   AliMaterial(26, "SDD Si chip$", 28.0855, 14., 2.33,  9.36, 999.);
981   AliMaterial(27, "SDD Si bus$",  28.0855, 14., 2.33,  9.36, 999.);
982   AliMaterial(28, "SDD C$",       12.011,   6., 2.265,18.8,  999.);
983   // v. dens 
984   AliMaterial(29, "SDD Air$",     14.61, 7.3, .001205, 30423., 999.);
985   AliMaterial(30, "SDD Vacuum$",  1e-16, 1e-16, 1e-16, 1e16,  1e16);
986   AliMaterial(31, "SDD Al$",      26.981539, 13., 2.6989, 8.9, 999.);
987   // After a call with ratios by number (negative number of elements), 
988   // the ratio array is changed to the ratio by weight, so all successive 
989   // calls with the same array must specify the number of elements as 
990   // positive 
991   AliMixture(32, "SDD Water $", awat, zwat, denswat, 2, wwat);
992   // After a call with ratios by number (negative number of elements), 
993   // the ratio array is changed to the ratio by weight, so all successive 
994   // calls with the same array must specify the number of elements as 
995   // positive 
996   AliMixture( 33, "SDD Freon$", afre, zfre, densfre, 2, wfre);
997   AliMixture( 34, "SDD PCB$",   apcb, zpcb, denspcb, 3, wpcb);
998   AliMaterial(35, "SDD Copper$", 63.546, 29., 8.96, 1.43, 999.);
999   AliMixture( 36, "SDD Ceramics$", acer, zcer, denscer, -5, wcer);
1000   AliMaterial(37, "SDD Kapton$", 12.011, 6., 1.3, 31.27, 999.);
1001   AliMaterial(38, "SDD End ladder$", 69.9298, 29.8246, 0.3824, 36.5103, 999.); 
1002   AliMaterial(39, "SDD cone$",63.546, 29., 1.15, 1.265, 999.);   
1003   AliMaterial(40, "SDD M55J$",12.3565, 6.4561, 1.8097, 22.9570, 999.);         
1004   //AliMaterial(38, "SDD End ladder$", 69.9298, 29.8246, -0.3824, -36.5103, 999.); 
1005   //AliMaterial(39, "SDD cone$",63.546, 29., -1.15, -1.265, 999.);       
1006
1007   // ** 
1008   // check A and Z 
1009   AliMedium(25, "SDD Si$",        25, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1010   AliMedium(26, "SDD Si chip$",   26, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1011   AliMedium(27, "SDD Si bus$",    27, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1012   AliMedium(28, "SDD C$",         28, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1013   AliMedium(29, "SDD Air$",       29, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1014   AliMedium(30, "SDD Vacuum$",    30, 0,isxfld,sxmgmx, 10.,1.00, .1, .100,10.00);
1015   AliMedium(31, "SDD Al$",        31, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1016   AliMedium(32, "SDD Water $",    32, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1017   AliMedium(33, "SDD Freon$",     33, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1018   AliMedium(34, "SDD PCB$",       34, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1019   AliMedium(35, "SDD Copper$",    35, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1020   AliMedium(36, "SDD Ceramics$",  36, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1021   AliMedium(37, "SDD Kapton$",    37, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1022   AliMedium(38, "SDD End ladder$",38, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1023   AliMedium(39, "SDD cone$",      39, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1024   AliMedium(40, "SDD M55J$",      40, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);  
1025   //  250-274 --> Silicon Strip Detectors (detectors, chips, buses, cooling,..)
1026   
1027   AliMaterial(50, "SSD Si$",      28.0855, 14., 2.33, 9.36, 999.);
1028   AliMaterial(51, "SSD Si chip$", 28.0855, 14., 2.33, 9.36, 999.);
1029   AliMaterial(52, "SSD Si bus$",  28.0855, 14., 2.33, 9.36, 999.);
1030   AliMaterial(53, "SSD C$",       12.011,   6., 2.265,18.8, 999.);
1031   // v. dens 
1032   AliMaterial(54, "SSD Air$",     14.61, 7.3, .001205, 30423., 999.);
1033   AliMaterial(55, "SSD Vacuum$",  1e-16, 1e-16, 1e-16, 1e16, 1e16);
1034   AliMaterial(56, "SSD Al$",      26.981539, 13., 2.6989, 8.9, 999.);
1035   // After a call with ratios by number (negative number of elements), 
1036   // the ratio array is changed to the ratio by weight, so all successive 
1037   // calls with the same array must specify the number of elements as 
1038   // positive 
1039   AliMixture(57, "SSD Water $", awat, zwat, denswat, 2, wwat);
1040   // After a call with ratios by number (negative number of elements), 
1041   // the ratio array is changed to the ratio by weight, so all successive 
1042   // calls with the same array must specify the number of elements as 
1043   // positive 
1044   AliMixture(58, "SSD Freon$", afre, zfre, densfre, 2, wfre);
1045   AliMixture(59, "SSD PCB$",   apcb, zpcb, denspcb, 3, wpcb);
1046   AliMaterial(60, "SSD Copper$", 63.546, 29., 8.96, 1.43, 999.);
1047   // After a call with ratios by number (negative number of elements), 
1048   // the ratio array is changed to the ratio by weight, so all successive 
1049   // calls with the same array must specify the number of elements as 
1050   // positive 
1051   AliMixture(61, "SSD Ceramics$", acer, zcer, denscer, 5, wcer);
1052   AliMaterial(62, "SSD Kapton$", 12.011, 6., 1.3, 31.27, 999.);
1053   // check A and Z 
1054   AliMaterial(63, "SSD G10FR4$", 17.749, 8.875, 1.8, 21.822, 999.);
1055   AliMaterial(64, "SSD End ladder$", 32.0988, 15.4021, 0.68, 35.3238, 999.); 
1056   AliMaterial(65, "SSD cone$",63.546, 29., 1.15, 1.265, 999.);  
1057   //AliMaterial(64, "SSD End ladder$", 32.0988, 15.4021, -0.68, -35.3238, 999.); 
1058   //AliMaterial(65, "SSD cone$",63.546, 29., -1.15, -1.265, 999.);    
1059   // ** 
1060   AliMedium(50, "SSD Si$",        50, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1061   AliMedium(51, "SSD Si chip$",   51, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1062   AliMedium(52, "SSD Si bus$",    52, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1063   AliMedium(53, "SSD C$",         53, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1064   AliMedium(54, "SSD Air$",       54, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1065   AliMedium(55, "SSD Vacuum$",    55, 0,isxfld,sxmgmx, 10.,1.00, .1, .100,10.00);
1066   AliMedium(56, "SSD Al$",        56, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1067   AliMedium(57, "SSD Water $",    57, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1068   AliMedium(58, "SSD Freon$",     58, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1069   AliMedium(59, "SSD PCB$",       59, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1070   AliMedium(60, "SSD Copper$",    60, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1071   AliMedium(61, "SSD Ceramics$",  61, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1072   AliMedium(62, "SSD Kapton$",    62, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1073   AliMedium(63, "SSD G10FR4$",    63, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1074   AliMedium(64, "SSD End ladder$",64, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1075   AliMedium(65, "SSD cone$",      65, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1076
1077   //     275-299 --> General (end-caps, frames, cooling, cables, etc.) 
1078   
1079   AliMaterial(75, "GEN C$", 12.011, 6., 2.265, 18.8, 999.);
1080   // verify density 
1081   AliMaterial(76, "GEN Air$", 14.61, 7.3, .001205, 30423., 999.);
1082   AliMaterial(77, "GEN Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
1083   AliMixture( 78, "GEN POLYETHYL$", apoly, zpoly, .95, -2, wpoly);
1084   AliMixture( 79, "GEN SERVICES$",  aserv, zserv, 4.68, 4, wserv);
1085   AliMaterial(80, "GEN Copper$", 63.546, 29., 8.96, 1.43, 999.);
1086   // After a call with ratios by number (negative number of elements), 
1087   // the ratio array is changed to the ratio by weight, so all successive 
1088   // calls with the same array must specify the number of elements as 
1089   // positive 
1090   AliMixture(81, "GEN Water $", awat, zwat, denswat, 2, wwat);
1091 //  AliMaterial(82, "GEN Cables$", 12.011, 6., 2.265, 18.8, 999.);  // check !!!
1092 //  AliMaterial(83, "GEN patch pan$", 12.011, 6., 2.265, 18.8, 999.);  // check !!!  
1093 //  AliMaterial(84, "GEN serv$", 12.011, 6., 2.265, 18.8, 999.);  // check !!!  
1094   AliMixture(85, "GEN Inox$", asteel, zsteel, 7.88, 4, wsteel);
1095   AliMaterial(86, "GEN Al$",      26.981539, 13., 2.6989, 8.9, 999.);
1096   AliMaterial(87,"inox/alum$",    32.1502,15.3383,3.0705,6.9197,999.);
1097   // ** 
1098   AliMedium(75,"GEN C$",        75, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1099   AliMedium(76,"GEN Air$",      76, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1100   AliMedium(77,"GEN Vacuum$",   77, 0,isxfld,sxmgmx, 10., .10, .1, .100,10.00);
1101   AliMedium(78,"GEN POLYETHYL$",78, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1102   AliMedium(79,"GEN SERVICES$", 79, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1103   AliMedium(80,"GEN Copper$",   80, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1104   AliMedium(81,"GEN Water $",   81, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1105 //  AliMedium(82,"GEN Cables$",   82, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1106 //  AliMedium(83,"GEN patch pan$",83, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);  
1107 //  AliMedium(84,"GEN serv$",     84, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1108   AliMedium(85,"GEN Inox$",     85, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1109   AliMedium(86, "GEN Al$",      86, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1110   AliMedium(87,"inox/alum$",    87, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
1111
1112 }
1113 //_____________________________________________________________________________
1114 void AliITSvPPRcoarseasymm::Init(){
1115 ////////////////////////////////////////////////////////////////////////
1116 //     Initialise the ITS after it has been created.
1117 ////////////////////////////////////////////////////////////////////////
1118     Int_t i;
1119
1120     cout << endl;
1121     for(i=0;i<24;i++) cout << "*";cout << " ITSvPPRcoarseasymm_Init ";
1122     for(i=0;i<25;i++) cout << "*";cout << endl;
1123 //
1124     AliITS::Init();
1125 //
1126     for(i=0;i<72;i++) cout << "*";
1127     cout << endl;
1128 }  
1129  
1130 //_____________________________________________________________________________
1131 void AliITSvPPRcoarseasymm::DrawModule() const {
1132 ////////////////////////////////////////////////////////////////////////
1133 //     Draw a shaded view of the FMD version 6.
1134 ////////////////////////////////////////////////////////////////////////
1135   
1136   // Set everything unseen
1137   gMC->Gsatt("*", "seen", -1);
1138   // 
1139   // Set ALIC mother visible
1140   gMC->Gsatt("ALIC","SEEN",0);
1141   //
1142   // Set the volumes visible
1143   gMC->Gsatt("ITSD","SEEN",0);
1144   gMC->Gsatt("ITS1","SEEN",1);
1145   gMC->Gsatt("ITS2","SEEN",1);
1146   gMC->Gsatt("ITS3","SEEN",1);
1147   gMC->Gsatt("ITS4","SEEN",1);
1148   gMC->Gsatt("ITS5","SEEN",1);
1149   gMC->Gsatt("ITS6","SEEN",1);
1150
1151   gMC->Gsatt("IPCB","SEEN",1);
1152   gMC->Gsatt("ICO2","SEEN",1);
1153   gMC->Gsatt("ICER","SEEN",0);
1154   gMC->Gsatt("ISI2","SEEN",0);
1155   gMC->Gsatt("IPLA","SEEN",0);
1156   gMC->Gsatt("ICO3","SEEN",0);
1157   gMC->Gsatt("IEPX","SEEN",0);
1158   gMC->Gsatt("ISI3","SEEN",1);
1159   gMC->Gsatt("ISUP","SEEN",0);
1160   gMC->Gsatt("ICHO","SEEN",0);
1161   gMC->Gsatt("ICMO","SEEN",0);
1162   gMC->Gsatt("ICMD","SEEN",0);
1163   gMC->Gsatt("ICCO","SEEN",1);
1164   gMC->Gsatt("ICCM","SEEN",0);
1165   gMC->Gsatt("ITMD","SEEN",0);
1166   gMC->Gsatt("ITTT","SEEN",1);
1167
1168   //
1169   gMC->Gdopt("hide", "on");
1170   gMC->Gdopt("shad", "on");
1171   gMC->Gsatt("*", "fill", 7);
1172   gMC->SetClipBox(".");
1173   gMC->SetClipBox("*", 0, 300, -300, 300, -300, 300);
1174   gMC->DefaultRange();
1175   gMC->Gdraw("alic", 40, 30, 0, 11, 10, .07, .07);
1176   gMC->Gdhead(1111, "Inner Tracking System Version 1");
1177   gMC->Gdman(17, 6, "MAN");
1178 }
1179 //_____________________________________________________________________________
1180 void AliITSvPPRcoarseasymm::StepManager(){
1181 ////////////////////////////////////////////////////////////////////////
1182 //    Called for every step in the ITS, then calls the AliITShit class
1183 // creator with the information to be recoreded about that hit.
1184 ////////////////////////////////////////////////////////////////////////
1185
1186 /*
1187   Int_t         copy, id;
1188   Float_t       hits[8];
1189   Int_t         vol[4];
1190   TLorentzVector position, momentum;
1191 //  TClonesArray &lhits = *fHits;
1192 //
1193 // no hits for this coarse asymmetric version.
1194 //
1195
1196   //
1197   // Track status
1198   vol[3] = 0;
1199   if(gMC->IsTrackInside())      vol[3] +=  1;
1200   if(gMC->IsTrackEntering())    vol[3] +=  2;
1201   if(gMC->IsTrackExiting())     vol[3] +=  4;
1202   if(gMC->IsTrackOut())         vol[3] +=  8;
1203   if(gMC->IsTrackDisappeared()) vol[3] += 16;
1204   if(gMC->IsTrackStop())        vol[3] += 32;
1205   if(gMC->IsTrackAlive())       vol[3] += 64;
1206   //
1207   // Fill hit structure.
1208   if( !(gMC->TrackCharge()) ) return;
1209     //
1210     // Only entering charged tracks
1211     if((id=gMC->CurrentVolID(copy))==fIdSens[0]) {  
1212       vol[0]=1;
1213       id=gMC->CurrentVolOffID(1,copy);      
1214       vol[1]=copy;
1215       id=gMC->CurrentVolOffID(2,copy);
1216       vol[2]=copy;                       
1217     } else if(id==fIdSens[1]) {
1218       vol[0]=2;
1219       id=gMC->CurrentVolOffID(1,copy);       
1220       vol[1]=copy;
1221       id=gMC->CurrentVolOffID(2,copy);
1222       vol[2]=copy;                    
1223     } else if(id==fIdSens[2]) {
1224       vol[0]=3;
1225       vol[1]=copy;
1226       id=gMC->CurrentVolOffID(1,copy);
1227       vol[2]=copy;             
1228     } else if(id==fIdSens[3]) {
1229       vol[0]=4;
1230       vol[1]=copy;
1231       id=gMC->CurrentVolOffID(1,copy);
1232       vol[2]=copy;                  
1233     } else if(id==fIdSens[4]) {
1234       vol[0]=5;
1235       vol[1]=copy;
1236       id=gMC->CurrentVolOffID(1,copy);
1237       vol[2]=copy;               
1238     } else if(id==fIdSens[5]) {
1239       vol[0]=6;
1240       vol[1]=copy;
1241       id=gMC->CurrentVolOffID(1,copy);
1242       vol[2]=copy;                      
1243     } else return;
1244     gMC->TrackPosition(position);
1245     gMC->TrackMomentum(momentum);
1246     hits[0]=position[0];
1247     hits[1]=position[1];
1248     hits[2]=position[2];          
1249     hits[3]=momentum[0];
1250     hits[4]=momentum[1];
1251     hits[5]=momentum[2];
1252     hits[6]=gMC->Edep();
1253     hits[7]=gMC->TrackTime();
1254 //    new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,hits);
1255 //
1256 // no hits for this coarse asymmetric version.
1257 //
1258 */
1259 }
1260