Made persistent
authorcholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 18 Mar 2006 14:11:45 +0000 (14:11 +0000)
committercholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 18 Mar 2006 14:11:45 +0000 (14:11 +0000)
FMD/AliFMDBoolMap.cxx
FMD/AliFMDBoolMap.h
FMD/AliFMDEdepMap.cxx
FMD/AliFMDEdepMap.h
FMD/AliFMDUShortMap.cxx
FMD/AliFMDUShortMap.h

index c3b413fd968ae9d61fe773b48e6e86c2dde0bf0c..3e72594db2ec43ae876cf176638650b9c576a2bd 100644 (file)
@@ -38,9 +38,9 @@ AliFMDBoolMap::AliFMDBoolMap(const AliFMDBoolMap& other)
     fData(0)
 {
   // Copy constructor
     fData(0)
 {
   // Copy constructor
-  fData = new Bool_t[fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips];
-  for (size_t i = 0; i < fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips; i++)
-    fData[i] = other.fData[i];
+  fTotal = fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
+  fData  = new Bool_t[fTotal];
+  for (size_t i = 0; i < fTotal; i++) fData[i] = other.fData[i];
 }
 
 //__________________________________________________________
 }
 
 //__________________________________________________________
@@ -57,7 +57,8 @@ AliFMDBoolMap::AliFMDBoolMap(size_t maxDet,
   //   maxRing Maximum number of rings per detector
   //   maxSec  Maximum number of sectors per ring
   //   maxStr  Maximum number of strips per sector
   //   maxRing Maximum number of rings per detector
   //   maxSec  Maximum number of sectors per ring
   //   maxStr  Maximum number of strips per sector
-  fData = new Bool_t[fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips];
+  fTotal = fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
+  fData  = new Bool_t[fTotal];
   Reset();
 }
 
   Reset();
 }
 
@@ -71,10 +72,9 @@ AliFMDBoolMap::operator=(const AliFMDBoolMap& other)
   fMaxSectors   = other.fMaxSectors;
   fMaxStrips    = other.fMaxStrips;
   if (fData) delete [] fData;
   fMaxSectors   = other.fMaxSectors;
   fMaxStrips    = other.fMaxStrips;
   if (fData) delete [] fData;
-  fData = new Bool_t[fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips];
-  for (size_t i = 0; i < fMaxDetectors * fMaxRings 
-        * fMaxSectors * fMaxStrips; i++)
-    fData[i] = other.fData[i];
+  fTotal = fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
+  fData  = new Bool_t[fTotal];
+  for (size_t i = 0; i < fTotal; i++) fData[i] = other.fData[i];
   return *this;
 }
 
   return *this;
 }
 
@@ -83,9 +83,7 @@ void
 AliFMDBoolMap::Reset(const Bool_t& val)
 {
   // Reset map to val
 AliFMDBoolMap::Reset(const Bool_t& val)
 {
   // Reset map to val
-  for (size_t i = 0; i < fMaxDetectors * fMaxRings 
-        * fMaxSectors * fMaxStrips; i++)
-    fData[i] = val;
+  for (size_t i = 0; i < fTotal; i++) fData[i] = val;
 }
 
 //__________________________________________________________
 }
 
 //__________________________________________________________
index 61b00e6b878f5b9802759140ba8c7728a96ccf1c..4227dd0647cfb5e08378ffc14addecde341d20f1 100644 (file)
@@ -37,8 +37,9 @@ public:
                                   UShort_t sec,
                                   UShort_t str) const;
 protected:
                                   UShort_t sec,
                                   UShort_t str) const;
 protected:
-  Bool_t* fData; // The Data
-  ClassDef(AliFMDBoolMap,1) // Map of Bool_t data per strip
+  size_t  fTotal; // Total number of entries 
+  Bool_t* fData;  // [fTotal] The Data
+  ClassDef(AliFMDBoolMap,2) // Map of Bool_t data per strip
 };
 
 #endif
 };
 
 #endif
