]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONv1.cxx
Removing old segmentation, obsolete classes and removing old new conditions (Christian)
[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      printf("\n New Segmentation \n\n");
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 //  if (GetDebug()) {
300 //     Float_t z = ( (AliMUONChamber*)(*fChambers)[idvol])->Z() ;
301 //      Info("StepManager Step","Active volume found %d chamber %d Z chamber is %f ",idvol,iChamber, z);
302 //   }  
303   // Particule id and mass, 
304   Int_t     ipart = gMC->TrackPid();
305   Float_t   mass  = gMC->TrackMass();
306
307   fDestepSum[idvol]+=gMC->Edep();
308   // Get current particle id (ipart), track position (pos)  and momentum (mom)
309   if ( fStepSum[idvol]==0.0 )  gMC->TrackMomentum(fTrackMomentum);
310   fStepSum[idvol]+=gMC->TrackStep();
311   
312 //   if (GetDebug()) {
313 //     Info("StepManager Step","iChamber %d, Particle %d, theta %f phi %f mass %f StepSum %f eloss %g",
314 //       iChamber,ipart, fTrackMomentum.Theta()*kRaddeg, fTrackMomentum.Phi()*kRaddeg, mass, fStepSum[idvol], gMC->Edep());//     Info("StepManager Step","Track Momentum %f %f %f", fTrackMomentum.X(), fTrackMomentum.Y(), fTrackMomentum.Z()) ;
315 //     gMC->TrackPosition(fTrackPosition);
316 //     Info("StepManager Step","Track Position %f %f %f",fTrackPosition.X(),fTrackPosition.Y(),fTrackPosition.Z()) ;
317 //   }
318
319   // Track left chamber or StepSum larger than fStepMaxInActiveGas
320   if ( gMC->IsTrackExiting() || 
321        gMC->IsTrackStop() || 
322        gMC->IsTrackDisappeared()||
323        (fStepSum[idvol]>fStepMaxInActiveGas) ) {
324     
325     if   ( gMC->IsTrackExiting() || 
326            gMC->IsTrackStop() || 
327            gMC->IsTrackDisappeared() ) gMC->SetMaxStep(kBig);
328
329     gMC->TrackPosition(fTrackPosition);
330     Float_t theta = fTrackMomentum.Theta();
331     Float_t phi   = fTrackMomentum.Phi();
332     
333     TLorentzVector backToWire( fStepSum[idvol]/2.*sin(theta)*cos(phi),
334                                fStepSum[idvol]/2.*sin(theta)*sin(phi),
335                                fStepSum[idvol]/2.*cos(theta),0.0       );
336     //     if (GetDebug()) 
337     //       Info("StepManager Exit","Track Position %f %f %f",fTrackPosition.X(),fTrackPosition.Y(),fTrackPosition.Z()) ;
338     //     if (GetDebug()) 
339     //        Info("StepManager Exit ","Track backToWire %f %f %f",backToWire.X(),backToWire.Y(),backToWire.Z()) ;
340     fTrackPosition-=backToWire;
341     
342     //-------------- Angle effect 
343     // Ratio between energy loss of particle and Mip as a function of BetaGamma of particle (Energy/Mass)
344     
345     Float_t betaxGamma    = fTrackMomentum.P()/mass;//  pc/mc2
346     Float_t sigmaEffect10degrees;
347     Float_t sigmaEffectThetadegrees;
348     Float_t eLossParticleELossMip;
349     Float_t yAngleEffect=0.;
350     Float_t thetawires      =  TMath::Abs( TMath::ASin( TMath::Sin(TMath::Pi()-theta) * TMath::Sin(phi) ) );// We use Pi-theta because z is negative
351
352
353     if (fAngleEffect){
354     if ( (betaxGamma >3.2)   &&  (thetawires*kRaddeg<=15.) ) {
355       betaxGamma=TMath::Log(betaxGamma);
356       eLossParticleELossMip = fElossRatio->Eval(betaxGamma);
357       // 10 degrees is a reference for a model (arbitrary)
358       sigmaEffect10degrees=fAngleEffect10->Eval(eLossParticleELossMip);// in micrometers
359       // Angle with respect to the wires assuming that chambers are perpendicular to the z axis.
360       sigmaEffectThetadegrees =  sigmaEffect10degrees/fAngleEffectNorma->Eval(thetawires*kRaddeg);  // For 5mm gap  
361       if ( (iChamber==1)  ||  (iChamber==2) )  
362         sigmaEffectThetadegrees/=(1.09833e+00+1.70000e-02*(thetawires*kRaddeg)); // The gap is different (4mm)
363       yAngleEffect=1.e-04*gRandom->Gaus(0,sigmaEffectThetadegrees); // Error due to the angle effect in cm
364     }
365     }
366     
367     // Detection elements ids
368     AliMUONGeometryModule* geometry
369       = Chamber(iChamber-1).GetGeometry();
370
371     AliMUONGeometryDetElement* detElement
372       = geometry->FindBySensitiveVolume(CurrentVolumePath());
373
374     Int_t detElemId = 0;
375     if (detElement) detElemId = detElement->GetUniqueID(); 
376  
377     if (!detElemId) {
378       cerr << "Chamber id: "
379            << setw(3) << iChamber << "  "
380            << "Current SV: " 
381            <<  CurrentVolumePath() 
382            << "  detElemId: "
383            << setw(5) << detElemId 
384            << endl;
385       Double_t x, y, z;
386       gMC->TrackPosition(x, y, z);         
387       cerr << "   global position: "
388            << x << ", " << y << ", " << z
389            << endl;
390       AliWarning("DetElemId not identified.");
391     }  
392     
393     // One hit per chamber
394     GetMUONData()->AddHit(fIshunt, 
395                           gAlice->GetMCApp()->GetCurrentTrackNumber(), 
396                           iChamber, ipart,
397                           fTrackPosition.X(), 
398                           fTrackPosition.Y()+yAngleEffect, 
399                           fTrackPosition.Z(), 
400                           gMC->TrackTime(),
401                           fTrackMomentum.P(),
402                           theta, 
403                           phi, 
404                           fStepSum[idvol], 
405                           fDestepSum[idvol],                        
406                           fTrackPosition.X(),
407                           fTrackPosition.Y(),
408                           fTrackPosition.Z());
409
410 //     if (GetDebug()){
411 //       Info("StepManager Exit","Particle exiting from chamber %d",iChamber);
412 //       Info("StepManager Exit","StepSum %f eloss geant %g ",fStepSum[idvol],fDestepSum[idvol]);
413 //       Info("StepManager Exit","Track Position %f %f %f",fTrackPosition.X(),fTrackPosition.Y(),fTrackPosition.Z()) ;
414 //     }
415     fStepSum[idvol]  =0; // Reset for the next event
416     fDestepSum[idvol]=0; // Reset for the next event
417   }
418 }
419
420 //_______________________________________________________________________________
421 void AliMUONv1::StepManager2()
422 {
423   // Stepmanager for the chambers
424
425   // Only charged tracks
426   if( !(gMC->TrackCharge()) ) return; 
427   // Only charged tracks
428   
429   // Only gas gap inside chamber
430   // Tag chambers and record hits when track enters 
431   static Int_t   idvol=-1;
432   Int_t   iChamber=0;
433   Int_t   id=0;
434   Int_t   copy;
435   const  Float_t kBig = 1.e10;
436
437
438   //
439   // Only gas gap inside chamber
440   // Tag chambers and record hits when track enters 
441   id=gMC->CurrentVolID(copy);
442   iChamber = GetChamberId(id);
443   idvol = iChamber -1;
444
445   if (idvol == -1) return;
446   
447   // Filling TrackRefs file for MUON. Our Track references are the active volume of the chambers
448   if ( (gMC->IsTrackEntering() || gMC->IsTrackExiting() ) )     
449     AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
450   
451    if( gMC->IsTrackEntering() ) {
452      Float_t theta = fTrackMomentum.Theta();
453      if ((TMath::Pi()-theta)*kRaddeg>=15.) gMC->SetMaxStep(fStepMaxInActiveGas); // We use Pi-theta because z is negative
454   }
455
456 //  if (GetDebug()) {
457 //     Float_t z = ( (AliMUONChamber*)(*fChambers)[idvol])->Z() ;
458 //      Info("StepManager Step","Active volume found %d chamber %d Z chamber is %f ",idvol,iChamber, z);
459 //   }  
460   // Particule id and mass, 
461   Int_t     ipart = gMC->TrackPid();
462   Float_t   mass  = gMC->TrackMass();
463
464   fDestepSum[idvol]+=gMC->Edep();
465   // Get current particle id (ipart), track position (pos)  and momentum (mom)
466   if ( fStepSum[idvol]==0.0 )  gMC->TrackMomentum(fTrackMomentum);
467   fStepSum[idvol]+=gMC->TrackStep();
468   
469 //   if (GetDebug()) {
470 //     Info("StepManager Step","iChamber %d, Particle %d, theta %f phi %f mass %f StepSum %f eloss %g",
471 //       iChamber,ipart, fTrackMomentum.Theta()*kRaddeg, fTrackMomentum.Phi()*kRaddeg, mass, fStepSum[idvol], gMC->Edep());//     Info("StepManager Step","Track Momentum %f %f %f", fTrackMomentum.X(), fTrackMomentum.Y(), fTrackMomentum.Z()) ;
472 //     gMC->TrackPosition(fTrackPosition);
473 //     Info("StepManager Step","Track Position %f %f %f",fTrackPosition.X(),fTrackPosition.Y(),fTrackPosition.Z()) ;
474 //   }
475
476   // Track left chamber or StepSum larger than fStepMaxInActiveGas
477   if ( gMC->IsTrackExiting() || 
478        gMC->IsTrackStop() || 
479        gMC->IsTrackDisappeared()||
480        (fStepSum[idvol]>fStepMaxInActiveGas) ) {
481     
482     if   ( gMC->IsTrackExiting() || 
483            gMC->IsTrackStop() || 
484            gMC->IsTrackDisappeared() ) gMC->SetMaxStep(kBig);
485
486     gMC->TrackPosition(fTrackPosition);
487     Float_t theta = fTrackMomentum.Theta();
488     Float_t phi   = fTrackMomentum.Phi();
489     
490     TLorentzVector backToWire( fStepSum[idvol]/2.*sin(theta)*cos(phi),
491                                fStepSum[idvol]/2.*sin(theta)*sin(phi),
492                                fStepSum[idvol]/2.*cos(theta),0.0       );
493     //     if (GetDebug()) 
494     //       Info("StepManager Exit","Track Position %f %f %f",fTrackPosition.X(),fTrackPosition.Y(),fTrackPosition.Z()) ;
495     //     if (GetDebug()) 
496     //        Info("StepManager Exit ","Track backToWire %f %f %f",backToWire.X(),backToWire.Y(),backToWire.Z()) ;
497     fTrackPosition-=backToWire;
498     
499     //-------------- Angle effect 
500     // Ratio between energy loss of particle and Mip as a function of BetaGamma of particle (Energy/Mass)
501     
502     Float_t betaxGamma    = fTrackMomentum.P()/mass;//  pc/mc2
503     Float_t sigmaEffect10degrees;
504     Float_t sigmaEffectThetadegrees;
505     Float_t eLossParticleELossMip;
506     Float_t yAngleEffect=0.;
507     Float_t thetawires      =  TMath::Abs( TMath::ASin( TMath::Sin(TMath::Pi()-theta) * TMath::Sin(phi) ) );// We use Pi-theta because z is negative
508
509
510     if (fAngleEffect){
511     if ( (betaxGamma >3.2)   &&  (thetawires*kRaddeg<=15.) ) {
512       betaxGamma=TMath::Log(betaxGamma);
513       eLossParticleELossMip = fElossRatio->Eval(betaxGamma);
514       // 10 degrees is a reference for a model (arbitrary)
515       sigmaEffect10degrees=fAngleEffect10->Eval(eLossParticleELossMip);// in micrometers
516       // Angle with respect to the wires assuming that chambers are perpendicular to the z axis.
517       sigmaEffectThetadegrees =  sigmaEffect10degrees/fAngleEffectNorma->Eval(thetawires*kRaddeg);  // For 5mm gap  
518       if ( (iChamber==1)  ||  (iChamber==2) )  
519         sigmaEffectThetadegrees/=(1.09833e+00+1.70000e-02*(thetawires*kRaddeg)); // The gap is different (4mm)
520       yAngleEffect=1.e-04*gRandom->Gaus(0,sigmaEffectThetadegrees); // Error due to the angle effect in cm
521     }
522     }
523     
524     // Detection elements ids
525     AliMUONGeometryModule* geometry
526       = Chamber(iChamber-1).GetGeometry();
527
528     AliMUONGeometryDetElement* detElement
529       = geometry->FindBySensitiveVolume(CurrentVolumePath());
530
531     Int_t detElemId = 0;
532     if (detElement) detElemId = detElement->GetUniqueID(); 
533  
534     if (!detElemId) {
535       cerr << "Chamber id: "
536            << setw(3) << iChamber << "  "
537            << "Current SV: " 
538            <<  CurrentVolumePath() 
539            << "  detElemId: "
540            << setw(5) << detElemId 
541            << endl;
542       Double_t x, y, z;
543       gMC->TrackPosition(x, y, z);         
544       cerr << "   global position: "
545            << x << ", " << y << ", " << z
546            << endl;
547       AliError("DetElemId not identified.");
548     }  
549     
550     // One hit per chamber
551     GetMUONData()->AddHit2(fIshunt, 
552                           gAlice->GetMCApp()->GetCurrentTrackNumber(), 
553                           detElemId, ipart,
554                           fTrackPosition.X(), 
555                           fTrackPosition.Y()+yAngleEffect, 
556                           fTrackPosition.Z(), 
557                           gMC->TrackTime(),
558                           fTrackMomentum.P(),
559                           theta, 
560                           phi, 
561                           fStepSum[idvol], 
562                           fDestepSum[idvol],                        
563                           fTrackPosition.X(),
564                           fTrackPosition.Y(),
565                           fTrackPosition.Z());
566
567 //     if (GetDebug()){
568 //       Info("StepManager Exit","Particle exiting from chamber %d",iChamber);
569 //       Info("StepManager Exit","StepSum %f eloss geant %g ",fStepSum[idvol],fDestepSum[idvol]);
570 //       Info("StepManager Exit","Track Position %f %f %f",fTrackPosition.X(),fTrackPosition.Y(),fTrackPosition.Z()) ;
571 //     }
572     fStepSum[idvol]  =0; // Reset for the next event
573     fDestepSum[idvol]=0; // Reset for the next event
574   }
575 }