]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/AliFMDUShortMap.h
less log
[u/mrichter/AliRoot.git] / FMD / AliFMDUShortMap.h
index 1ee4a28c42568a18f058c9c971899252f72f31d0..48d4398d1b2b86499c8c2ef6071d2ad091fdee42 100644 (file)
@@ -5,6 +5,14 @@
  *
  * See cxx source for full Copyright notice                               
  */
+/** @file    AliFMDUShortMap.h
+    @author  Christian Holm Christensen <cholm@nbi.dk>
+    @date    Mon Mar 27 12:48:18 2006
+    @brief   Per strip of unisgned shorts (16 bit) data 
+*/
+// Map of an integer per strip
+// This class stores one short unsigned integer (16 bits) per strip in
+// the FMD detectors. 
 #ifndef ALIFMDMAP_H
 # include "AliFMDMap.h"
 #endif 
@@ -19,15 +27,17 @@ public:
   /** Copy constructor 
       @param other Object to copy from.  */
   AliFMDUShortMap(const AliFMDUShortMap& other);
+  /** Constructor */
+  AliFMDUShortMap();
   /** Constructor 
       @param maxDet  Number of detectors (3)
       @param maxRing Number of rings (2)
       @param maxSec  Number of sectors (40)
       @param maxStr  Number of strips (20) */
-  AliFMDUShortMap(size_t maxDet = kMaxDetectors, 
-                 size_t maxRing= kMaxRings, 
-                 size_t maxSec = kMaxSectors, 
-                 size_t maxStr = kMaxStrips);
+  AliFMDUShortMap(UShort_t maxDet,
+                 UShort_t maxRing= kMaxRings, 
+                 UShort_t maxSec = kMaxSectors, 
+                 UShort_t maxStr = kMaxStrips);
   /** Destructor */
   virtual ~AliFMDUShortMap() { delete [] fData; }
   /** Assignment operator 
@@ -35,32 +45,42 @@ public:
       @return reference to this object.  */
   AliFMDUShortMap& operator=(const AliFMDUShortMap& other);
   /** Reset to value 
-      @param v Value to reset from */
+      @param val Value to reset from */
   virtual void Reset(const UShort_t& val=UShort_t());
   /** Access operator 
-      @param det   Detector 
-      @param ring  Ring 
-      @param sec   Sector  
-      @param str   Strip
+      @param detector Detector 
+      @param ring     Ring 
+      @param sector   Sector  
+      @param strip    Strip
       @return  reference value stored for the strip */
   virtual UShort_t& operator()(UShort_t detector, 
                               Char_t   ring, 
                               UShort_t sector, 
                               UShort_t strip);
   /** Access operator 
-      @param det   Detector 
-      @param ring  Ring 
-      @param sec   Sector  
-      @param str   Strip
+      @param detector Detector 
+      @param ring     Ring 
+      @param sector   Sector  
+      @param strip    Strip
       @return  value stored for the strip */
   virtual const UShort_t& operator()(UShort_t detector, 
                                     Char_t   ring, 
                                     UShort_t sector, 
                                     UShort_t strip) const;
  protected:
-  size_t    fTotal; // Total number of entries 
+  Int_t     MaxIndex()            const { return fTotal; }
+  UShort_t  AtAsUShort(Int_t idx) const { return fData[idx]; }
+  UShort_t& AtAsUShort(Int_t idx)       { return fData[idx]; }
+  Int_t     AtAsInt(Int_t idx)    const { return fData[idx]; }
+  Float_t   AtAsFloat(Int_t idx)  const { return fData[idx]; }
+  Bool_t    AtAsBool(Int_t idx)   const { return fData[idx]!=0?kTRUE:kFALSE; }
+  Int_t&    AtAsInt(Int_t idx)          { return AliFMDMap::AtAsInt(idx);    }
+  Float_t&  AtAsFloat(Int_t idx)        { return AliFMDMap::AtAsFloat(idx);  }
+  Bool_t&   AtAsBool(Int_t idx)         { return AliFMDMap::AtAsBool(idx); }
+  Bool_t    IsUShort()            const { return kTRUE; }  
+  Int_t     fTotal; // Total number of entries 
   UShort_t* fData;  // [fTotal] The data 
-  ClassDef(AliFMDUShortMap, 2) // Cache of edep,hit information per strip
+  ClassDef(AliFMDUShortMap, 3) // Cache of edep,hit information per strip
 };
 
 #endif