]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Fix lego summary
authorfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 3 Dec 1999 10:54:35 +0000 (10:54 +0000)
committerfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 3 Dec 1999 10:54:35 +0000 (10:54 +0000)
STEER/AliLego.cxx
STEER/AliRun.cxx

index 250834ba3c238bfafd596fb173318a08d9af0330..003856342ca41552e78ce1db66df2383ab72b240 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.8  1999/10/01 09:54:33  fca
+Correct logics for Lego StepManager
+
 Revision 1.7  1999/09/29 09:24:29  fca
 Introduction of the Copyright and cvs Log
 
@@ -241,7 +244,7 @@ void AliLego::StepManager()
 // called from AliRun::Stepmanager from gustep.
 // Accumulate the 3 parameters step by step
   
-   Float_t t, tt;
+   static Float_t t;
    Float_t a,z,dens,radl,absl;
    Int_t i;
    
@@ -259,7 +262,13 @@ void AliLego::StepManager()
 // --- 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();
+     if (gMC->TrackLength()) {
+       // Not the first step, add past contribution
+       fTotAbso += t/absl;
+       fTotRadl += t/radl;
+       fTotGcm2 += t*dens;
+     }
+     gMC->StopTrack();
      return;
    }
 
@@ -268,11 +277,11 @@ void AliLego::StepManager()
      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;
+   fTotAbso += step/absl;
+   fTotRadl += step/radl;
+   fTotGcm2 += step*dens;
 }
 
index 98f9a0f147409be7e0626eafd4d529b2fb6b7326..37118ff1afa6495770dc0a00e4637eec05dc5fc8 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.21  1999/11/25 10:40:08  fca
+Fixing daughters information also in primary tracks
+
 Revision 1.20  1999/10/04 18:08:49  fca
 Adding protection against inconsistent Euclid files
 
@@ -416,7 +419,7 @@ void AliRun::FinishEvent()
   //
   // Called at the end of the event.
   //
-  
+  printf("\n\n\n\nEntering FinishEvent \n\n\n");
   //Update the energy deposit tables
   Int_t i;
   for(i=0;i<sEventEnergy.GetSize();i++) {
@@ -448,6 +451,21 @@ void AliRun::FinishEvent()
   // Write out the event Header information
   if (fTreeE) fTreeE->Fill();
   
+  Int_t np=fParticles->GetEntriesFast();
+  printf("Checking %d\n",np);
+  for (Int_t inpart=0; inpart<np;++inpart) {
+       
+    TParticle *particle = (TParticle*)fParticles->UncheckedAt(inpart);
+    Int_t icode = particle->GetPdgCode();
+    Double_t chg = particle->GetPDG()->Charge();
+    
+    if (icode==111 && chg) {
+      printf("%s charge %f %p %s\n",
+            particle->GetName(),chg,particle->GetPDG(),
+            particle->GetPDG()->GetName());
+    }
+  }
+
   // Reset stack info
   ResetStack();