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"
26 #include "AliMpStationType.h"
28 class AliMpVPadIterator;
31 class AliMpMotifPosition;
37 class AliMpVSegmentation : public TObject
41 virtual ~AliMpVSegmentation();
48 /// Create iterator over pads in the given area
49 virtual AliMpVPadIterator* CreateIterator(const AliMpArea& area) const = 0;
51 /// Create a pad iterator over the whole area
52 virtual AliMpVPadIterator* CreateIterator() const = 0;
54 /// Fill the array with the pads that are neighbours of pad. Returns
55 /// the number of neighbours.
56 virtual Int_t GetNeighbours(const AliMpPad& pad, TObjArray& neighbours,
57 Bool_t includeSelf=kFALSE,
58 Bool_t includeVoid=kFALSE) const = 0;
60 /// Find pad by location
61 virtual AliMpPad PadByLocation(const AliMpIntPair& location,
62 Bool_t warning = true) const = 0;
63 /// Find pad by indices
64 virtual AliMpPad PadByIndices (const AliMpIntPair& indices,
65 Bool_t warning = true) const = 0;
66 /// Find pad by position
67 virtual AliMpPad PadByPosition(const TVector2& position,
68 Bool_t warning = true) const = 0;
70 virtual AliMpPadPair PadsUp(const AliMpPad& pad) const;
71 virtual AliMpPadPair PadsDown(const AliMpPad& pad) const;
72 virtual AliMpPadPair PadsLeft(const AliMpPad& pad) const;
73 virtual AliMpPadPair PadsRight(const AliMpPad& pad) const;
75 /// Return true if the pad with given indices exists.
76 /// Compared with the PadByIndices method, this one can generally be implemented
77 /// faster, as one does not have to create an AliMpPad object...
78 virtual Bool_t HasPadByIndices(const AliMpIntPair& indices) const;
80 /// Return true if the pad with given location exists
81 virtual Bool_t HasPadByLocation(const AliMpIntPair& location) const;
83 /// For backward compatibility
84 virtual Bool_t HasPad(const AliMpIntPair& indices) const { return HasPadByIndices(indices); }
86 /// Return maximum pad index in X direction
87 virtual Int_t MaxPadIndexX() const = 0;
88 /// Return maximum pad index in Y direction
89 virtual Int_t MaxPadIndexY() const = 0;
90 /// Return the number of pads in the detection element
91 virtual Int_t NofPads() const = 0;
93 /// Fill the given array with the electronic card IDs
94 virtual void GetAllElectronicCardIDs(TArrayI& ecn) const = 0;
96 /// Get the number of electronic card IDs
97 virtual Int_t GetNofElectronicCards() const = 0;
99 /// Whether or not we have a given manu
100 virtual Bool_t HasMotifPosition(Int_t manuId) const = 0;
102 /// Return the position of a given manu (aka motifPosition)
103 virtual AliMpMotifPosition* MotifPosition(Int_t manuId) const = 0;
105 /// Return the plane type
106 virtual AliMp::PlaneType PlaneType() const = 0;
108 /// Return the station type
109 virtual AliMp::StationType StationType() const = 0;
111 /// Return the half-sizes of the detection element
112 virtual TVector2 Dimensions() const = 0;
114 /// Return the position of the origine of the detection element
115 virtual TVector2 Position() const = 0;
120 AliMpPadPair FindPads(const TVector2& position1,
121 const TVector2& position2) const;
123 ClassDef(AliMpVSegmentation,1) // Segmentation
126 #endif //ALI_MP_V_SEGMENTATION_H