]>
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 | |
44 | typedef std::map<Int_t, TVector2> PadDimensionsMap; | |
45 | typedef PadDimensionsMap::const_iterator PadDimensionsMapCIterator; | |
46 | #endif | |
47 | #ifdef WITH_ROOT | |
48 | typedef TExMap PadDimensionsMap; | |
49 | typedef TExMapIter PadDimensionsMapCIterator; | |
50 | #endif | |
51 | ||
5f91c9e8 | 52 | public: |
d79286ca | 53 | AliMpSectorSegmentation(const AliMpSector* sector, Bool_t own = false); |
5f91c9e8 | 54 | AliMpSectorSegmentation(); |
55 | virtual ~AliMpSectorSegmentation(); | |
56 | ||
57 | // factory methods | |
58 | virtual AliMpVPadIterator* CreateIterator(const AliMpArea& area) const; | |
984a565f | 59 | virtual AliMpVPadIterator* CreateIterator() const; |
60 | ||
5f91c9e8 | 61 | AliMpVPadIterator* CreateIterator(const AliMpPad& centerPad, |
984a565f | 62 | Bool_t includeCenter=kFALSE) const; |
5f91c9e8 | 63 | |
984a565f | 64 | Int_t GetNeighbours(const AliMpPad& pad, TObjArray& neighbours, |
65 | Bool_t includeSelf = kFALSE, | |
66 | Bool_t includeVoid = kFALSE) const; | |
67 | ||
5f91c9e8 | 68 | // methods |
69 | virtual AliMpPad PadByLocation(const AliMpIntPair& location, | |
70 | Bool_t warning = kTRUE) const; | |
71 | virtual AliMpPad PadByIndices (const AliMpIntPair& indices, | |
72 | Bool_t warning = kTRUE) const; | |
73 | virtual AliMpPad PadByPosition(const TVector2& position , | |
74 | Bool_t warning = kTRUE) const; | |
75 | virtual AliMpPad PadByDirection(const TVector2& startPosition, | |
76 | Double_t distance) const; | |
580c28fd | 77 | |
bd984e15 | 78 | virtual Int_t MaxPadIndexX() const; |
79 | virtual Int_t MaxPadIndexY() const; | |
80 | virtual Int_t NofPads() const; | |
5f91c9e8 | 81 | |
82 | virtual Int_t Zone(const AliMpPad& pad, Bool_t warning = kTRUE) const; | |
83 | virtual TVector2 PadDimensions(Int_t zone, Bool_t warning = kTRUE) const; | |
84 | ||
85 | virtual Bool_t HasPad(const AliMpIntPair& indices) const; | |
86 | Bool_t HasMotifPosition(Int_t motifPositionID) const; | |
87 | TVector2 GetMinPadDimensions() const; | |
88 | Bool_t CircleTest(const AliMpIntPair& indices) const; | |
bcf37928 | 89 | void PrintZones() const; |
f5ed7890 | 90 | |
91 | const AliMpSector* GetSector() const; | |
5f91c9e8 | 92 | |
63bcb3c3 | 93 | virtual void Print(Option_t* opt="") const; |
94 | ||
95 | virtual void GetAllElectronicCardIDs(TArrayI& ecn) const; | |
96 | ||
cddd101e | 97 | AliMp::PlaneType PlaneType() const; |
63bcb3c3 | 98 | |
99 | TVector2 Dimensions() const; | |
100 | ||
13e7956b | 101 | private: |
fb1bf5c0 | 102 | AliMpSectorSegmentation(const AliMpSectorSegmentation& right); |
103 | AliMpSectorSegmentation& operator = (const AliMpSectorSegmentation& right); | |
104 | ||
f79c58a5 | 105 | #ifdef WITH_ROOT |
bcf37928 | 106 | static const Double_t fgkS1; // the separators used for conversion |
107 | static const Double_t fgkS2; // of TVector2 to Long_t | |
f79c58a5 | 108 | |
109 | // methods | |
110 | Long_t GetIndex(const TVector2& vector2) const; | |
111 | TVector2 GetVector(Long_t index) const; | |
112 | #endif | |
113 | ||
5f91c9e8 | 114 | // methods |
115 | void FillPadDimensionsMap(); | |
116 | AliMpMotifPosition* FindMotifPosition(const AliMpIntPair& indices) const; | |
117 | virtual AliMpPad PadByXDirection(const TVector2& startPosition, | |
118 | Double_t maxX) const; | |
119 | virtual AliMpPad PadByYDirection(const TVector2& startPosition, | |
120 | Double_t maxY) const; | |
5f91c9e8 | 121 | |
d79286ca | 122 | // data members |
829425a5 | 123 | const AliMpSector* fkSector; ///< Sector |
d79286ca | 124 | Bool_t fIsOwner; ///< Sector ownership |
829425a5 | 125 | AliMpPad* fPadBuffer; ///< The pad buffer |
f79c58a5 | 126 | #ifdef WITH_STL |
829425a5 | 127 | PadDimensionsMap fPadDimensionsMap; ///< Map between zone IDs and pad dimensions |
f79c58a5 | 128 | #endif |
129 | #ifdef WITH_ROOT | |
829425a5 | 130 | mutable PadDimensionsMap fPadDimensionsMap; ///< Map between zone IDs and pad dimensions |
580c28fd | 131 | #endif |
132 | ||
829425a5 | 133 | Int_t fMaxIndexInX; ///< maximum pad index in x |
134 | Int_t fMaxIndexInY; ///< maximum pad index in y | |
5f91c9e8 | 135 | |
d79286ca | 136 | ClassDef(AliMpSectorSegmentation,2) // Segmentation |
5f91c9e8 | 137 | }; |
138 | ||
f5ed7890 | 139 | |
140 | // inline functions | |
141 | ||
142 | inline const AliMpSector* AliMpSectorSegmentation::GetSector() const | |
143 | { return fkSector; } | |
144 | ||
5f91c9e8 | 145 | #endif //ALI_MP_SECTOR_SEGMENTATION_H |
146 |