]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONSt1GeometryBuilderV2.cxx
The present commit corresponds to an important change in the way the
[u/mrichter/AliRoot.git] / MUON / AliMUONSt1GeometryBuilderV2.cxx
index 01ec8352caa58168e366a2823183788ff2e0d153..b2049b4894689bb077635ac73fa47bd239550f83 100644 (file)
@@ -36,7 +36,6 @@
 #include "AliMpContainers.h"
 #include "AliMpConstants.h"
 #include "AliMpCDB.h"
-#include "AliMpSectorSegmentation.h"
 #include "AliMpSector.h"
 #include "AliMpRow.h"
 #include "AliMpVRowSegment.h"
 #include "AliMagF.h"
 #include "AliLog.h"
 
-#include <TVector2.h>
-#include <TVector3.h>
-#include <TGeoMatrix.h>
-#include <TClonesArray.h>
 #include <Riostream.h>
-#include <TSystem.h>
-#include <TVirtualMC.h>
+#include <TClonesArray.h>
+#include <TGeoCompositeShape.h>
+#include <TGeoGlobalMagField.h>
 #include <TGeoManager.h>
-#include <TGeoVolume.h>
+#include <TGeoMatrix.h>
 #include <TGeoTube.h>
+#include <TGeoVolume.h>
 #include <TGeoXtru.h>
-#include <TGeoCompositeShape.h>
+#include <TSystem.h>
+#include <TVector2.h>
+#include <TVector3.h>
+#include <TVirtualMC.h>
 
 #ifdef WITH_STL
   #include <vector>
@@ -414,16 +414,12 @@ void AliMUONSt1GeometryBuilderV2::CreateQuadrant(Int_t chamber)
     AliFatal("Mapping has to be loaded first !");
   }
        
-  const AliMpSectorSegmentation* kSegmentation1 
-    = dynamic_cast<const AliMpSectorSegmentation*>(
-        AliMpSegmentation::Instance()
-          ->GetMpSegmentation(100, AliMpDEManager::GetCathod(100, AliMp::kBendingPlane))); 
-  if ( ! kSegmentation1 ) {
+  const AliMpSector* kSector1 
+    = AliMpSegmentation::Instance()->GetSector(100, AliMpDEManager::GetCathod(100, AliMp::kBendingPlane));
+  if ( ! kSector1 ) {
     AliFatal("Could not access sector segmentation !");
   }
 
-  const AliMpSector* kSector1 = kSegmentation1->GetSector();
-
   //Bool_t reflectZ = true;
   Bool_t reflectZ = false;
   //TVector3 where = TVector3(2.5+0.1+0.56+0.001, 2.5+0.1+0.001, 0.);
@@ -448,15 +444,12 @@ void AliMUONSt1GeometryBuilderV2::CreateQuadrant(Int_t chamber)
       // Fix (7) - overlap of SQ42 with MCHL (after moving the whole sector
       // in the true position)   
 
-  const AliMpSectorSegmentation* kSegmentation2 
-    = dynamic_cast<const AliMpSectorSegmentation*>(
-        AliMpSegmentation::Instance()
-          ->GetMpSegmentation(100, AliMpDEManager::GetCathod(100, AliMp::kNonBendingPlane))); 
-  if ( ! kSegmentation2 ) {
-    AliFatal("Could not access sector segmentation !");
+  const AliMpSector* kSector2 
+    = AliMpSegmentation::Instance()
+          ->GetSector(100, AliMpDEManager::GetCathod(100, AliMp::kNonBendingPlane));
+  if ( ! kSector2 ) {
+    AliFatal("Could not access sector !");
   }
-    
-  const AliMpSector* kSector2 = kSegmentation2->GetSector();
 
   //reflectZ = false;
   reflectZ = true;
@@ -2235,8 +2228,8 @@ void AliMUONSt1GeometryBuilderV2::CreateMaterials()
   GReal_t maxStepAlu   = fMUON->GetMaxStepAlu();
   GReal_t maxDestepAlu = fMUON->GetMaxDestepAlu();
   // GReal_t maxStepGas   = fMUON->GetMaxStepGas();
-  Int_t iSXFLD   = gAlice->Field()->PrecInteg();
-  Float_t sXMGMX = gAlice->Field()->Max();
+  Int_t iSXFLD   = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->PrecInteg();
+  Float_t sXMGMX = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
 
   fMUON->AliMedium(21, "ALU_II$",    41, 0, iSXFLD, sXMGMX, 
                    tmaxfd, maxStepAlu, maxDestepAlu, epsil, stmin);