]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/AliFMDParameters.h
CSP registers depend of FEE firmware, not RCU firmware
[u/mrichter/AliRoot.git] / FMD / AliFMDParameters.h
index 3eec5d5ec3dd9e09a1974c2c2354864cf94abc58..0a48809dafbf56131e80f404368bd1455068f05d 100644 (file)
@@ -113,7 +113,7 @@ public:
   void Init(AliFMDPreprocessor* pp, 
            Bool_t forceReInit=kFALSE, 
            UInt_t what = (kPulseGain|kPedestal|kDeadMap|kSampleRate|
-                          kZeroSuppression|kAltroMap));
+                          kZeroSuppression|kAltroMap|kStripRange));
   /** Print all parameters. 
       @param option Option string */
   void Print(Option_t* option="A") const;
@@ -146,6 +146,15 @@ public:
   void SetChannelsPerAltro(UShort_t size=128) { fChannelsPerAltro = size; }
   /** @param f Factor to use for accepting a signal. */
   void SetPedestalFactor(Float_t f=3)         { fPedestalFactor = f; }
+  /** @param n Number of pre-samples to keep during zero-suppression -
+      only used in simulation. */
+  void SetZSPreSamples(UShort_t n=1) { fZSPre = (n & 0x3); }
+  /** @param n Number of post-samples to keep during zero-suppression -
+      only used in simulation. */
+  void SetZSPostSamples(UShort_t n=1) { fZSPost = (n & 0x3); }
+  /** @param use If true, do pedestal subtraction before zero
+      suppression - only used in simulation */
+  void SetZSPedSubtract(Bool_t use=kTRUE) { fZSPedSubtract = use; }
   /** @} */
 
   /** @{ */
@@ -182,12 +191,23 @@ public:
   UShort_t GetChannelsPerAltro()     const { return fChannelsPerAltro; }
   /** @return The average energy deposited by one MIP */
   Float_t  GetEdepMip()              const;
+  /** @return The conversion factor from DAC to ADC */
+  Float_t  GetDACPerMIP()              const;
   /** @return The factor used of signal acceptance */
   Float_t  GetPedestalFactor()      const { return fPedestalFactor; }
+  /** @param n Number of pre-samples to keep during zero-suppression -
+      only used in simulation. */
+  UShort_t GetZSPreSamples() const { return fZSPre; }
+  /** @param n Number of post-samples to keep during zero-suppression -
+      only used in simulation. */
+  UShort_t GetZSPostSamples() const { return fZSPost; }
+  /** @param use If true, do pedestal subtraction before zero
+      suppression - only used in simulation */
+  Bool_t IsZSPedSubtract() const { return fZSPedSubtract; }
   /** @} */
 
   /** @{ */
-  /** @name Get variable parameters */
+  /** @name Various varible conditions */
   /** Whether the strip is considered dead
       @param detector Detector # (1-3)
       @param ring     Ring ID ('I' or 'O')
@@ -280,6 +300,44 @@ public:
                         Char_t, 
                         UShort_t, 
                         UShort_t) const { return 14+5; }
+  /** @} */
+  
+  /** @{ 
+      @name Hardware to detector translation (and inverse) */
+  /** 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 timebin    Timebin 
+      @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 #
+      @param sam        On return, the sample number for this strip
+      @return @c true on success, false otherwise */
+  Bool_t Hardware2Detector(UShort_t    ddl,        UShort_t    board, 
+                          UShort_t    altro,      UShort_t    chan,
+                          UShort_t  timebin,   
+                          UShort_t& det,        Char_t&   ring, 
+                          UShort_t& sec,        Short_t& str,
+                          UShort_t& sam) const;
+  /** Map a hardware address into a detector index. 
+      @param ddl        Hardware DDL number 
+      @param hwaddr     Hardware address.  
+      @param timebin    Timebin 
+      @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 #
+      @param sam        On return, the sample number for this strip
+      @return @c true on success, false otherwise */
+  Bool_t Hardware2Detector(UShort_t    ddl,        UShort_t    hwaddr, 
+                          UShort_t  timebin,    
+                          UShort_t& det,        Char_t&   ring, 
+                          UShort_t& sec,        Short_t& str,
+                          UShort_t& sam) const;
+#if 0
   /** Translate hardware address to detector coordinates 
       @param ddl      DDL number 
       @param board    Board address
@@ -290,10 +348,10 @@ public:
       @param sec      On return, Sector number (0-39)
       @param str      On return, Strip number (0-511)
       @return @c true on success. */
