]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliLego.cxx
add possibility to write sdigits, digits and rec. points into separate files
[u/mrichter/AliRoot.git] / STEER / AliLego.cxx
index 30076cd50c223bbc43f4b70a66358fb16723b227..8d69f21c4b89ec5cfe561d38903a4b70a9aa0a84 100644 (file)
 
 /*
 $Log$
+Revision 1.27  2001/07/20 09:32:18  morsch
+Protection against uncomplete backward stepping in dumping added.
+
+Revision 1.26  2001/05/30 12:18:13  morsch
+Fastidious printf commented.
+
+Revision 1.25  2001/05/23 11:59:46  morsch
+Use RemoveAt method instead of delete to remove objects from TClonesArray.
+
+Revision 1.24  2001/05/21 08:39:13  morsch
+Use fStepBack = 1 only in debug mode.
+
 Revision 1.23  2001/05/20 10:10:39  morsch
 - Debug output at the beginning of new event and end of run.
 - Filter out boundary loops.
@@ -125,10 +137,13 @@ AliLego::AliLego()
   //
   // Default constructor
   //
+  fGener    = 0;
   fHistRadl = 0;
   fHistAbso = 0;
   fHistGcm2 = 0;
   fHistReta = 0;
+  fVolumesFwd = 0;
+  fVolumesBwd = 0;
 }
 
 //___________________________________________
@@ -314,10 +329,9 @@ void AliLego::StepManager() {
          if (fStepsForward > 0) {
              AliDebugVolume* tmp = (AliDebugVolume*) (*fVolumesFwd)[fStepsForward-1];         
              if (tmp->IsEqual(vol, copy) && gMC->IsTrackEntering()) {
-                 step += ((AliDebugVolume*) lvols[fStepsForward])->Step();
                  fStepsForward -= 2;
-                 delete ((AliDebugVolume*) lvols[fStepsForward]);
-                 delete ((AliDebugVolume*) lvols[fStepsForward+1]);
+                 fVolumesFwd->RemoveAt(fStepsForward);
+                 fVolumesFwd->RemoveAt(fStepsForward+1);                 
              }
          }
 
@@ -394,9 +408,8 @@ void AliLego::StepManager() {
              AliDebugVolume* tmp = (AliDebugVolume*) (*fVolumesBwd)[fStepsBackward];          
              if (tmp->IsEqual(vol, copy) && gMC->IsTrackEntering()) {
                  fStepsBackward += 2;
-                 delete ((AliDebugVolume*) lvols[fStepsBackward-1]);
-                 delete ((AliDebugVolume*) lvols[fStepsBackward-2]);
-                 step += ((AliDebugVolume*) lvols[fStepsBackward])->Step();
+                 fVolumesBwd->RemoveAt(fStepsBackward-1);
+                 fVolumesBwd->RemoveAt(fStepsBackward-2);                
              }
          } 
 
@@ -433,12 +446,13 @@ void AliLego::DumpVolumes()
     {
        AliDebugVolume* tmp1 = (AliDebugVolume*) (*fVolumesFwd)[i];
        AliDebugVolume* tmp2 = (AliDebugVolume*) (*fVolumesBwd)[i];
-       printf("\n Volume Fwd: %3d: %5s (%3d) step: %12.5e (x,y,z) (%12.5e %12.5e %12.5e) status: %9s\n"
+       if (tmp1)
+       printf("\n Volume Fwd: %3d: %5s (%3d) step: %12.5e (x,y,z) (%12.5e %12.5e %12.5e) status: %9s \n"
               , i, 
               tmp1->GetName(), tmp1->CopyNumber(), tmp1->Step(), 
               tmp1->X(), tmp1->Y(), tmp1->Z(), tmp1->Status());
-       
-       printf("\n Volume Bwd: %3d: %5s (%3d) step: %12.5e (x,y,z) (%12.5e %12.5e %12.5e) status: %9s\n"
+       if (tmp2 && i>= fStepsBackward)
+       printf("\n Volume Bwd: %3d: %5s (%3d) step: %12.5e (x,y,z) (%12.5e %12.5e %12.5e) status: %9s \n"
               , i, 
               tmp2->GetName(), tmp2->CopyNumber(), tmp2->Step(), 
               tmp2->X(), tmp2->Y(), tmp2->Z(), tmp2->Status());