]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/AliFMDDigit.h
extra bit for TPC and Global constrained flagging
[u/mrichter/AliRoot.git] / FMD / AliFMDDigit.h
index da905fbda17e4a9581f42ec7fb532bea5e830dcd..5168476ffb83551e46c4145d48d79b1b888b0f57 100644 (file)
 #ifndef ALIFMDBASEDIGIT_H
 # include <AliFMDBaseDigit.h>
 #endif
+#ifndef ROOT_TArrayI
+# include <TArrayI.h>
+#endif
+
 
 //____________________________________________________________________
 /** @class AliFMDDigit AliFMDDigit.h <FMD/AliFMDDigit.h>
@@ -26,46 +30,97 @@ class AliFMDDigit : public AliFMDBaseDigit
 public:
   /** CTOR */
   AliFMDDigit();
-  /** Constrctor 
-      @param detector Detector 
-      @param ring     Ring
-      @param sector   Sector
-      @param strip    Strip 
-      @param count    ADC (first sample)
-      @param count2   ADC (second sample, or -1 if not used)
-      @param count3   ADC (third sample, or -1 if not used) */
-  AliFMDDigit(UShort_t detector, 
-             Char_t   ring='\0', 
-             UShort_t sector=0, 
-             UShort_t strip=0, 
-             UShort_t count=0, 
-             Short_t  count2=-1, 
-             Short_t  count3=-1, 
-             Short_t  count4=-1);
-  /** DTOR */
+  /** 
+   * Constrctor 
+   *
+   * @param detector Detector 
+   * @param ring     Ring
+   * @param sector   Sector
+   * @param strip    Strip 
+   * @param count    ADC (first sample)
+   * @param count2   ADC (second sample, or -1 if not used)
+   * @param count3   ADC (third sample, or -1 if not used) 
+   * @param refs     Track references
+   */
+  AliFMDDigit(UShort_t       detector, 
+             Char_t         ring='\0', 
+             UShort_t       sector=0, 
+             UShort_t       strip=0, 
+             UShort_t       count=0, 
+             Short_t        count2=-1, 
+             Short_t        count3=-1, 
+             Short_t        count4=-1, 
+             UShort_t       nrefs=0,
+             const Int_t*   refs=0);
+  /** 
+   * DTOR 
+   */
   virtual ~AliFMDDigit() {}
-  /** @param i # of sample to get 
-      @return sample # @a i */
+  /** 
+   * @param i # of sample to get 
+   * 
+   * @return sample # @a i 
+   */
   Int_t Count(UShort_t i=0) const;
-  /** @return ADC count (first sample) */
-  UShort_t Count1()                const { return fCount1;   }
-  /** @return ADC count (second sample, or -1 if not used) */
-  Short_t  Count2()                const { return fCount2;   }
-  /** @return ADC count (third sample, or -1 if not used) */
-  Short_t  Count3()                const { return fCount3;   }
-  /** @return ADC count (third sample, or -1 if not used) */
-  Short_t  Count4()                const { return fCount4;   }
-  /** @return Canonical ADC counts */
-  UShort_t Counts()                const;
-  /** Print info 
-      @param opt Not used */
+  /** 
+   * 
+   * @return ADC count (first sample) 
+   */
+  UShort_t Count1() const { return fCount1;   }
+  /** 
+   * 
+   * @return ADC count (second sample, or -1 if not used) 
+   */
+  Short_t  Count2() const { return fCount2;   }
+  /** 
+   * 
+   * @return ADC count (third sample, or -1 if not used) 
+   */
+  Short_t  Count3() const { return fCount3;   }
+  /** 
+   * 
+   * @return ADC count (third sample, or -1 if not used) 
+   */
+  Short_t  Count4() const { return fCount4;   }
+  /** 
+   * 
+   * @return Canonical ADC counts 
+   */
+  UShort_t Counts() const;
+  /** 
+   * Print info 
+   * 
+   * @param opt Not used 
+   */
   void     Print(Option_t* opt="") const;
-  /** @return Title */
+  /** 
+   * 
+   * @return Title 
+   */
   const char* GetTitle() const;
-  /** Set the count value 
-      @param s Sample number 
-      @param c Counts */
+  /** 
+   * Set the count value 
+   * 
+   * @param s Sample number 
+   * @param c Counts 
+   */
   void SetCount(UShort_t s, Short_t c);
+  /**
+   * Initialize all counts to appropriate values for this oversampling
+   * rate.  That is 
+   *
+   * @verbatim
+   *     Rate | Sample 1 | Sample 2 | Sample 3 | Sample 4 
+   *     -----+----------+----------+----------+----------
+   *     1    | 0        | -1       | -1       | -1
+   *     2    | 0        | 0        | -1       | -1
+   *     3    | 0        | 0        | 0        | -1
+   *     4    | 0        | 0        | 0        | 0
+   * @endverbatim
+   *
+   * @param rate Oversampling rate 
+   */
+  void SetDefaultCounts(UShort_t rate);
 protected:
   UShort_t fCount1;     // Digital signal 
   Short_t  fCount2;     // Digital signal (-1 if not used)
@@ -74,6 +129,20 @@ protected:
   ClassDef(AliFMDDigit,2)     // Normal FMD digit
 };
 
+inline void
+AliFMDDigit::SetDefaultCounts(UShort_t rate)
+{
+  switch (rate) { 
+  case 4: fCount4 = 0; // Fall through 
+  case 3: fCount3 = 0; // Fall through 
+  case 2: fCount2 = 0; // Fall through 
+  case 1: fCount1 = 0;
+    break;
+  default: 
+    fCount4 = fCount3 = fCount2 = fCount1 = 0;
+    break;
+  }
+}
 inline UShort_t 
 AliFMDDigit::Counts() const 
 {