]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
In case of double step, set deposited energy to 0 in first step.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 2 Aug 2004 09:53:38 +0000 (09:53 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 2 Aug 2004 09:53:38 +0000 (09:53 +0000)
TFluka/endraw.cxx

index 158bbcd69d82784f60fa42e7af991c11ff97a1af..c1b94b87eddc6892488fb4f952293a58ee94ad8e 100644 (file)
@@ -25,6 +25,9 @@ void endraw(Int_t& icode, Int_t& mreg, Double_t& rull, Double_t& xsco, Double_t&
   fluka->SetYsco(ysco);
   fluka->SetZsco(zsco);
   fluka->SetMreg(mreg);
+  
+  Float_t edep = rull;
+  
   if (icode == 11) {
     if (debug) cout << " For icode=" << icode << " Stepping is NOT called" << endl;
     return;
@@ -38,22 +41,27 @@ void endraw(Int_t& icode, Int_t& mreg, Double_t& rull, Double_t& xsco, Double_t&
       if (cerenkov) {
          Double_t eff = (cerenkov->GetQuantumEfficiency(rull));
          if (gRandom->Rndm() > eff) {
-             rull = 0.;
-             fluka->SetRull(rull);
+             edep = 0.;
          }
       }
   }
   if (debug) printf("endraw: Depositing energy for : %d %e icode: %d \n", TRACKR.ispusr[mkbmx2-1], rull, icode);
 
-  (TVirtualMCApplication::Instance())->Stepping();
+  if (icode != 21 && icode != 22) {
+      fluka->SetRull(edep);
+      (TVirtualMCApplication::Instance())->Stepping();
+  } else {
   //
   // for icode 21,22 the particle has fallen below thresshold 
   // This has to be signalled to the StepManager() 
   //
-  fluka->SetTrackIsNew(kFALSE);
-  fluka->SetIcode(icode);
-  (TVirtualMCApplication::Instance())->Stepping();
-
+      fluka->SetRull(0.);
+      (TVirtualMCApplication::Instance())->Stepping();
+      fluka->SetTrackIsNew(kFALSE);
+      fluka->SetIcode(icode);
+      fluka->SetRull(edep);
+      (TVirtualMCApplication::Instance())->Stepping();
+  }
 } // end of endraw
 } // end of extern "C"