]>
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$ |
5006ec94 | 5 | // $MpId: AliMpSectorSegmentation.h,v 1.10 2005/09/26 16:12:11 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 | /// | |
15 | /// Authors: 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 | |
21 | #include "AliMpContainers.h" | |
22 | ||
23 | #ifdef WITH_STL | |
24 | #include <map> | |
25 | #endif | |
26 | ||
27 | #ifdef WITH_ROOT | |
28 | #include <TExMap.h> | |
29 | #endif | |
30 | ||
5f91c9e8 | 31 | #include <TVector2.h> |
32 | ||
5f91c9e8 | 33 | #include "AliMpVSegmentation.h" |
5f91c9e8 | 34 | #include "AliMpPad.h" |
5f91c9e8 | 35 | |
36 | class AliMpSector; | |
37 | class AliMpMotifPosition; | |
38 | class AliMpVPadIterator; | |
2998a151 | 39 | class AliMpIntPair; |
40 | class AliMpArea; | |
5f91c9e8 | 41 | |
42 | class AliMpSectorSegmentation : public AliMpVSegmentation | |
43 | { | |
5006ec94 | 44 | public: |
45 | #ifdef WITH_STL | |
46 | typedef std::map<Int_t, TVector2> PadDimensionsMap; | |
47 | typedef PadDimensionsMap::const_iterator PadDimensionsMapCIterator; | |
48 | #endif | |
49 | #ifdef WITH_ROOT | |
50 | typedef TExMap PadDimensionsMap; | |
51 | typedef TExMapIter PadDimensionsMapCIterator; | |
52 | #endif | |
53 | ||
5f91c9e8 | 54 | public: |
55 | AliMpSectorSegmentation(const AliMpSector* sector); | |
56 | AliMpSectorSegmentation(); | |
57 | virtual ~AliMpSectorSegmentation(); | |
58 | ||
59 | // factory methods | |
60 | virtual AliMpVPadIterator* CreateIterator(const AliMpArea& area) const; | |
61 | AliMpVPadIterator* CreateIterator(const AliMpPad& centerPad, | |
62 | Bool_t includeCenter=kFALSE) const; | |
63 | ||
64 | // methods | |
65 | virtual AliMpPad PadByLocation(const AliMpIntPair& location, | |
66 | Bool_t warning = kTRUE) const; | |
67 | virtual AliMpPad PadByIndices (const AliMpIntPair& indices, | |
68 | Bool_t warning = kTRUE) const; | |
69 | virtual AliMpPad PadByPosition(const TVector2& position , | |
70 | Bool_t warning = kTRUE) const; | |
71 | virtual AliMpPad PadByDirection(const TVector2& startPosition, | |
72 | Double_t distance) const; | |
580c28fd | 73 | |
74 | virtual Int_t MaxPadIndexX(); | |
75 | virtual Int_t MaxPadIndexY(); | |
5f91c9e8 | 76 | |
77 | virtual Int_t Zone(const AliMpPad& pad, Bool_t warning = kTRUE) const; | |
78 | virtual TVector2 PadDimensions(Int_t zone, Bool_t warning = kTRUE) const; | |
79 | ||
80 | virtual Bool_t HasPad(const AliMpIntPair& indices) const; | |
81 | Bool_t HasMotifPosition(Int_t motifPositionID) const; | |
82 | TVector2 GetMinPadDimensions() const; | |
83 | Bool_t CircleTest(const AliMpIntPair& indices) const; | |
bcf37928 | 84 | void PrintZones() const; |
f5ed7890 | 85 | |
86 | const AliMpSector* GetSector() const; | |
5f91c9e8 | 87 | |
fb1bf5c0 | 88 | protected: |
89 | AliMpSectorSegmentation(const AliMpSectorSegmentation& right); | |
90 | AliMpSectorSegmentation& operator = (const AliMpSectorSegmentation& right); | |
91 | ||
5f91c9e8 | 92 | private: |
f79c58a5 | 93 | #ifdef WITH_ROOT |
bcf37928 | 94 | static const Double_t fgkS1; // the separators used for conversion |
95 | static const Double_t fgkS2; // of TVector2 to Long_t | |
f79c58a5 | 96 | |
97 | // methods | |
98 | Long_t GetIndex(const TVector2& vector2) const; | |
99 | TVector2 GetVector(Long_t index) const; | |
100 | #endif | |
101 | ||
5f91c9e8 | 102 | // methods |
103 | void FillPadDimensionsMap(); | |
104 | AliMpMotifPosition* FindMotifPosition(const AliMpIntPair& indices) const; | |
105 | virtual AliMpPad PadByXDirection(const TVector2& startPosition, | |
106 | Double_t maxX) const; | |
107 | virtual AliMpPad PadByYDirection(const TVector2& startPosition, | |
108 | Double_t maxY) const; | |
5f91c9e8 | 109 | |
110 | // data members | |
111 | const AliMpSector* fkSector; // Sector | |
112 | AliMpPad* fPadBuffer; // The pad buffer | |
f79c58a5 | 113 | #ifdef WITH_STL |
5006ec94 | 114 | PadDimensionsMap fPadDimensionsMap; // Map between zone IDs and pad dimensions |
5f91c9e8 | 115 | // EXCLUDED FOR CINT (does not compile on HP) |
f79c58a5 | 116 | #endif |
117 | #ifdef WITH_ROOT | |
118 | mutable PadDimensionsMap fPadDimensionsMap; // Map between zone IDs and pad dimensions | |
580c28fd | 119 | #endif |
120 | ||
121 | Int_t fMaxIndexInX; // maximum pad index in x | |
122 | Int_t fMaxIndexInY; // maximum pad index in y | |
5f91c9e8 | 123 | |
124 | ClassDef(AliMpSectorSegmentation,1) // Segmentation | |
125 | }; | |
126 | ||
f5ed7890 | 127 | |
128 | // inline functions | |
129 | ||
130 | inline const AliMpSector* AliMpSectorSegmentation::GetSector() const | |
131 | { return fkSector; } | |
132 | ||
5f91c9e8 | 133 | #endif //ALI_MP_SECTOR_SEGMENTATION_H |
134 |