index dea63beb2f835f145eee963d4a5b808e343f7cf4..e6872b06ef7a7a0f04bf56c912192c6cfb6bb58f 100644 (file)
@@ -34,10 +34,9 @@ AliFMDEdepMap::AliFMDEdepMap(const AliFMDEdepMap& other)
     fData(0)
 {
   // Copy constructor 
     fData(0)
 {
   // Copy constructor 
-  fData = new AliFMDEdepHitPair[fMaxDetectors * fMaxRings * 
-                               fMaxSectors * fMaxStrips];
-  for (size_t i = 0; i < fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
-       i++) fData[i] = other.fData[i];
+  fTotal = fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
+  fData  = new AliFMDEdepHitPair[fTotal];
+  for (size_t i = 0; i < fTotal; i++) fData[i] = other.fData[i];
 }
 
   
 }
 
   
@@ -57,8 +56,8 @@ AliFMDEdepMap::AliFMDEdepMap(size_t maxDet,
   //     maxRinf      Maximum # of rings
   //     maxSec       Maximum # of sectors
   //     maxStr       Maximum # of strips
   //     maxRinf      Maximum # of rings
   //     maxSec       Maximum # of sectors
   //     maxStr       Maximum # of strips
-  fData = new AliFMDEdepHitPair[fMaxDetectors * fMaxRings * 
-                               fMaxSectors * fMaxStrips];
+  fTotal = fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
+  fData  = new AliFMDEdepHitPair[fTotal];
 }
 
 //____________________________________________________________________
 }
 
 //____________________________________________________________________
@@ -71,10 +70,9 @@ AliFMDEdepMap::operator=(const AliFMDEdepMap& other)
   fMaxSectors   = other.fMaxSectors;
   fMaxStrips    = other.fMaxStrips;
   if (fData) delete [] fData;
   fMaxSectors   = other.fMaxSectors;
   fMaxStrips    = other.fMaxStrips;
   if (fData) delete [] fData;
-  fData = new AliFMDEdepHitPair[fMaxDetectors * fMaxRings * 
-                               fMaxSectors * fMaxStrips];
-  for (size_t i = 0; i < fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
-       i++) fData[i] = other.fData[i];
+  fTotal = fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
+  fData  = new AliFMDEdepHitPair[fTotal];
+  for (size_t i = 0; i < fTotal; i++) fData[i] = other.fData[i];
   return *this;
 }
 
   return *this;
 }
 
@@ -83,8 +81,10 @@ void
 AliFMDEdepMap::Reset() 
 {
   // Reset to zero
 AliFMDEdepMap::Reset() 
 {
   // Reset to zero
-  for (size_t i = 0; i < fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
-       i++) { fData[i].fEdep = 0; fData[i].fN = 0; };
+  for (size_t i = 0; i < fTotal; i++) { 
+    fData[i].fEdep = 0; 
+    fData[i].fN = 0; 
+  };
 }
 
 //____________________________________________________________________
 }
 
 //____________________________________________________________________
@@ -92,8 +92,10 @@ void
 AliFMDEdepMap::Reset(const AliFMDEdepHitPair& val) 
 {
   // Reset to val
 AliFMDEdepMap::Reset(const AliFMDEdepHitPair& val) 
 {
   // Reset to val
-  for (size_t i = 0; i < fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
-       i++) { fData[i].fEdep = val.fEdep; fData[i].fN = val.fN; };
+  for (size_t i = 0; i < fTotal; i++) { 
+    fData[i].fEdep = val.fEdep; 
+    fData[i].fN = val.fN; 
+  };
 }
 
 //____________________________________________________________________
 }
 
 //____________________________________________________________________
