]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliMC.cxx
Temporary reverting the changes introduced earlier to store the TGeo geometry. New...
[u/mrichter/AliRoot.git] / STEER / AliMC.cxx
index a3ed600b345d3910c0a0590d59a7d5205aaf0970..e1bde47e0167bf27dea9bf527f4a21961963adaa 100644 (file)
@@ -26,9 +26,9 @@
 #include <TStopwatch.h>
 #include <TSystem.h>
 #include <TVirtualMC.h>
 #include <TStopwatch.h>
 #include <TSystem.h>
 #include <TVirtualMC.h>
-#include <TGeoManager.h>
-#include "TGeant3.h" 
+#include "TGeant3.h"
 
 
 #include "AliLog.h"
 #include "AliDetector.h"
 #include "AliGenerator.h"
 #include "AliLog.h"
 #include "AliDetector.h"
 #include "AliGenerator.h"
@@ -144,26 +144,9 @@ void AliMC::Copy(TObject &) const
 void  AliMC::ConstructGeometry() 
 {
   //
 void  AliMC::ConstructGeometry() 
 {
   //
-  // Either load geometry from file or create it through usual
-  // loop on detectors. In the first case the method
-  // AliModule::CreateMaterials() only builds fIdtmed and is postponed
-  // at InitGeometry().
+  // Create modules, materials, geometry
   //
 
   //
 
-  if(gAlice->IsRootGeometry()){
-    // Load geometry 
-    const char *geomfilename = gAlice->GetGeometryFileName();
-    if(gSystem->ExpandPathName(geomfilename)){
-      AliInfo(Form("Loading geometry from file:\n %40s\n\n",geomfilename));
-      TGeoManager::Import(geomfilename);
-    }else{
-      AliInfo(Form("Geometry file %40s not found!\n",geomfilename));
-      return;
-    }
-
-  }else{
-
-    // Create modules, materials, geometry
     TStopwatch stw;
     TIter next(gAlice->Modules());
     AliModule *detector;
     TStopwatch stw;
     TIter next(gAlice->Modules());
     AliModule *detector;
@@ -176,9 +159,6 @@ void  AliMC::ConstructGeometry()
       AliInfo(Form("%10s R:%.2fs C:%.2fs",
                   detector->GetName(),stw.RealTime(),stw.CpuTime()));
     }
       AliInfo(Form("%10s R:%.2fs C:%.2fs",
                   detector->GetName(),stw.RealTime(),stw.CpuTime()));
     }
-
-  }
-  
 }
 
 //_______________________________________________________________________
 }
 
 //_______________________________________________________________________
@@ -195,7 +175,6 @@ void  AliMC::InitGeometry()
     while((detector = dynamic_cast<AliModule*>(next()))) {
       stw.Start();
       // Initialise detector and display geometry
     while((detector = dynamic_cast<AliModule*>(next()))) {
       stw.Start();
       // Initialise detector and display geometry
-      if (gAlice->IsRootGeometry()) detector->CreateMaterials();
       detector->Init();
       detector->BuildGeometry();
       AliInfo(Form("%10s R:%.2fs C:%.2fs",
       detector->Init();
       detector->BuildGeometry();
       AliInfo(Form("%10s R:%.2fs C:%.2fs",
@@ -310,9 +289,9 @@ void AliMC::Stepping()
     AddEnergyDeposit(gMC->CurrentVolID(copy),gMC->Edep());
     //
     // write tracke reference for track which is dissapearing - MI
     AddEnergyDeposit(gMC->CurrentVolID(copy),gMC->Edep());
     //
     // write tracke reference for track which is dissapearing - MI
-//     if (gMC->IsTrackDisappeared()) {      
-//     if (gMC->Etot()>0.05) AddTrackReference(GetCurrentTrackNumber());
-//     }
+    if (gMC->IsTrackDisappeared()) {      
+       if (gMC->Etot()>0.05) AddTrackReference(GetCurrentTrackNumber());
+    }
   
     //Call the appropriate stepping routine;
     AliModule *det = dynamic_cast<AliModule*>(gAlice->Modules()->At(id));
   
     //Call the appropriate stepping routine;
     AliModule *det = dynamic_cast<AliModule*>(gAlice->Modules()->At(id));
@@ -501,12 +480,12 @@ void AliMC::ResetHits()
 void AliMC::PostTrack()
 {
   // Posts tracks for each module
 void AliMC::PostTrack()
 {
   // Posts tracks for each module
-  TObjArray &dets = *gAlice->Modules();
-  AliModule *module;
-  
-  for(Int_t i=0; i<=gAlice->GetNdets(); i++)
-    if((module = dynamic_cast<AliModule*>(dets[i])))
-      module->PostTrack();
+     TObjArray &dets = *gAlice->Modules();
+     AliModule *module;
+
+     for(Int_t i=0; i<=gAlice->GetNdets(); i++)
+       if((module = dynamic_cast<AliModule*>(dets[i])))
+        module->PostTrack();
 }
 
 //_______________________________________________________________________
 }
 
 //_______________________________________________________________________