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