]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpSector.h
Added the sector offset in zones.dat files and
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpSector.h
1 // $Id$
2 // Category: sector
3 //
4 // Class AliMpSector
5 // -----------------
6 // Class describing the sector of the MUON chamber of station 1.
7 //
8 // Authors: David Guez, Ivana Hrivnacova; IPN Orsay
9
10 #ifndef ALI_MP_SECTOR_H
11 #define ALI_MP_SECTOR_H
12
13 #include <TObject.h>
14 #include <TString.h>
15 #include <TVector2.h>
16
17 #include "AliMpSectorTypes.h"
18 #include "AliMpDirection.h"
19
20 class AliMpZone;
21 class AliMpRow;
22 class AliMpVRowSegment;
23 class AliMpVMotif;
24 class AliMpVPadIterator;
25 class AliMpMotifMap;
26
27 class AliMpSector : public TObject
28 {
29   public:
30     AliMpSector(const TString& id, Int_t nofZones, Int_t nofRows,
31                 AliMpDirection direction, const TVector2& offset);
32     AliMpSector();
33     virtual ~AliMpSector();
34   
35     // methods  
36     virtual AliMpVPadIterator* CreateIterator() const;
37     void  SetRowSegmentOffsets();
38     void  Initialize(); 
39     void  PrintGeometry() const;
40
41     // find methods   
42     AliMpRow*     FindRow(const TVector2& position) const;    
43     AliMpVMotif*  FindMotif(const TVector2& position) const;
44     Int_t         FindMotifPositionId(const TVector2& position) const;
45
46     AliMpRow*          FindRow(Int_t motifPositionId) const;
47     AliMpVRowSegment*  FindRowSegment(Int_t motifPositionId) const;
48     TVector2           FindPosition(Int_t motifPositionId) const;
49
50     AliMpZone*  FindZone(const TVector2& padDimensions) const;
51
52     // geometry 
53     TVector2  Position() const;
54     TVector2  Dimensions() const;
55     TVector2  Offset() const;
56    
57     // get methods
58     Int_t       GetNofZones() const;
59     AliMpZone*  GetZone(Int_t i) const;    
60     Int_t       GetNofRows() const;
61     AliMpRow*   GetRow(Int_t i) const;
62     AliMpDirection  GetDirection() const;  
63     TVector2        GetMinPadDimensions() const;
64     AliMpMotifMap*  GetMotifMap() const;
65     
66   protected:
67     AliMpSector(const AliMpSector& right);
68     AliMpSector&  operator = (const AliMpSector& right);
69
70   private:
71     // methods
72     AliMpVRowSegment* FindRowSegment(const TVector2& position) const;
73     void SetRowOffsets();
74     void SetMotifPositions();
75     void SetGlobalIndices();
76     void SetMinPadDimensions();
77
78     // data members        
79     TString    fID;       // sector ID
80     TVector2   fOffset;   // sector position
81     ZoneVector fZones;    // zones
82     RowVector  fRows;     // rows
83     AliMpMotifMap* fMotifMap; // motif map
84     AliMpDirection fDirection;// the direction of constant pad size
85     TVector2       fMinPadDimensions; // minimal pad dimensions
86
87   ClassDef(AliMpSector,1)  //Sector
88 };
89
90 // inline functions
91
92 inline TVector2  AliMpSector::Offset() const
93 { return fOffset; }
94
95 inline AliMpDirection AliMpSector::GetDirection() const 
96 { return fDirection; }    
97
98 inline TVector2   AliMpSector::GetMinPadDimensions() const
99 { return fMinPadDimensions; }
100
101 inline AliMpMotifMap* AliMpSector::GetMotifMap() const 
102 { return fMotifMap; }    
103
104 #endif //ALI_MP_SECTOR_H
105