]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TFluka/mgdraw.cxx
added parent functionality
[u/mrichter/AliRoot.git] / TFluka / mgdraw.cxx
index f0f25565105ed23e6ca1e2ffa9d3f56a55eb94cf..570eb8fcc0f4660436a1c8d4c5dda696b4784e4c 100644 (file)
@@ -1,7 +1,9 @@
 #include <Riostream.h>
 #include "TVirtualMCApplication.h"
 #include "TVirtualMCStack.h"
+
 #include "TFluka.h"
+
 // Fluka include
 #include "Fdimpar.h"  //(DIMPAR) fluka include
 #include "Fdblprc.h"  //(DBLPRC) fluka common
@@ -17,7 +19,7 @@ extern "C" {
 void mgdraw(Int_t& icode, Int_t& mreg)
 {
     TFluka* fluka =  (TFluka*) gMC;
-    Int_t verbosityLevel = fluka->GetVerbosityLevel();
+//    Int_t verbosityLevel = fluka->GetVerbosityLevel();
 //
 //  Make sure that stack has currrent track Id
     Int_t trackId = TRACKR.ispusr[mkbmx2-1];
@@ -25,41 +27,21 @@ void mgdraw(Int_t& icode, Int_t& mreg)
     cppstack->SetCurrentTrack(trackId);
 //
 //    
-    Int_t oldreg = ((TFluka*) gMC)->GetMreg();
-    if (oldreg != mreg) {
-//
-//  Boundary Crossing
-//
-       fluka->SetNewreg(mreg);
-       if (oldreg == -1) fluka->SetMreg(mreg);
-       if (verbosityLevel >= 3)
-           printf("Boundary Crossing %d %d \n", oldreg, mreg);
-    } else {
-       fluka->SetMreg(mreg);
-       fluka->SetNewreg(mreg);
-       if (verbosityLevel >= 3)
-           printf("Normal step %d %d \n", oldreg, mreg);
-    }
+    fluka->SetMreg(mreg);
+    fluka->SetNewreg(mreg);
     fluka->SetIcode(icode);
-
-    cout << endl << " !!! I am in mgdraw - calling Stepping()" << endl;
-    cout << endl << " Track Id =" << trackId << endl;
+    fluka->SetCaller(4);
     
-    fluka->FutoTest();
+//    if (verbosityLevel >= 3) {
+//      cout << endl << " !!! I am in mgdraw - calling Stepping()" << endl;
+//      cout << endl << " Track Id =" << trackId << endl;
+//    }
+    if (TRACKR.jtrack == -1)
+    printf("Cerenkov photon: region# %6d icode %6d \n", mreg, icode);
 
-    if (oldreg != mreg) {
-//
-//  Double step for boundary crossing
-//
-       fluka->SetTrackIsExiting();
-       (TVirtualMCApplication::Instance())->Stepping();
-       fluka->SetMreg(mreg);
-       fluka->SetTrackIsEntering();
-       (TVirtualMCApplication::Instance())->Stepping();
-       fluka->SetTrackIsInside();
-    } else {
-       (TVirtualMCApplication::Instance())->Stepping();
-    }
+    
+    (TVirtualMCApplication::Instance())->Stepping();
+    fluka->SetTrackIsNew(kFALSE);
 } // end of mgdraw
 } // end of extern "C"