Pass align option to geometry modules in AddBuilder()
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 28 Sep 2005 09:16:53 +0000 (09:16 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 28 Sep 2005 09:16:53 +0000 (09:16 +0000)
MUON/AliMUONGeometryBuilder.cxx
MUON/AliMUONGeometryBuilder.h

index 0650e11..fba0f21 100644 (file)
@@ -268,6 +268,19 @@ void AliMUONGeometryBuilder::FillGlobalTransformations(
   }                        
 }           
 
+//_____________________________________________________________________________
+void AliMUONGeometryBuilder::SetAlign(AliMUONVGeometryBuilder* builder)
+{
+/// Set align option to all geometry modules associated with the builder
+
+  for (Int_t j=0; j<builder->NofGeometries(); j++) {
+
+    AliMUONGeometryModule* geometry = builder->Geometry(j);
+  
+    geometry->SetAlign(fAlign);
+  }      
+}           
+
 //
 // public functions
 //
@@ -278,6 +291,8 @@ void AliMUONGeometryBuilder::AddBuilder(AliMUONVGeometryBuilder* geomBuilder)
 /// Add the geometry builder to the list
 
   fGeometryBuilders->Add(geomBuilder);
+  
+  SetAlign(geomBuilder);
 }
 
 //______________________________________________________________________________
@@ -513,15 +528,9 @@ void AliMUONGeometryBuilder::SetAlign(Bool_t align)
 
   for (Int_t i=0; i<fGeometryBuilders->GetEntriesFast(); i++) {
 
-    // Get the builder
     AliMUONVGeometryBuilder* builder
       = (AliMUONVGeometryBuilder*)fGeometryBuilders->At(i);
-
-    for (Int_t j=0; j<builder->NofGeometries(); j++) {
-
-      AliMUONGeometryModule* geometry = builder->Geometry(j);
-  
-      geometry->SetAlign(align);
-    }            
-  }      
+    
+    SetAlign(builder); 
+  }   
 }
index da2c42b..318ddab 100644 (file)
@@ -56,7 +56,8 @@ class AliMUONGeometryBuilder : public TObject
     void PlaceVolume(const TString& name, const TString& mName, Int_t copyNo, 
              const TGeoHMatrix& matrix, Int_t npar, Double_t* param,
             const char* only) const;
-    void FillGlobalTransformations(AliMUONVGeometryBuilder* builder);       
+    void FillGlobalTransformations(AliMUONVGeometryBuilder* builder);
+    void SetAlign(AliMUONVGeometryBuilder* builder);        
 
     // data members
     AliModule*      fModule;              // the AliRoot module