Cerenkov photon update.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 19 Oct 2007 19:33:07 +0000 (19:33 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 19 Oct 2007 19:33:07 +0000 (19:33 +0000)
TFluka/TFluka.cxx
TFluka/bxdraw.cxx
TFluka/crnkvp.f
TFluka/endraw.cxx

index 51bbe7f..f9808f0 100644 (file)
@@ -2095,8 +2095,11 @@ Int_t TFluka::StepProcesses(TArrayI &proc) const
     
     proc.Set(1);
     TMCProcess iproc;
-    if (caller == kBXEntering || caller == kBXExiting || caller == kEEDRAW) {
+    if (caller == kBXEntering || caller == kBXExiting || caller == kEEDRAW || caller == kSODRAW) {
        iproc = kPTransportation;
+    }
+    else if (caller == kUSTCKV) {
+       iproc = kPCerenkov;
     } else {
        switch (icode) {
        case kEMFSCO:
@@ -2113,6 +2116,16 @@ Int_t TFluka::StepProcesses(TArrayI &proc) const
                iproc = kPTransportation;
            }
            break;
+       case kKASHEA:
+       case kKASNEU:
+       case kKASOPH:
+       case kKASKADescape:
+       case kEMFSCOescape:
+       case kKASNEUescape:
+       case kKASHEAescape:
+       case kKASOPHescape:
+           iproc = kPTransportation;
+           break;
        case kKASKADtimekill:
        case kEMFSCOtimekill:
        case kKASNEUtimekill:
@@ -2121,14 +2134,9 @@ Int_t TFluka::StepProcesses(TArrayI &proc) const
            iproc =  kPTOFlimit;
            break;
        case kKASKADstopping:
-       case kKASKADescape:
        case kEMFSCOstopping1:
        case kEMFSCOstopping2:
-       case kEMFSCOescape:
        case kKASNEUstopping:
-       case kKASNEUescape:
-       case kKASHEAescape:
-       case kKASOPHescape:
            iproc = kPStop;
            break;
        case kKASOPHabsorption:
@@ -2136,6 +2144,7 @@ Int_t TFluka::StepProcesses(TArrayI &proc) const
            break;
        case kKASOPHrefraction:
            iproc = kPLightRefraction;
+           break;
        case kEMFSCOlocaldep : 
            iproc = kPPhotoelectric;
            break;
index f386743..315ec66 100644 (file)
@@ -6,6 +6,8 @@
 #include "Fdimpar.h"  //(DIMPAR) fluka include
 #include "Ftrackr.h"  //(TRACKR) fluka common
 #include "Fltclcm.h"  //(LTCLCM) fluka common
+#include "Fopphst.h"  //(OPPHST) fluka common
+
 #ifndef WIN32
 # define bxdraw bxdraw_
 #else
@@ -42,63 +44,74 @@ void bxdraw(Int_t& icode, Int_t& mreg, Int_t& newreg,
 //
     fluka->SetTrackIsNew(kFALSE); // has to be called BEFORE Stepping()
     if (mreg != fluka->GetDummyRegion() && newreg != fluka->GetDummyRegion()) {
-       if (debug) printf("bxdraw (ex) \n");
-       fluka->SetTrackIsExiting();
-       fluka->SetCaller(kBXExiting);
-       fluka->SetMreg(mreg,oldlttc);
-
-    // check region lattice consistency (debug Ernesto)
-    // *****************************************************
-    Int_t nodeId;
-    Int_t volId = fluka->CurrentVolID(nodeId);
-    Int_t crtlttc = gGeoManager->GetCurrentNodeId()+1;
-    if(debug && mreg != volId  && !gGeoManager->IsOutside()) {
-       cout << "  bxdraw:   track=" << TRACKR.ispusr[mkbmx2-1]<< " pdg=" << fluka->PDGFromId(TRACKR.jtrack)
-            << " icode=" << icode << " gNstep=" << fluka->GetNstep() << endl
-            << "               fluka   mreg=" << mreg << " oldlttc=" << oldlttc << " newreg=" << newreg << " newlttc=" << newlttc << endl
-            << "               TGeo   volId=" << volId << " crtlttc=" << crtlttc << endl
-            << "     common TRACKR   lt1trk=" << TRACKR.lt1trk << " lt2trk=" << TRACKR.lt2trk << endl
-            << "     common LTCLCM   newlat=" << LTCLCM.newlat << " mlatld=" <<  LTCLCM.mlatld << endl
-            << "                     mlatm1=" << LTCLCM.mlatm1 << " mltsen=" <<  LTCLCM.mltsen << endl
-            << "                     mltsm1=" << LTCLCM.mltsm1 << " mlattc=" << LTCLCM.mlattc << endl;
-        if( oldlttc == crtlttc ) cout << "   **************************** Exit *********************************" << endl;
-    }
-    // *****************************************************
-
-
-       
-       TVirtualMCStack* cppstack = fluka->GetStack();
-       cppstack->SetCurrentTrack( TRACKR.ispusr[mkbmx2-1] );
-       (TVirtualMCApplication::Instance())->Stepping();
+       if (debug) printf("bxdraw (ex) \n");
+       fluka->SetTrackIsExiting();
+       fluka->SetCaller(kBXExiting);
+       fluka->SetMreg(mreg,oldlttc);
+       
+       // check region lattice consistency (debug Ernesto)
+       // *****************************************************
+       Int_t nodeId;
+       Int_t volId = fluka->CurrentVolID(nodeId);
+       Int_t crtlttc = gGeoManager->GetCurrentNodeId()+1;
+       if(debug && mreg != volId  && !gGeoManager->IsOutside()) {
+           cout << "  bxdraw:   track=" << TRACKR.ispusr[mkbmx2-1]<< " pdg=" << fluka->PDGFromId(TRACKR.jtrack)
+                << " icode=" << icode << " gNstep=" << fluka->GetNstep() << endl
+                << "               fluka   mreg=" << mreg << " oldlttc=" << oldlttc << " newreg=" << newreg << " newlttc=" << newlttc << endl
+                << "               TGeo   volId=" << volId << " crtlttc=" << crtlttc << endl
+                << "     common TRACKR   lt1trk=" << TRACKR.lt1trk << " lt2trk=" << TRACKR.lt2trk << endl
+                << "     common LTCLCM   newlat=" << LTCLCM.newlat << " mlatld=" <<  LTCLCM.mlatld << endl
+                << "                     mlatm1=" << LTCLCM.mlatm1 << " mltsen=" <<  LTCLCM.mltsen << endl
+                << "                     mltsm1=" << LTCLCM.mltsm1 << " mlattc=" << LTCLCM.mlattc << endl;
+           if( oldlttc == crtlttc ) cout << "   **************************** Exit *********************************" << endl;
+       }
+       // *****************************************************
+       
+       
+       
+       TVirtualMCStack* cppstack = fluka->GetStack();
+       
+       if (TRACKR.jtrack == -1) {
+           cppstack->SetCurrentTrack(OPPHST.louopp[OPPHST.lstopp]);
+       } else {
+           cppstack->SetCurrentTrack( TRACKR.ispusr[mkbmx2-1] );
+       }
+       
+       (TVirtualMCApplication::Instance())->Stepping();
     }
     if (newreg != fluka->GetDummyRegion()) {
-       if (debug) printf("bxdraw (en) \n");
-       fluka->SetCaller(kBXEntering);
-       fluka->SetTrackIsEntering();
-       if (fluka->GetDummyBoundary() == 1) fluka->SetDummyBoundary(2);
-       fluka->SetMreg(newreg,newlttc);
-
-    // check region lattice consistency (debug Ernesto)
-    // *****************************************************
-    Int_t nodeId;
-    Int_t volId = fluka->CurrentVolID(nodeId);
-    Int_t crtlttc = gGeoManager->GetCurrentNodeId()+1;
-    if(debug && newreg != volId  && !gGeoManager->IsOutside()) {
-       cout << "  bxdraw:   track=" << TRACKR.ispusr[mkbmx2-1] << " pdg=" << fluka->PDGFromId(TRACKR.jtrack)
-            << " icode=" << icode << " gNstep=" << fluka->GetNstep() << endl
-            << "               fluka   mreg=" << mreg << " oldlttc=" << oldlttc << " newreg=" << newreg << " newlttc=" << newlttc << endl
-            << "               TGeo   volId=" << volId << " crtlttc=" << crtlttc << endl
-            << "     common TRACKR   lt1trk=" << TRACKR.lt1trk << " lt2trk=" << TRACKR.lt2trk << endl
-            << "     common LTCLCM   newlat=" << LTCLCM.newlat << " mlatld=" <<  LTCLCM.mlatld << endl
-            << "                     mlatm1=" << LTCLCM.mlatm1 << " mltsen=" <<  LTCLCM.mltsen << endl
-            << "                     mltsm1=" << LTCLCM.mltsm1 << " mlattc=" << LTCLCM.mlattc << endl;
-        if( newlttc == crtlttc ) cout << "   ******************************** Enter *****************************" << endl;
-    }
-    // *****************************************************
-
-       TVirtualMCStack* cppstack = fluka->GetStack();
-       cppstack->SetCurrentTrack( TRACKR.ispusr[mkbmx2-1] );
-       (TVirtualMCApplication::Instance())->Stepping();
+       if (debug) printf("bxdraw (en) \n");
+       fluka->SetCaller(kBXEntering);
+       fluka->SetTrackIsEntering();
+       if (fluka->GetDummyBoundary() == 1) fluka->SetDummyBoundary(2);
+       fluka->SetMreg(newreg,newlttc);
+       
+       // check region lattice consistency (debug Ernesto)
+       // *****************************************************
+       Int_t nodeId;
+       Int_t volId = fluka->CurrentVolID(nodeId);
+       Int_t crtlttc = gGeoManager->GetCurrentNodeId()+1;
+       if(debug && newreg != volId  && !gGeoManager->IsOutside()) {
+           cout << "  bxdraw:   track=" << TRACKR.ispusr[mkbmx2-1] << " pdg=" << fluka->PDGFromId(TRACKR.jtrack)
+                << " icode=" << icode << " gNstep=" << fluka->GetNstep() << endl
+                << "               fluka   mreg=" << mreg << " oldlttc=" << oldlttc << " newreg=" << newreg << " newlttc=" << newlttc << endl
+                << "               TGeo   volId=" << volId << " crtlttc=" << crtlttc << endl
+                << "     common TRACKR   lt1trk=" << TRACKR.lt1trk << " lt2trk=" << TRACKR.lt2trk << endl
+                << "     common LTCLCM   newlat=" << LTCLCM.newlat << " mlatld=" <<  LTCLCM.mlatld << endl
+                << "                     mlatm1=" << LTCLCM.mlatm1 << " mltsen=" <<  LTCLCM.mltsen << endl
+                << "                     mltsm1=" << LTCLCM.mltsm1 << " mlattc=" << LTCLCM.mlattc << endl;
+           if( newlttc == crtlttc ) cout << "   ******************************** Enter *****************************" << endl;
+       }
+       // *****************************************************
+       
+       TVirtualMCStack* cppstack = fluka->GetStack();
+       if (TRACKR.jtrack == -1) {
+           cppstack->SetCurrentTrack(OPPHST.louopp[OPPHST.lstopp]);
+       } else {
+           cppstack->SetCurrentTrack( TRACKR.ispusr[mkbmx2-1] );
+       }
+       
+       (TVirtualMCApplication::Instance())->Stepping();
     }
 
 } // end of bxdraw
index 9998960..e5ca1d2 100644 (file)
 *
 *
 *  |  !!!!!! Here Stuprf should be used !!!!!!
-         LOUOPP (LSTOPP) = LLOUSE
+         LOUOPP (LSTOPP) = ITFL
          DO 2100 ISPR = 1, MKBMX1
             SPAROK (ISPR,LSTOPP) = SPAUSR (ISPR)
  2100    CONTINUE
index e4e55d2..5c68002 100644 (file)
@@ -12,6 +12,7 @@
 #include "Ftrackr.h"  //(TRACKR) fluka common
 #include "Fltclcm.h"  //(LTCLCM) fluka common
 #include "Fpaprop.h"  //(PAPROP) fluka common
+#include "Fopphst.h"  //(OPPHST) fluka common
 
 #ifndef WIN32
 # define endraw endraw_
@@ -41,7 +42,6 @@ void endraw(Int_t& icode, Int_t& mreg, Double_t& rull, Double_t& xsco, Double_t&
       return;
   }
   
-  
   if (TRACKR.jtrack == -1) {
   // Handle quantum efficiency the G3 way
       if (debug) printf("endraw: Cerenkov photon depositing energy: %d %e\n", mreg, rull);
@@ -87,6 +87,8 @@ void endraw(Int_t& icode, Int_t& mreg, Double_t& rull, Double_t& xsco, Double_t&
          //  Elastic recoil and in stuprf npprmr > 0,
          //  the secondary being loaded is actually still the interacting particle
          cppstack->SetCurrentTrack( TRACKR.ispusr[mkbmx2-4] );
+      } else if (TRACKR.jtrack == -1) {
+         cppstack->SetCurrentTrack(OPPHST.louopp[OPPHST.lstopp]);
       } else {
           cppstack->SetCurrentTrack(TRACKR.ispusr[mkbmx2-1] );
       }
@@ -99,6 +101,7 @@ void endraw(Int_t& icode, Int_t& mreg, Double_t& rull, Double_t& xsco, Double_t&
   // This has to be signalled to the StepManager() 
   //
       cppstack->SetCurrentTrack( TRACKR.ispusr[mkbmx2-1] );
+      
       fluka->SetRull(edep);
       fluka->SetIcode((FlukaProcessCode_t) icode);
       (TVirtualMCApplication::Instance())->Stepping();