]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliFMDFloatMap.cxx
Change of naiming convention
[u/mrichter/AliRoot.git] / STEER / AliFMDFloatMap.cxx
index 5251a30ce2f897bd24feb4c635af61d2f6fc6b68..859dd7fb7493f2ec680546d3424dcb127e307220 100755 (executable)
 //__________________________________________________________
 // 
 // Map of per strip Float_t information
+// the floats are indexed by the coordinates 
+//     DETECTOR # (1-3)
+//     RING ID    ('I' or 'O', any case)
+//     SECTOR #   (0-39)
+//     STRIP #    (0-511)
+//
 // 
 // Created Mon Nov  8 12:51:51 2004 by Christian Holm Christensen
 // 
@@ -33,22 +39,22 @@ AliFMDFloatMap::AliFMDFloatMap(const AliFMDFloatMap& other)
               other.fMaxRings,
               other.fMaxSectors,
               other.fMaxStrips),
-    fData(0)
+    fTotal(fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips),
+    fData(new Float_t[fTotal])
 {
   // Copy constructor
-  fData = new Float_t[fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips];
-  for (size_t i = 0; i < fMaxDetectors * fMaxRings 
-        * fMaxSectors * fMaxStrips; i++)
+  for (Int_t i = 0; i < fTotal; i++)
     fData[i] = other.fData[i];
 }
 
 //__________________________________________________________
-AliFMDFloatMap::AliFMDFloatMap(size_t maxDet,
-                              size_t maxRing,
-                              size_t maxSec,
-                              size_t maxStr)
+AliFMDFloatMap::AliFMDFloatMap(Int_t maxDet,
+                              Int_t maxRing,
+                              Int_t maxSec,
+                              Int_t maxStr)
   : AliFMDMap(maxDet, maxRing, maxSec, maxStr),
-    fData(0)
+    fTotal(fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips),
+    fData(new Float_t[fTotal])
 {
   // Constructor.
   // Parameters:
@@ -56,7 +62,6 @@ AliFMDFloatMap::AliFMDFloatMap(size_t maxDet,
   //   maxRing Maximum number of rings per detector
   //   maxSec  Maximum number of sectors per ring
   //   maxStr  Maximum number of strips per sector
-  fData = new Float_t[fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips];
   Reset();
 }
 
@@ -69,11 +74,10 @@ AliFMDFloatMap::operator=(const AliFMDFloatMap& other)
   fMaxRings     = other.fMaxRings;
   fMaxSectors   = other.fMaxSectors;
   fMaxStrips    = other.fMaxStrips;
+  fTotal        = fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
   if (fData) delete [] fData;
-  fData = new Float_t[fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips];
-  for (size_t i = 0; i < fMaxDetectors * fMaxRings 
-        * fMaxSectors * fMaxStrips; i++)
-    fData[i] = other.fData[i];
+  fData = new Float_t[fTotal];
+  for (Int_t i = 0; i < fTotal; i++) fData[i] = other.fData[i];
   return *this;
 }
 
@@ -82,9 +86,7 @@ void
 AliFMDFloatMap::Reset(const Float_t& val)
 {
   // Reset map to val
-  for (size_t i = 0; i < fMaxDetectors * fMaxRings 
-        * fMaxSectors * fMaxStrips; i++)
-    fData[i] = val;
+  for (Int_t i = 0; i < fTotal; i++) fData[i] = val;
 }
 
 //__________________________________________________________