Reordering includes, forward declarations from most specific to more
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpVRowSegmentSpecial.h
CommitLineData
dee1d5f1 1/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
3
ea4cae7a 4// $Id$
2a7ea2e6 5// $MpId: AliMpVRowSegmentSpecial.h,v 1.8 2006/03/17 11:38:28 ivana Exp $
dee1d5f1 6
7/// \ingroup sector
8/// \class AliMpVRowSegmentSpecial
9/// \brief Abstract base class for a special row segment composed of the
10/// pad rows.
11///
12/// Authors: David Guez, Ivana Hrivnacova; IPN Orsay
ea4cae7a 13
14#ifndef ALI_MP_V_ROW_SEGMENT_SPECIAL_H
15#define ALI_MP_V_ROW_SEGMENT_SPECIAL_H
16
5006ec94 17#include "AliMpContainers.h"
18
2a7ea2e6 19#include "AliMpVRowSegment.h"
20#include "AliMpVMotif.h"
5006ec94 21
2a7ea2e6 22#include <TVector2.h>
5006ec94 23#ifdef WITH_ROOT
24#include <TArrayI.h>
25#include <TObjArray.h>
26#endif
27
2a7ea2e6 28#ifdef WITH_STL
29#include <vector>
30#endif
ea4cae7a 31
32class AliMpRow;
33class AliMpPadRow;
34class AliMpVPadRowSegment;
35class AliMpIntPair;
36
37class AliMpVRowSegmentSpecial : public AliMpVRowSegment
38{
39 public:
5006ec94 40#ifdef WITH_STL
41 typedef std::vector<AliMpPadRow*> PadRowVector;
42 typedef std::vector<AliMpVMotif*> MotifVector;
43 typedef std::vector<Int_t> MotifPositionIdVector;
44#endif
45#ifdef WITH_ROOT
46 typedef TObjArray PadRowVector;
47 typedef TObjArray MotifVector;
48 typedef TArrayI MotifPositionIdVector;
49#endif
50
51 public:
ea4cae7a 52 AliMpVRowSegmentSpecial(AliMpRow* row, Double_t offsetX);
53 AliMpVRowSegmentSpecial();
54 virtual ~AliMpVRowSegmentSpecial();
55
56 // methods
57 void AddPadRow(AliMpPadRow* padRow);
58 void UpdateMotifVector();
59 virtual void UpdatePadsOffset() = 0;
60 virtual Double_t LeftBorderX() const = 0;
61 virtual Double_t RightBorderX() const= 0;
62 virtual Double_t HalfSizeY() const;
63
64 // find methods
65 virtual AliMpVMotif* FindMotif(const TVector2& position) const;
66 virtual Int_t FindMotifPositionId(const TVector2& position) const;
67 virtual Bool_t HasMotifPosition(Int_t motifPositionId) const;
68 virtual TVector2 MotifCenter(Int_t motifPositionId) const;
69
70 // geometry
71 virtual TVector2 Position() const = 0;
72 virtual TVector2 Dimensions() const;
73
74 // set methods
75 virtual void SetOffset(const TVector2& /*offset*/) {}
580c28fd 76 virtual void SetGlobalIndices(AliMpRow* rowBefore) = 0;
ea4cae7a 77 virtual Int_t SetIndicesToMotifPosition(Int_t i,
78 const AliMpIntPair& indices) = 0;
79
80 // get methods
81 virtual AliMpRow* GetRow() const;
82 virtual Int_t GetNofMotifs() const;
83 virtual AliMpVMotif* GetMotif(Int_t i) const;
84 virtual Int_t GetMotifPositionId(Int_t i) const;
85
86 protected:
fb1bf5c0 87 AliMpVRowSegmentSpecial(const AliMpVRowSegmentSpecial& right);
88 AliMpVRowSegmentSpecial& operator = (const AliMpVRowSegmentSpecial& right);
89
ea4cae7a 90 // methods
91 virtual TVector2 MotifCenterSlow(Int_t motifPositionId) const = 0;
92 AliMpPadRow* FindPadRow(Double_t y) const;
93 AliMpVPadRowSegment* FindPadRowSegment(Int_t motifPositionId) const;
94 AliMpIntPair FindRelativeLowIndicesOf(Int_t motifPositionId) const;
95 Int_t MaxNofPadsInRow() const;
96 Bool_t HasMotif(const AliMpVMotif* motif) const;
97
98 // get methods
99 Int_t GetNofPadRows() const;
100 AliMpPadRow* GetPadRow(Int_t i) const;
101 Double_t GetOffsetX() const;
102
103 private:
f79c58a5 104#ifdef WITH_ROOT
105 // static data members
106 static const Int_t fgkMaxNofMotifPositionIds; // dimension of fMotifPositionIds
107#endif
108
ea4cae7a 109 // data members
110 AliMpRow* fRow; //the row containing this segment
111 Double_t fOffsetX; //the x position of the border that touches a standard
112 //row segment
113 PadRowVector fPadRows; //pad rows vector
114 MotifVector fMotifs; //motifs vector
115 MotifPositionIdVector fMotifPositionIds; //motifs position Ids vector
5006ec94 116
f79c58a5 117#ifdef WITH_ROOT
5006ec94 118 Int_t fNofMotifPositionIds; // number of motif positions Ids
f79c58a5 119#endif
ea4cae7a 120
121 ClassDef(AliMpVRowSegmentSpecial,1) //Row segment
122};
123
124// inline functions
125
126inline Double_t AliMpVRowSegmentSpecial::GetOffsetX() const
127{ return fOffsetX; }
128
129#endif //ALI_MP_V_ROW_SEGMENT_SPECIAL_H