]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Replacing non-portable size_t by UShort_t (Christian)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 27 Oct 2006 07:52:44 +0000 (07:52 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 27 Oct 2006 07:52:44 +0000 (07:52 +0000)
STEER/AliESDFMD.cxx
STEER/AliESDFMD.h
STEER/AliFMDMap.cxx
STEER/AliFMDMap.h

index 49f49a2c5c9b6d5422c54d014bc4fa5a4dce5310..61f5a68f4480803d615b5c8ea046143e9c438767 100755 (executable)
@@ -136,13 +136,13 @@ AliESDFMD::Print(Option_t* /* option*/) const
 {
   // Print all information to standard output. 
   std::cout << "AliESDFMD:" << std::endl;
-  for (size_t det = 1; det <= fMultiplicity.MaxDetectors(); det++) {
-    for (size_t ir = 0; ir < fMultiplicity.MaxRings(); ir++) {
+  for (UShort_t det = 1; det <= fMultiplicity.MaxDetectors(); det++) {
+    for (UShort_t ir = 0; ir < fMultiplicity.MaxRings(); ir++) {
       Char_t ring = (ir == 0 ? 'I' : 'O');
       std::cout << "FMD" << det << ring << ":" << std::endl;
-      for  (size_t sec = 0; sec < fMultiplicity.MaxSectors(); sec++) {
+      for  (UShort_t sec = 0; sec < fMultiplicity.MaxSectors(); sec++) {
        std::cout << " Sector # " << sec << ":" << std::flush;
-       for (size_t str = 0; str < fMultiplicity.MaxStrips(); str++) {
+       for (UShort_t str = 0; str < fMultiplicity.MaxStrips(); str++) {
          if (str % 6 == 0) std::cout << "\n  " << std::flush;
          Float_t m = fMultiplicity(det, ring, sec, str);
          Float_t e = fEta(det, ring, 0, str);
index d8b0a7ced6c104ffd512e51401193a2354643a9d..e2431c51bafe2a0db66980f88865919fa4af7c5b 100755 (executable)
@@ -41,10 +41,10 @@ public:
              UShort_t sector, UShort_t strip, 
              Float_t mult);
 
-  size_t MaxDetectors() const { return fMultiplicity.MaxDetectors(); }
-  size_t MaxRings()     const { return fMultiplicity.MaxRings(); }
-  size_t MaxSectors()   const { return fMultiplicity.MaxSectors(); }
-  size_t MaxStrips()    const { return fMultiplicity.MaxStrips(); }
+  UShort_t MaxDetectors() const { return fMultiplicity.MaxDetectors(); }
+  UShort_t MaxRings()     const { return fMultiplicity.MaxRings(); }
+  UShort_t MaxSectors()   const { return fMultiplicity.MaxSectors(); }
+  UShort_t MaxStrips()    const { return fMultiplicity.MaxStrips(); }
   void Print(Option_t* option="") const;
   enum {
     kInvalidMult = 1000
@@ -56,7 +56,7 @@ protected:
   AliFMDFloatMap fMultiplicity; // Psuedo multplicity per strip
   AliFMDFloatMap fEta;          // Psuedo-rapidity per strip
   
-  ClassDef(AliESDFMD,1)  // ESD info from FMD
+  ClassDef(AliESDFMD,2)  // ESD info from FMD
 };
 #endif
 //____________________________________________________________________
index f5b0406993b5ed643ee151869b72a5e851815e19..06d2ca153b71da98bac67a8e5ef241a5eb372f09 100755 (executable)
@@ -33,10 +33,10 @@ ClassImp(AliFMDMap)
 #endif
 
 //____________________________________________________________________
-AliFMDMap::AliFMDMap(size_t maxDet, 
-                    size_t maxRing, 
-                    size_t maxSec, 
-                    size_t maxStr)
+AliFMDMap::AliFMDMap(UShort_t maxDet, 
+                    UShort_t maxRing, 
+                    UShort_t maxSec, 
+                    UShort_t maxStr)
   : fMaxDetectors(maxDet), 
     fMaxRings(maxRing), 
     fMaxSectors(maxSec), 
@@ -53,13 +53,13 @@ AliFMDMap::AliFMDMap(size_t maxDet,
 
 //____________________________________________________________________
 Int_t 
-AliFMDMap::CheckIndex(size_t det, Char_t ring, size_t sec, size_t str) const
+AliFMDMap::CheckIndex(UShort_t det, Char_t ring, UShort_t sec, UShort_t str) const
 {
   // Check that the index supplied is OK.   Returns true index, or -1
   // on error. 
   if (det < 1) return -1;
-  size_t ringi = (ring == 'I' ||  ring == 'i' ? 0 : 1);
-  size_t idx = 
+  UShort_t ringi = (ring == 'I' ||  ring == 'i' ? 0 : 1);
+  UShort_t idx = 
     (str + fMaxStrips * (sec + fMaxSectors * (ringi + fMaxRings * (det-1))));
   if (idx >= fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips) return -1;
   return idx;
@@ -67,8 +67,8 @@ AliFMDMap::CheckIndex(size_t det, Char_t ring, size_t sec, size_t str) const
 
     
 //____________________________________________________________________
-size_t 
-AliFMDMap::CalcIndex(size_t det, Char_t ring, size_t sec, size_t str) const
+UShort_t 
+AliFMDMap::CalcIndex(UShort_t det, Char_t ring, UShort_t sec, UShort_t str) const
 {
   // Calculate index into storage from arguments. 
   // 
@@ -82,7 +82,7 @@ AliFMDMap::CalcIndex(size_t det, Char_t ring, size_t sec, size_t str) const
   //
   Int_t idx = CheckIndex(det, ring, sec, str);
   if (idx < 0) {
-    size_t ringi = (ring == 'I' ||  ring == 'i' ? 0 : 1);
+    UShort_t ringi = (ring == 'I' ||  ring == 'i' ? 0 : 1);
     AliFatal(Form("Index (%d,'%c',%d,%d) out of bounds, "
                  "in particular the %s index ", 
                  det, ring, sec, str, 
@@ -91,7 +91,7 @@ AliFMDMap::CalcIndex(size_t det, Char_t ring, size_t sec, size_t str) const
                    (sec >= fMaxSectors ? "Sector" : "Strip")))));
     return 0;
   }
-  return size_t(idx);
+  return UShort_t(idx);
 }
 
 
index 83dc57ef7bc01f53d93e70104aa8636ea1853663..7bcf4342ffeac35e147cb4abc91e52f94f98a3c3 100755 (executable)
@@ -23,23 +23,25 @@ public:
     kMaxSectors   = 40, 
     kMaxStrips    = 512
   };
-  AliFMDMap(size_t maxDet = kMaxDetectors, 
-           size_t maxRing= kMaxRings, 
-           size_t maxSec = kMaxSectors, 
-           size_t maxStr = kMaxStrips);
+  AliFMDMap(UShort_t maxDet = kMaxDetectors, 
+           UShort_t maxRing= kMaxRings, 
+           UShort_t maxSec = kMaxSectors, 
+           UShort_t maxStr = kMaxStrips);
   virtual ~AliFMDMap() {}
-  size_t MaxDetectors() const { return fMaxDetectors; }
-  size_t MaxRings()     const { return fMaxRings; }
-  size_t MaxSectors()   const { return fMaxSectors; }
-  size_t MaxStrips()    const { return fMaxStrips; }
-  Int_t  CheckIndex(size_t det, Char_t ring, size_t sec, size_t str) const;
+  UShort_t MaxDetectors() const { return fMaxDetectors; }
+  UShort_t MaxRings()     const { return fMaxRings; }
+  UShort_t MaxSectors()   const { return fMaxSectors; }
+  UShort_t MaxStrips()    const { return fMaxStrips; }
+  Int_t  CheckIndex(UShort_t det, Char_t ring, 
+                   UShort_t sec, UShort_t str) const;
 protected:
-  size_t CalcIndex(size_t det, Char_t ring, size_t sec, size_t str) const;
-  size_t fMaxDetectors;             // Maximum # of detectors
-  size_t fMaxRings;                 // Maximum # of rings
-  size_t fMaxSectors;               // Maximum # of sectors
-  size_t fMaxStrips;                // Maximum # of strips
-  ClassDef(AliFMDMap, 1) // Cache of per strip information
+  UShort_t CalcIndex(UShort_t det, Char_t ring, 
+                    UShort_t sec, UShort_t str) const;
+  UShort_t fMaxDetectors;             // Maximum # of detectors
+  UShort_t fMaxRings;                 // Maximum # of rings
+  UShort_t fMaxSectors;               // Maximum # of sectors
+  UShort_t fMaxStrips;                // Maximum # of strips
+  ClassDef(AliFMDMap, 2) // Cache of per strip information
 };
 
 #ifdef  MAY_USE_TEMPLATES
@@ -51,10 +53,10 @@ protected:
 // Class template for classes that cache per strip information.  
 // Access to the data goes via 
 //
-//   Type& AliFMDMap<Type>::operator()(size_t detector,
+//   Type& AliFMDMap<Type>::operator()(UShort_t detector,
 //                                     Char_t ring, 
-//                                     size_t sector,
-//                                     size_t strip);
+//                                     UShort_t sector,
+//                                     UShort_t strip);
 // 
 // (as well as a const version of this member function). 
 // The elements can be reset to the default value by calling 
@@ -64,21 +66,23 @@ template <typename Type>
 class AliFMDMap : public TObject 
 {
 public:
-  AliFMDMap(size_t maxDet=3, size_t maxRing=2, size_t maxSec=40, 
-           size_t maxStr=512);
+  AliFMDMap(UShort_t maxDet=3, UShort_t maxRing=2, UShort_t maxSec=40, 
+           UShort_t maxStr=512);
   virtual ~AliFMDMap() {}
   void Clear(const Type& val=Type());
-  Type& operator()(size_t det, Char_t ring, size_t sec, size_t str);
-  const Type& operator()(size_t det, Char_t ring, size_t sec, size_t str)const;
+  Type& operator()(UShort_t det, Char_t ring, UShort_t sec, UShort_t str);
+  const Type& operator()(UShort_t det, Char_t ring, 
+                        UShort_t sec, UShort_t str)const;
 private:
   typedef std::vector<Type> ValueVector; // Type of container
   ValueVector fValues;                   // Contained values
-  size_t      fMaxDetectors;             // Maximum # of detectors
-  size_t      fMaxRings;                 // Maximum # of rings
-  size_t      fMaxSectors;               // Maximum # of sectors
-  size_t      fMaxStrips;                // Maximum # of strips
+  UShort_t      fMaxDetectors;             // Maximum # of detectors
+  UShort_t      fMaxRings;                 // Maximum # of rings
+  UShort_t      fMaxSectors;               // Maximum # of sectors
+  UShort_t      fMaxStrips;                // Maximum # of strips
   
-  size_t CalcIndex(size_t det, Char_t ring, size_t sec, size_t str) const;
+  UShort_t CalcIndex(UShort_t det, Char_t ring, 
+                    UShort_t sec, UShort_t str) const;
   ClassDef(AliFMDMap, 0); // Map of FMD index's to values 
 };
 
@@ -86,10 +90,10 @@ private:
 //____________________________________________________________________
 template <typename Type>
 inline 
-AliFMDMap<Type>::AliFMDMap(size_t maxDet, 
-                          size_t maxRing, 
-                          size_t maxSec, 
-                          size_t maxStr)
+AliFMDMap<Type>::AliFMDMap(UShort_t maxDet, 
+                          UShort_t maxRing, 
+                          UShort_t maxSec, 
+                          UShort_t maxStr)
   : fValues(maxDet * maxRing * maxSec * maxStr), 
     fMaxDetectors(maxDet), 
     fMaxRings(maxRing), 
@@ -108,8 +112,9 @@ AliFMDMap<Type>::AliFMDMap(size_t maxDet,
 
 //____________________________________________________________________
 template <typename Type>
-inline size_t 
-AliFMDMap<Type>::CalcIndex(size_t det, Char_t ring, size_t sec, size_t str) const
+inline UShort_t 
+AliFMDMap<Type>::CalcIndex(UShort_t det, Char_t ring, 
+                          UShort_t sec, UShort_t str) const
 {
   // Calculate index into storage from arguments. 
   // 
@@ -121,8 +126,8 @@ AliFMDMap<Type>::CalcIndex(size_t det, Char_t ring, size_t sec, size_t str) cons
   //
   // Returns appropriate index into storage 
   //
-  size_t ringi = (ring == 'I' ||  ring == 'i' ? 0 : 1);
-  size_t idx = 
+  UShort_t ringi = (ring == 'I' ||  ring == 'i' ? 0 : 1);
+  UShort_t idx = 
     (det + fMaxDetectors * (ringi + fMaxRings * (sec + fMaxSectors * str)));
   if (idx >= fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips) {
     Fatal("CalcIndex", "Index (%d,'%c',%d,%d) out of bounds, "
@@ -142,13 +147,14 @@ inline void
 AliFMDMap<Type>::Clear(const Type& val) 
 {
   // Resets stored values to the default value for that type 
-  for (size_t i = 0; i < fValues.size(); ++i) fValues[i] = val;
+  for (UShort_t i = 0; i < fValues.size(); ++i) fValues[i] = val;
 }
 
 //____________________________________________________________________
 template <typename Type>
 inline Type& 
-AliFMDMap<Type>::operator()(size_t det, Char_t ring, size_t sec, size_t str)
+AliFMDMap<Type>::operator()(UShort_t det, Char_t ring, 
+                           UShort_t sec, UShort_t str)
 {
   // Parameters: 
   //     det       Detector #
@@ -163,10 +169,10 @@ AliFMDMap<Type>::operator()(size_t det, Char_t ring, size_t sec, size_t str)
 //____________________________________________________________________
 template <typename Type>
 inline const Type& 
-AliFMDMap<Type>::operator()(size_t det, 
+AliFMDMap<Type>::operator()(UShort_t det, 
                            Char_t ring, 
-                           size_t sec, 
-                           size_t str) const
+                           UShort_t sec, 
+                           UShort_t str) const
 {
   // Parameters: 
   //     det       Detector #