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