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