]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliFMDFloatMap.h
The description of changes:
[u/mrichter/AliRoot.git] / STEER / AliFMDFloatMap.h
index 26f4b7d3ce2e399434d55aae723aedc1a349b73f..c9a772f5d262f13c4e02102a52dc3b855760b420 100755 (executable)
 class AliFMDFloatMap : public AliFMDMap
 {
 public:
-  AliFMDFloatMap(Int_t  maxDet = kMaxDetectors, 
-                Int_t  maxRing= kMaxRings, 
-                Int_t  maxSec = kMaxSectors, 
-                Int_t  maxStr = kMaxStrips);
+  AliFMDFloatMap();
+  AliFMDFloatMap(Int_t  maxDet, 
+                Int_t  maxRing= 0, 
+                Int_t  maxSec = 0, 
+                Int_t  maxStr = 0);
+  AliFMDFloatMap(const AliFMDMap& o);
   AliFMDFloatMap(const AliFMDFloatMap& o);
-  virtual ~AliFMDFloatMap() { delete [] fData; }
+  virtual ~AliFMDFloatMap() { delete [] fData;fData = 0; }
   AliFMDFloatMap& operator=(const AliFMDFloatMap& o);
   virtual void Reset(const Float_t& v=Float_t());
   virtual Float_t& operator()(UShort_t det,
@@ -37,12 +39,47 @@ public:
                                    UShort_t sec,
                                    UShort_t str) const;
   Float_t* Data() const { return fData; }
+  void Print(Option_t* option="%8.4f") const;
 protected:
+  Int_t    MaxIndex() const { return fTotal; }
+  Float_t  AtAsFloat(Int_t i) const { return fData[i]; } 
+  Float_t& AtAsFloat(Int_t i)       { return fData[i]; } 
+  Bool_t   IsFloat() const { return kTRUE; }
+
   Int_t   fTotal;  // Total number of entries
   Float_t* fData;   //[fTotal]
-  ClassDef(AliFMDFloatMap,2) // Map of floats
+  ClassDef(AliFMDFloatMap,3) // Map of floats
 };
 
+inline AliFMDFloatMap
+operator*(const AliFMDMap& lhs, const AliFMDMap& rhs)
+{
+  AliFMDFloatMap r(lhs);
+  r *= rhs;
+  return r;
+}
+inline AliFMDFloatMap
+operator/(const AliFMDMap& lhs, const AliFMDMap& rhs)
+{
+  AliFMDFloatMap r(lhs);
+  r /= rhs;
+  return r;
+}
+inline AliFMDFloatMap
+operator+(const AliFMDMap& lhs, const AliFMDMap& rhs)
+{
+  AliFMDFloatMap r(lhs);
+  r += rhs;
+  return r;
+}
+inline AliFMDFloatMap
+operator-(const AliFMDMap& lhs, const AliFMDMap& rhs)
+{
+  AliFMDFloatMap r(lhs);
+  r -= rhs;
+  return r;
+}
+
 #endif
 //____________________________________________________________________
 //