//
//______________________________________________________________________________
-Bool_t AliMpNeighboursPadIterator::IsNeighbours(const AliMpPad& pad) const
+Bool_t AliMpNeighboursPadIterator::IsNeighbour(const AliMpPad& pad) const
{
/// Return true if the pad located by <padIndice> is a neighbour of those
/// located at <fCenterPad>
-
+ if ( !pad.IsValid() ) return kFALSE;
+
TVector2 relPos = pad.Position() - fCenterPad.Position();
TVector2 bounds = pad.Dimensions() + fCenterPad.Dimensions();
return (TMath::Abs(relPos.X())- bounds.X()<AliMpConstants::LengthTolerance()) &&
PadVector ans;
Bool_t cont=kTRUE;
do {
- if (IsNeighbours(current))
+ if (IsNeighbour(current))
ans.push_back(current);
else
cont=kFALSE;
TVector2 nextPos = current.Position() + TVector2(
current.Dimensions().X()*(AliMpConstants::LengthStep()+1.)*direction.GetFirst(),
current.Dimensions().Y()*(AliMpConstants::LengthStep()+1.)*direction.GetSecond());
- current = fkSegmentation->PadByPosition(nextPos);
+ current = fkSegmentation->PadByPosition(nextPos, false);
} while (cont);
return ans;
}
PadVector* ans = new PadVector();
Bool_t cont=kTRUE;
do {
- if (IsNeighbours(current))
+ if (IsNeighbour(current))
ans->Add(new AliMpPad(current));
else
cont=kFALSE;
TVector2 nextPos = current.Position() + TVector2(
current.Dimensions().X()*(AliMpConstants::LengthStep()+1.)*direction.GetFirst(),
current.Dimensions().Y()*(AliMpConstants::LengthStep()+1.)*direction.GetSecond());
- current = fkSegmentation->PadByPosition(nextPos);
+ current = fkSegmentation->PadByPosition(nextPos, false);
} while (cont);
return ans;
}
static const UInt_t fgkInvalidIndex; // invalid index number
// private methods
- Bool_t IsNeighbours(const AliMpPad& pad) const;
+ Bool_t IsNeighbour(const AliMpPad& pad) const;
#ifdef WITH_STL
PadVector PadVectorLine(const AliMpPad& from,
const AliMpIntPair& direction) const;