-  Bool_t   Hardware2Detector(UInt_t ddl,    UInt_t    board, 
-                            UInt_t chip,   UInt_t    channel, 
+  Bool_t   Hardware2Detector(UShort_t ddl,    UShort_t    board, 
+                            UShort_t chip,   UShort_t    channel, 
                             UShort_t& det, Char_t&   ring, 
-                            UShort_t& sec, UShort_t& str) const;
+                            UShort_t& sec, Short_t& str) const;
   /** Translate hardware address to detector coordinates 
       @param ddl      DDL number 
       @param addr     Hardware address
@@ -302,9 +360,44 @@ public:
       @param sec      On return, Sector number (0-39)
       @param str      On return, Strip number (0-511)
       @return @c true on success. */
-  Bool_t   Hardware2Detector(UInt_t ddl, UInt_t addr, UShort_t& det,
-                            Char_t& ring, UShort_t& sec, UShort_t& str) const;
+  Bool_t   Hardware2Detector(UShort_t ddl, UShort_t addr, UShort_t& det,
+                            Char_t& ring, UShort_t& sec, Short_t& str) const;
+#endif
 
+  /** 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 sam         The sample number 
+      @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)
+      @param timebin     On return, the timebin 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,
+                          UShort_t  sam, 
+                          UShort_t&   ddl,        UShort_t&   board, 
+                          UShort_t&   altro,      UShort_t&   channel, 
+                          UShort_t& timebin) 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 sam         The sample number 
+      @param ddl         On return, hardware DDL number 
+      @param hwaddr      On return, hardware address.  
+      @param timebin     On return, the timebin 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,
+                          UShort_t  sam, 
+                          UShort_t&   ddl,        UShort_t&   hwaddr, 
+                          UShort_t& timebin) const;
+#if 0
   /** Translate detector coordinates to hardware address 
       @param det      Detector # (1-3)
       @param ring     Ring ID ('I' or 'O')
@@ -317,8 +410,8 @@ public:
       @return @c true on success. */
   Bool_t   Detector2Hardware(UShort_t det, Char_t ring, 
                             UShort_t sec, UShort_t str, 
-                            UInt_t& ddl,  UInt_t& board,
-                            UInt_t& chip, UInt_t& channel) const;
+                            UShort_t& ddl,  UShort_t& board,
+                            UShort_t& chip, UShort_t& channel) const;
   /** Translate detector coordinates to hardware address 
       @param det      Detector # (1-3)
       @param ring     Ring ID ('I' or 'O')
@@ -328,7 +421,8 @@ public:
       @param addr     On return, Hardware address
       @return @c true on success. */
   Bool_t   Detector2Hardware(UShort_t det, Char_t ring, UShort_t sec, 
-                            UShort_t str, UInt_t& ddl, UInt_t& addr) const;
+                            UShort_t str, UShort_t& ddl, UShort_t& addr) const;
+#endif
   /** Get the map that translates hardware to detector coordinates 
       @return Get the map that translates hardware to detector
       coordinates */ 
@@ -362,6 +456,9 @@ protected:
       fAltroChannelSize(o.fAltroChannelSize),
       fChannelsPerAltro(o.fChannelsPerAltro),
       fPedestalFactor(o.fPedestalFactor),
+      fZSPre(o.fZSPre),
+      fZSPost(o.fZSPost),
+      fZSPedSubtract(o.fZSPedSubtract),
       fFixedPedestal(o.fFixedPedestal),
       fFixedPedestalWidth(o.fFixedPedestalWidth),
       fFixedZeroSuppression(o.fFixedZeroSuppression),
@@ -424,6 +521,9 @@ protected:
   UShort_t        fAltroChannelSize;         // Largest # to store in 1 ADC ch.
   UShort_t        fChannelsPerAltro;         // Number of pre-amp. chan/adc chan.
   Float_t         fPedestalFactor;           // Number of pedestal widths
+  UShort_t        fZSPre;                    // Number of pre-samples in ZS
+  UShort_t        fZSPost;                   // Number of post-samples in ZS
+  Bool_t          fZSPedSubtract;            // Pedestal subtraction before ZS
 
   Float_t         fFixedPedestal;            // Pedestal to subtract
   Float_t         fFixedPedestalWidth;       // Width of pedestal