28 #include "AliCodeTimer.h"
64 Int_t Encode(Int_t a, Int_t b)
69 Int_t Encode2(Int_t a)
73 return ( a ^ (1<<10) ) << 16 ;
91 AliError(
"Will get a hard time working with a NULL vseg !");
95 AliCodeTimerAuto(vseg->ClassName(),0);
104 for ( Int_t i = 0; i < manus.GetSize(); ++i )
106 Int_t manuId = manus[i];
112 AliFatal(
"AliMpMotifPosition not found.");
119 fManuId.Add(Encode2(manuId),1+index);
160 Bool_t includeVoid)
const
169 Bool_t warning)
const
173 Int_t index =
fManuId.GetValue(Encode2(manuId));
179 AliWarning(Form(
"Manu ID %d not found",manuId));
189 AliError(Form(
"InternalMotifPosition(%d) failed",index));
198 if ( localIndices < 0 )
202 AliWarning(Form(
"The pad number %d doesn't exists", manuChannel));
238 return AliMpPad(manuId, manuChannel,
257 Int_t index =
fIxIy.GetValue(Encode(ix, iy));
263 AliWarning(Form(
"ManuID not found for pad indices (%d,%d)", ix, iy));
273 AliError(Form(
"InternalMotifPosition(%d) failed",index));
287 AliWarning(Form(
"No connection for pad indices (%d,%d)", ix, iy));
304 ix, iy, posx, posy, dx, dy);
316 return AliMpPad(motifPos->
GetID(),connection->GetManuChannel(),
317 ix, iy, posx, posy, dx, dy);
374 Int_t index =
fIxIy.GetValue(Encode(ix, iy));
376 if ( !index )
return kFALSE;
395 Int_t index =
fManuId.GetValue(Encode2(manuId));
397 if (!index)
return kFALSE;
463 return (
fManuId.GetValue(Encode2(manuId)) != 0);
471 Int_t index =
fManuId.GetValue(Encode2(manuId));
479 AliWarning(Form(
"DE %04d Manu ID %04d not found",pad.
GetManuId(),manuId));
Double_t GetPositionY() const
Return y position.
virtual Int_t MaxPadIndexY() const
Return maximum pad index in Y direction.
virtual AliMp::PlaneType PlaneType() const
Return the plane type.
Double_t fPositionY
to compute pad positions
virtual Int_t GetNofElectronicCards() const
Get the number of electronic card IDs.
virtual AliMp::PlaneType PlaneType() const =0
Return the plane type.
TExMap fManuId
map of (manuid) -> index in array above
virtual Int_t NofPads() const =0
Return the number of pads in the detection element.
virtual Bool_t HasPadByIndices(Int_t ix, Int_t iy) const
virtual Int_t GetNofElectronicCards() const =0
Get the number of electronic card IDs.
virtual AliMpMotifPosition * MotifPosition(Int_t manuId) const =0
Return the position of a given manu (aka motifPosition)
virtual void GetAllElectronicCardIDs(TArrayI &ecn) const
Fill the given array with the electronic card IDs.
MpPair_t Pair(Int_t first, Int_t second)
Encode the pair of integers to another integer.
A rectangle area positioned in plane..
Bool_t HasPadByIndices(MpPair_t indices) const
virtual AliMpVPadIterator * CreateIterator(const AliMpArea &area) const =0
Create iterator over pads in the given area.
AliMpConnection * FindConnectionByLocalIndices(MpPair_t localIndices) const
AliMpFastSegmentation(AliMpVSegmentation *seg)
virtual Bool_t HasPadByIndices(Int_t ix, Int_t iy) const
MpPair_t FindLocalIndicesByGassiNum(Int_t gassiNum) const
virtual AliMpMotifPosition * InternalMotifPosition(Int_t index) const
virtual AliMpPad PadByIndices(Int_t ix, Int_t iy, Bool_t warning=true) const =0
Find pad by indices.
AliMpMotifType * GetMotifType() const
Return the motif type.
virtual Double_t GetDimensionY() const =0
Return the y half-sizes of the detection element.
static AliMpPad Invalid()
Return invalid pad.
virtual Bool_t HasMotifPosition(Int_t manuId) const
Whether or not we have a given manu.
virtual Double_t GetPositionY() const
Return the y position of the origin of the detection element.
virtual AliMpPad PadByIndices(Int_t ix, Int_t iy, Bool_t warning=true) const
Find pad by indices.
static Int_t ManuNofChannels()
Max number of channels per manu.
virtual Double_t GetPositionY() const =0
Return the y position of the origin of the detection element.
Int_t GetID() const
Return motif position ID = manu id.
virtual Int_t MaxPadIndexY() const =0
Return maximum pad index in Y direction.
virtual Int_t NofPads() const
Return the number of pads in the detection element.
TExMap fIxIy
map of (ix,iy) -> index in array above
An interface for an iterator over pads.
virtual AliMpPad PadByLocation(Int_t manuId, Int_t manuChannel, Bool_t warning=true) const
Find pad by location.
MpPair_t GetLowIndicesLimit() const
virtual Bool_t HasPadByLocation(Int_t manuId, Int_t manuChannel) const
Return true if the pad with given location exists.
virtual Double_t GetDimensionX() const =0
Return the x half-sizes of the detection element.
void Print(const char *="") const
AliMpVMotif * GetMotif() const
Return motif.
virtual ~AliMpFastSegmentation()
virtual Double_t GetPositionX() const
Return the x position of the origin of the detection element.
virtual Int_t GetNeighbours(const AliMpPad &pad, TObjArray &neighbours, Bool_t includeSelf=kFALSE, Bool_t includeVoid=kFALSE) const
virtual AliMpPad CurrentItem() const =0
Return current pad.
virtual AliMpVPadIterator * CreateIterator() const
Create a pad iterator over the whole area.
virtual AliMpMotifPosition * MotifPosition(Int_t manuId) const
Return the position of a given manu (aka motifPosition)
virtual void PadPositionLocal(MpPair_t localIndices, Double_t &posx, Double_t &posy) const =0
Fill local position of the pad specified by local indices.
virtual AliMpPad PadByPosition(Double_t x, Double_t y, Bool_t warning=true) const =0
Find pad by position.
Abstract base class for a motif with its unique ID and the motif type.
virtual Int_t MaxPadIndexX() const
Return maximum pad index in X direction.
virtual Bool_t HasPadByLocation(Int_t manuId, Int_t manuChannel) const
Return true if the pad with given location exists.
The abstract base class for the segmentation.
virtual MpPair_t GlobalIndices(MpPair_t localIndices) const
Double_t fPositionX
to compute pad positions
virtual Int_t MaxPadIndexX() const =0
Return maximum pad index in X direction.
virtual Int_t GetNeighbours(const AliMpPad &pad, TObjArray &neighbours, Bool_t includeSelf=kFALSE, Bool_t includeVoid=kFALSE) const =0
virtual Double_t GetDimensionY() const
Return the y half-sizes of the detection element.
virtual void First()=0
Set iterator to the first pad.
Class which encapsuate all information about a pad.
TObjArray fMotifPositions
array of AliMpMotifPositions (not owner)
Double_t GetPositionX() const
Return x position.
Fast version of AliMpVSegmentation.
virtual AliMpPad PadByPosition(Double_t x, Double_t y, Bool_t warning=true) const
Find pad by position.
virtual void Print(Option_t *opt="") const
virtual AliMpPad PadByLocation(Int_t manuId, Int_t manuChannel, Bool_t warning=true) const =0
Find pad by location.
Bool_t HasPadByManuChannel(Int_t manuChannel) const
virtual Double_t GetDimensionX() const
Return the x half-sizes of the detection element.
virtual Double_t GetPositionX() const =0
Return the x position of the origin of the detection element.
Class that defines the motif properties.
AliMpVSegmentation * fHelper
helper class (owner)
virtual void GetAllElectronicCardIDs(TArrayI &ecn) const =0
Fill the given array with the electronic card IDs.
virtual void GetPadDimensionsByIndices(MpPair_t localIndices, Double_t &dx, Double_t &dy) const =0
Return the dimensions of the pad specified by localIndices.