]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSv1.cxx
Merged ITS-working with HEAD. Improved some of the documentation and
[u/mrichter/AliRoot.git] / ITS / AliITSv1.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.14.2.1  2000/03/04 23:45:19  nilsen
19 Fixed up the comments/documentation.
20
21 Revision 1.14  1999/11/25 06:52:56  fca
22 Correct value of drca
23
24 Revision 1.13.2.1  1999/11/25 06:52:21  fca
25 Correct value of drca
26
27 Revision 1.13  1999/10/27 11:16:26  fca
28 Correction of problem in geometry
29
30 Revision 1.12  1999/10/22 08:25:25  fca
31 remove double definition of destructors
32
33 Revision 1.11  1999/10/22 08:16:49  fca
34 Correct destructors, thanks to I.Hrivnacova
35
36 Revision 1.10  1999/10/06 19:56:50  fca
37 Add destructor
38
39 Revision 1.9  1999/10/05 08:05:09  fca
40 Minor corrections for uninitialised variables.
41
42 Revision 1.8  1999/09/29 09:24:20  fca
43 Introduction of the Copyright and cvs Log
44
45 */
46
47 ///////////////////////////////////////////////////////////////////////////////
48 //                                                                           //
49 //  Inner Traking System version 1                                           //
50 //  This class contains the base procedures for the Inner Tracking System    //
51 //                                                                           //
52 // Authors: R. Barbera, A. Morsch.
53 // version 1.
54 // Created  1998.
55 //
56 //  NOTE: THIS IS THE COARSE pre.TDR geometry of the ITS. THIS WILL NOT WORK
57 // with the geometry or module classes or any analysis classes. You are 
58 // strongly encouraged to uses AliITSv5.
59 //                                                                           //
60 ///////////////////////////////////////////////////////////////////////////////
61  
62 #include <TMath.h>
63 #include <TRandom.h>
64 #include <TVector.h>
65 #include "AliITShit.h"
66 #include "AliITSv1.h"
67 #include "AliRun.h"
68
69 #include "AliMC.h"
70 #include "AliConst.h"
71
72 ClassImp(AliITSv1)
73  
74 //_____________________________________________________________________________
75 AliITSv1::AliITSv1() {
76 ////////////////////////////////////////////////////////////////////////
77 //    Standard default constructor for the ITS version 1.
78 ////////////////////////////////////////////////////////////////////////
79     fId1N = 6;
80     fId1Name = new char*[fId1N];
81     fId1Name[0] = "ITS1";
82     fId1Name[1] = "ITS2";
83     fId1Name[2] = "ITS3";
84     fId1Name[3] = "ITS4";
85     fId1Name[4] = "ITS5";
86     fId1Name[5] = "ITS6";
87 }
88 //_____________________________________________________________________________
89 AliITSv1::AliITSv1(const char *name, const char *title) : AliITS(name, title){
90 ////////////////////////////////////////////////////////////////////////
91 //    Standard constructor for the ITS version 1.
92 ////////////////////////////////////////////////////////////////////////
93     fId1N = 6;
94     fId1Name = new char*[fId1N];
95     fId1Name[0] = "ITS1";
96     fId1Name[1] = "ITS2";
97     fId1Name[2] = "ITS3";
98     fId1Name[3] = "ITS4";
99     fId1Name[4] = "ITS5";
100     fId1Name[5] = "ITS6";
101 }
102 //_____________________________________________________________________________
103 AliITSv1::~AliITSv1() {
104 ////////////////////////////////////////////////////////////////////////
105 //    Standard destructor for the ITS version 1.
106 ////////////////////////////////////////////////////////////////////////
107   delete [] fId1Name;
108 }
109 //_____________________________________________________________________________
110 void AliITSv1::CreateGeometry(){
111 ////////////////////////////////////////////////////////////////////////
112 //    This routine defines and Creates the geometry for version 1 of the ITS.
113 ////////////////////////////////////////////////////////////////////////
114   
115   Float_t drcer[6] = { 0.,0.,.08,.08,0.,0. };           //CERAMICS THICKNESS
116   Float_t drepx[6] = { 0.,0.,0.,0.,.5357,.5357 };       //EPOXY THICKNESS
117   Float_t drpla[6] = { 0.,0.,0.,0.,.1786,.1786 };       //PLASTIC THICKNESS
118   Float_t dzb[6]   = { 0.,0.,15.,15.,4.,4. };           //LENGTH OF BOXES
119   Float_t dphi[6]  = { 72.,72.,72.,72.,50.6,45. };      //COVERED PHI-RANGE FOR LAYERS 1-6
120   Float_t rl[6]    = { 3.9,7.6,14.,24.,40.,45. };       //SILICON LAYERS INNER RADIUS
121   Float_t drl[6]   = { .755,.755,.809,.809,.7,.7 };     //THICKNESS OF LAYERS (in % radiation length)
122   Float_t dzl[6]   = { 12.67,16.91,20.85,29.15,45.11,50.975 };//HALF LENGTH OF LAYERS
123   Float_t drpcb[6] = { 0.,0.,.06,.06,0.,0. };           //PCB THICKNESS
124   Float_t drcu[6]  = { 0.,0.,.0504,.0504,.0357,.0357 }; //COPPER THICKNESS
125   Float_t drsi[6]  = { 0.,0.,.006,.006,.3571,.3571 };   //SILICON THICKNESS
126
127   Float_t drca, dzfc;
128   Int_t i, nsec;
129   Float_t rend, drca_tpc, dzco, zend, dits[3], rlim, drsu, zmax;
130   Float_t zpos, dzco1, dzco2;
131   Float_t drcac[6], acone, dphii;
132   Float_t pcits[15], xltpc;
133   Float_t rzcone, rstep, r0, z0, acable, fp, dz, zi, ri;
134   Int_t idrotm[399];
135   Float_t dgh[15];
136   
137   Int_t *idtmed = fIdtmed->GetArray()-199;
138   
139   //     CONVERT INTO CM (RL(SI)=9.36 CM) 
140   for (i = 0; i < 6; ++i) {
141     drl[i] = drl[i] / 100. * 9.36;
142   }
143   
144   //     SUPPORT ENDPLANE THICKNESS 
145   drsu = 2.*0.06+1./20;  // 1./20. is 1 cm of honeycomb (1/20 carbon density);
146   
147   //     CONE BELOW TPC 
148   
149   drca_tpc = 1.2/4.;
150   
151   //     CABLE THICKNESS (CONICAL CABLES CONNECTING THE LAYERS) 
152
153   drca = 0.2;
154   
155   //     ITS CONE ANGLE 
156   
157   acone  = 45.;
158   acone *= kDegrad;
159   
160   //     CONE RADIUS AT 1ST LAYER 
161   
162   rzcone = 30.;
163   
164   //     FIELD CAGE HALF LENGTH 
165   
166   dzfc  = 64.5;
167   rlim  = 48.;
168   zmax  = 80.;
169   xltpc = 275.;
170   
171   
172   //     PARAMETERS FOR SMALL (1/2) ITS 
173
174   for (i = 0; i < 6; ++i) {
175     dzl[i] /= 2.;
176     dzb[i] /= 2.;
177   }
178   drca     /= 2.;
179   acone    /= 2.;
180   drca_tpc /= 2.;
181   rzcone   /= 2.;
182   dzfc     /= 2.;
183   zmax     /= 2.;
184   xltpc    /= 2.;
185   acable    = 15.;
186   
187   
188   
189   //     EQUAL DISTRIBUTION INTO THE 6 LAYERS 
190   rstep = drca_tpc / 6.;
191   for (i = 0; i < 6; ++i) {
192     drcac[i] = (i+1) * rstep;
193   }
194
195   //     NUMBER OF PHI SECTORS 
196   
197   nsec = 5;
198   
199   //     PACK IN PHI AS MUCH AS POSSIBLE 
200   //     NOW PACK USING THICKNESS 
201   
202   for (i = 0; i < 6; ++i) {
203     
204 //     PACKING FACTOR 
205     fp = rl[5] / rl[i];
206     
207     //      PHI-PACKING NOT SUFFICIENT ? 
208     
209     if (dphi[i]/45 < fp) {
210       drcac[i] = drcac[i] * fp * 45/dphi[i];
211     }
212   }
213   
214   
215   // --- Define ghost volume containing the six layers and fill it with air 
216   
217   dgh[0] = 3.5;
218   dgh[1] = 50.;
219   dgh[2] = zmax;
220   gMC->Gsvolu("ITSV", "TUBE", idtmed[275], dgh, 3);
221   
222   // --- Place the ghost volume in its mother volume (ALIC) and make it 
223   //     invisible 
224   
225   gMC->Gspos("ITSV", 1, "ALIC", 0., 0., 0., 0, "ONLY");
226   gMC->Gsatt("ITSV", "SEEN", 0);
227   
228   //     ITS LAYERS (SILICON) 
229   
230   dits[0] = rl[0];
231   dits[1] = rl[0] + drl[0];
232   dits[2] = dzl[0];
233   gMC->Gsvolu("ITS1", "TUBE", idtmed[199], dits, 3);
234   gMC->Gspos("ITS1", 1, "ITSV", 0., 0., 0., 0, "ONLY");
235   
236   dits[0] = rl[1];
237   dits[1] = rl[1] + drl[1];
238   dits[2] = dzl[1];
239   gMC->Gsvolu("ITS2", "TUBE", idtmed[199], dits, 3);
240   gMC->Gspos("ITS2", 1, "ITSV", 0., 0., 0., 0, "ONLY");
241   
242   dits[0] = rl[2];
243   dits[1] = rl[2] + drl[2];
244   dits[2] = dzl[2];
245   gMC->Gsvolu("ITS3", "TUBE", idtmed[224], dits, 3);
246   gMC->Gspos("ITS3", 1, "ITSV", 0., 0., 0., 0, "ONLY");
247   
248   dits[0] = rl[3];
249   dits[1] = rl[3] + drl[3];
250   dits[2] = dzl[3];
251   gMC->Gsvolu("ITS4", "TUBE", idtmed[224], dits, 3);
252   gMC->Gspos("ITS4", 1, "ITSV", 0., 0., 0., 0, "ONLY");
253   
254   dits[0] = rl[4];
255   dits[1] = rl[4] + drl[4];
256   dits[2] = dzl[4];
257   gMC->Gsvolu("ITS5", "TUBE", idtmed[249], dits, 3);
258   gMC->Gspos("ITS5", 1, "ITSV", 0., 0., 0., 0, "ONLY");
259   
260   dits[0] = rl[5];
261   dits[1] = rl[5] + drl[5];
262   dits[2] = dzl[5];
263   gMC->Gsvolu("ITS6", "TUBE", idtmed[249], dits, 3);
264   gMC->Gspos("ITS6", 1, "ITSV", 0., 0., 0., 0, "ONLY");
265   
266   //    ELECTRONICS BOXES 
267   
268   //     PCB (layer #3 and #4) 
269   
270   gMC->Gsvolu("IPCB", "TUBE", idtmed[233], dits, 0);
271   for (i = 2; i < 4; ++i) {
272     dits[0] = rl[i];
273     dits[1] = dits[0] + drpcb[i];
274     dits[2] = dzb[i] / 2.;
275     zpos = dzl[i] + dits[2];
276     gMC->Gsposp("IPCB", i-1, "ITSV", 0., 0., zpos, 0, "ONLY", dits, 3);
277     gMC->Gsposp("IPCB", i+1, "ITSV", 0., 0.,-zpos, 0, "ONLY", dits, 3);
278   }
279   
280   //     COPPER (layer #3 and #4) 
281   
282   gMC->Gsvolu("ICO2", "TUBE", idtmed[234], dits, 0);
283   for (i = 2; i < 4; ++i) {
284     dits[0] = rl[i] + drpcb[i];
285     dits[1] = dits[0] + drcu[i];
286     dits[2] = dzb[i] / 2.;
287     zpos = dzl[i] + dits[2];
288     gMC->Gsposp("ICO2", i-1, "ITSV", 0., 0., zpos, 0, "ONLY", dits, 3);
289     gMC->Gsposp("ICO2", i+1, "ITSV", 0., 0.,-zpos, 0, "ONLY", dits, 3);
290   }
291   
292   //     CERAMICS (layer #3 and #4) 
293   
294   gMC->Gsvolu("ICER", "TUBE", idtmed[235], dits, 0);
295   for (i = 2; i < 4; ++i) {
296     dits[0] = rl[i] + drpcb[i] + drcu[i];
297     dits[1] = dits[0] + drcer[i];
298     dits[2] = dzb[i] / 2.;
299     zpos = dzl[i] + dits[2];
300     gMC->Gsposp("ICER", i-1, "ITSV", 0., 0., zpos, 0, "ONLY", dits, 3);
301     gMC->Gsposp("ICER", i+1, "ITSV", 0., 0.,-zpos, 0, "ONLY", dits, 3);
302   }
303   
304   //     SILICON (layer #3 and #4) 
305   
306   gMC->Gsvolu("ISI2", "TUBE", idtmed[226], dits, 0);
307   for (i = 2; i < 4; ++i) {
308     dits[0] = rl[i] + drpcb[i] + drcu[i] + drcer[i];
309     dits[1] = dits[0] + drsi[i];
310     dits[2] = dzb[i] / 2.;
311     zpos = dzl[i] + dits[2];
312     gMC->Gsposp("ISI2", i-1, "ITSV", 0., 0., zpos, 0, "ONLY", dits, 3);
313     gMC->Gsposp("ISI2", i+1, "ITSV", 0., 0.,-zpos, 0, "ONLY", dits, 3);
314   }
315   
316   //     PLASTIC (G10FR4) (layer #5 and #6) 
317   
318   gMC->Gsvolu("IPLA", "TUBE", idtmed[262], dits, 0);
319   for (i = 4; i < 6; ++i) {
320     dits[0] = rl[i];
321     dits[1] = dits[0] + drpla[i];
322     dits[2] = dzb[i] / 2.;
323     zpos = dzl[i] + dits[2];
324     gMC->Gsposp("IPLA", i-1, "ITSV", 0., 0., zpos, 0, "ONLY", dits, 3);
325     gMC->Gsposp("IPLA", i+1, "ITSV", 0., 0.,-zpos, 0, "ONLY", dits, 3);
326   }
327   
328   //     COPPER (layer #5 and #6) 
329   
330   gMC->Gsvolu("ICO3", "TUBE", idtmed[259], dits, 0);
331   for (i = 4; i < 6; ++i) {
332     dits[0] = rl[i] + drpla[i];
333     dits[1] = dits[0] + drcu[i];
334     dits[2] = dzb[i] / 2.;
335     zpos = dzl[i] + dits[2];
336     gMC->Gsposp("ICO3", i-1, "ITSV", 0., 0., zpos, 0, "ONLY", dits, 3);
337     gMC->Gsposp("ICO3", i+1, "ITSV", 0., 0.,-zpos, 0, "ONLY", dits, 3);
338   }
339   
340   //     EPOXY (layer #5 and #6) 
341   
342   gMC->Gsvolu("IEPX", "TUBE", idtmed[262], dits, 0);
343   for (i = 4; i < 6; ++i) {
344     dits[0] = rl[i] + drpla[i] + drcu[i];
345     dits[1] = dits[0] + drepx[i];
346     dits[2] = dzb[i] / 2.;
347     zpos = dzl[i] + dits[2];
348     gMC->Gsposp("IEPX", i-1, "ITSV", 0., 0., zpos, 0, "ONLY", dits, 3);
349     gMC->Gsposp("IEPX", i+1, "ITSV", 0., 0.,-zpos, 0, "ONLY", dits, 3);
350   }
351   
352   //     SILICON (layer #5 and #6) 
353   
354   gMC->Gsvolu("ISI3", "TUBE", idtmed[251], dits, 0);
355   for (i = 4; i < 6; ++i) {
356     dits[0] = rl[i] + drpla[i] + drcu[i] + drepx[i];
357     dits[1] = dits[0] + drsi[i];
358     dits[2] = dzb[i] / 2.;
359     zpos = dzl[i] + dits[2];
360     gMC->Gsposp("ISI3", i-1, "ITSV", 0., 0., zpos, 0, "ONLY", dits, 3);
361     gMC->Gsposp("ISI3", i+1, "ITSV", 0., 0.,-zpos, 0, "ONLY", dits, 3);
362   }
363   
364   //    SUPPORT 
365   
366   gMC->Gsvolu("ISUP", "TUBE", idtmed[274], dits, 0);
367   for (i = 0; i < 6; ++i) {
368     dits[0] = rl[i];
369     if (i < 5) dits[1] = rl[i+1];
370     else       dits[1] = rlim;
371     dits[2] = drsu / 2.;
372     zpos = dzl[i] + dzb[i] + dits[2];
373     gMC->Gsposp("ISUP", i+1, "ITSV", 0., 0., zpos, 0, "ONLY", dits, 3);
374     gMC->Gsposp("ISUP", i+7, "ITSV", 0., 0.,-zpos, 0, "ONLY", dits, 3);
375   }
376   
377   // CABLES (HORIZONTAL) 
378   
379   gMC->Gsvolu("ICHO", "TUBE", idtmed[278], dits, 0);
380   for (i = 0; i < 6; ++i) {
381     dits[0] = rl[i];
382     dits[1] = dits[0] + drca;
383     dits[2] = (rzcone + TMath::Tan(acone) * (rl[i] - rl[0]) - (dzl[i]+ dzb[i] + drsu)) / 2.;
384     zpos = dzl[i - 1] + dzb[i] + drsu + dits[2];
385     gMC->Gsposp("ICHO", i+1, "ITSV", 0., 0., zpos, 0, "ONLY", dits, 3);
386     gMC->Gsposp("ICHO", i+7, "ITSV", 0., 0.,-zpos, 0, "ONLY", dits, 3);
387   }
388   //    DEFINE A CONICAL GHOST VOLUME FOR THE PHI SEGMENTATION 
389   pcits[0] = 0.;
390   pcits[1] = 360.;
391   pcits[2] = 2.;
392   pcits[3] = rzcone;
393   pcits[4] = 3.5;
394   pcits[5] = rl[0];
395   pcits[6] = pcits[3] + TMath::Tan(acone) * (rlim - rl[0]);
396   pcits[7] = rlim - rl[0] + 3.5;
397   pcits[8] = rlim;
398   gMC->Gsvolu("ICMO", "PCON", idtmed[275], pcits, 9);
399   AliMatrix(idrotm[200], 90., 0., 90., 90., 180., 0.);
400   gMC->Gspos("ICMO", 1, "ITSV", 0., 0., 0., 0, "ONLY");
401   gMC->Gspos("ICMO", 2, "ITSV", 0., 0., 0., idrotm[200], "ONLY");
402   
403   //     DIVIDE INTO NSEC PHI-SECTIONS 
404   
405   gMC->Gsdvn("ICMD", "ICMO", nsec, 2);
406   gMC->Gsatt("ICMO", "SEEN", 0);
407   gMC->Gsatt("ICMD", "SEEN", 0);
408   
409   //     CONICAL CABLES 
410   
411   pcits[2] = 2.;
412   gMC->Gsvolu("ICCO", "PCON", idtmed[278], pcits, 0);
413   for (i = 1; i < 6; ++i) {
414     pcits[0] = -dphi[i] / 2.;
415     pcits[1] = dphi[i];
416     if (i < 5) {
417       dzco = TMath::Tan(acone) * (rl[i+1] - rl[i]);
418     } else {
419       dzco1 = zmax - (rzcone + TMath::Tan(acone) * (rl[5] - rl[0])) -2.;
420       dzco2 = (rlim - rl[5]) * TMath::Tan(acone);
421       if (rl[5] + dzco1 / TMath::Tan(acone) < rlim) {
422         dzco = dzco1;
423       } else {
424         dzco = dzco2;
425       }
426     }
427     pcits[3] = rzcone + TMath::Tan(acone) * (rl[i] - rl[0]);
428     pcits[4] = rl[i] - drcac[i] / TMath::Sin(acone);
429     pcits[5] = rl[i];
430     pcits[6] = pcits[3] + dzco;
431     pcits[7] = rl[i] + dzco / TMath::Tan(acone) - drcac[i] / TMath::Sin(acone);
432     pcits[8] = rl[i] + dzco / TMath::Tan(acone);
433     
434     gMC->Gsposp("ICCO", i, "ICMD", 0., 0., 0., 0, "ONLY", pcits, 9);
435     
436   }
437   zend = pcits[6];
438   rend = pcits[8];
439   
440   //  CONICAL CABLES BELOW TPC 
441   
442   //    DEFINE A CONICAL GHOST VOLUME FOR THE PHI SEGMENTATION 
443   pcits[0] = 0.;
444   pcits[1] = 360.;
445   pcits[2] = 2.;
446   pcits[3] = zend;
447   pcits[5] = rend;
448   pcits[4] = pcits[5] - drca_tpc;
449   pcits[6] = xltpc;
450   pcits[8] = pcits[4] + (pcits[6] - pcits[3]) * TMath::Tan(acable * kDegrad);
451   pcits[7] = pcits[8] - drca_tpc;
452   AliMatrix(idrotm[200], 90., 0., 90., 90., 180., 0.);
453   gMC->Gsvolu("ICCM", "PCON", idtmed[275], pcits, 9);
454   gMC->Gspos("ICCM", 1, "ALIC", 0., 0., 0., 0, "ONLY");
455   gMC->Gspos("ICCM", 2, "ALIC", 0., 0., 0., idrotm[200], "ONLY");
456   gMC->Gsdvn("ITMD", "ICCM", nsec, 2);
457   gMC->Gsatt("ITMD", "SEEN", 0);
458   gMC->Gsatt("ICCM", "SEEN", 0);
459   
460   //     NOW PLACE SEGMENTS WITH DECREASING PHI SEGMENTS INTO THE 
461   //     GHOST-VOLUME 
462   
463   pcits[2] = 2.;
464   gMC->Gsvolu("ITTT", "PCON", idtmed[278], pcits, 0);
465   r0 = rend;
466   z0 = zend;
467   dz = (xltpc - zend) / 9.;
468   for (i = 0; i < 9; ++i) {
469     zi = z0 + i*dz + dz / 2.;
470     ri = r0 + (zi - z0) * TMath::Tan(acable * kDegrad);
471     dphii = dphi[5] * r0 / ri;
472     pcits[0] = -dphii / 2.;
473     pcits[1] = dphii;
474     pcits[3] = zi - dz / 2.;
475     pcits[5] = r0 + (pcits[3] - z0) * TMath::Tan(acable * kDegrad);
476     pcits[4] = pcits[5] - drca_tpc;
477     pcits[6] = zi + dz / 2.;
478     pcits[8] = r0 + (pcits[6] - z0) * TMath::Tan(acable * kDegrad);
479     pcits[7] = pcits[8] - drca_tpc;
480     
481     gMC->Gsposp("ITTT", i+1, "ITMD", 0., 0., 0., 0, "ONLY", pcits, 9);
482   }
483   
484   // --- Outputs the geometry tree in the EUCLID/CAD format 
485   
486   if (fEuclidOut) {
487     gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
488   }
489 }
490 //_____________________________________________________________________________
491 void AliITSv1::CreateMaterials(){
492 ////////////////////////////////////////////////////////////////////////
493 //     Create Materials for ITS as defined in AliITS::CreateMaterials().
494 ////////////////////////////////////////////////////////////////////////
495   AliITS::CreateMaterials();
496 }
497 //_____________________________________________________________________________
498 void AliITSv1::Init(){
499 ////////////////////////////////////////////////////////////////////////
500 //     Initialise the ITS after it has been created.
501 ////////////////////////////////////////////////////////////////////////
502     Int_t i,j,l;
503
504     fIdN       = fId1N;;
505     fIdName    = new char*[fIdN];
506     fIdSens    = new Int_t[fIdN];
507     for(i=0;i<fId1N;i++) {
508         l = strlen(fId1Name[i]);
509         fIdName[i] = new char[l+1];
510         for(j=0;j<l;j++) fIdName[i][j] = fId1Name[i][j];
511         fIdName[i][l] = '\0'; // Null terminate this string.
512     } // end for i
513     //
514     AliITS::Init();
515     fMajorVersion = 1;
516     fMinorVersion = 0;
517 }  
518  
519 //_____________________________________________________________________________
520 void AliITSv1::DrawModule(){
521 ////////////////////////////////////////////////////////////////////////
522 //     Draw a shaded view of the FMD version 1.
523 ////////////////////////////////////////////////////////////////////////
524   
525   // Set everything unseen
526   gMC->Gsatt("*", "seen", -1);
527   // 
528   // Set ALIC mother visible
529   gMC->Gsatt("ALIC","SEEN",0);
530   //
531   // Set the volumes visible
532   gMC->Gsatt("ITSV","SEEN",0);
533   gMC->Gsatt("ITS1","SEEN",1);
534   gMC->Gsatt("ITS2","SEEN",1);
535   gMC->Gsatt("ITS3","SEEN",1);
536   gMC->Gsatt("ITS4","SEEN",1);
537   gMC->Gsatt("ITS5","SEEN",1);
538   gMC->Gsatt("ITS6","SEEN",1);
539
540   gMC->Gsatt("IPCB","SEEN",1);
541   gMC->Gsatt("ICO2","SEEN",1);
542   gMC->Gsatt("ICER","SEEN",0);
543   gMC->Gsatt("ISI2","SEEN",0);
544   gMC->Gsatt("IPLA","SEEN",0);
545   gMC->Gsatt("ICO3","SEEN",0);
546   gMC->Gsatt("IEPX","SEEN",0);
547   gMC->Gsatt("ISI3","SEEN",1);
548   gMC->Gsatt("ISUP","SEEN",0);
549   gMC->Gsatt("ICHO","SEEN",0);
550   gMC->Gsatt("ICMO","SEEN",0);
551   gMC->Gsatt("ICMD","SEEN",0);
552   gMC->Gsatt("ICCO","SEEN",1);
553   gMC->Gsatt("ICCM","SEEN",0);
554   gMC->Gsatt("ITMD","SEEN",0);
555   gMC->Gsatt("ITTT","SEEN",1);
556
557   //
558   gMC->Gdopt("hide", "on");
559   gMC->Gdopt("shad", "on");
560   gMC->Gsatt("*", "fill", 7);
561   gMC->SetClipBox(".");
562   gMC->SetClipBox("*", 0, 300, -300, 300, -300, 300);
563   gMC->DefaultRange();
564   gMC->Gdraw("alic", 40, 30, 0, 11, 10, .07, .07);
565   gMC->Gdhead(1111, "Inner Tracking System Version 1");
566   gMC->Gdman(17, 6, "MAN");
567 }
568 //_____________________________________________________________________________
569 void AliITSv1::StepManager(){
570 ////////////////////////////////////////////////////////////////////////
571 //    Called for every step in the ITS, then calles the AliITShit class
572 // creator with the information to be recoreded about that hit.
573 ////////////////////////////////////////////////////////////////////////
574   Int_t         copy, id;
575   Float_t       hits[8];
576   Int_t         vol[4];
577   TLorentzVector position, momentum;
578   TClonesArray &lhits = *fHits;
579   //
580   // Track status
581   vol[3] = 0;
582   if(gMC->IsTrackInside())      vol[3] +=  1;
583   if(gMC->IsTrackEntering())    vol[3] +=  2;
584   if(gMC->IsTrackExiting())     vol[3] +=  4;
585   if(gMC->IsTrackOut())         vol[3] +=  8;
586   if(gMC->IsTrackDisappeared()) vol[3] += 16;
587   if(gMC->IsTrackStop())        vol[3] += 32;
588   if(gMC->IsTrackAlive())       vol[3] += 64;
589   //
590   // Fill hit structure.
591   if( !(gMC->TrackCharge()) ) return;
592     //
593     // Only entering charged tracks
594     if((id=gMC->CurrentVolID(copy))==fIdSens[0]) {  
595       vol[0]=1;
596       id=gMC->CurrentVolOffID(1,copy);      
597       vol[1]=copy;
598       id=gMC->CurrentVolOffID(2,copy);
599       vol[2]=copy;                       
600     } else if(id==fIdSens[1]) {
601       vol[0]=2;
602       id=gMC->CurrentVolOffID(1,copy);       
603       vol[1]=copy;
604       id=gMC->CurrentVolOffID(2,copy);
605       vol[2]=copy;                    
606     } else if(id==fIdSens[2]) {
607       vol[0]=3;
608       vol[1]=copy;
609       id=gMC->CurrentVolOffID(1,copy);
610       vol[2]=copy;             
611     } else if(id==fIdSens[3]) {
612       vol[0]=4;
613       vol[1]=copy;
614       id=gMC->CurrentVolOffID(1,copy);
615       vol[2]=copy;                  
616     } else if(id==fIdSens[4]) {
617       vol[0]=5;
618       vol[1]=copy;
619       id=gMC->CurrentVolOffID(1,copy);
620       vol[2]=copy;               
621     } else if(id==fIdSens[5]) {
622       vol[0]=6;
623       vol[1]=copy;
624       id=gMC->CurrentVolOffID(1,copy);
625       vol[2]=copy;                      
626     } else return;
627     gMC->TrackPosition(position);
628     gMC->TrackMomentum(momentum);
629     hits[0]=position[0];
630     hits[1]=position[1];
631     hits[2]=position[2];          
632     hits[3]=momentum[0];
633     hits[4]=momentum[1];
634     hits[5]=momentum[2];
635     hits[6]=gMC->Edep();
636     hits[7]=gMC->TrackTime();
637     new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
638 }
639 //____________________________________________________________________________
640 void AliITSv1::Streamer(TBuffer &R__b){
641 ////////////////////////////////////////////////////////////////////////
642 //    A dummy Streamer function for this class AliITSv1. By default it
643 // only streams the AliITS class as it is required. Since this class
644 // dosen't contain any "real" data to be saved, it doesn't.
645 ////////////////////////////////////////////////////////////////////////
646
647    if (R__b.IsReading()) {
648       Version_t R__v = R__b.ReadVersion(); if (R__v) { }
649       AliITS::Streamer(R__b);
650       // This information does not need to be read. It is "hard wired"
651       // into this class via its creators.
652       //R__b >> fId1N;
653       //R__b.ReadArray(fId1Name);
654    } else {
655       R__b.WriteVersion(AliITSv1::IsA());
656       AliITS::Streamer(R__b);
657       // This information does not need to be saved. It is "hard wired"
658       // into this class via its creators.
659       //R__b << fId1N;
660       //R__b.WriteArray(fId1Name, __COUNTER__);
661    } // end if R__b.IsReading()
662 }