29 #include "Riostream.h"
65 AliError(Form(
"Could not crop area : (x,y)min=(%e,%e) ; max=(%e,%e) for slat %s",
66 area.LeftBorder(),area.DownBorder(),
67 area.RightBorder(),area.UpBorder(),fkSlat->GetID()));
89 AliDebug(3,Form(
"Input area (%7.2f,%7.2f)->(%7.2f,%7.2f)",
104 AliError(
"This iterator supposed to work on a single PCB. Please check");
108 AliDebug(3,Form(
"PCB %s Ixmin %2d Ixmax %2d",
114 AliDebug(3,Form(
"xleft,xright=%e,%e",xleft,xright));
116 Double_t xmin = TMath::Max(area.
LeftBorder(),xleft);
117 Double_t xmax = TMath::Min(area.
RightBorder(),xright);
118 Double_t ymin = TMath::Max(area.
DownBorder(),0.0);
121 AliDebug(3,Form(
"Cropped area (%e,%e)->(%e,%e)",
122 xmin,ymin,xmax,ymax));
133 Int_t iymin = first->
Iymin() + TMath::FloorNint((ymin-first->
Ymin())/first->
PadSizeY());
134 Int_t iymax = first->
Iymin() + TMath::CeilNint((ymax-first->
Ymin())/first->
PadSizeY()) - 1;
140 AliDebug(3,Form(
"Paddified cropped area (%d,%d)->(%d,%d) %d,%d ; %d,%d",
141 ixmin,iymin,ixmax,iymax,
166 AliDebug(3,Form(
"area = (%d,%d)->(%d,%d)",
177 AliError(Form(
"Could not initiate iterator for slat %s. "
178 " Please check the area you gave : %d,%d to %d,%d",
264 AliFatal(
"This should not happen!");
276 << Form(
"minIndices=(%d,%d) maxIndices=(%d,%d)",
279 << Form(
"currentOffset=(%d,%d) isdone=%d currentpad=",
void First()
Set iterator to the first pad.
AliMpPad fCurrentPad
! current pad
void SetPad(AliMpPad &pad, Int_t ix, Int_t iy)
AliMpPCB * FindPCB(Int_t ix) const
Find the PCB containing the pad at location (ix,any iy).
Double_t LeftBorder() const
A PCB for station 3,4 or 5.
virtual AliMpPad PadByIndices(Int_t ix, Int_t iy, Bool_t warning) const
Find pad by indices.
MpPair_t Pair(Int_t first, Int_t second)
Encode the pair of integers to another integer.
A rectangle area positioned in plane..
MpPair_t fOffset
! current position
Double_t PadSizeX() const
A slat (building block of stations 3, 4 and 5)
virtual ~AliMpPCBPadIterator()
Iterates over slat pads within a region of constant pad size.
static AliMpPad Invalid()
Return invalid pad.
void Next()
Set iterator to the next pad.
static Double_t LengthTolerance()
Return the length precision for tests.
void Print(Option_t *opt="") const
const char * GetID() const
Bool_t fIsDone
! whether we've finished or not
Double_t ActiveXmin() const
const char * GetName() const
An interface for an iterator over pads.
const AliMpSlat * fkSlat
! the slat we're iterating over
Double_t ActiveXmax() const
Double_t UpBorder() const
void Print(const char *="") const
MpPair_t fMinIndices
! indices of bottom left of region to iterate over
Implementation of AliMpVSegmentation for St345 slats.
Double_t DownBorder() const
Bool_t IsValid() const
Return validity.
Bool_t GetNextPosition(Int_t &ix, Int_t &iy) const
void Invalidate()
Invalidate iterator (.
Int_t PairFirst(MpPair_t pair)
Decode the first integer from encoded pair.
Bool_t CropArea(const AliMpArea &area)
Class which encapsuate all information about a pad.
AliMpSlatSegmentation * fSlatSegmentation
! segmentation pointer
AliMpPad CurrentItem() const
Return current pad.
MpPair_t fMaxIndices
! indices of top right of region to iterate over
Int_t PairSecond(MpPair_t pair)
Decode the second integer from encoded pair.
Double_t PadSizeY() const
Bool_t IsDone() const
Is iterator done.
Double_t RightBorder() const