]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONGeometrySegmentation.h
Additional protection in case of negative indexes. More investigation is needed
[u/mrichter/AliRoot.git] / MUON / AliMUONGeometrySegmentation.h
index 6cddb6ec9a0e598c703c24c20994ae65a8585584..6a22776764bc33a01418afc46dc865e3e33686a6 100644 (file)
 #ifndef ALI_MUON_GEOMETRY_SEGMENTATION_H
 #define ALI_MUON_GEOMETRY_SEGMENTATION_H
 
-#include <TObject.h>
-
 #include "AliMUONGeometryDirection.h"
 
+#include <TObject.h>
+#include <TString.h>
+
 class TObjArray;
 class TF1;
 
-class AliMUONGeometryModule;
+class AliMUONGeometryModuleTransformer;
 class AliMUONGeometryStore;
 class AliMUONGeometryDetElement;
 class AliMUONVGeometryDESegmentation;
@@ -32,24 +33,34 @@ class AliMUONSegmentManuIndex;
 class AliMUONGeometrySegmentation : public TObject
 {
   public:
-    AliMUONGeometrySegmentation(AliMUONGeometryModule* geometry);
+    AliMUONGeometrySegmentation(
+           const AliMUONGeometryModuleTransformer* geometry);
     AliMUONGeometrySegmentation();
     virtual ~AliMUONGeometrySegmentation();
 
-    // methods
-    void Add(Int_t detElemId, 
+    // Methods
+    //
+    void Add(Int_t detElemId, const TString& detElemName,
              AliMUONVGeometryDESegmentation* segmentation); 
  
-    // get methods
-    AliMUONGeometryModule* GetGeometry() const;              
-    virtual const AliMUONVGeometryDESegmentation* GetDESegmentation(Int_t detElemId) const;
+    // Get methods
+    //
+    const AliMUONGeometryModuleTransformer* GetTransformer() const;
+                       // Geometry transformer       
+    const AliMUONVGeometryDESegmentation* GetDESegmentation(
+                        Int_t detElemId, Bool_t warn = true) const;
                        // DE segmentation
-    virtual AliMUONGeometryDirection GetDirection(Int_t detElemId) const;
+    
+    AliMUONGeometryDirection GetDirection(Int_t detElemId) const;
                        // Direction with a constant pad size  
-                      // (Direction or coordinate where the resolution is the best)
+                      // (Direction or coordinate where the resolution 
+                      // is the best)
     
-    //    
-    // redefined methods from AliSegmentation interface
+    TString GetDEName(Int_t detElemId) const;                 
+                       // DE name
+
+    // Redefined methods from AliSegmentation interface
     // 
 
     // Set Chamber Segmentation Parameters
@@ -72,7 +83,10 @@ class AliMUONGeometrySegmentation : public TObject
                           Float_t& x, Float_t& y, Float_t& z);
                        // Transform from real to pad coordinates
 
-    virtual Bool_t HasPad(Int_t detElemId, Int_t ix, Int_t iy);
+    virtual Bool_t HasPad(Int_t detElemId, 
+                          Int_t ix, Int_t iy);
+    virtual Bool_t HasPad(Int_t detElemId, 
+                          Float_t& x, Float_t& y, Float_t& z);
   
     // Initialisation
     //
@@ -163,7 +177,9 @@ class AliMUONGeometrySegmentation : public TObject
                    // Set the correction function
     virtual TF1* CorrFunc(Int_t detElemId, Int_t isec) const;
                    // Get the correction Function
-    virtual void Print(Option_t* ="") const;
+    // Printing
+    //
+    virtual void Print(Option_t* opt = "") const;
        
   protected:
     AliMUONGeometrySegmentation(const AliMUONGeometrySegmentation& rhs);
@@ -173,22 +189,31 @@ class AliMUONGeometrySegmentation : public TObject
 
   private:
     // methods
-    Bool_t OwnNotify(Int_t detElemId) const;
+    Bool_t OwnNotify(Int_t detElemId, Bool_t warn = true) const;
+
+    // static data members
+    static  const Float_t  fgkMaxDistance; // the big value passed to pad coordinates
+                                           // if pad does not exist
   
     // data members
-    mutable  Int_t                           fCurrentDetElemId;  
-    mutable  AliMUONGeometryDetElement*      fCurrentDetElement;  
-    mutable  AliMUONVGeometryDESegmentation* fCurrentSegmentation;
-    AliMUONGeometryModule*    fGeometryModule;
-    AliMUONGeometryStore*     fDESegmentations;
+    mutable  Int_t                           fCurrentDetElemId;   // current DE ID 
+    mutable  AliMUONGeometryDetElement*      fCurrentDetElement;  // current detection element 
+    mutable  AliMUONVGeometryDESegmentation* fCurrentSegmentation;// current DE segmentation
+   
+    const AliMUONGeometryModuleTransformer*  fkModuleTransformer; // associated geometry transformer
+    AliMUONGeometryStore*        fDESegmentations;// DE segmentations
+    AliMUONGeometryStore*        fDENames;        // DE names
+    
  
-   ClassDef(AliMUONGeometrySegmentation,2) // Geometry segmentation
+   ClassDef(AliMUONGeometrySegmentation,3) // Geometry segmentation
 };
 
 // inline functions
 
-inline AliMUONGeometryModule* AliMUONGeometrySegmentation::GetGeometry() const
-{ return fGeometryModule; }          
+inline 
+const AliMUONGeometryModuleTransformer* 
+AliMUONGeometrySegmentation::GetTransformer() const
+{ return fkModuleTransformer; }              
 
 #endif //ALI_MUON_GEOMETRY_SEGMENTATION_H