Adding data members for transformations file and svmaps file names
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 7 Dec 2005 08:59:51 +0000 (08:59 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 7 Dec 2005 08:59:51 +0000 (08:59 +0000)
+ its default values and updating Read/Write methods accordingly.

MUON/AliMUONGeometryBuilder.cxx
MUON/AliMUONGeometryBuilder.h

index 06314bb..83a2588 100644 (file)
 
 
 ClassImp(AliMUONGeometryBuilder)
+
+// static data members
  
+const TString  AliMUONGeometryBuilder::fgkDefaultTransformFileName = "transform.dat";   
+const TString  AliMUONGeometryBuilder::fgkDefaultSVMapFileName = "svmap.dat";    
+const TString  AliMUONGeometryBuilder::fgkOutFileNameExtension = ".out";    
+
 // static functions
 
 //______________________________________________________________________________
@@ -105,6 +111,8 @@ AliMUONGeometryBuilder::AliMUONGeometryBuilder(AliModule* module)
   : TObject(),
     fModule(module),
     fAlign(false),
+    fTransformFileName(fgkDefaultTransformFileName),
+    fSVMapFileName(fgkDefaultSVMapFileName),
     fGlobalTransformation(), 
     fGeometryBuilders(0),
     fGeometry(0)
@@ -129,6 +137,8 @@ AliMUONGeometryBuilder::AliMUONGeometryBuilder()
   : TObject(),
     fModule(0),
     fAlign(false),
+    fTransformFileName(),
+    fSVMapFileName(),
     fGlobalTransformation(),
     fGeometryBuilders(0),
     fGeometry(0)
@@ -447,6 +457,8 @@ void AliMUONGeometryBuilder::InitGeometry(const TString& svmapFileName)
   }  
 }
 
+
+
 //______________________________________________________________________________
 void AliMUONGeometryBuilder::ReadTransformations(const TString& fileName)
 {
@@ -469,8 +481,8 @@ void AliMUONGeometryBuilder::WriteTransformations(const TString& fileName)
 }
 
 //______________________________________________________________________________
-void AliMUONGeometryBuilder::WriteSVMaps(Bool_t rebuild, 
-                                         const TString& fileName)
+void AliMUONGeometryBuilder::WriteSVMaps(const TString& fileName, 
+                                         Bool_t rebuild)
 {
 /// Write sensitive volume maps into files per builder
 
@@ -504,3 +516,20 @@ void AliMUONGeometryBuilder::SetAlign(Bool_t align)
     SetAlign(builder); 
   }   
 }
+
+//_____________________________________________________________________________
+void AliMUONGeometryBuilder::SetAlign(const TString& fileName, Bool_t align)
+{ 
+/// Set the option for alignement
+
+  fTransformFileName = fileName;
+  fAlign = align; 
+
+  for (Int_t i=0; i<fGeometryBuilders->GetEntriesFast(); i++) {
+
+    AliMUONVGeometryBuilder* builder
+      = (AliMUONVGeometryBuilder*)fGeometryBuilders->At(i);
+    
+    SetAlign(builder); 
+  }   
+}
index a51c818..a650409 100644 (file)
@@ -37,14 +37,22 @@ class AliMUONGeometryBuilder : public TObject
                                 const TGeoMatrix& m3, const TGeoMatrix& m4); 
 
     // methods
+    //
     void  AddBuilder(AliMUONVGeometryBuilder* geomBuilder);
     void  CreateGeometry();
     void  CreateMaterials();
-    void  InitGeometry(const TString& svmapFileName = "svmap.dat");
-    void  ReadTransformations(const TString& fileName = "transform.dat");
-    void  WriteTransformations(const TString& fileName = "transform.dat.out");
-    void  WriteSVMaps(Bool_t rebuild = true, 
-                      const TString& fileName = "svmap.dat.out");
+
+    void  InitGeometry();
+    void  InitGeometry(const TString& svmapFileName);
+
+    void  ReadTransformations();
+    void  ReadTransformations(const TString& fileName);
+
+    void  WriteTransformations();
+    void  WriteTransformations(const TString& fileName);
+
+    void  WriteSVMaps();
+    void  WriteSVMaps(const TString& fileName, Bool_t rebuild = true);
     
     // Geometry parametrisation
     const AliMUONGeometry*            GetGeometry() const;
@@ -52,7 +60,8 @@ class AliMUONGeometryBuilder : public TObject
 
     // Alignement
     virtual Bool_t  GetAlign() const;
-    virtual void    SetAlign(Bool_t align);
+    virtual void    SetAlign(Bool_t align = true);
+    virtual void    SetAlign(const TString& fileName, Bool_t align = true);
  
   protected:
     AliMUONGeometryBuilder(const AliMUONGeometryBuilder& right);
@@ -65,10 +74,17 @@ class AliMUONGeometryBuilder : public TObject
             const char* only) const;
     void SetAlign(AliMUONVGeometryBuilder* builder);        
 
+    // static data members
+    static const TString  fgkDefaultTransformFileName; // default transformations file name                                       
+    static const TString  fgkDefaultSVMapFileName;     // default svmaps file name                                        
+    static const TString  fgkOutFileNameExtension;     // default output file name extension                                      
+
     // data members
     AliModule*       fModule;              // the AliRoot module
     Bool_t           fAlign;               // option to read transformations 
                                            // from a file
+    TString          fTransformFileName;   // transformations file name                                           
+    TString          fSVMapFileName;       // svmaps file name                                    
     TGeoCombiTrans   fGlobalTransformation;// global transformation 
                                            // applied to the whole geometry 
     TObjArray*       fGeometryBuilders;    // list of Geometry Builders
@@ -79,6 +95,18 @@ class AliMUONGeometryBuilder : public TObject
 
 // inline functions
 
+inline void  AliMUONGeometryBuilder::InitGeometry()
+{ InitGeometry(fSVMapFileName); }
+
+inline void  AliMUONGeometryBuilder::ReadTransformations()
+{ ReadTransformations(fTransformFileName); }
+
+inline void  AliMUONGeometryBuilder::WriteTransformations()
+{ WriteTransformations(fTransformFileName + fgkOutFileNameExtension); }
+
+inline void  AliMUONGeometryBuilder::WriteSVMaps()
+{ WriteSVMaps(fSVMapFileName + fgkOutFileNameExtension); }
+
 inline 
 const AliMUONGeometry* AliMUONGeometryBuilder::GetGeometry() const
 { return fGeometry; }