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