]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/AliFMDAltroMapping.h
Put middle plane of FMD1 to z = 320 cm.
[u/mrichter/AliRoot.git] / FMD / AliFMDAltroMapping.h
index 1e4e56f4238f2565c2650f3c611dcf816498eca3..138553f86da6e2203975a27d0430dee3d621c536 100644 (file)
 #ifndef ROOT_TArrayI
 # include <TArrayI.h>
 #endif
-
+//
+// Map hardware address to detector coordinates. 
+//
+//    The hardware address consist of a DDL number and 12bits of ALTRO
+//    addresses.  The ALTRO address are formatted as follows. 
+//
+//    12              7         4            0
+//    |---------------|---------|------------|
+//    | Board #       | ALTRO # | Channel #  |
+//    +---------------+---------+------------+
+//
+//
 //____________________________________________________________________
 /** @class AliFMDAltroMapping 
     @brief Class that encodes a map to/from ALTRO hardware address to
@@ -43,17 +54,47 @@ class AliFMDAltroMapping : public AliAltroMapping
 public:
   /** Constructor */
   AliFMDAltroMapping();
+  /** Destructor */
+  virtual ~AliFMDAltroMapping() {}
   /** Map a hardware address into a detector index. 
       @param ddl    Hardware DDL number 
       @param hwaddr Hardware address.  
       @param det    On return, the detector #
       @param ring   On return, the ring ID
       @param sec    On return, the sector #
-      @param str    On return, the strip #
+      @param str    On return, the base of strip #
       @return @c true on success, false otherwise */
   Bool_t Hardware2Detector(UInt_t    ddl, UInt_t    hwaddr, 
                           UShort_t& det, Char_t&   ring, 
                           UShort_t& sec, UShort_t& str) const;
+  /** Map a hardware address into a detector index. 
+      @param ddl     Hardware DDL number 
+      @param board   FEC number
+      @param altro   ALTRO number 
+      @param channel Channel number 
+      @param det     On return, the detector #
+      @param ring    On return, the ring ID
+      @param sec     On return, the sector #
+      @param str     On return, the base of strip #
+      @return @c true on success, false otherwise */
+  Bool_t Hardware2Detector(UInt_t    ddl,   UInt_t    board, 
+                          UInt_t    altro, UInt_t    channel,
+                          UShort_t& det,   Char_t&   ring, 
+                          UShort_t& sec,   UShort_t& str) const;
+  /** Map a detector index into a hardware address. 
+      @param det     The detector #
+      @param ring    The ring ID
+      @param sec     The sector #
+      @param str     The strip #
+      @param ddl     On return, hardware DDL number 
+      @param board   On return, the FEC board address (local to DDL)
+      @param altro   On return, the ALTRO number (local to FEC)
+      @param channel On return, the channel number (local to ALTRO)
+      @return @c true on success, false otherwise */
+  Bool_t Detector2Hardware(UShort_t  det,   Char_t    ring, 
+                          UShort_t  sec,   UShort_t  str,
+                          UInt_t&   ddl,   UInt_t&   board, 
+                          UInt_t&   altro, UInt_t&   channel) const;
   /** Map a detector index into a hardware address. 
       @param det    The detector #
       @param ring   The ring ID
@@ -65,21 +106,12 @@ public:
   Bool_t Detector2Hardware(UShort_t  det, Char_t    ring, 
                           UShort_t  sec, UShort_t  str,
                           UInt_t&   ddl, UInt_t&   hwaddr) const;
-  /** Here to take care of a a misspelling in base class 
-      @param sector Sector number
-      @param str    Strip number
-      @param ring   Ring ID as an integer 
-      @return Hardware address */
-  Int_t  GetHWAdress(Int_t sector, Int_t str, Int_t ring) const
-  {
-    return GetHWAddress(sector, str, ring);
-  }
   /** convert a partial detector index into a hardware address
       @param sector Sector number
       @param str    Strip number
       @param ring   Ring ID as an integer 
       @return Hardware address */
-  Int_t  GetHWAddress(Int_t sector, Int_t str, Int_t ring) const;
+  Int_t  GetHWAddress(Int_t sector, Int_t str, Int_t ring);
   /** Get the pad-row (or sector) corresponding to hardware address
       @param hwaddr hardware address
       @return Sector number */
@@ -92,14 +124,17 @@ public:
       @param hwaddr hardware address
       @return Ring ID as an integer */
   Int_t  GetSector(Int_t hwaddr) const;
+  /** Print map to standard out 
+      @param option Option string (hw, or det) */
+  void Print(Option_t* option="hw") const;
 protected:
   /** Read map from file - not used 
       @return @c true on success */
   virtual Bool_t ReadMapping();
-  /** Clear map in memory */
-  virtual void   DeleteMappingArrays();
+  /** Create the inverse mapping arrays */
+  virtual Bool_t CreateInvMapping();
   
-  ClassDef(AliFMDAltroMapping, 1) // Read raw FMD Altro data 
+  ClassDef(AliFMDAltroMapping, 2) // Read raw FMD Altro data 
 };
 
 #endif