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