]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TFluka/bxdraw.cxx
Updated geometry. Includes FMD named shapes
[u/mrichter/AliRoot.git] / TFluka / bxdraw.cxx
index f386743325dd4069fb9794db01bb57db8ed15821..315ec664ebf5a24d4d0a3b6c8272e09d3673ac55 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