]>
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 | ||
5f91c9e8 | 4 | // $Id$ |
13985652 | 5 | // $MpId: AliMpSectorSegmentation.h,v 1.15 2006/05/24 13:58:21 ivana Exp $ |
dee1d5f1 | 6 | |
7 | /// \ingroup sector | |
8 | /// \class AliMpSectorSegmentation | |
9 | /// \brief A segmentation of the sector. | |
10 | /// | |
11 | /// Provides methods related to pads: \n | |
12 | /// conversion between pad indices, pad location, pad position; | |
13 | /// finding pad neighbour. | |
14 | /// | |
13985652 | 15 | /// \author David Guez, Ivana Hrivnacova; IPN Orsay |
5f91c9e8 | 16 | |
17 | #ifndef ALI_MP_SECTOR_SEGMENTATION_H | |
18 | #define ALI_MP_SECTOR_SEGMENTATION_H | |
19 | ||
5006ec94 | 20 | #include "AliMpContainers.h" |
21 | ||
2a7ea2e6 | 22 | #include "AliMpVSegmentation.h" |
23 | #include "AliMpPad.h" | |
5006ec94 | 24 | |
2a7ea2e6 | 25 | #include <TVector2.h> |
5006ec94 | 26 | #ifdef WITH_ROOT |
27 | #include <TExMap.h> | |
28 | #endif | |
29 | ||
2a7ea2e6 | 30 | #ifdef WITH_STL |
31 | #include <map> | |
32 | #endif | |
5f91c9e8 | 33 | |
34 | class AliMpSector; | |
35 | class AliMpMotifPosition; | |
36 | class AliMpVPadIterator; | |
2998a151 | 37 | class AliMpIntPair; |
38 | class AliMpArea; | |
5f91c9e8 | 39 | |
40 | class AliMpSectorSegmentation : public AliMpVSegmentation | |
41 | { | |
5006ec94 | 42 | public: |
43 | #ifdef WITH_STL | |
f5671fc3 | 44 | /// Pad dimensions map type |
5006ec94 | 45 | typedef std::map<Int_t, TVector2> PadDimensionsMap; |
f5671fc3 | 46 | /// Pad dimensions map iterator type |
5006ec94 | 47 | typedef PadDimensionsMap::const_iterator PadDimensionsMapCIterator; |
48 | #endif | |
49 | #ifdef WITH_ROOT | |
f5671fc3 | 50 | /// Pad dimensions map type |
5006ec94 | 51 | typedef TExMap PadDimensionsMap; |
f5671fc3 | 52 | /// Pad dimensions map iterator type |
5006ec94 | 53 | typedef TExMapIter PadDimensionsMapCIterator; |
54 | #endif | |
55 | ||
5f91c9e8 | 56 | public: |
d79286ca | 57 | AliMpSectorSegmentation(const AliMpSector* sector, Bool_t own = false); |
5f91c9e8 | 58 | AliMpSectorSegmentation(); |
59 | virtual ~AliMpSectorSegmentation(); | |
60 | ||
61 | // factory methods | |
62 | virtual AliMpVPadIterator* CreateIterator(const AliMpArea& area) const; | |
984a565f | 63 | virtual AliMpVPadIterator* CreateIterator() const; |
64 | ||
5f91c9e8 | 65 | AliMpVPadIterator* CreateIterator(const AliMpPad& centerPad, |
984a565f | 66 | Bool_t includeCenter=kFALSE) const; |
5f91c9e8 | 67 | |
984a565f | 68 | Int_t GetNeighbours(const AliMpPad& pad, TObjArray& neighbours, |
69 | Bool_t includeSelf = kFALSE, | |
70 | Bool_t includeVoid = kFALSE) const; | |
71 | ||
5f91c9e8 | 72 | // methods |
73 | virtual AliMpPad PadByLocation(const AliMpIntPair& location, | |
74 | Bool_t warning = kTRUE) const; | |
75 | virtual AliMpPad PadByIndices (const AliMpIntPair& indices, | |
76 | Bool_t warning = kTRUE) const; | |
77 | virtual AliMpPad PadByPosition(const TVector2& position , | |
78 | Bool_t warning = kTRUE) const; | |
79 | virtual AliMpPad PadByDirection(const TVector2& startPosition, | |
80 | Double_t distance) const; | |
580c28fd | 81 | |
bd984e15 | 82 | virtual Int_t MaxPadIndexX() const; |
83 | virtual Int_t MaxPadIndexY() const; | |
84 | virtual Int_t NofPads() const; | |
5f91c9e8 | 85 | |
86 | virtual Int_t Zone(const AliMpPad& pad, Bool_t warning = kTRUE) const; | |
87 | virtual TVector2 PadDimensions(Int_t zone, Bool_t warning = kTRUE) const; | |
88 | ||
89 | virtual Bool_t HasPad(const AliMpIntPair& indices) const; | |
90 | Bool_t HasMotifPosition(Int_t motifPositionID) const; | |
91 | TVector2 GetMinPadDimensions() const; | |
92 | Bool_t CircleTest(const AliMpIntPair& indices) const; | |
bcf37928 | 93 | void PrintZones() const; |
f5ed7890 | 94 | |
95 | const AliMpSector* GetSector() const; | |
5f91c9e8 | 96 | |
63bcb3c3 | 97 | virtual void Print(Option_t* opt="") const; |
98 | ||
99 | virtual void GetAllElectronicCardIDs(TArrayI& ecn) const; | |
100 | ||
cddd101e | 101 | AliMp::PlaneType PlaneType() const; |
63bcb3c3 | 102 | |
103 | TVector2 Dimensions() const; | |
104 | ||
13e7956b | 105 | private: |
f5671fc3 | 106 | /// Not implemented |
fb1bf5c0 | 107 | AliMpSectorSegmentation(const AliMpSectorSegmentation& right); |
f5671fc3 | 108 | /// Not implemented |
fb1bf5c0 | 109 | AliMpSectorSegmentation& operator = (const AliMpSectorSegmentation& right); |
110 | ||
f79c58a5 | 111 | #ifdef WITH_ROOT |
f5671fc3 | 112 | static const Double_t fgkS1; ///< the separators used for conversion |
113 | static const Double_t fgkS2; ///< of TVector2 to Long_t | |
f79c58a5 | 114 | |
115 | // methods | |
116 | Long_t GetIndex(const TVector2& vector2) const; | |
117 | TVector2 GetVector(Long_t index) const; | |
118 | #endif | |
119 | ||
5f91c9e8 | 120 | // methods |
121 | void FillPadDimensionsMap(); | |
122 | AliMpMotifPosition* FindMotifPosition(const AliMpIntPair& indices) const; | |
123 | virtual AliMpPad PadByXDirection(const TVector2& startPosition, | |
124 | Double_t maxX) const; | |
125 | virtual AliMpPad PadByYDirection(const TVector2& startPosition, | |
126 | Double_t maxY) const; | |
5f91c9e8 | 127 | |
d79286ca | 128 | // data members |
829425a5 | 129 | const AliMpSector* fkSector; ///< Sector |
d79286ca | 130 | Bool_t fIsOwner; ///< Sector ownership |
829425a5 | 131 | AliMpPad* fPadBuffer; ///< The pad buffer |
f79c58a5 | 132 | #ifdef WITH_STL |
829425a5 | 133 | PadDimensionsMap fPadDimensionsMap; ///< Map between zone IDs and pad dimensions |
f79c58a5 | 134 | #endif |
135 | #ifdef WITH_ROOT | |
829425a5 | 136 | mutable PadDimensionsMap fPadDimensionsMap; ///< Map between zone IDs and pad dimensions |
580c28fd | 137 | #endif |
138 | ||
829425a5 | 139 | Int_t fMaxIndexInX; ///< maximum pad index in x |
140 | Int_t fMaxIndexInY; ///< maximum pad index in y | |
5f91c9e8 | 141 | |
d79286ca | 142 | ClassDef(AliMpSectorSegmentation,2) // Segmentation |
5f91c9e8 | 143 | }; |
144 | ||
f5ed7890 | 145 | |
146 | // inline functions | |
147 | ||
f5671fc3 | 148 | /// Return the sector |
f5ed7890 | 149 | inline const AliMpSector* AliMpSectorSegmentation::GetSector() const |
150 | { return fkSector; } | |
151 | ||
5f91c9e8 | 152 | #endif //ALI_MP_SECTOR_SEGMENTATION_H |
153 |