]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/AliFMDDigit.h
New versions of the DA executables to comply with DAQ DA file naming conventions
[u/mrichter/AliRoot.git] / FMD / AliFMDDigit.h
index 167431e4669077598baa6869edc37df4f52f2def..b865d59202f2e90f7081300f38c265c32697b7e8 100644 (file)
 #ifndef ALIFMDDIGIT_H
 #define ALIFMDDIGIT_H
-
-//////////////////////////////////////////////////////////////////////
+/** @file    AliFMDDigit.h
+    @author  Christian Holm Christensen <cholm@nbi.dk>
+    @date    Mon Mar 27 12:37:41 2006
+    @brief   Digits for the FMD 
+*/
+//___________________________________________________________________
 //
-//  Digits classes for the FMD                
+//  Digits classes for the FMD
+//  AliFMDBaseDigit - base class 
+//  AliFMDDigit     - Normal (smeared) digit             
+//  AliFMDSDigit    - Summable (non-smeared) digit             
 //
-//////////////////////////////////////////////////////////////////////
-#ifndef ROOT_TObject
-# include <TObject.h>
+#ifndef ALIFMDBASEDIGIT_H
+# include <AliFMDBaseDigit.h>
 #endif
 
 //____________________________________________________________________
-class AliFMDBaseDigit : public TObject 
-{
-public: 
-  AliFMDBaseDigit();
-  AliFMDBaseDigit(UShort_t detector, 
-                 Char_t   ring='\0', 
-                 UShort_t sector=0, 
-                 UShort_t strip=0);
-  virtual ~AliFMDBaseDigit() {}
-  UShort_t     Detector()         const { return fDetector; }
-  Char_t       Ring()             const { return fRing;     }
-  UShort_t     Sector()                   const { return fSector;   }
-  UShort_t     Strip()            const { return fStrip;    }
-  virtual void Print(Option_t* opt="") const;
-
-protected:
-  UShort_t fDetector;  // (Sub) Detector # (1,2, or 3)
-  Char_t   fRing;      // Ring ID ('I' or 'O')
-  UShort_t fSector;    // Sector # (phi division)
-  UShort_t fStrip;     // Strip # (radial division)
-  ClassDef(AliFMDBaseDigit, 1) // Base class for FMD digits 
-};
-
-//____________________________________________________________________
+/** @class AliFMDDigit AliFMDDigit.h <FMD/AliFMDDigit.h>
+    @brief class for digits 
+    @ingroup FMD_base
+ */
 class AliFMDDigit : public AliFMDBaseDigit
 {
-protected:
-  UShort_t fCount1;     // Digital signal 
-  Short_t  fCount2;     // Digital signal (-1 if not used)
-  Short_t  fCount3;     // Digital signal (-1 if not used)
 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  count3=-1, 
+             Short_t  count4=-1);
+  /** DTOR */
   virtual ~AliFMDDigit() {}
+  /** @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 */
   void     Print(Option_t* opt="") const;
-  ClassDef(AliFMDDigit,1)     // Normal FMD digit
-};
-
-inline UShort_t 
-AliFMDDigit::Counts() const 
-{
-  return fCount1 
-    + (fCount2 >= 0 ? fCount2 : 0)
-    + (fCount3 >= 0 ? fCount3 : 0);
-}
-
-//____________________________________________________________________
-class AliFMDSDigit : public AliFMDBaseDigit
-{
+  /** @return Title */
+  const char* GetTitle() const;
 protected:
-  Float_t  fEdep;       // Energy deposited 
   UShort_t fCount1;     // Digital signal 
   Short_t  fCount2;     // Digital signal (-1 if not used)
   Short_t  fCount3;     // Digital signal (-1 if not used)
-public:
-  AliFMDSDigit();
-  AliFMDSDigit(UShort_t detector, 
-              Char_t   ring='\0', 
-              UShort_t sector=0, 
-              UShort_t strip=0, 
-              Float_t  edep=0,
-              UShort_t count=0, 
-              Short_t  count2=-1, 
-              Short_t  count3=-1);
-  virtual ~AliFMDSDigit() {}
-  UShort_t Count1()                const { return fCount1;   }
-  Short_t  Count2()                const { return fCount2;   }
-  Short_t  Count3()                const { return fCount3;   }
-  Float_t  Edep()                  const { return fEdep;     }
-  UShort_t Counts()                const;
-  void     Print(Option_t* opt="") const;
-  ClassDef(AliFMDSDigit,1)     // Summable FMD digit
+  Short_t  fCount4;     // Digital signal (-1 if not used)
+  ClassDef(AliFMDDigit,2)     // Normal FMD digit
 };
-  
+
 inline UShort_t 
-AliFMDSDigit::Counts() const 
+AliFMDDigit::Counts() const 
 {
-  return fCount1 
-    + (fCount2 >= 0 ? fCount2 : 0)
-    + (fCount3 >= 0 ? fCount3 : 0);
+  if (fCount4 >= 0) return fCount3;
+  if (fCount3 >= 0) return fCount2;
+  if (fCount2 >= 0) return fCount2;
+  return fCount1;
 }
 
+inline Int_t
+AliFMDDigit::Count(UShort_t i) const 
+{
+  switch (i) {
+  case 0: return fCount1;
+  case 1: return fCount2;
+  case 2: return fCount3;
+  case 3: return fCount4;
+  }
+  return -1;
+}
 
 #endif
 //____________________________________________________________________