// $Id$
// $MpId: AliMpSectorAreaHPadIterator.cxx,v 1.7 2006/05/24 13:58:46 ivana Exp $
// Category: sector
-//
+
+//-----------------------------------------------------------------------------
// Class AliMpSectorAreaHPadIterator
// ---------------------------------
// Class, which defines an iterator over the pads
// inside a given area in a sector in horizontal direction.
// Included in AliRoot: 2003/05/02
// Authors: David Guez, Ivana Hrivnacova; IPN Orsay
+//-----------------------------------------------------------------------------
#include "AliMpSectorAreaHPadIterator.h"
#include "AliMpSectorSegmentation.h"
//______________________________________________________________________________
AliMpSectorAreaHPadIterator::AliMpSectorAreaHPadIterator(
const AliMpSectorAreaHPadIterator& right)
- : AliMpVPadIterator(right)
+ : AliMpVPadIterator(right),
+ fkSegmentation(0),
+ fkArea(AliMpArea()),
+ fCurrentPad(AliMpPad::Invalid()),
+ fCurrentRowPosition(0.)
{
-/// Protected copy constructor (not provided)
+/// Copy constructor
- Fatal("Copy constructor", "Not implemented");
+ *this = right;
}
//______________________________________________________________________________
{
/// Increase the current row position and searches the first valid pad.
- Double_t step = 2.* fkSegmentation->GetMinPadDimensions().Y();
+ Double_t dy = fkSegmentation->GetMinPadDimensionY();
- while ( !fCurrentPad.IsValid() &&
- fCurrentRowPosition + step < fkArea.UpBorder())
+ while ( ! fCurrentPad.IsValid() &&
+ fCurrentRowPosition + dy < fkArea.UpBorder() )
{
- fCurrentRowPosition += step;
- TVector2 position = TVector2(fkArea.LeftBorder(), fCurrentRowPosition);
+ fCurrentRowPosition += 2.*dy;
- fCurrentPad = fkSegmentation->PadByDirection(position, fkArea.RightBorder());
+ fCurrentPad
+ = fkSegmentation->PadByDirection(fkArea.LeftBorder(), fCurrentRowPosition,
+ fkArea.RightBorder());
}
}
/// Reset the iterator, so that it points to the first available
/// pad in the area
- if (!fkSegmentation) {
+ if ( ! fkSegmentation ) {
Fatal("First", "Segmentation is not defined");
return;
}
// Start position = left down corner of the area
//
- fCurrentRowPosition = fkArea.DownBorder();
- TVector2 position(fkArea.LeftDownCorner());
- fCurrentPad = fkSegmentation->PadByDirection(position, fkArea.RightBorder());
+ fCurrentRowPosition = fkArea.DownBorder();
+
+ Double_t posx, posy;
+ fkArea.LeftDownCorner(posx, posy);
+
+ fCurrentPad = fkSegmentation->PadByDirection(posx, posy, fkArea.RightBorder());
MoveUp();
// Set the row position to the center of pad
//
- if (fCurrentPad.IsValid()) fCurrentRowPosition = fCurrentPad.Position().Y();
+ if (fCurrentPad.IsValid()) fCurrentRowPosition = fCurrentPad.GetPositionY();
}
//______________________________________________________________________________
{
/// Move the iterator to the next valid pad.
- if (!IsValid()) return;
+ if ( ! IsValid() ) return;
// Start position = right board of current pad + little step
- //
- TVector2 position
- = fCurrentPad.Position()
- + TVector2(fCurrentPad.Dimensions().X() + AliMpConstants::LengthStep(), 0.);
- fCurrentPad = fkSegmentation->PadByDirection(position, fkArea.RightBorder());
+ fCurrentPad
+ = fkSegmentation->PadByDirection(
+ fCurrentPad.GetPositionX() + fCurrentPad.GetDimensionX() +
+ AliMpConstants::LengthStep(),
+ fCurrentPad.GetPositionY(),
+ fkArea.RightBorder());
- if (fCurrentPad.IsValid()) return;
+ if ( fCurrentPad.IsValid() ) return;
MoveUp();
}