]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpRow.h
dc9bc623f52c5bd7d4965327df3b4ec32bcd0df6
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpRow.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: AliMpRow.h,v 1.8 2005/09/26 16:12:11 ivana Exp $
6
7 /// \ingroup sector
8 /// \class AliMpRow
9 /// \brief A row composed of the row segments.
10 ///
11 /// Authors: David Guez, Ivana Hrivnacova; IPN Orsay
12
13 #ifndef ALI_MP_ROW_H
14 #define ALI_MP_ROW_H
15
16 #include "AliMpContainers.h"
17
18 #ifdef WITH_STL
19 #include <vector>
20 #endif
21
22 #ifdef WITH_ROOT
23 #include <TList.h>
24 #endif
25
26 #include <TVector2.h>
27
28 #include "AliMpVIndexed.h"
29 #include "AliMpDirection.h"
30
31 class AliMpVRowSegment;
32 class AliMpVPadIterator;
33 class AliMpMotifPosition;
34 class AliMpMotifMap;
35
36 class AliMpRow : public AliMpVIndexed
37 {
38   public:
39 #ifdef WITH_STL
40     typedef std::vector<AliMpVRowSegment*>  RowSegmentVector;
41 #endif
42 #ifdef WITH_ROOT
43     typedef TList  RowSegmentVector;
44 #endif
45
46   public:
47     AliMpRow(Int_t id, AliMpMotifMap* motifMap);
48     AliMpRow();
49     virtual ~AliMpRow();
50   
51     // methods
52     void  AddRowSegment(AliMpVRowSegment* rowSegment);
53     void  AddRowSegmentInFront(AliMpVRowSegment* rowSegment);
54     AliMpVRowSegment*  FindRowSegment(Double_t x) const;
55     Double_t  LowBorderY() const;
56     Double_t  UpperBorderY() const;
57     virtual AliMpVPadIterator* CreateIterator() const;
58     
59     void      SetRowSegmentOffsets(const TVector2& offset);
60     Double_t  SetOffsetY(Double_t offsetY);
61     void      SetMotifPositions();
62     void      SetGlobalIndices(AliMpDirection constPadSizeDirection, 
63                                AliMpRow* rowBefore);
64
65     // geometry
66     TVector2  Position() const;
67     TVector2  Dimensions() const;    
68
69     // get methods
70     UInt_t   GetID() const;
71     Int_t    GetNofRowSegments() const;
72     AliMpVRowSegment*  GetRowSegment(Int_t i) const;
73     AliMpMotifMap*     GetMotifMap() const;
74
75   protected:
76     AliMpRow(const AliMpRow& right);
77     AliMpRow&  operator = (const AliMpRow& right);
78
79   private:
80     // methods
81     AliMpVRowSegment*    FindRowSegment(Int_t ix) const;
82     AliMpMotifPosition*  FindMotifPosition(AliMpVRowSegment* segment, Int_t ix) const;
83     void SetHighIndicesLimits(Int_t iy);
84     void CheckEmpty() const;
85   
86     // data members
87     UInt_t            fID;      // row ID
88     Double_t          fOffsetY; // the y position of the centre of motifs
89     RowSegmentVector  fSegments;// row segments
90     AliMpMotifMap*    fMotifMap;// the motif map associated with its sector
91
92   ClassDef(AliMpRow,1)  //Row
93 };
94
95 // inline functions
96
97 inline  UInt_t  AliMpRow::GetID() const { return fID; }
98 inline  AliMpMotifMap*  AliMpRow::GetMotifMap() const { return fMotifMap; }
99
100 #endif //ALI_MP_ROW_H
101