]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/mapping/AliMpRow.cxx
Removing obsolete class (Christian)
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpRow.cxx
index dddf80cf23d119bcd88db9ba22462560b9b85f65..3ace568e4e34a2e5cc03790ef7604377ad5b75e6 100755 (executable)
@@ -4,7 +4,7 @@
 // Class AliMpRow
 // --------------
 // Class describing a row composed of the row segments.
-//
+// Included in AliRoot: 2003/05/02
 // Authors: David Guez, Ivana Hrivnacova; IPN Orsay
 
 #include <Riostream.h>
@@ -13,7 +13,8 @@
 
 #include "AliMpRow.h"
 #include "AliMpVRowSegment.h"
-#include "AliMpRowSegmentSpecial.h"
+#include "AliMpVRowSegmentSpecial.h"
+#include "AliMpRowSegmentRSpecial.h"
 #include "AliMpVMotif.h"
 #include "AliMpMotifType.h"
 #include "AliMpMotifPosition.h"
@@ -44,14 +45,42 @@ AliMpRow::AliMpRow()
 //
 }
 
+//_____________________________________________________________________________
+AliMpRow::AliMpRow(const AliMpRow& right) 
+  : AliMpVIndexed(right) {
+// 
+  Fatal("AliMpRow", "Copy constructor not provided.");
+}
+
 //_____________________________________________________________________________
 AliMpRow::~AliMpRow() {
 // 
 
+#ifdef WITH_STL
   for (Int_t i=0; i<GetNofRowSegments(); i++)
     delete fSegments[i]; 
+#endif
+
+#ifdef WITH_ROOT
+  fSegments.Delete();
+#endif
 }
 
+//
+// operators
+//
+
+//_____________________________________________________________________________
+AliMpRow&  AliMpRow::operator=(const AliMpRow& right)
+{
+  // check assignement to self
+  if (this == &right) return *this;
+
+  Fatal("operator =", "Assignement operator not provided.");
+    
+  return *this;  
+}    
+
 //
 // private methods
 //
@@ -65,12 +94,12 @@ AliMpVRowSegment*  AliMpRow::FindRowSegment(Int_t ix) const
   for (Int_t i=0; i<GetNofRowSegments(); i++) {
     AliMpVRowSegment* segment = GetRowSegment(i);
 
-    if (!dynamic_cast<AliMpRowSegmentSpecial*>(segment) &&
+    if (!dynamic_cast<AliMpVRowSegmentSpecial*>(segment) &&
          segment->GetHighIndicesLimit().GetFirst() >= ix)
         
      return segment;    
   }   
-  
+
   return 0;     
 }
 
@@ -149,7 +178,13 @@ void AliMpRow::AddRowSegment(AliMpVRowSegment* rowSegment)
 // Adds row segment at the end.
 // ---
 
+#ifdef WITH_STL
   fSegments.push_back(rowSegment);
+#endif
+
+#ifdef WITH_ROOT
+  fSegments.Add(rowSegment);
+#endif
 }  
   
 //_____________________________________________________________________________
@@ -158,7 +193,13 @@ void AliMpRow::AddRowSegmentInFront(AliMpVRowSegment* rowSegment)
 // Inserts row segment in the first vector position.
 // ---
 
+#ifdef WITH_STL
   fSegments.insert(fSegments.begin(), rowSegment);
+#endif
+
+#ifdef WITH_ROOT
+  fSegments.AddFirst(rowSegment);
+#endif
 }  
   
 //_____________________________________________________________________________
@@ -169,7 +210,14 @@ AliMpVRowSegment* AliMpRow::FindRowSegment(Double_t x) const
 // ---
 
   for (Int_t i=0; i<GetNofRowSegments(); i++) {
+
+#ifdef WITH_STL
     AliMpVRowSegment* rs = fSegments[i];
+#endif
+#ifdef WITH_ROOT
+    AliMpVRowSegment* rs = (AliMpVRowSegment*)fSegments.At(i);
+#endif
+
     if (x >= rs->LeftBorderX() && x <= rs->RightBorderX())
       return rs;
   }
@@ -236,7 +284,9 @@ void AliMpRow::SetMotifPositions()
         // special row segments)
         motifPosition->SetHighIndicesLimit(AliMpIntPair::Invalid());
 
-        Bool_t warn = (rowSegment->GetNofMotifs()==1); 
+        //Bool_t warn = (rowSegment->GetNofMotifs()==1); 
+        Bool_t warn = true;
+       if (dynamic_cast<AliMpVRowSegmentSpecial*>(rowSegment)) warn = false; 
                // supress warnings for special row segments
               // which motifs can overlap the row borders
               
@@ -271,19 +321,21 @@ void AliMpRow::SetGlobalIndices(AliMpDirection constPadSizeDirection,
            iy = rowBefore->GetHighIndicesLimit().GetSecond()+1;
          } 
         else {
-           AliMpVRowSegment* seg = rowBefore->FindRowSegment(ix);         
+           AliMpVRowSegment* seg = rowBefore->FindRowSegment(ix);      
           AliMpMotifPosition* motPos =  FindMotifPosition(seg, ix);
-           if (!motPos) 
-            Fatal("SetGlobalIndices", "Motif position in rowBefore not found.");
+          if (!dynamic_cast<AliMpRowSegmentRSpecial*>(rowSegment)) {
+             if (!motPos) 
+              Fatal("SetGlobalIndices", "Motif position in rowBefore not found.");
           
-           iy = motPos->GetHighIndicesLimit().GetSecond()+1;
+             iy = motPos->GetHighIndicesLimit().GetSecond()+1;
+          }  
          }
        } 
 
        // Set (ix, iy) to k-th motif position and update ix
        ix = rowSegment->SetIndicesToMotifPosition(k, AliMpIntPair(ix, iy));               
     }
-    rowSegment->SetGlobalIndices();        
+    rowSegment->SetGlobalIndices();    
   }
 
   SetLowIndicesLimit(GetRowSegment(0)->GetLowIndicesLimit());
@@ -363,8 +415,8 @@ Double_t AliMpRow::SetOffsetY(Double_t offsetY)
      Double_t sizeY = GetRowSegment(i)->HalfSizeY();
      
      if (TMath::Abs(sizeY - rowSizeY) >= AliMpConstants::LengthTolerance()) {
-       cout << GetID() << "th row " << i << "th segment " 
-            << sizeY << "  " << rowSizeY  << endl;
+       //cout << GetID() << "th row " << i << "th segment " 
+       //     << sizeY << "  " << rowSizeY  << endl;
        Fatal("SetOffsetY", "Motif with different Y size in one row");
        return 0.;
      }  
@@ -381,18 +433,34 @@ Double_t AliMpRow::SetOffsetY(Double_t offsetY)
 Int_t AliMpRow::GetNofRowSegments() const 
 {
 // Returns number of row segments.
+// ---
 
+#ifdef WITH_STL
   return fSegments.size();
+#endif
+
+#ifdef WITH_ROOT
+  return fSegments.GetSize();
+#endif
 }  
 
 //_____________________________________________________________________________
 AliMpVRowSegment* AliMpRow::GetRowSegment(Int_t i) const 
 {
+// Returns i-th row segment.
+// ---
+
   if (i<0 || i>=GetNofRowSegments()) {
     Warning("GetRowSegment", "Index outside range");
     return 0;
   }
   
+#ifdef WITH_STL
   return fSegments[i];  
+#endif
+
+#ifdef WITH_ROOT
+  return (AliMpVRowSegment*)fSegments.At(i);  
+#endif
 }