index e9831a1f4699ec55008b8f7663ebef27837fca84..4a634ce054fe5de9d65eb67601e8e4c268e558fc 100644 (file)
@@ -49,8 +49,9 @@ public:
                                           UShort_t sector, 
                                           UShort_t strip) const;
 protected:
                                           UShort_t sector, 
                                           UShort_t strip) const;
 protected:
-  AliFMDEdepHitPair* fData;  // The data 
-  ClassDef(AliFMDEdepMap, 1) // Cache of edep,hit information per strip
+  size_t             fTotal; //  
+  AliFMDEdepHitPair* fData;  //[fTotal] The data 
+  ClassDef(AliFMDEdepMap, 2) // Cache of edep,hit information per strip
 };
 
 #endif 
 };
 
 #endif 
index a4be648921db2487718b214b1317d48622ccfbba..62e440f1bb6bf197038f63f7ea2a485826c902bc 100644 (file)
@@ -38,9 +38,9 @@ AliFMDUShortMap::AliFMDUShortMap(const AliFMDUShortMap& other)
     fData(0)
 {
   // CTOR
     fData(0)
 {
   // CTOR
-  fData = new UShort_t[fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips];
-  for (size_t i = 0; i < fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
-       i++) fData[i] = other.fData[i];
+  fTotal = fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
+  fData  = new UShort_t[fTotal];
+  for (size_t i = 0; i < fTotal; i++) fData[i] = other.fData[i];
 }
 
   
 }
 
   
@@ -60,7 +60,8 @@ AliFMDUShortMap::AliFMDUShortMap(size_t maxDet,
   //     maxRinf      Maximum # of rings
   //     maxSec       Maximum # of sectors
   //     maxStr       Maximum # of strips
   //     maxRinf      Maximum # of rings
   //     maxSec       Maximum # of sectors
   //     maxStr       Maximum # of strips
-  fData = new UShort_t[fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips];
+  fTotal = fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
+  fData  = new UShort_t[fTotal];
 }
 
 //____________________________________________________________________
 }
 
 //____________________________________________________________________
@@ -73,9 +74,9 @@ AliFMDUShortMap::operator=(const AliFMDUShortMap& other)
   fMaxSectors   = other.fMaxSectors;
   fMaxStrips    = other.fMaxStrips;
   if (fData) delete [] fData;
   fMaxSectors   = other.fMaxSectors;
   fMaxStrips    = other.fMaxStrips;
   if (fData) delete [] fData;
-  fData = new UShort_t[fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips];
-  for (size_t i = 0; i < fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
-       i++) fData[i] = other.fData[i];
+  fTotal = fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
+  fData  = new UShort_t[fTotal];
+  for (size_t i = 0; i < fTotal; i++) fData[i] = other.fData[i];
   return *this;
 }
 
   return *this;
 }
 
@@ -84,8 +85,7 @@ void
 AliFMDUShortMap::Reset(const UShort_t& val) 
 {
   // Reset to val
 AliFMDUShortMap::Reset(const UShort_t& val) 
 {
   // Reset to val
-  for (size_t i = 0; i < fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips;
-       i++) fData[i] = val;
+  for (size_t i = 0; i < fTotal; i++) fData[i] = val;
 }
 
 //____________________________________________________________________
 }
 
 //____________________________________________________________________
index e54ef17cce11444057eaefb4e5be76088356d71f..22787c1b30d9859d8eabe30d131847d569bd9ed3 100644 (file)
@@ -34,8 +34,9 @@ public:
                                     UShort_t sector, 
                                     UShort_t strip) const;
  protected:
                                     UShort_t sector, 
                                     UShort_t strip) const;
  protected:
-  UShort_t* fData;  // The data 
-  ClassDef(AliFMDUShortMap, 1) // Cache of edep,hit information per strip
+  size_t    fTotal; // Total number of entries 
+  UShort_t* fData;  // [fTotal] The data 
+  ClassDef(AliFMDUShortMap, 2) // Cache of edep,hit information per strip
 };
 
 #endif 
 };
 
 #endif