]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
- CurrentVolPath implemented
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 28 Apr 2005 04:50:56 +0000 (04:50 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 28 Apr 2005 04:50:56 +0000 (04:50 +0000)
- Update on reading geometry from file

TFluka/TFluka.cxx
TFluka/TFluka.h

index d55b2165cea127b0e77505291213f5450d5141f1..2f828adf8f5f4dc38fc395a26f84bbba91982410 100644 (file)
@@ -191,14 +191,17 @@ void TFluka::Init() {
     
     if (!gGeoManager) new TGeoManager("geom", "FLUKA geometry");
     fApplication->ConstructGeometry();
-    TGeoVolume *top = (TGeoVolume*)gGeoManager->GetListOfVolumes()->First();
-    gGeoManager->SetTopVolume(top);
-    gGeoManager->CloseGeometry("di");
-    gGeoManager->DefaultColors();  // to be removed
-    
-    // Now we have TGeo geometry created and we have to patch FlukaVmc.inp
-    // with the material mapping file FlukaMat.inp
+    if (!gGeoManager->IsClosed()) {
+       TGeoVolume *top = (TGeoVolume*)gGeoManager->GetListOfVolumes()->First();
+       gGeoManager->SetTopVolume(top);
+       gGeoManager->CloseGeometry("di");
+    } else {
+       TGeoNodeCache *cache = gGeoManager->GetCache();
+       if (!cache->HasIdArray()) {
+          printf("Node ID tracking must be enabled with TFluka: enabling...\n");
+          cache->BuildIdArray();
+       }   
+    }           
     fNVolumes = fGeom->NofVolumes();
     fGeom->CreateFlukaMatFile("flukaMat.inp");   
     if (fVerbosityLevel >=3) {
@@ -1772,6 +1775,10 @@ const char* TFluka::CurrentVolOffName(Int_t off) const
   return node->GetVolume()->GetName();
 }
 
+const char* TFluka::CurrentVolPath() {
+  // Return the current volume path
+  return gGeoManager->GetPath(); 
+}
 //______________________________________________________________________________ 
 Int_t TFluka::CurrentMaterial(Float_t & a, Float_t & z, 
                      Float_t & dens, Float_t & radl, Float_t & absl) const
@@ -1970,6 +1977,7 @@ extern "C" {
        fluka->SetZsco(z);
        fluka->SetNCerenkov(nphot);
        fluka->SetCaller(50);
+       if (fluka->GetVerbosityLevel() >= 3) 
        printf("userstepping ckv: %10d %10d %13.3f %13.3f %13.2f %s\n", nphot, mreg, x, y, z, fluka->CurrentVolName());
        (TVirtualMCApplication::Instance())->Stepping();
     }
index 979221b3a22aae9fe95e4db023349432270af081..d1c41b57f5446548b9ff4cf3581e2141821a08b3 100644 (file)
@@ -416,10 +416,7 @@ class TFluka : public TVirtualMC {
     return 0;
   }
 
-  inline const char* TFluka::CurrentVolPath() {
-    Warning("CurrentVolPath", "New function - not yet implemented.");
-    return "";
-  }
+
 
 #endif //TFLUKA