]>
Commit | Line | Data |
---|---|---|
dee1d5f1 | 1 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
2 | * See cxx source for full Copyright notice */ | |
3 | ||
ea4cae7a | 4 | // $Id$ |
13985652 | 5 | // $MpId: AliMpVRowSegmentSpecial.h,v 1.10 2006/05/24 13:58:21 ivana Exp $ |
dee1d5f1 | 6 | |
7 | /// \ingroup sector | |
8 | /// \class AliMpVRowSegmentSpecial | |
9 | /// \brief Abstract base class for a special row segment composed of the | |
10 | /// pad rows. | |
11 | /// | |
13985652 | 12 | /// \author David Guez, Ivana Hrivnacova; IPN Orsay |
ea4cae7a | 13 | |
14 | #ifndef ALI_MP_V_ROW_SEGMENT_SPECIAL_H | |
15 | #define ALI_MP_V_ROW_SEGMENT_SPECIAL_H | |
16 | ||
5006ec94 | 17 | #include "AliMpContainers.h" |
18 | ||
2a7ea2e6 | 19 | #include "AliMpVRowSegment.h" |
20 | #include "AliMpVMotif.h" | |
5006ec94 | 21 | |
2a7ea2e6 | 22 | #include <TVector2.h> |
5006ec94 | 23 | #ifdef WITH_ROOT |
24 | #include <TArrayI.h> | |
25 | #include <TObjArray.h> | |
26 | #endif | |
27 | ||
2a7ea2e6 | 28 | #ifdef WITH_STL |
29 | #include <vector> | |
30 | #endif | |
ea4cae7a | 31 | |
32 | class AliMpRow; | |
33 | class AliMpPadRow; | |
34 | class AliMpVPadRowSegment; | |
35 | class AliMpIntPair; | |
36 | ||
37 | class AliMpVRowSegmentSpecial : public AliMpVRowSegment | |
38 | { | |
5006ec94 | 39 | public: |
40 | #ifdef WITH_STL | |
f5671fc3 | 41 | /// Pad row vector type |
5006ec94 | 42 | typedef std::vector<AliMpPadRow*> PadRowVector; |
f5671fc3 | 43 | /// Motif vector type |
5006ec94 | 44 | typedef std::vector<AliMpVMotif*> MotifVector; |
f5671fc3 | 45 | /// Motif position Id vector type |
5006ec94 | 46 | typedef std::vector<Int_t> MotifPositionIdVector; |
47 | #endif | |
48 | #ifdef WITH_ROOT | |
f5671fc3 | 49 | /// Pad row vector type |
5006ec94 | 50 | typedef TObjArray PadRowVector; |
f5671fc3 | 51 | /// Motif vector type |
5006ec94 | 52 | typedef TObjArray MotifVector; |
f5671fc3 | 53 | /// Motif position Id vector type |
5006ec94 | 54 | typedef TArrayI MotifPositionIdVector; |
55 | #endif | |
56 | ||
ea4cae7a | 57 | public: |
58 | AliMpVRowSegmentSpecial(AliMpRow* row, Double_t offsetX); | |
59 | AliMpVRowSegmentSpecial(); | |
60 | virtual ~AliMpVRowSegmentSpecial(); | |
61 | ||
f5671fc3 | 62 | // |
ea4cae7a | 63 | // methods |
f5671fc3 | 64 | // |
ea4cae7a | 65 | void AddPadRow(AliMpPadRow* padRow); |
66 | void UpdateMotifVector(); | |
f5671fc3 | 67 | /// Update pads offset |
ea4cae7a | 68 | virtual void UpdatePadsOffset() = 0; |
f5671fc3 | 69 | /// Return the x coordinate of the left border in the global coordinate system. |
ea4cae7a | 70 | virtual Double_t LeftBorderX() const = 0; |
f5671fc3 | 71 | /// Return the x coordinate of the right border in the global coordinate system. |
ea4cae7a | 72 | virtual Double_t RightBorderX() const= 0; |
f5671fc3 | 73 | /// Return the half size in y of this row segment. |
ea4cae7a | 74 | virtual Double_t HalfSizeY() const; |
75 | ||
f5671fc3 | 76 | // |
ea4cae7a | 77 | // find methods |
f5671fc3 | 78 | // |
ea4cae7a | 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; | |
83 | ||
f5671fc3 | 84 | // |
ea4cae7a | 85 | // geometry |
f5671fc3 | 86 | // |
87 | /// Return the position of the row segment centre. | |
ea4cae7a | 88 | virtual TVector2 Position() const = 0; |
89 | virtual TVector2 Dimensions() const; | |
90 | ||
f5671fc3 | 91 | // |
ea4cae7a | 92 | // set methods |
f5671fc3 | 93 | // |
94 | /// Calculate offset | |
ea4cae7a | 95 | virtual void SetOffset(const TVector2& /*offset*/) {} |
f5671fc3 | 96 | /// Set global indices limits. |
580c28fd | 97 | virtual void SetGlobalIndices(AliMpRow* rowBefore) = 0; |
f5671fc3 | 98 | /// Set global indices to i-th motif position and returns next index in x. |
ea4cae7a | 99 | virtual Int_t SetIndicesToMotifPosition(Int_t i, |
100 | const AliMpIntPair& indices) = 0; | |
101 | ||
f5671fc3 | 102 | // |
ea4cae7a | 103 | // get methods |
f5671fc3 | 104 | // |
ea4cae7a | 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; | |
109 | ||
110 | protected: | |
111 | // methods | |
f5671fc3 | 112 | /// Return the coordinates of the motif specified with the given motif position Id \n |
ea4cae7a | 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; | |
119 | ||
120 | // get methods | |
121 | Int_t GetNofPadRows() const; | |
122 | AliMpPadRow* GetPadRow(Int_t i) const; | |
123 | Double_t GetOffsetX() const; | |
124 | ||
125 | private: | |
f5671fc3 | 126 | /// Not implemented |
13e7956b | 127 | AliMpVRowSegmentSpecial(const AliMpVRowSegmentSpecial& right); |
f5671fc3 | 128 | /// Not implemented |
13e7956b | 129 | AliMpVRowSegmentSpecial& operator = (const AliMpVRowSegmentSpecial& right); |
130 | ||
f79c58a5 | 131 | #ifdef WITH_ROOT |
132 | // static data members | |
f5671fc3 | 133 | static const Int_t fgkMaxNofMotifPositionIds; ///< dimension of fMotifPositionIds |
f79c58a5 | 134 | #endif |
135 | ||
ea4cae7a | 136 | // data members |
829425a5 | 137 | AliMpRow* fRow; ///< the row containing this segment |
138 | Double_t fOffsetX; ///< \brief the x position of the border that touches a standard | |
139 | /// row segment | |
140 | PadRowVector fPadRows; ///< pad rows vector | |
141 | MotifVector fMotifs; ///< motifs vector | |
142 | MotifPositionIdVector fMotifPositionIds; ///< motifs position Ids vector | |
5006ec94 | 143 | |
f79c58a5 | 144 | #ifdef WITH_ROOT |
829425a5 | 145 | Int_t fNofMotifPositionIds; ///< number of motif positions Ids |
f79c58a5 | 146 | #endif |
ea4cae7a | 147 | |
148 | ClassDef(AliMpVRowSegmentSpecial,1) //Row segment | |
149 | }; | |
150 | ||
151 | // inline functions | |
152 | ||
f5671fc3 | 153 | /// Return the x position of the border that touches a standard row segment |
ea4cae7a | 154 | inline Double_t AliMpVRowSegmentSpecial::GetOffsetX() const |
155 | { return fOffsetX; } | |
156 | ||
157 | #endif //ALI_MP_V_ROW_SEGMENT_SPECIAL_H |