]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/AliFMDIndex.cxx
Update
[u/mrichter/AliRoot.git] / FMD / AliFMDIndex.cxx
index 799a3d3757adcb2b108c6b58da693c708dcb40bb..062009e8379018a56213d2e03a24a82a229dab9c 100644 (file)
@@ -38,6 +38,8 @@
 #include <AliFMDMap.h>
 
 //====================================================================
+using std::cout;
+using std::flush;
 ClassImp(AliFMDIndex)
 #if 0
   ; // This is here to keep Emacs from indenting the next line
@@ -49,8 +51,11 @@ AliFMDIndex::AliFMDIndex()
     fRing('\0'), 
     fSector(0), 
     fStrip(0), 
-    fHash(-1)
-{}
+    fName(""),
+    fHash(-1) 
+{
+  // CTOR
+}
 
 //____________________________________________________________________
 AliFMDIndex::AliFMDIndex(const AliFMDIndex& o)
@@ -58,6 +63,7 @@ AliFMDIndex::AliFMDIndex(const AliFMDIndex& o)
     fRing(o.fRing), 
     fSector(o.fSector), 
     fStrip(o.fStrip), 
+    fName(""),
     fHash(o.fHash)
 {
   // Copy constructor 
@@ -72,6 +78,7 @@ AliFMDIndex::AliFMDIndex(UShort_t detector,
     fRing(ring), 
     fSector(sector), 
     fStrip(strip), 
+    fName(""),
     fHash(-1)
 {
   //
@@ -90,6 +97,7 @@ AliFMDIndex&
 AliFMDIndex::operator=(const AliFMDIndex& o)
 {
   // Assignment operator 
+  if (&o == this) return *this; 
   fDetector = o.fDetector;
   fRing     = o.fRing;
   fSector   = o.fSector;
@@ -102,6 +110,7 @@ AliFMDIndex::operator=(const AliFMDIndex& o)
 Int_t
 AliFMDIndex::Hash() const 
 {
+  // calculate hash value 
   if (fHash < 0) {
     size_t ringi = (fRing == 'I' ||  fRing == 'i' ? 0 : 1);
     fHash = (fStrip + 
@@ -125,6 +134,7 @@ AliFMDIndex::Print(Option_t* /* option*/) const
 const char*
 AliFMDIndex::Name() const 
 { 
+  // GEt the name of the index 
   if (fName.IsNull()) 
     fName = Form("FMD%d%c[%2d,%3d]", fDetector, fRing, fSector, fStrip);
   return fName.Data();
@@ -140,6 +150,7 @@ ClassImp(AliFMDObjIndex)
 Int_t 
 AliFMDObjIndex::Compare(const TObject* o) const
 {
+  // Compare to another index 
   const AliFMDObjIndex* a = dynamic_cast<const AliFMDObjIndex*>(o);
   if (!a) {
     Fatal("Compare",