]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONGeometryTransformer.cxx
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / MUON / AliMUONGeometryTransformer.cxx
index 6d34e730bd7c9d13337f8f8e80cf1a4073961c69..5dad62cc0bae8a57a0db9b554267a0e58e132312 100644 (file)
 
 #include <sstream>
 
+using std::endl;
+using std::ios;
+using std::cerr;
+using std::setw;
+using std::setprecision;
 /// \cond CLASSIMP
 ClassImp(AliMUONGeometryTransformer)
 /// \endcond
 
-const TString  AliMUONGeometryTransformer::fgkDefaultDetectorName = "MUON";
+//
+// static private methods
+//
+
+//______________________________________________________________________________
+const TString& AliMUONGeometryTransformer::GetDefaultDetectorName()
+{ 
+  /// Default detector name
+  static const TString kDefaultDetectorName = "MUON";
+  return kDefaultDetectorName;
+}  
  
+//
+// ctor, dtor
+//
+
 //______________________________________________________________________________
 AliMUONGeometryTransformer::AliMUONGeometryTransformer()
 
   : TObject(),
-    fDetectorName(fgkDefaultDetectorName),
+    fDetectorName(GetDefaultDetectorName()),
     fModuleTransformers(0),
     fMisAlignArray(0),
     fDEAreas(0x0)
@@ -141,8 +160,8 @@ AliMUONGeometryTransformer::CreateDEAreas() const
     AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
     
     Double_t xl(0.0), yl(0.0), zl(0.0);
-    Double_t dx(seg->Dimensions().X());
-    Double_t dy(seg->Dimensions().Y());
+    Double_t dx(seg->GetDimensionX());
+    Double_t dy(seg->GetDimensionY());
     
     if ( stationType == AliMp::kStation12 ) 
     {
@@ -163,7 +182,8 @@ AliMUONGeometryTransformer::CreateDEAreas() const
         while ( !itp->IsDone() ) 
         {
           AliMpPad pad = itp->CurrentItem();
-          AliMpArea a(pad.Position(),pad.Dimensions());
+          AliMpArea a(pad.GetPositionX(),pad.GetPositionY(),
+                      pad.GetDimensionX(), pad.GetDimensionY());
           xmin = TMath::Min(xmin,a.LeftBorder());
           xmax = TMath::Max(xmax,a.RightBorder());
           ymin = TMath::Min(ymin,a.DownBorder());
@@ -186,7 +206,7 @@ AliMUONGeometryTransformer::CreateDEAreas() const
       Local2Global(detElemId,xl,yl,zl,xg,yg,zg);
     }
     
-    fDEAreas->Add(detElemId,new AliMpArea(TVector2(xg,yg),TVector2(dx,dy)));
+    fDEAreas->Add(detElemId,new AliMpArea(xg,yg,dx,dy));
     
     it.Next();
   }
@@ -252,6 +272,7 @@ void AliMUONGeometryTransformer::FillModuleTransform(Int_t moduleId,
   if ( !moduleTransformer) {
     AliErrorStream() 
       << "Module " << moduleId << " has not volume path defined." << endl;
+    return;  
   }  
       
   // Build the transformation from the parameters
@@ -700,7 +721,7 @@ void AliMUONGeometryTransformer::AddModuleTransformer(
 
 //_____________________________________________________________________________
 void  AliMUONGeometryTransformer::AddMisAlignModule(Int_t moduleId, 
-                                              const TGeoHMatrix& matrix)
+                                                   const TGeoHMatrix& matrix, Bool_t bGlobal)
 {
 /// Build AliAlignObjMatrix with module ID, its volumePath
 /// and the given delta transformation matrix                                        
@@ -722,12 +743,12 @@ void  AliMUONGeometryTransformer::AddMisAlignModule(Int_t moduleId,
   TClonesArray& refArray =*fMisAlignArray;
   Int_t pos = fMisAlignArray->GetEntriesFast();
   new (refArray[pos]) AliAlignObjMatrix(GetModuleSymName(moduleId), volId, 
-                                       const_cast<TGeoHMatrix&>(matrix),kTRUE);
+                                       const_cast<TGeoHMatrix&>(matrix),bGlobal);
 }
 
 //_____________________________________________________________________________
 void  AliMUONGeometryTransformer::AddMisAlignDetElement(Int_t detElemId, 
-                                              const TGeoHMatrix& matrix)
+                                                       const TGeoHMatrix& matrix, Bool_t bGlobal)
 {
 /// Build AliAlignObjMatrix with detection element ID, its volumePath
 /// and the given delta transformation matrix                                        
@@ -750,7 +771,7 @@ void  AliMUONGeometryTransformer::AddMisAlignDetElement(Int_t detElemId,
   TClonesArray& refArray =*fMisAlignArray;
   Int_t pos = fMisAlignArray->GetEntriesFast();
   new(refArray[pos]) AliAlignObjMatrix(GetDESymName(detElemId), volId, 
-                                      const_cast<TGeoHMatrix&>(matrix),kTRUE);
+                                      const_cast<TGeoHMatrix&>(matrix),bGlobal);
 }
 
 //______________________________________________________________________________