]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSv0.cxx
Minor corrections for uninitialised variables.
[u/mrichter/AliRoot.git] / ITS / AliITSv0.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.7  1999/09/29 09:24:20  fca
19 Introduction of the Copyright and cvs Log
20
21 */
22
23 ///////////////////////////////////////////////////////////////////////////////
24 //                                                                           //
25 //  Inner Traking System version 0                                           //
26 //                                                                           //
27 //Begin_Html
28 /*
29 <img src="picts/AliITSv0Class.gif">
30 </pre>
31 <br clear=left>
32 <font size=+2 color=red>
33 <p>The responsible person for this module is
34 <a href="mailto:roberto.barbera@ct.infn.it">Roberto Barbera</a>.
35 </font>
36 <pre>
37 */
38 //End_Html
39 //                                                                           //
40 ///////////////////////////////////////////////////////////////////////////////
41
42 #include <TMath.h>
43 #include <TRandom.h>
44 #include <TVector.h>
45 #include "AliITSv0.h"
46 #include "AliRun.h"
47
48 #include "AliMC.h"
49 #include "AliConst.h"
50
51 ClassImp(AliITSv0)
52  
53 //_____________________________________________________________________________
54 AliITSv0::AliITSv0()
55 {
56   //
57   // Default constructor for ITS
58   //
59 }
60  
61 //_____________________________________________________________________________
62 AliITSv0::AliITSv0(const char *name, const char *title)
63       : AliITS(name, title)
64 {
65   //
66   // Standard constructor for ITS
67   //
68 }
69  
70 //_____________________________________________________________________________
71 void AliITSv0::CreateGeometry()
72 {
73   //
74   // Create Geometry for ITS version 0
75   //
76   //Begin_Html
77   /*
78     <img src="picts/AliITSv0Tree.gif">
79   */
80   //End_Html
81   //Begin_Html
82   /*
83     <img src="picts/AliITSv0.gif">
84   */
85   //End_Html
86   
87   
88   Float_t rl[6]    = { 3.9,7.6,14.,24.,40.,45. };       //SILICON LAYERS INNER RADIUS
89   Float_t drl[6]   = { .755,.755,.809,.809,.7,.7 };     //THICKNESS OF LAYERS (in % radiation length)
90   Float_t dzl[6]   = { 12.67,16.91,20.85,29.15,45.11,50.975 }; //HALF LENGTH OF LAYERS
91   Float_t drpcb[6] = { 0.,0.,.06,.06,0.,0. };           //PCB THICKNESS
92   Float_t drcu[6]  = { 0.,0.,.0504,.0504,.0357,.0357 }; //COPPER THICKNESS
93   Float_t drsi[6]  = { 0.,0.,.006,.006,.3571,.3571 };   //SILICON THICKNESS
94   Float_t drcer[6] = { 0.,0.,.08,.08,0.,0. };           //CERAMICS THICKNESS
95   Float_t drepx[6] = { 0.,0.,0.,0.,.5357,.5357 };       //EPOXY THICKNESS
96   Float_t drpla[6] = { 0.,0.,0.,0.,.1786,.1786 };       //PLASTIC THICKNESS
97   Float_t dzb[6]   = { 0.,0.,15.,15.,4.,4. };           //LENGTH OF BOXES
98   Float_t dphi[6]  = { 72.,72.,72.,72.,50.6,45. };      //COVERED PHI-RANGE FOR LAYERS 1-6
99   
100   Float_t drca;
101   //Float_t dzfc, dwat;
102   Int_t i, nsec;
103   Float_t rend, drca_tpc, dzco, zend, dits[3], rlim, drsu, zmax;
104   Float_t zpos, dzco1, dzco2;
105   Float_t drcac[6], acone, dphii;
106   Float_t pcits[15], xltpc;
107   Float_t rstep, r0, z0, acable, fp, dz, zi, ri;
108   Int_t idrotm[399];
109   Float_t rzcone;
110   Float_t dgh[15];
111   
112   Int_t *idtmed = fIdtmed->GetArray()-199;
113   
114   //     CONVERT INTO CM (RL(SI)=9.36 CM) 
115   for (i = 0; i < 6; ++i) {
116     drl[i] = drl[i]/100. * 9.36;
117   }
118   
119   //     SUPPORT ENDPLANE THICKNESS 
120   drsu = 2.*0.06 + 1./20;  // 1./20. is 1 cm of honeycomb (1/20 carbon density)
121   
122   //     CABLE THICKNESS (HORIZONTAL CABLES CONNECTING THE LAYERS) 
123   drca = .2;
124   
125   //     WATER THICKNESS 
126
127   //dwat = .1;
128   
129   //     CONE BELOW TPC 
130   
131   drca_tpc = 1.2/4.;
132   
133   //     CABLE THICKNESS (CONICAL CABLES CONNECTING THE LAYERS) 
134   
135   
136   //     ITS CONE ANGLE 
137   
138   acone  = 45.;
139   acone *= kDegrad;
140   
141   //     CONE RADIUS AT 1ST LAYER 
142   
143   rzcone = 30.;
144   
145   //     FIELD CAGE HALF LENGTH 
146   
147   //dzfc  = 64.5;
148   rlim  = 48.;
149   zmax  = 80.;
150   xltpc = 275.;
151   
152   
153   //     PARAMETERS FOR SMALL (1/2) ITS 
154   
155   //      DO I=1,6 
156   //        DZL(I)=DZL(I)/2. 
157   //        DZB(I)=DZB(I)/2. 
158   //     ENDDO 
159   //      DRCA=DRCA/2. 
160   //      ACONE=ACONE/2. 
161   //      DRCA_TPC=DRCA_TPC/2. 
162   //      RZCONE=RZCONE/2. 
163   //      DZFC=DZFC/2. 
164   //      ZMAX=ZMAX/2. 
165   //      XLTPC=XLTPC/2. 
166   acable = 8.5;  
167   
168   //     EQUAL DISTRIBUTION INTO THE 6 LAYERS 
169   rstep = drca_tpc / 6.;
170   for (i = 0; i < 6; ++i) {
171     drcac[i] = (i+1) * rstep;
172   }
173
174   //     NUMBER OF PHI SECTORS 
175   
176   nsec = 5;
177   
178   //     NOW PACK USING THICKNESS 
179   
180   for (i = 0; i < 6; ++i) {
181     
182     //     PACKING FACTOR 
183     fp = rl[5] / rl[i];
184     
185     //      PHI-PACKING NOT SUFFICIENT ? 
186     
187     if (dphi[i]/45 < fp) {
188       drcac[i] = drcac[i]*fp*45/dphi[i];
189     }
190   }
191   
192   
193   // --- Define ghost volume containing the six layers and fill it with air 
194   
195   dgh[0] = 3.5;
196   dgh[1] = 50.;
197   dgh[2] = zmax;
198   gMC->Gsvolu("ITSV", "TUBE", idtmed[275], dgh, 3);
199   
200   // --- Place the ghost volume in its mother volume (ALIC) and make it 
201   //     invisible 
202   
203   gMC->Gspos("ITSV", 1, "ALIC", 0., 0., 0., 0, "ONLY");
204   gMC->Gsatt("ITSV", "SEEN", 0);
205   
206   //     ITS LAYERS (SILICON) 
207   
208   dits[0] = rl[0];
209   dits[1] = rl[0] + drl[0];
210   dits[2] = dzl[0];
211   gMC->Gsvolu("ITS1", "TUBE", idtmed[199], dits, 3);
212   gMC->Gspos("ITS1", 1, "ITSV", 0., 0., 0., 0, "ONLY");
213   
214   dits[0] = rl[1];
215   dits[1] = rl[1] + drl[1];
216   dits[2] = dzl[1];
217   gMC->Gsvolu("ITS2", "TUBE", idtmed[199], dits, 3);
218   gMC->Gspos("ITS2", 1, "ITSV", 0., 0., 0., 0, "ONLY");
219   
220   dits[0] = rl[2];
221   dits[1] = rl[2] + drl[2];
222   dits[2] = dzl[2];
223   gMC->Gsvolu("ITS3", "TUBE", idtmed[224], dits, 3);
224   gMC->Gspos("ITS3", 1, "ITSV", 0., 0., 0., 0, "ONLY");
225   
226   dits[0] = rl[3];
227   dits[1] = rl[3] + drl[3];
228   dits[2] = dzl[3];
229   gMC->Gsvolu("ITS4", "TUBE", idtmed[224], dits, 3);
230   gMC->Gspos("ITS4", 1, "ITSV", 0., 0., 0., 0, "ONLY");
231   
232   dits[0] = rl[4];
233   dits[1] = rl[4] + drl[4];
234   dits[2] = dzl[4];
235   gMC->Gsvolu("ITS5", "TUBE", idtmed[249], dits, 3);
236   gMC->Gspos("ITS5", 1, "ITSV", 0., 0., 0., 0, "ONLY");
237   
238   dits[0] = rl[5];
239   dits[1] = rl[5] + drl[5];
240   dits[2] = dzl[5];
241   gMC->Gsvolu("ITS6", "TUBE", idtmed[249], dits, 3);
242   gMC->Gspos("ITS6", 1, "ITSV", 0., 0., 0., 0, "ONLY");
243   
244   //    ELECTRONICS BOXES   
245   //     PCB (layer #3 and #4) 
246   
247   gMC->Gsvolu("IPCB", "TUBE", idtmed[233], dits, 0);
248   for (i = 2; i < 4; ++i) {
249     dits[0] = rl[i];
250     dits[1] = dits[0] + drpcb[i];
251     dits[2] = dzb[i] / 2.;
252     zpos = dzl[i] + dits[2];
253     gMC->Gsposp("IPCB", i-1, "ITSV", 0., 0., zpos, 0, "ONLY", dits, 3);
254     gMC->Gsposp("IPCB", i+1, "ITSV", 0., 0.,-zpos, 0, "ONLY", dits, 3);
255   }
256   
257   //     COPPER (layer #3 and #4) 
258   
259   gMC->Gsvolu("ICO2", "TUBE", idtmed[234], dits, 0);
260   for (i = 2; i < 4; ++i) {
261     dits[0] = rl[i] + drpcb[i];
262     dits[1] = dits[0] + drcu[i];
263     dits[2] = dzb[i] / 2.;
264     zpos = dzl[i] + dits[2];
265     gMC->Gsposp("ICO2", i-1, "ITSV", 0., 0., zpos, 0, "ONLY", dits, 3);
266     gMC->Gsposp("ICO2", i+1, "ITSV", 0., 0.,-zpos, 0, "ONLY", dits, 3);
267   }
268   
269   //     CERAMICS (layer #3 and #4) 
270   
271   gMC->Gsvolu("ICER", "TUBE", idtmed[235], dits, 0);
272   for (i = 2; i < 4; ++i) {
273     dits[0] = rl[i] + drpcb[i] + drcu[i];
274     dits[1] = dits[0] + drcer[i];
275     dits[2] = dzb[i] / 2.;
276     zpos = dzl[i] + dits[2];
277     gMC->Gsposp("ICER", i-1, "ITSV", 0., 0., zpos, 0, "ONLY", dits, 3);
278     gMC->Gsposp("ICER", i+1, "ITSV", 0., 0.,-zpos, 0, "ONLY", dits, 3);
279   }
280   
281   //     SILICON (layer #3 and #4) 
282   
283   gMC->Gsvolu("ISI2", "TUBE", idtmed[226], dits, 0);
284   for (i = 2; i < 4; ++i) {
285     dits[0] = rl[i] + drpcb[i] + drcu[i] + drcer[i];
286     dits[1] = dits[0] + drsi[i];
287     dits[2] = dzb[i] / 2.;
288     zpos = dzl[i - 1] + dits[2];
289     gMC->Gsposp("ISI2", i-1, "ITSV", 0., 0., zpos, 0, "ONLY", dits, 3);
290     gMC->Gsposp("ISI2", i+1, "ITSV", 0., 0.,-zpos, 0, "ONLY", dits, 3);
291   }
292   
293   //     PLASTIC (G10FR4) (layer #5 and #6) 
294   
295   gMC->Gsvolu("IPLA", "TUBE", idtmed[262], dits, 0);
296   for (i = 4; i < 6; ++i) {
297     dits[0] = rl[i];
298     dits[1] = dits[0] + drpla[i];
299     dits[2] = dzb[i] / 2.;
300     zpos = dzl[i] + dits[2];
301     gMC->Gsposp("IPLA", i-1, "ITSV", 0., 0., zpos, 0, "ONLY", dits, 3);
302     gMC->Gsposp("IPLA", i+1, "ITSV", 0., 0.,-zpos, 0, "ONLY", dits, 3);
303   }
304   
305   //     COPPER (layer #5 and #6) 
306   
307   gMC->Gsvolu("ICO3", "TUBE", idtmed[259], dits, 0);
308   for (i = 4; i < 6; ++i) {
309     dits[0] = rl[i] + drpla[i];
310     dits[1] = dits[0] + drcu[i];
311     dits[2] = dzb[i] / 2.;
312     zpos = dzl[i] + dits[2];
313     gMC->Gsposp("ICO3", i-1, "ITSV", 0., 0., zpos, 0, "ONLY", dits, 3);
314     gMC->Gsposp("ICO3", i+1, "ITSV", 0., 0.,-zpos, 0, "ONLY", dits, 3);
315   }
316   
317   //     EPOXY (layer #5 and #6) 
318   
319   gMC->Gsvolu("IEPX", "TUBE", idtmed[262], dits, 0);
320   for (i = 4; i < 6; ++i) {
321     dits[0] = rl[i] + drpla[i] + drcu[i];
322     dits[1] = dits[0] + drepx[i];
323     dits[2] = dzb[i] / 2.;
324     zpos = dzl[i] + dits[2];
325     gMC->Gsposp("IEPX", i-1, "ITSV", 0., 0., zpos, 0, "ONLY", dits, 3);
326     gMC->Gsposp("IEPX", i+1, "ITSV", 0., 0.,-zpos, 0, "ONLY", dits, 3);
327   }
328   
329   //     SILICON (layer #5 and #6) 
330   
331   gMC->Gsvolu("ISI3", "TUBE", idtmed[251], dits, 0);
332   for (i = 4; i < 6; ++i) {
333     dits[0] = rl[i] + drpla[i] + drcu[i] + drepx[i];
334     dits[1] = dits[0] + drsi[i];
335     dits[2] = dzb[i] / 2.;
336     zpos = dzl[i] + dits[2];
337     gMC->Gsposp("ISI3", i-1, "ITSV", 0., 0., zpos, 0, "ONLY", dits, 3);
338     gMC->Gsposp("ISI3", i+1, "ITSV", 0., 0.,-zpos, 0, "ONLY", dits, 3);
339   }
340   
341   //    SUPPORT 
342   
343   gMC->Gsvolu("ISUP", "TUBE", idtmed[274], dits, 0);
344   for (i = 0; i < 6; ++i) {
345     dits[0] = rl[i];
346     if (i < 5) dits[1] = rl[i+1];
347     else       dits[1] = rlim;
348     dits[2] = drsu / 2.;
349     zpos = dzl[i] + dzb[i] + dits[2];
350     gMC->Gsposp("ISUP", i+1, "ITSV", 0., 0., zpos, 0, "ONLY", dits, 3);
351     gMC->Gsposp("ISUP", i+7, "ITSV", 0., 0.,-zpos, 0, "ONLY", dits, 3);
352   }
353   
354   // CABLES (HORIZONTAL) 
355   
356   gMC->Gsvolu("ICHO", "TUBE", idtmed[278], dits, 0);
357   for (i = 0; i < 6; ++i) {
358     dits[0] = rl[i];
359     dits[1] = dits[0] + drca;
360     dits[2] = (rzcone + TMath::Tan(acone) * (rl[i] - rl[0]) - (dzl[i]+ dzb[i] + drsu)) / 2.;
361     zpos = dzl[i] + dzb[i] + drsu + dits[2];
362     gMC->Gsposp("ICHO", i+1, "ITSV", 0., 0., zpos, 0, "ONLY", dits, 3);
363     gMC->Gsposp("ICHO", i+7, "ITSV", 0., 0.,-zpos, 0, "ONLY", dits, 3);
364   }
365   //    DEFINE A CONICAL GHOST VOLUME FOR THE PHI SEGMENTATION 
366   pcits[0] = 0.;
367   pcits[1] = 360.;
368   pcits[2] = 2.;
369   pcits[3] = rzcone;
370   pcits[4] = 3.5;
371   pcits[5] = rl[0];
372   pcits[6] = pcits[3] + TMath::Tan(acone) * (rlim - rl[0]);
373   pcits[7] = rlim - rl[0] + 3.5;
374   pcits[8] = rlim;
375   gMC->Gsvolu("ICMO", "PCON", idtmed[275], pcits, 9);
376   AliMatrix(idrotm[200], 90., 0., 90., 90., 180., 0.);
377   gMC->Gspos("ICMO", 1, "ITSV", 0., 0., 0., 0, "ONLY");
378   gMC->Gspos("ICMO", 2, "ITSV", 0., 0., 0., idrotm[200], "ONLY");
379   
380   //     DIVIDE INTO NSEC PHI-SECTIONS 
381   
382   gMC->Gsdvn("ICMD", "ICMO", nsec, 2);
383   gMC->Gsatt("ICMO", "SEEN", 0);
384   gMC->Gsatt("ICMD", "SEEN", 0);
385   
386   //     CONICAL CABLES 
387   
388   pcits[2] = 2.;
389   gMC->Gsvolu("ICCO", "PCON", idtmed[278], pcits, 0);
390   for (i = 1; i < 6; ++i) {
391     pcits[0] = -dphi[i] / 2.;
392     pcits[1] = dphi[i];
393     if (i < 5) {
394       dzco = TMath::Tan(acone) * (rl[i] - rl[i-1]);
395     } else {
396       dzco1 = zmax - (rzcone + TMath::Tan(acone) * (rl[5] - rl[0])) -2.;
397       dzco2 = (rlim - rl[5]) * TMath::Tan(acone);
398       if (rl[5] + dzco1 / TMath::Tan(acone) < rlim) {
399         dzco = dzco1;
400       } else {
401         dzco = dzco2;
402       }
403     }
404     pcits[3] = rzcone + TMath::Tan(acone) * (rl[i] - rl[0]);
405     pcits[4] = rl[i] - drcac[i] / TMath::Sin(acone);
406     pcits[5] = rl[i];
407     pcits[6] = pcits[3] + dzco;
408     pcits[7] = rl[i] + dzco / TMath::Tan(acone) - drcac[i] / TMath::Sin(acone);
409     pcits[8] = rl[i] + dzco / TMath::Tan(acone);
410     
411     gMC->Gsposp("ICCO", i, "ICMD", 0., 0., 0., 0, "ONLY", pcits, 9);
412     
413   }
414   zend = pcits[6];
415   rend = pcits[8];
416   
417   //  CONICAL CABLES BELOW TPC 
418   
419   //    DEFINE A CONICAL GHOST VOLUME FOR THE PHI SEGMENTATION 
420   pcits[0] = 0.;
421   pcits[1] = 360.;
422   pcits[2] = 2.;
423   pcits[3] = zend;
424   pcits[5] = rend;
425   pcits[4] = pcits[5] - drca_tpc;
426   pcits[6] = xltpc;
427   pcits[8] = pcits[4] + (pcits[6] - pcits[3]) * TMath::Tan(acable * kDegrad);
428   pcits[7] = pcits[8] - drca_tpc;
429   AliMatrix(idrotm[200], 90., 0., 90., 90., 180., 0.);
430   gMC->Gsvolu("ICCM", "PCON", idtmed[275], pcits, 9);
431   gMC->Gspos("ICCM", 1, "ALIC", 0., 0., 0., 0, "ONLY");
432   gMC->Gspos("ICCM", 2, "ALIC", 0., 0., 0., idrotm[200], "ONLY");
433   gMC->Gsdvn("ITMD", "ICCM", nsec, 2);
434   gMC->Gsatt("ITMD", "SEEN", 0);
435   gMC->Gsatt("ICCM", "SEEN", 0);
436   
437   //     NOW PLACE SEGMENTS WITH DECREASING PHI SEGMENTS INTO THE 
438   //     GHOST-VOLUME 
439   
440   pcits[2] = 2.;
441   gMC->Gsvolu("ITTT", "PCON", idtmed[278], pcits, 0);
442   r0 = rend;
443   z0 = zend;
444   dz = (xltpc - zend) / 9.;
445   for (i = 0; i < 9; ++i) {
446     zi = z0 + i* dz + dz / 2.;
447     ri = r0 + (zi - z0) * TMath::Tan(acable * kDegrad);
448     dphii = dphi[5] * r0 / ri;
449     pcits[0] = -dphii / 2.;
450     pcits[1] = dphii;
451     pcits[3] = zi - dz / 2.;
452     pcits[5] = r0 + (pcits[3] - z0) * TMath::Tan(acable * kDegrad);
453     pcits[4] = pcits[5] - drca_tpc;
454     pcits[6] = zi + dz / 2.;
455     pcits[8] = r0 + (pcits[6] - z0) * TMath::Tan(acable * kDegrad);
456     pcits[7] = pcits[8] - drca_tpc;
457     
458     gMC->Gsposp("ITTT", i+1, "ITMD", 0., 0., 0., 0, "ONLY", pcits, 9);
459   }
460   
461   // --- Outputs the geometry tree in the EUCLID/CAD format 
462   
463   if (fEuclidOut) {
464     gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
465   }
466 }
467  
468 //_____________________________________________________________________________
469 void AliITSv0::DrawModule()
470 {
471   //
472   // Draw a shaded view of the FMD version 1
473   //
474   
475   
476   // Set everything unseen
477   gMC->Gsatt("*", "seen", -1);
478   // 
479   // Set ALIC mother visible
480   gMC->Gsatt("ALIC","SEEN",0);
481   //
482   // Set the volumes visible
483   gMC->Gsatt("ITSV","SEEN",0);
484   gMC->Gsatt("ITS1","SEEN",1);
485   gMC->Gsatt("ITS2","SEEN",1);
486   gMC->Gsatt("ITS3","SEEN",1);
487   gMC->Gsatt("ITS4","SEEN",1);
488   gMC->Gsatt("ITS5","SEEN",1);
489   gMC->Gsatt("ITS6","SEEN",1);
490   gMC->Gsatt("ISI2","SEEN",1);
491   gMC->Gsatt("IPLA","SEEN",1);
492   gMC->Gsatt("ICHO","SEEN",1);
493   gMC->Gsatt("ICMO","SEEN",0);
494   gMC->Gsatt("ICMD","SEEN",0);
495   gMC->Gsatt("ICCO","SEEN",1);
496   gMC->Gsatt("ICCM","SEEN",0);
497   gMC->Gsatt("ITMD","SEEN",0);
498   gMC->Gsatt("ITTT","SEEN",1);
499   //
500   gMC->Gdopt("hide", "on");
501   gMC->Gdopt("shad", "on");
502   gMC->Gsatt("*", "fill", 7);
503   gMC->SetClipBox(".");
504   gMC->SetClipBox("*", 0, 300, -300, 300, -300, 300);
505   gMC->DefaultRange();
506   gMC->Gdraw("alic", 40, 30, 0, 11, 10, .05, .05);
507   gMC->Gdhead(1111, "Inner Tracking System Version 0");
508   gMC->Gdman(16, 6, "MAN");
509 }
510
511 //_____________________________________________________________________________
512 void AliITSv0::StepManager()
513 {
514   //
515   // Called at every step in the ITS
516   //
517   Int_t         copy, id;
518   Float_t       hits[7];
519   Int_t         vol[3];
520   TLorentzVector position;
521   TLorentzVector momentum;
522   TClonesArray &lhits = *fHits;
523   //
524   if(gMC->TrackCharge() && gMC->Edep()) {
525     //
526     // Only entering charged tracks
527     if((id=gMC->CurrentVolID(copy))==fIdSens1) {  
528       vol[0]=1;
529       id=gMC->CurrentVolOffID(1,copy);      
530       vol[1]=copy;
531       id=gMC->CurrentVolOffID(2,copy);
532       vol[2]=copy;                       
533     } else if(id==fIdSens2) {
534       vol[0]=2;
535       id=gMC->CurrentVolOffID(1,copy);       
536       vol[1]=copy;
537       id=gMC->CurrentVolOffID(2,copy);
538       vol[2]=copy;                    
539     } else if(id==fIdSens3) {
540       vol[0]=3;
541       vol[1]=copy;
542       id=gMC->CurrentVolOffID(1,copy);
543       vol[2]=copy;             
544     } else if(id==fIdSens4) {
545       vol[0]=4;
546       vol[1]=copy;
547       id=gMC->CurrentVolOffID(1,copy);
548       vol[2]=copy;                  
549     } else if(id==fIdSens5) {
550       vol[0]=5;
551       vol[1]=copy;
552       id=gMC->CurrentVolOffID(1,copy);
553       vol[2]=copy;               
554     } else if(id==fIdSens6) {
555       vol[0]=6;
556       vol[1]=copy;
557       id=gMC->CurrentVolOffID(1,copy);
558       vol[2]=copy;                      
559     } else return;
560     gMC->TrackPosition(position);
561     gMC->TrackMomentum(momentum);
562     hits[0]=position[0];
563     hits[1]=position[1];
564     hits[2]=position[2];          
565     hits[3]=momentum[0];
566     hits[4]=momentum[1];
567     hits[5]=momentum[2];          
568     hits[6]=gMC->Edep();
569     new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
570   }    
571 }