]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONSegmentationDetectionElement.h
Removing extrap.F (Christian)
[u/mrichter/AliRoot.git] / MUON / AliMUONSegmentationDetectionElement.h
index 1dc9f312b391bd8126207a3597df5716ebb72cdf..d7feb8bfd2b721b592fda4ff6011c0b892bac56f 100644 (file)
 //===========================================================
 #include <Riostream.h>
 
-
-#include <TObject.h>
 #include <TString.h>
-#include <TArrayF.h>
+
+#include "AliSegmentation.h"
 
 class TClonesArray;
 class TMap;
@@ -38,28 +37,45 @@ class AliMUONSegmentationDetectionElement : public TObject {
   AliMUONSegmentationDetectionElement();
   //AliMUONSegmentationDetectionElement(const char* ElementType="");
   virtual ~AliMUONSegmentationDetectionElement();
-  
-  AliMUONSegmentIndex     * GetIndex( const char * SegmentManuIndexName);
-  AliMUONSegmentManuIndex * GetManuIndex( const char * SegmentIndexName);
-  AliMUONSegmentPosition  * GetPosition( const char * SegmentIndexName);
-  TObjArray *            ListOfIndexes() {return fListOfIndexes;}
-  TObjArray *            ListOfManuIndexes() {return fListOfIndexes;}
-  TObjArray *            ListOfPositions() {return fListOfIndexes;}
-  AliMUONSegmentManuIndex * FindManuIndex(const char* ManuIndexName="");
-  AliMUONSegmentManuIndex * FindIndex(const char* IndexName="");
-  
-  void     Init(const char * DetectionElementType="slat220000N");
 
-  void     ReadingSegmentationMappingFile(TString infile, Int_t cathode);
+  // User common functions
+
+  AliMUONSegmentIndex     * FindIndexFromPosition(Float_t x, Float_t y, Int_t cathode);
+  AliMUONSegmentIndex     * GetIndex(Int_t manu, Int_t channel) const;
+  AliMUONSegmentIndex     * GetIndexFromPosition(Float_t x, Float_t y, Int_t cathode) const;
+  AliMUONSegmentManuIndex * GetManuIndex( Int_t padx, Int_t pady, Int_t cathode) const ;
+  AliMUONSegmentPosition  * GetPosition(Int_t padx, Int_t pady, Int_t cathode) const ;
+  TObjArray *               ListOfIndexes()     {return fListOfIndexes;}
+  TObjArray *               ListOfManuIndexes() {return fListOfManuIndexes;}
+  TObjArray *               ListOfPositions()   {return fListOfPositions;}
   
- protected:
+  void                      Init(const char * DetectionElementType="slat220000N");
+  void                      ReadingSegmentationMappingFile(TString infile, Int_t cathode);
+
+  // virtual functions from AliSegmentation. In future this class should derive from AliSegmentation
+  Float_t      GetAnod(Float_t xhit) const; // Anod wire coordinate closest to xhit
+  void         SetDAnod(Float_t D) {fWireD = D;};  // Wire Pitch
+  void         GetPadI(Float_t x, Float_t y , Int_t cathode, Int_t &padx, Int_t &pady); // Transform from Position to closest Index 
+  void         GetPadC(Int_t ix, Int_t iy, Int_t cathode, Float_t &x, Float_t &y );  // Transform from Index to Position 
+/*   void      FirstPad(Float_t xhit, Float_t yhit, Float_t dx, Float_t dy);// Initialiser  */
+/*   void      NextPad();  // Stepper  */
+/*   Int_t     MorePads(); // Condition  */
+/*   void      Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10]); // Get next neighbours  */ 
+
+ protected:  
+  AliMUONSegmentIndex     * GetIndex( const char * SegmentManuIndexName)const;
+  AliMUONSegmentIndex     * GetIndexFromPosition( const char * PositionName)const;
+  AliMUONSegmentManuIndex * GetManuIndex( const char * SegmentIndexName) const;
+  AliMUONSegmentPosition  * GetPosition( const char * SegmentIndexName) const;
+  AliMUONSegmentManuIndex * FindManuIndex(const char* ManuIndexName="") const;
+  AliMUONSegmentIndex     * FindIndex(const char* IndexName="") const;
+
   AliMUONSegmentationDetectionElement(const AliMUONSegmentationDetectionElement& rhs);
   
  private:
   // static data members  
-  static const TString fgkDefaultTop;  // 
-  static const TString fgkStationDir;  // 
+  static const TString fgkDefaultTop;  // Top directory of $Alice_ROOT/MUON/mapping
+  static const TString fgkStationDir;  // Directory for station station1, station2, station345
   static const TString fgkBendingDir;    //bending plane directory
   static const TString fgkNonBendingDir; //non-bending plane directory
   static const TString fgkFileExt;  // File extention
@@ -67,18 +83,19 @@ class AliMUONSegmentationDetectionElement : public TObject {
   static const TString fgkNonBendingExt;  // bending file extention
 
   // data members
-  TString   fDetectionElementType;               //  Type of detection element St1Sector, slat220000N, etc ....
-  TString   fSegmentationMappingFile_Bending;    //  Segmentation & mapping file for bending plane
-  TString   fSegmentationMappingFile_NonBending; //  Segmentation & mapping file for non bending plane
-  TObjArray * fListOfIndexes;
-  TObjArray * fListOfManuIndexes;
-  TObjArray * fListOfPositions;
-  TMap *    fMapManuIndexIndex;  // Map with key ManuIndex and value = Index
-  TMap *    fMapIndexManuIndex;// Map with key ManuIndexIndex and value = ManuIndex
-  TMap *    fMapIndexPosition;// Map with key Index and value = Position
-  TArrayF * fXlocalSegmentPositions; // Array of posible values of Xlocal
-  TArrayF * fYlocalSegmentPositions;// Array of posible values of Ylocal
-  
+  Float_t     fWireD;         // Wire pitch in cm
+  Float_t     fWireX0;        // Initial X0 position in local coordinates of the first wire
+  Int_t       fCurrentSegment;// Index of the current segment
+  TString     fDetectionElementType;               //  Type of detection element St1Sector, slat220000N, etc ....
+  TString     fSegmentationMappingFileBending;    //  Segmentation & mapping file for bending plane
+  TString     fSegmentationMappingFileNonBending; //  Segmentation & mapping file for non bending plane
+  TObjArray * fListOfIndexes;        // TObject Array fo AliMUONSegmentIndex
+  TObjArray * fListOfManuIndexes;   // TObject Array fo AliMUONSegmentManuIndex
+  TObjArray * fListOfPositions;  // TObject Array fo AliMUONSegmentPositions
+  TMap *      fMapManuIndexIndex;  // Map with key ManuIndex and value = Index
+  TMap *      fMapIndexManuIndex;// Map with key ManuIndexIndex and value = ManuIndex
+  TMap *      fMapIndexPosition;// Map with key Index and value = Position
+  TMap *      fMapPositionIndex;// Map with key Index and value = Position
 
   ClassDef(AliMUONSegmentationDetectionElement,1) // Segmentation for MUON detection elements