]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpSector.h
Syntax change propagation (Laurent)
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpSector.h
1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2  * See cxx source for full Copyright notice                               */
3
4 // $Id$
5 // $MpId: AliMpSector.h,v 1.14 2006/05/24 13:58:21 ivana Exp $
6
7 /// \ingroup sector
8 /// \class AliMpSector
9 /// \brief A sector (quadrant) of the MUON chamber of stations 1 and 2.
10 ///
11 /// \author David Guez, Ivana Hrivnacova; IPN Orsay
12
13 #ifndef ALI_MP_SECTOR_H
14 #define ALI_MP_SECTOR_H
15
16 #include <TNamed.h>
17
18 #include "AliMpContainers.h"
19
20 #include "AliMpDirection.h"
21 #include "AliMpPlaneType.h"
22 #include "AliMpIntPair.h"
23
24 #include <TString.h>
25 #include <TVector2.h>
26 #ifdef WITH_ROOT
27 #include <TObjArray.h>
28 #endif
29
30 #ifdef WITH_STL
31 #include <vector>
32 #endif
33
34 class AliMpZone;
35 class AliMpRow;
36 class AliMpVRowSegment;
37 class AliMpVMotif;
38 class AliMpVPadIterator;
39 class AliMpMotifMap;
40
41 class TArrayI;
42
43 class AliMpSector : public TNamed
44 {
45   public:
46 #ifdef WITH_STL
47     typedef std::vector<AliMpRow*> RowVector;
48     typedef std::vector<AliMpZone*> ZoneVector;
49 #endif
50 #ifdef WITH_ROOT
51     typedef TObjArray  RowVector;
52     typedef TObjArray  ZoneVector;
53 #endif
54
55   public:
56     AliMpSector(const TString& id, Int_t nofZones, Int_t nofRows,
57                 AliMp::Direction direction, const TVector2& offset);
58     AliMpSector();
59     virtual ~AliMpSector();
60   
61     // methods  
62     virtual AliMpVPadIterator* CreateIterator() const;
63     void  SetRowSegmentOffsets();
64     void  Initialize(); 
65     void  PrintGeometry() const;
66
67     // find methods   
68     AliMpRow*     FindRow(const TVector2& position) const;    
69     AliMpVMotif*  FindMotif(const TVector2& position) const;
70     Int_t         FindMotifPositionId(const TVector2& position) const;
71
72     AliMpRow*          FindRow(Int_t motifPositionId) const;
73     AliMpVRowSegment*  FindRowSegment(Int_t motifPositionId) const;
74     TVector2           FindPosition(Int_t motifPositionId) const;
75
76     AliMpZone*  FindZone(const TVector2& padDimensions) const;
77
78     // geometry 
79     TVector2  Position() const;
80     TVector2  Dimensions() const;
81    
82     //
83     // get methods
84
85     Int_t       GetNofZones() const;
86     AliMpZone*  GetZone(Int_t i) const;    
87
88     Int_t       GetNofRows() const;
89     AliMpRow*   GetRow(Int_t i) const;
90
91     AliMp::Direction  GetDirection() const;  
92     AliMp::PlaneType  GetPlaneType() const;  
93
94     TVector2        GetMinPadDimensions() const;
95     AliMpIntPair    GetMaxPadIndices() const;
96     Int_t           GetNofPads() const;
97
98     AliMpMotifMap*  GetMotifMap() const;
99     void            GetAllMotifPositionsIDs(TArrayI& ecn) const;
100     
101     virtual void Print(Option_t* opt="") const;
102     
103     
104   private:
105     AliMpSector(const AliMpSector& right);
106     AliMpSector&  operator = (const AliMpSector& right);
107
108     // methods
109     AliMpVRowSegment* FindRowSegment(const TVector2& position) const;
110     void SetRowOffsets();
111     void SetMotifPositions();
112     void SetGlobalIndices();
113     void SetMinPadDimensions();
114     void SetMaxPadIndices();
115     void SetNofPads();
116
117     // data members        
118     TString    fID;       ///< sector ID
119     TVector2   fOffset;   ///< sector position
120     ZoneVector fZones;    ///< zones
121     RowVector  fRows;     ///< rows
122     AliMpMotifMap*   fMotifMap; ///< motif map
123     AliMp::Direction fDirection;///< the direction of constant pad size
124     TVector2         fMinPadDimensions; ///< minimal pad dimensions
125     AliMpIntPair     fMaxPadIndices;    ///< maximum pad indices    
126     Int_t            fNofPads;          ///<  total number of pads
127
128
129   ClassDef(AliMpSector,1)  // Sector
130 };
131
132 // inline functions
133
134 inline AliMp::Direction AliMpSector::GetDirection() const 
135 { return fDirection; }    
136
137 inline TVector2   AliMpSector::GetMinPadDimensions() const
138 { return fMinPadDimensions; }
139
140 inline AliMpIntPair  AliMpSector::GetMaxPadIndices() const
141 { return fMaxPadIndices; }
142
143 inline Int_t  AliMpSector::GetNofPads() const
144 { return fNofPads; }
145
146 inline AliMpMotifMap* AliMpSector::GetMotifMap() const 
147 { return fMotifMap; }    
148
149 #endif //ALI_MP_SECTOR_H
150