1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
5 // $MpId: AliMpVRowSegmentSpecial.h,v 1.10 2006/05/24 13:58:21 ivana Exp $
8 /// \class AliMpVRowSegmentSpecial
9 /// \brief Abstract base class for a special row segment composed of the
12 /// \author David Guez, Ivana Hrivnacova; IPN Orsay
14 #ifndef ALI_MP_V_ROW_SEGMENT_SPECIAL_H
15 #define ALI_MP_V_ROW_SEGMENT_SPECIAL_H
17 #include "AliMpContainers.h"
19 #include "AliMpVRowSegment.h"
20 #include "AliMpVMotif.h"
25 #include <TObjArray.h>
34 class AliMpVPadRowSegment;
37 class AliMpVRowSegmentSpecial : public AliMpVRowSegment
41 /// Pad row vector type
42 typedef std::vector<AliMpPadRow*> PadRowVector;
44 typedef std::vector<AliMpVMotif*> MotifVector;
45 /// Motif position Id vector type
46 typedef std::vector<Int_t> MotifPositionIdVector;
49 /// Pad row vector type
50 typedef TObjArray PadRowVector;
52 typedef TObjArray MotifVector;
53 /// Motif position Id vector type
54 typedef TArrayI MotifPositionIdVector;
58 AliMpVRowSegmentSpecial(AliMpRow* row, Double_t offsetX);
59 AliMpVRowSegmentSpecial();
60 virtual ~AliMpVRowSegmentSpecial();
65 void AddPadRow(AliMpPadRow* padRow);
66 void UpdateMotifVector();
67 /// Update pads offset
68 virtual void UpdatePadsOffset() = 0;
69 /// Return the x coordinate of the left border in the global coordinate system.
70 virtual Double_t LeftBorderX() const = 0;
71 /// Return the x coordinate of the right border in the global coordinate system.
72 virtual Double_t RightBorderX() const= 0;
73 /// Return the half size in y of this row segment.
74 virtual Double_t HalfSizeY() const;
79 virtual AliMpVMotif* FindMotif(const TVector2& position) const;
80 virtual Int_t FindMotifPositionId(const TVector2& position) const;
81 virtual Bool_t HasMotifPosition(Int_t motifPositionId) const;
82 virtual TVector2 MotifCenter(Int_t motifPositionId) const;
87 /// Return the position of the row segment centre.
88 virtual TVector2 Position() const = 0;
89 virtual TVector2 Dimensions() const;
95 virtual void SetOffset(const TVector2& /*offset*/) {}
96 /// Set global indices limits.
97 virtual void SetGlobalIndices(AliMpRow* rowBefore) = 0;
98 /// Set global indices to i-th motif position and returns next index in x.
99 virtual Int_t SetIndicesToMotifPosition(Int_t i,
100 const AliMpIntPair& indices) = 0;
105 virtual AliMpRow* GetRow() const;
106 virtual Int_t GetNofMotifs() const;
107 virtual AliMpVMotif* GetMotif(Int_t i) const;
108 virtual Int_t GetMotifPositionId(Int_t i) const;
112 /// Return the coordinates of the motif specified with the given motif position Id \n
113 virtual TVector2 MotifCenterSlow(Int_t motifPositionId) const = 0;
114 AliMpPadRow* FindPadRow(Double_t y) const;
115 AliMpVPadRowSegment* FindPadRowSegment(Int_t motifPositionId) const;
116 AliMpIntPair FindRelativeLowIndicesOf(Int_t motifPositionId) const;
117 Int_t MaxNofPadsInRow() const;
118 Bool_t HasMotif(const AliMpVMotif* motif) const;
121 Int_t GetNofPadRows() const;
122 AliMpPadRow* GetPadRow(Int_t i) const;
123 Double_t GetOffsetX() const;
127 AliMpVRowSegmentSpecial(const AliMpVRowSegmentSpecial& right);
129 AliMpVRowSegmentSpecial& operator = (const AliMpVRowSegmentSpecial& right);
132 // static data members
133 static const Int_t fgkMaxNofMotifPositionIds; ///< dimension of fMotifPositionIds
137 AliMpRow* fRow; ///< the row containing this segment
138 Double_t fOffsetX; ///< \brief the x position of the border that touches a standard
140 PadRowVector fPadRows; ///< pad rows vector
141 MotifVector fMotifs; ///< motifs vector
142 MotifPositionIdVector fMotifPositionIds; ///< motifs position Ids vector
145 Int_t fNofMotifPositionIds; ///< number of motif positions Ids
148 ClassDef(AliMpVRowSegmentSpecial,1) //Row segment
153 /// Return the x position of the border that touches a standard row segment
154 inline Double_t AliMpVRowSegmentSpecial::GetOffsetX() const
157 #endif //ALI_MP_V_ROW_SEGMENT_SPECIAL_H