]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliLego.cxx
Correct logics for Lego StepManager
[u/mrichter/AliRoot.git] / STEER / AliLego.cxx
index 3d25fe6555a5c86f23ce6b49c78831a1d53ea185..250834ba3c238bfafd596fb173318a08d9af0330 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.7  1999/09/29 09:24:29  fca
+Introduction of the Copyright and cvs Log
+
 */
 
 //////////////////////////////////////////////////////////////
@@ -241,7 +244,6 @@ void AliLego::StepManager()
    Float_t t, tt;
    Float_t a,z,dens,radl,absl;
    Int_t i;
-   Bool_t out;
    
    Float_t step  = gMC->TrackStep();
        
@@ -254,28 +256,23 @@ void AliLego::StepManager()
    
    if (z < 1) return;
    
-// --- See how long we have to go
-   if (TMath::Abs(pos[2]) <= fZMax  && 
-       pos[0]*pos[0] +pos[1]*pos[1] <= fRadMax*fRadMax) {
-
-     tt = step;
-     out = kFALSE;
-   } else {
+// --- See if we have to stop now
+   if (TMath::Abs(pos[2]) > fZMax  || 
+       pos[0]*pos[0] +pos[1]*pos[1] > fRadMax*fRadMax) {
+     gMC->StopEvent();
+     return;
+   }
 
-      for(i=0;i<3;++i) {
-       vect[i]=pos[i];
-       dir[i]=mom[i];
-      }
-      t  = PropagateCylinder(vect,dir,fRadMax,fZMax);
-      tt = TMath::Min(step,t);
-      out = kTRUE;
+// --- See how long we have to go
+   for(i=0;i<3;++i) {
+     vect[i]=pos[i];
+     dir[i]=mom[i];
    }
+   t  = PropagateCylinder(vect,dir,fRadMax,fZMax);
+   tt = TMath::Min(step,t);
 
    fTotAbso += tt/absl;
    fTotRadl += tt/radl;
    fTotGcm2 += tt*dens;
-
-// --- See if we have to stop now
-   if(out) gMC->StopEvent();
 }