// 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>
#include "AliMpRow.h"
#include "AliMpVRowSegment.h"
-#include "AliMpRowSegmentSpecial.h"
+#include "AliMpVRowSegmentSpecial.h"
+#include "AliMpRowSegmentRSpecial.h"
#include "AliMpVMotif.h"
#include "AliMpMotifType.h"
#include "AliMpMotifPosition.h"
//
}
+//_____________________________________________________________________________
+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
//
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;
}
// Adds row segment at the end.
// ---
+#ifdef WITH_STL
fSegments.push_back(rowSegment);
+#endif
+
+#ifdef WITH_ROOT
+ fSegments.Add(rowSegment);
+#endif
}
//_____________________________________________________________________________
// Inserts row segment in the first vector position.
// ---
+#ifdef WITH_STL
fSegments.insert(fSegments.begin(), rowSegment);
+#endif
+
+#ifdef WITH_ROOT
+ fSegments.AddFirst(rowSegment);
+#endif
}
//_____________________________________________________________________________
// ---
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;
}
// 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
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());
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.;
}
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
}