]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Corrected stack pointer to optical photons.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 29 Jul 2004 10:13:10 +0000 (10:13 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 29 Jul 2004 10:13:10 +0000 (10:13 +0000)
TFluka/mgdraw.cxx

index bf1405ecded177289225fa1223cc3ae2707b21a2..009679cf755d6a39772c27a68e7e9e64f85ca332 100644 (file)
@@ -9,6 +9,7 @@
 #include "Fdblprc.h"  //(DBLPRC) fluka common
 #include "Ftrackr.h"  //(TRACKR) fluka common
 #include "Fopphst.h"  //(OPPHST) fluka common
+#include "Fstack.h"   //(STACK)  fluka common
 
 #ifndef WIN32
 # define mgdraw mgdraw_
@@ -27,8 +28,14 @@ void mgdraw(Int_t& icode, Int_t& mreg)
     TVirtualMCStack* cppstack = fluka->GetStack();
     
     if (TRACKR.jtrack == -1) {
-       trackId = OPPHST.LOUOPP[OPPHST.LSTOPP - 1];
-
+       // Optical photons
+       //
+       // Try first to get the track ID from the FLUKA stack for optical photons
+       trackId = OPPHST.LOUOPP[OPPHST.LSTOPP];
+       if (trackId == 0) {
+           // This might be a feedback photon or similar that was put on the VMC stack first 
+           trackId = STACK.ispark[STACK.lstack][mkbmx2-1];
+       }
     } else {
        trackId = TRACKR.ispusr[mkbmx2-1];
     }