]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/MUONmapping/AliMpSector.h
Fixes for object target dependencies
[u/mrichter/AliRoot.git] / MUON / MUONmapping / 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 "AliMpDirection.h"
19 #include "AliMpPlaneType.h"
20 #include "AliMpEncodePair.h"
21
22 #include <TString.h>
23 #include <TObjArray.h>
24
25 class AliMpZone;
26 class AliMpRow;
27 class AliMpVRowSegment;
28 class AliMpVMotif;
29 class AliMpVPadIterator;
30 class AliMpMotifMap;
31
32 class TArrayI;
33
34 class AliMpSector : public TNamed
35 {
36   public:
37     AliMpSector(const TString& id, Int_t nofZones, Int_t nofRows,
38                 AliMp::Direction direction, 
39                 Double_t offsetx, Double_t offsety);
40     AliMpSector();
41     virtual ~AliMpSector();
42   
43     // methods  
44     virtual AliMpVPadIterator* CreateIterator() const;
45     
46     void  SetRowSegmentOffsets();
47     void  Initialize(); 
48     void  PrintGeometry() const;
49
50     // find methods   
51     Int_t  FindMotifPositionId(Double_t x, Double_t y) const;
52
53     AliMpRow*          FindRow(Int_t motifPositionId) const;
54     AliMpVRowSegment*  FindRowSegment(Int_t motifPositionId) const;
55
56
57     // geometry 
58     Double_t  GetPositionX() const;
59     Double_t  GetPositionY() const;
60     Double_t  GetDimensionX() const;
61     Double_t  GetDimensionY() const;
62    
63     //
64     // get methods
65
66     Int_t       GetNofZones() const;
67     AliMpZone*  GetZone(Int_t i) const;    
68
69     Int_t       GetNofRows() const;
70     AliMpRow*   GetRow(Int_t i) const;
71
72     AliMp::Direction  GetDirection() const;  
73     AliMp::PlaneType  GetPlaneType() const;  
74
75     Double_t    GetMinPadDimensionX() const;
76     Double_t    GetMinPadDimensionY() const;
77     Double_t    GetMaxPadDimensionX() const;
78     Double_t    GetMaxPadDimensionY() const;
79     MpPair_t    GetMaxPadIndices() const;
80     Int_t       GetNofPads() const;
81
82     AliMpMotifMap*  GetMotifMap() const;
83
84     Int_t  GetNofMotifPositions() const;
85     void   GetAllMotifPositionsIDs(TArrayI& ecn) const;
86     
87     virtual void Print(Option_t* opt="") const;
88     
89     
90   private:
91     /// Not implemented
92     AliMpSector(const AliMpSector& right);
93     /// Not implemented
94     AliMpSector&  operator = (const AliMpSector& right);
95
96     // methods
97     AliMpRow*         FindRow(Double_t y) const;    
98     AliMpVRowSegment* FindRowSegment(Double_t x, Double_t y) const;
99
100     void SetRowOffsets();
101     void SetMotifPositions();
102     void SetGlobalIndices();
103     void SetMinMaxPadDimensions();
104     void SetMaxPadIndices();
105     void SetNofPads();
106     void SetDimensions();
107
108     // data members        
109     TString    fID;       ///< sector ID
110     Double_t   fOffsetX;  ///< sector x position
111     Double_t   fOffsetY;  ///< sector y position
112     Double_t   fDimensionX;  ///< sector x dimension
113     Double_t   fDimensionY;  ///< sector y dimension
114     TObjArray  fZones;    ///< zones
115     TObjArray  fRows;     ///< rows
116     AliMpMotifMap*   fMotifMap;         ///< motif map
117     AliMp::Direction fDirection;        ///< the direction of constant pad size
118     Double_t         fMinPadDimensionX; ///< minimum pad x dimensions
119     Double_t         fMinPadDimensionY; ///< minimum pad y dimensions
120     Double_t         fMaxPadDimensionX; ///< miximum pad x dimensions
121     Double_t         fMaxPadDimensionY; ///< miximum pad y dimensions
122     MpPair_t         fLMaxPadIndices;   ///< maximum pad indices    
123     Int_t            fNofPads;          ///<  total number of pads
124
125   ClassDef(AliMpSector,3)  // Sector
126 };
127
128 // inline functions
129
130 /// Return the direction of constant pad size
131 inline AliMp::Direction AliMpSector::GetDirection() const 
132 { return fDirection; }    
133
134 /// Return minimum x pad dimensions
135 inline Double_t  AliMpSector::GetMinPadDimensionX() const
136 { return fMinPadDimensionX; }
137
138 /// Return maximum y pad dimensions
139 inline Double_t  AliMpSector::GetMinPadDimensionY() const
140 { return fMinPadDimensionY; }
141
142 /// Return maximum x pad dimensions
143 inline Double_t  AliMpSector::GetMaxPadDimensionX() const
144 { return fMaxPadDimensionX; }
145
146 /// Return minimum y pad dimensions
147 inline Double_t  AliMpSector::GetMaxPadDimensionY() const
148 { return fMaxPadDimensionY; }
149
150 /// Return maximum pad indices
151 inline MpPair_t  AliMpSector::GetMaxPadIndices() const
152 { return fLMaxPadIndices; }
153
154 /// Return total number of pads
155 inline Int_t  AliMpSector::GetNofPads() const
156 { return fNofPads; }
157
158 /// Return the motif map
159 inline AliMpMotifMap* AliMpSector::GetMotifMap() const 
160 { return fMotifMap; }    
161
162 #endif //ALI_MP_SECTOR_H
163