1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
5 // $MpId: AliMpVSegmentation.h,v 1.12 2006/05/24 13:58:07 ivana Exp $
8 /// \class AliMpVSegmentation
9 /// \brief The abstract base class for the segmentation.
11 /// Provides methods related to pads:
12 /// conversion between pad indices, pad location, pad position;
13 /// finding pad neighbour.
15 /// \author David Guez, Ivana Hrivnacova, IPN Orsay;
16 /// Laurent Aphecetche, SUBATECH
18 #ifndef ALI_MP_V_SEGMENTATION_H
19 #define ALI_MP_V_SEGMENTATION_H
23 #include "AliMpPadPair.h"
25 #include "AliMpPlaneType.h"
27 class AliMpVPadIterator;
35 class AliMpVSegmentation : public TObject
39 virtual ~AliMpVSegmentation();
42 /// Create iterator over pads in the given area
43 virtual AliMpVPadIterator* CreateIterator(const AliMpArea& area) const = 0;
45 /// Create a pad iterator over the whole area
46 virtual AliMpVPadIterator* CreateIterator() const = 0;
48 /// Fill the array with the pads that are neighbours of pad. Returns
49 /// the number of neighbours.
50 virtual Int_t GetNeighbours(const AliMpPad& pad, TObjArray& neighbours,
51 Bool_t includeSelf=kFALSE,
52 Bool_t includeVoid=kFALSE) const = 0;
56 /// Find pad by location
57 virtual AliMpPad PadByLocation(const AliMpIntPair& location,
58 Bool_t warning = true) const = 0;
59 /// Find pad by indices
60 virtual AliMpPad PadByIndices (const AliMpIntPair& indices,
61 Bool_t warning = true) const = 0;
62 /// Find pad by position
63 virtual AliMpPad PadByPosition(const TVector2& position,
64 Bool_t warning = true) const = 0;
66 virtual AliMpPadPair PadsUp(const AliMpPad& pad) const;
67 virtual AliMpPadPair PadsDown(const AliMpPad& pad) const;
68 virtual AliMpPadPair PadsLeft(const AliMpPad& pad) const;
69 virtual AliMpPadPair PadsRight(const AliMpPad& pad) const;
71 /// Return maximum pad index in X direction
72 virtual Int_t MaxPadIndexX() const = 0;
73 /// Return maximum pad index in Y direction
74 virtual Int_t MaxPadIndexY() const = 0;
75 /// Return the number of pads in the detection element
76 virtual Int_t NofPads() const = 0;
78 /// Return true if the pad with given indices exists
79 virtual Bool_t HasPad(const AliMpIntPair& indices) const = 0;
81 /// Fill the given array with the electronic card IDs
82 virtual void GetAllElectronicCardIDs(TArrayI& ecn) const = 0;
84 /// Return the plane type
85 virtual AliMp::PlaneType PlaneType() const = 0;
87 /// Return the half-sizes of the detection element
88 virtual TVector2 Dimensions() const = 0;
92 AliMpPadPair FindPads(const TVector2& position1,
93 const TVector2& position2) const;
95 ClassDef(AliMpVSegmentation,1) // Segmentation
98 #endif //ALI_MP_V_SEGMENTATION_H