]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONv1.cxx
Update raw2digits framework (Ch.Finck)
[u/mrichter/AliRoot.git] / MUON / AliMUONv1.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *      SigmaEffect_thetadegrees                                                                  *
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 purpeateose. It is      *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 /* $Id$ */
17
18 /////////////////////////////////////////////////////////
19 //  Manager and hits classes for set:MUON version 1    //
20 /////////////////////////////////////////////////////////
21
22 #include <TRandom.h>
23 #include <TF1.h>
24 #include <TClonesArray.h>
25 #include <TRandom.h> 
26 #include <TVirtualMC.h>
27 #include <TGeoMatrix.h>
28
29 #include "AliMUONv1.h"
30 #include "AliConst.h" 
31 #include "AliMUONChamber.h"
32 #include "AliMUONConstants.h"
33 #include "AliMUONFactoryV2.h"
34 #include "AliMUONHit.h"
35 #include "AliMUONTriggerCircuit.h"
36 #include "AliMUONGeometryBuilder.h"     
37 #include "AliMUONGeometryModule.h"      
38 #include "AliMUONGeometrySVMap.h"       
39 #include "AliMUONGeometryDetElement.h"  
40 #include "AliMagF.h"
41 #include "AliRun.h"
42 #include "AliMC.h"
43 #include "AliLog.h"
44
45 ClassImp(AliMUONv1)
46  
47 //___________________________________________
48 AliMUONv1::AliMUONv1() 
49   : AliMUON(),
50     fStepManagerVersionOld(kFALSE),
51     fStepManagerVersionDE(kFALSE),
52     fAngleEffect(kTRUE),
53     fStepMaxInActiveGas(0.6),
54     fStepSum(0x0),
55     fDestepSum(0x0),
56     fTrackMomentum(), 
57     fTrackPosition(),
58     fElossRatio(0x0),
59     fAngleEffect10(0x0),
60     fAngleEffectNorma(0x0)
61 {
62 // Default constructor
63
64
65 //___________________________________________
66 AliMUONv1::AliMUONv1(const char *name, const char *title)
67   : AliMUON(name,title), 
68     fStepManagerVersionOld(kFALSE),
69     fStepManagerVersionDE(kFALSE),
70     fAngleEffect(kTRUE),
71     fStepMaxInActiveGas(0.6),
72     fStepSum(0x0),
73     fDestepSum(0x0),
74     fTrackMomentum(), 
75     fTrackPosition(),
76     fElossRatio(0x0),
77     fAngleEffect10(0x0),
78     fAngleEffectNorma(0x0)
79 {
80 // Standard onstructor
81
82     // By default include all stations
83
84     fStepSum   = new Float_t [AliMUONConstants::NCh()];
85     fDestepSum = new Float_t [AliMUONConstants::NCh()];
86     for (Int_t i=0; i<AliMUONConstants::NCh(); i++) {
87       fStepSum[i] =0.0;
88       fDestepSum[i]=0.0;
89     }
90     // Ratio of particle mean eloss with respect MIP's Khalil Boudjemline, sep 2003, PhD.Thesis and Particle Data Book
91     fElossRatio = new TF1("ElossRatio","[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x",0.5,5.); 
92     fElossRatio->SetParameter(0,1.02138);
93     fElossRatio->SetParameter(1,-9.54149e-02);
94     fElossRatio->SetParameter(2,+7.83433e-02); 
95     fElossRatio->SetParameter(3,-9.98208e-03);
96     fElossRatio->SetParameter(4,+3.83279e-04);
97
98     // Angle effect in tracking chambers at theta =10 degres as a function of ElossRatio (Khalil BOUDJEMLINE sep 2003 Ph.D Thesis) (in micrometers)
99     fAngleEffect10 = new TF1("AngleEffect10","[0]+[1]*x+[2]*x*x",0.5,3.0);
100     fAngleEffect10->SetParameter(0, 1.90691e+02);
101     fAngleEffect10->SetParameter(1,-6.62258e+01);
102     fAngleEffect10->SetParameter(2,+1.28247e+01);
103     // Angle effect: Normalisation form theta=10 degres to theta between 0 and 10 (Khalil BOUDJEMLINE sep 2003 Ph.D Thesis)  
104     // Angle with respect to the wires assuming that chambers are perpendicular to the z axis.
105     fAngleEffectNorma = new TF1("AngleEffectNorma","[0]+[1]*x+[2]*x*x+[3]*x*x*x",0.0,10.0);
106     fAngleEffectNorma->SetParameter(0,4.148);
107     fAngleEffectNorma->SetParameter(1,-6.809e-01);
108     fAngleEffectNorma->SetParameter(2,5.151e-02);
109     fAngleEffectNorma->SetParameter(3,-1.490e-03);
110 }
111
112 //_____________________________________________________________________________
113 AliMUONv1::AliMUONv1(const AliMUONv1& right) 
114   : AliMUON(right) 
115 {  
116   // copy constructor (not implemented)
117
118   AliFatal("Copy constructor not provided.");
119 }
120
121 //___________________________________________
122 AliMUONv1::~AliMUONv1()
123 {
124 // Destructor
125
126   delete [] fStepSum;
127   delete [] fDestepSum;
128   delete fElossRatio;
129   delete fAngleEffect10;
130   delete fAngleEffectNorma; 
131 }
132
133 //_____________________________________________________________________________
134 AliMUONv1& AliMUONv1::operator=(const AliMUONv1& right)
135 {
136   // assignement operator (not implemented)
137
138   // check assignement to self
139   if (this == &right) return *this;
140
141   AliFatal("Assignement operator not provided.");
142     
143   return *this;  
144 }    
145
146 //__________________________________________________
147 void AliMUONv1::CreateGeometry()
148 {
149 //
150 // Construct geometry using geometry builder
151 //
152
153   fGeometryBuilder->CreateGeometry();
154 }
155
156 //________________________________________________________________
157 void AliMUONv1::CreateMaterials()
158 {
159 //
160 // Construct materials using geometry builder
161 //
162
163   fGeometryBuilder->CreateMaterials();
164 }
165
166 //___________________________________________
167 void AliMUONv1::Init()
168
169    AliDebug(1,"Start Init for version 1 - CPC chamber type");
170    Int_t i;
171
172  
173    //
174    // Initialize geometry
175    //
176    fGeometryBuilder->InitGeometry();
177    AliDebug(1,"Finished Init for version 1 - CPC chamber type");   
178
179    if (fSegmentationType == 1) {
180      AliFatal("Old Segmentation no more supported");
181    }
182
183    if (fSegmentationType == 2) {
184      fFactory = new AliMUONFactoryV2("New MUON Factory");
185      AliInfo("New Segmentation");
186    } 
187
188    fFactory->Build(this, "default");
189
190    //
191    // Initialize segmentation
192    //
193    if (!fSegmentationType) {
194      AliFatal("No Segmentation Type defined.");
195      return;
196    }
197
198    for (i=0; i<AliMUONConstants::NCh(); i++) 
199      ( (AliMUONChamber*) (*fChambers)[i])->Init(fSegmentationType);// new segmentation
200    
201  
202    // trigger circuit
203    // cp 
204    for (i=0; i<AliMUONConstants::NTriggerCircuit(); i++) 
205      ( (AliMUONTriggerCircuit*) (*fTriggerCircuits)[i])->Init(i);
206    
207
208
209
210
211 }
212
213 //__________________________________________________________________
214 Int_t  AliMUONv1::GetChamberId(Int_t volId) const
215 {
216 // Check if the volume with specified  volId is a sensitive volume (gas) 
217 // of some chamber and returns the chamber number;
218 // if not sensitive volume - return 0.
219 // ---
220
221 /*
222   for (Int_t i = 1; i <= AliMUONConstants::NCh(); i++)
223     if (volId==((AliMUONChamber*)(*fChambers)[i-1])->GetGid()) return i;
224 */
225   for (Int_t i = 1; i <= AliMUONConstants::NCh(); i++)
226     if ( ((AliMUONChamber*)(*fChambers)[i-1])->IsSensId(volId) ) return i;
227
228   return 0;
229 }
230
231 //_______________________________________________________________________________
232 TString  AliMUONv1::CurrentVolumePath() const
233 {
234 // Returns current volume path
235 // (Could be removed when this function is available via gMC)
236 // ---       
237
238   TString path = "";
239   TString name;
240   Int_t copyNo;
241   Int_t imother = 0;
242   do {
243     name = gMC->CurrentVolOffName(imother);
244     gMC->CurrentVolOffID(imother++, copyNo);
245     TString add = "/";
246     add += name;
247     add += ".";
248     add += copyNo;
249     path.Insert(0,add); 
250   }
251   while ( name != TString("ALIC") );
252   
253   return path;  
254 }
255
256 //_______________________________________________________________________________
257 void AliMUONv1::StepManager()
258 {
259   // Stepmanager for the chambers
260   // TBR
261
262  if (fStepManagerVersionDE) {
263     StepManager2();
264     return;
265   }
266
267
268   // Only charged tracks
269   if( !(gMC->TrackCharge()) ) return; 
270   // Only charged tracks
271   
272   // Only gas gap inside chamber
273   // Tag chambers and record hits when track enters 
274   static Int_t   idvol=-1;
275   Int_t   iChamber=0;
276   Int_t   id=0;
277   Int_t   copy;
278   const  Float_t kBig = 1.e10;
279
280
281   //
282   // Only gas gap inside chamber
283   // Tag chambers and record hits when track enters 
284   id=gMC->CurrentVolID(copy);
285   iChamber = GetChamberId(id);
286   idvol = iChamber -1;
287
288   if (idvol == -1) return;
289
290   // Filling TrackRefs file for MUON. Our Track references are the active volume of the chambers
291   if ( (gMC->IsTrackEntering() || gMC->IsTrackExiting() ) )     
292     AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
293   
294    if( gMC->IsTrackEntering() ) {
295      Float_t theta = fTrackMomentum.Theta();
296      if ((TMath::Pi()-theta)*kRaddeg>=15.) gMC->SetMaxStep(fStepMaxInActiveGas); // We use Pi-theta because z is negative
297   }
298
299    //  AliDebug(1,
300    //    Form("Active volume found %d chamber %d Z chamber is %f ",idvol,iChamber,
301    //    ( (AliMUONChamber*)(*fChambers)[idvol])->Z()));
302    // Particule id and mass, 
303   Int_t     ipart = gMC->TrackPid();
304   Float_t   mass  = gMC->TrackMass();
305
306   fDestepSum[idvol]+=gMC->Edep();
307   // Get current particle id (ipart), track position (pos)  and momentum (mom)
308   if ( fStepSum[idvol]==0.0 )  gMC->TrackMomentum(fTrackMomentum);
309   fStepSum[idvol]+=gMC->TrackStep();
310   
311   //  if(AliDebugLevel()) {
312   //  AliDebug(1,
313   //         Form("iChamber %d, Particle %d, theta %f phi %f mass %f StepSum %f eloss %g",
314   //              iChamber,ipart, fTrackMomentum.Theta()*kRaddeg, fTrackMomentum.Phi()*kRaddeg, 
315   //              mass, fStepSum[idvol], gMC->Edep()));
316   //  AliDebug(1,
317   //         Form("Track Momentum %f %f %f", fTrackMomentum.X(), fTrackMomentum.Y(), 
318   //              fTrackMomentum.Z()));
319   //  gMC->TrackPosition(fTrackPosition);
320   //  AliDebug(1,
321   //         Form("Track Position %f %f %f",fTrackPosition.X(),fTrackPosition.Y(),
322   //      fTrackPosition.Z())) ;
323   //   }
324
325   // Track left chamber or StepSum larger than fStepMaxInActiveGas
326   if ( gMC->IsTrackExiting() || 
327        gMC->IsTrackStop() || 
328        gMC->IsTrackDisappeared()||
329        (fStepSum[idvol]>fStepMaxInActiveGas) ) {
330     
331     if   ( gMC->IsTrackExiting() || 
332            gMC->IsTrackStop() || 
333            gMC->IsTrackDisappeared() ) gMC->SetMaxStep(kBig);
334
335     gMC->TrackPosition(fTrackPosition);
336     Float_t theta = fTrackMomentum.Theta();
337     Float_t phi   = fTrackMomentum.Phi();
338     
339     TLorentzVector backToWire( fStepSum[idvol]/2.*sin(theta)*cos(phi),
340                                fStepSum[idvol]/2.*sin(theta)*sin(phi),
341                                fStepSum[idvol]/2.*cos(theta),0.0       );
342     //     AliDebug(1,Form("Exit: Track Position %f %f %f",fTrackPosition.X(),
343     //                     fTrackPosition.Y(),fTrackPosition.Z())) ;
344     //     AliDebug(1,Form("Exit: Track backToWire %f %f %f",backToWire.X(),
345     //                     backToWire.Y(),backToWire.Z()) ;
346     fTrackPosition-=backToWire;
347     
348     //-------------- Angle effect 
349     // Ratio between energy loss of particle and Mip as a function of BetaGamma of particle (Energy/Mass)
350     
351     Float_t betaxGamma    = fTrackMomentum.P()/mass;//  pc/mc2
352     Float_t sigmaEffect10degrees;
353     Float_t sigmaEffectThetadegrees;
354     Float_t eLossParticleELossMip;
355     Float_t yAngleEffect=0.;
356     Float_t thetawires      =  TMath::Abs( TMath::ASin( TMath::Sin(TMath::Pi()-theta) * TMath::Sin(phi) ) );// We use Pi-theta because z is negative
357
358
359     if (fAngleEffect){
360     if ( (betaxGamma >3.2)   &&  (thetawires*kRaddeg<=15.) ) {
361       betaxGamma=TMath::Log(betaxGamma);
362       eLossParticleELossMip = fElossRatio->Eval(betaxGamma);
363       // 10 degrees is a reference for a model (arbitrary)
364       sigmaEffect10degrees=fAngleEffect10->Eval(eLossParticleELossMip);// in micrometers
365       // Angle with respect to the wires assuming that chambers are perpendicular to the z axis.
366       sigmaEffectThetadegrees =  sigmaEffect10degrees/fAngleEffectNorma->Eval(thetawires*kRaddeg);  // For 5mm gap  
367       if ( (iChamber==1)  ||  (iChamber==2) )  
368         sigmaEffectThetadegrees/=(1.09833e+00+1.70000e-02*(thetawires*kRaddeg)); // The gap is different (4mm)
369       yAngleEffect=1.e-04*gRandom->Gaus(0,sigmaEffectThetadegrees); // Error due to the angle effect in cm
370     }
371     }
372     
373     // Detection elements ids
374     AliMUONGeometryModule* geometry
375       = Chamber(iChamber-1).GetGeometry();
376
377     AliMUONGeometryDetElement* detElement
378       = geometry->FindBySensitiveVolume(CurrentVolumePath());
379
380     Int_t detElemId = 0;
381     if (detElement) detElemId = detElement->GetUniqueID(); 
382  
383     if (!detElemId) {
384       cerr << "Chamber id: "
385            << setw(3) << iChamber << "  "
386            << "Current SV: " 
387            <<  CurrentVolumePath() 
388            << "  detElemId: "
389            << setw(5) << detElemId 
390            << endl;
391       Double_t x, y, z;
392       gMC->TrackPosition(x, y, z);         
393       cerr << "   global position: "
394            << x << ", " << y << ", " << z
395            << endl;
396       AliWarning("DetElemId not identified.");
397     }  
398     
399     // One hit per chamber
400     GetMUONData()->AddHit(fIshunt, 
401                           gAlice->GetMCApp()->GetCurrentTrackNumber(), 
402                           iChamber, ipart,
403                           fTrackPosition.X(), 
404                           fTrackPosition.Y()+yAngleEffect, 
405                           fTrackPosition.Z(), 
406                           gMC->TrackTime(),
407                           fTrackMomentum.P(),
408                           theta, 
409                           phi, 
410                           fStepSum[idvol], 
411                           fDestepSum[idvol],                        
412                           fTrackPosition.X(),
413                           fTrackPosition.Y(),
414                           fTrackPosition.Z());
415
416 //     if (AliDebugLevel()){
417 //       AliDebug(1,Form("Exit: Particle exiting from chamber %d",iChamber));
418 //       AliDebug(1,Form("Exit: StepSum %f eloss geant %g ",fStepSum[idvol],fDestepSum[idvol]));
419 //       AliDebug(1,Form("Exit: Track Position %f %f %f",fTrackPosition.X(),fTrackPosition.Y(),fTrackPosition.Z())) ;
420 //     }
421     fStepSum[idvol]  =0; // Reset for the next event
422     fDestepSum[idvol]=0; // Reset for the next event
423   }
424 }
425
426 //_______________________________________________________________________________
427 void AliMUONv1::StepManager2()
428 {
429   // Stepmanager for the chambers
430
431   // Only charged tracks
432   if( !(gMC->TrackCharge()) ) return; 
433   // Only charged tracks
434   
435   // Only gas gap inside chamber
436   // Tag chambers and record hits when track enters 
437   static Int_t   idvol=-1;
438   Int_t   iChamber=0;
439   Int_t   id=0;
440   Int_t   copy;
441   const  Float_t kBig = 1.e10;
442
443
444   //
445   // Only gas gap inside chamber
446   // Tag chambers and record hits when track enters 
447   id=gMC->CurrentVolID(copy);
448   iChamber = GetChamberId(id);
449   idvol = iChamber -1;
450
451   if (idvol == -1) return;
452   
453   // Filling TrackRefs file for MUON. Our Track references are the active volume of the chambers
454   if ( (gMC->IsTrackEntering() || gMC->IsTrackExiting() ) )     
455     AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
456   
457    if( gMC->IsTrackEntering() ) {
458      Float_t theta = fTrackMomentum.Theta();
459      if ((TMath::Pi()-theta)*kRaddeg>=15.) gMC->SetMaxStep(fStepMaxInActiveGas); // We use Pi-theta because z is negative
460   }
461
462    //   AliDebug(1,
463    //       Form("Active volume found %d chamber %d Z chamber is %f ",idvol,iChamber,
464    //            ( (AliMUONChamber*)(*fChambers)[idvol])->Z())) ;
465   // Particule id and mass, 
466   Int_t     ipart = gMC->TrackPid();
467   Float_t   mass  = gMC->TrackMass();
468
469   fDestepSum[idvol]+=gMC->Edep();
470   // Get current particle id (ipart), track position (pos)  and momentum (mom)
471   if ( fStepSum[idvol]==0.0 )  gMC->TrackMomentum(fTrackMomentum);
472   fStepSum[idvol]+=gMC->TrackStep();
473   
474   //  if (AliDebugLevel()) {
475   //   AliDebug(1,Form("Step, iChamber %d, Particle %d, theta %f phi %f mass %f StepSum %f eloss %g",
476   //                 iChamber,ipart, fTrackMomentum.Theta()*kRaddeg, fTrackMomentum.Phi()*kRaddeg,
477   //         mass, fStepSum[idvol], gMC->Edep()));
478   // AliDebug(1,Form("Step:Track Momentum %f %f %f", fTrackMomentum.X(), fTrackMomentum.Y(), 
479   //         fTrackMomentum.Z()));
480   // gMC->TrackPosition(fTrackPosition);
481   // AliDebug(1,Form("Step: Track Position %f %f %f",fTrackPosition.X(),
482   //         fTrackPosition.Y(),fTrackPosition.Z())) ;
483   //}
484
485   // Track left chamber or StepSum larger than fStepMaxInActiveGas
486   if ( gMC->IsTrackExiting() || 
487        gMC->IsTrackStop() || 
488        gMC->IsTrackDisappeared()||
489        (fStepSum[idvol]>fStepMaxInActiveGas) ) {
490     
491     if   ( gMC->IsTrackExiting() || 
492            gMC->IsTrackStop() || 
493            gMC->IsTrackDisappeared() ) gMC->SetMaxStep(kBig);
494
495     gMC->TrackPosition(fTrackPosition);
496     Float_t theta = fTrackMomentum.Theta();
497     Float_t phi   = fTrackMomentum.Phi();
498     
499     TLorentzVector backToWire( fStepSum[idvol]/2.*sin(theta)*cos(phi),
500                                fStepSum[idvol]/2.*sin(theta)*sin(phi),
501                                fStepSum[idvol]/2.*cos(theta),0.0       );
502     //    AliDebug(1,
503     //       Form("Track Position %f %f %f",fTrackPosition.X(),fTrackPosition.Y(),fTrackPosition.Z()));
504     // AliDebug(1,
505     //       Form("Exit: Track backToWire %f %f %f",backToWire.X(),backToWire.Y(),backToWire.Z())) ;
506     fTrackPosition-=backToWire;
507     
508     //-------------- Angle effect 
509     // Ratio between energy loss of particle and Mip as a function of BetaGamma of particle (Energy/Mass)
510     
511     Float_t betaxGamma    = fTrackMomentum.P()/mass;//  pc/mc2
512     Float_t sigmaEffect10degrees;
513     Float_t sigmaEffectThetadegrees;
514     Float_t eLossParticleELossMip;
515     Float_t yAngleEffect=0.;
516     Float_t thetawires      =  TMath::Abs( TMath::ASin( TMath::Sin(TMath::Pi()-theta) * TMath::Sin(phi) ) );// We use Pi-theta because z is negative
517
518
519     if (fAngleEffect){
520     if ( (betaxGamma >3.2)   &&  (thetawires*kRaddeg<=15.) ) {
521       betaxGamma=TMath::Log(betaxGamma);
522       eLossParticleELossMip = fElossRatio->Eval(betaxGamma);
523       // 10 degrees is a reference for a model (arbitrary)
524       sigmaEffect10degrees=fAngleEffect10->Eval(eLossParticleELossMip);// in micrometers
525       // Angle with respect to the wires assuming that chambers are perpendicular to the z axis.
526       sigmaEffectThetadegrees =  sigmaEffect10degrees/fAngleEffectNorma->Eval(thetawires*kRaddeg);  // For 5mm gap  
527       if ( (iChamber==1)  ||  (iChamber==2) )  
528         sigmaEffectThetadegrees/=(1.09833e+00+1.70000e-02*(thetawires*kRaddeg)); // The gap is different (4mm)
529       yAngleEffect=1.e-04*gRandom->Gaus(0,sigmaEffectThetadegrees); // Error due to the angle effect in cm
530     }
531     }
532     
533     // Detection elements ids
534     AliMUONGeometryModule* geometry
535       = Chamber(iChamber-1).GetGeometry();
536
537     AliMUONGeometryDetElement* detElement
538       = geometry->FindBySensitiveVolume(CurrentVolumePath());
539
540     Int_t detElemId = 0;
541     if (detElement) detElemId = detElement->GetUniqueID(); 
542  
543     if (!detElemId) {
544       cerr << "Chamber id: "
545            << setw(3) << iChamber << "  "
546            << "Current SV: " 
547            <<  CurrentVolumePath() 
548            << "  detElemId: "
549            << setw(5) << detElemId 
550            << endl;
551       Double_t x, y, z;
552       gMC->TrackPosition(x, y, z);         
553       cerr << "   global position: "
554            << x << ", " << y << ", " << z
555            << endl;
556       AliError("DetElemId not identified.");
557     }  
558     
559     // One hit per chamber
560     GetMUONData()->AddHit2(fIshunt, 
561                           gAlice->GetMCApp()->GetCurrentTrackNumber(), 
562                           detElemId, ipart,
563                           fTrackPosition.X(), 
564                           fTrackPosition.Y()+yAngleEffect, 
565                           fTrackPosition.Z(), 
566                           gMC->TrackTime(),
567                           fTrackMomentum.P(),
568                           theta, 
569                           phi, 
570                           fStepSum[idvol], 
571                           fDestepSum[idvol],                        
572                           fTrackPosition.X(),
573                           fTrackPosition.Y(),
574                           fTrackPosition.Z());
575
576     //       AliDebug(1,Form("Exit: Particle exiting from chamber %d",iChamber));
577     //       AliDebug(1,Form("Exit: StepSum %f eloss geant %g ",fStepSum[idvol],fDestepSum[idvol]));
578     //       AliDebug(1,Form("Exit: Track Position %f %f %f",fTrackPosition.X(),fTrackPosition.Y(),fTrackPosition.Z()) ;
579
580     fStepSum[idvol]  =0; // Reset for the next event
581     fDestepSum[idvol]=0; // Reset for the next event
582   }
583 }