Reordering includes, forward declarations from most specific to more
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpSector.h
CommitLineData
dee1d5f1 1/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
3
5f91c9e8 4// $Id$
2a7ea2e6 5// $MpId: AliMpSector.h,v 1.12 2006/03/17 11:38:28 ivana Exp $
dee1d5f1 6
7/// \ingroup sector
8/// \class AliMpSector
9/// \brief A sector (quadrant) of the MUON chamber of stations 1 and 2.
10///
11/// Authors: David Guez, Ivana Hrivnacova; IPN Orsay
5f91c9e8 12
13#ifndef ALI_MP_SECTOR_H
14#define ALI_MP_SECTOR_H
15
2a7ea2e6 16#include <TNamed.h>
17
5006ec94 18#include "AliMpContainers.h"
19
2a7ea2e6 20#include "AliMpDirection.h"
21#include "AliMpPlaneType.h"
22#include "AliMpIntPair.h"
5006ec94 23
2a7ea2e6 24#include <TString.h>
25#include <TVector2.h>
5006ec94 26#ifdef WITH_ROOT
27#include <TObjArray.h>
28#endif
29
2a7ea2e6 30#ifdef WITH_STL
31#include <vector>
32#endif
5f91c9e8 33
34class AliMpZone;
35class AliMpRow;
36class AliMpVRowSegment;
37class AliMpVMotif;
38class AliMpVPadIterator;
39class AliMpMotifMap;
40
2a7ea2e6 41class TArrayI;
42
5006ec94 43class AliMpSector : public TNamed
5f91c9e8 44{
45 public:
5006ec94 46#ifdef WITH_STL
47 typedef std::vector<AliMpRow*> RowVector;
48 typedef std::vector<AliMpZone*> ZoneVector;
49#endif
50#ifdef WITH_ROOT
51 typedef TObjArray RowVector;
52 typedef TObjArray ZoneVector;
53#endif
54
55 public:
ffb47139 56 AliMpSector(const TString& id, Int_t nofZones, Int_t nofRows,
14b7b896 57 AliMpDirection direction, const TVector2& offset);
5f91c9e8 58 AliMpSector();
59 virtual ~AliMpSector();
60
61 // methods
62 virtual AliMpVPadIterator* CreateIterator() const;
63 void SetRowSegmentOffsets();
64 void Initialize();
65 void PrintGeometry() const;
66
67 // find methods
68 AliMpRow* FindRow(const TVector2& position) const;
69 AliMpVMotif* FindMotif(const TVector2& position) const;
70 Int_t FindMotifPositionId(const TVector2& position) const;
71
72 AliMpRow* FindRow(Int_t motifPositionId) const;
73 AliMpVRowSegment* FindRowSegment(Int_t motifPositionId) const;
74 TVector2 FindPosition(Int_t motifPositionId) const;
75
76 AliMpZone* FindZone(const TVector2& padDimensions) const;
77
78 // geometry
79 TVector2 Position() const;
80 TVector2 Dimensions() const;
81
f9a3ff6a 82 //
5f91c9e8 83 // get methods
f9a3ff6a 84
5f91c9e8 85 Int_t GetNofZones() const;
86 AliMpZone* GetZone(Int_t i) const;
f9a3ff6a 87
5f91c9e8 88 Int_t GetNofRows() const;
89 AliMpRow* GetRow(Int_t i) const;
f9a3ff6a 90
5f91c9e8 91 AliMpDirection GetDirection() const;
f9a3ff6a 92 AliMpPlaneType GetPlaneType() const;
93
5f91c9e8 94 TVector2 GetMinPadDimensions() const;
f9a3ff6a 95 AliMpIntPair GetMaxPadIndices() const;
96 Int_t GetNofPads() const;
97
5f91c9e8 98 AliMpMotifMap* GetMotifMap() const;
f9a3ff6a 99 void GetAllMotifPositionsIDs(TArrayI& ecn) const;
5f91c9e8 100
c9da0af9 101 virtual void Print(Option_t* opt="") const;
102
c9da0af9 103
fb1bf5c0 104 protected:
105 AliMpSector(const AliMpSector& right);
106 AliMpSector& operator = (const AliMpSector& right);
107
5f91c9e8 108 private:
109 // methods
110 AliMpVRowSegment* FindRowSegment(const TVector2& position) const;
111 void SetRowOffsets();
112 void SetMotifPositions();
113 void SetGlobalIndices();
114 void SetMinPadDimensions();
f9a3ff6a 115 void SetMaxPadIndices();
116 void SetNofPads();
5f91c9e8 117
118 // data members
119 TString fID; // sector ID
120 TVector2 fOffset; // sector position
121 ZoneVector fZones; // zones
122 RowVector fRows; // rows
123 AliMpMotifMap* fMotifMap; // motif map
124 AliMpDirection fDirection;// the direction of constant pad size
125 TVector2 fMinPadDimensions; // minimal pad dimensions
f9a3ff6a 126 AliMpIntPair fMaxPadIndices; // maximum pad indices
127 Int_t fNofPads; // total number of pads
128
5f91c9e8 129
130 ClassDef(AliMpSector,1) //Sector
131};
132
133// inline functions
134
135inline AliMpDirection AliMpSector::GetDirection() const
136{ return fDirection; }
137
138inline TVector2 AliMpSector::GetMinPadDimensions() const
139{ return fMinPadDimensions; }
140
f9a3ff6a 141inline AliMpIntPair AliMpSector::GetMaxPadIndices() const
142{ return fMaxPadIndices; }
143
144inline Int_t AliMpSector::GetNofPads() const
145{ return fNofPads; }
146
5f91c9e8 147inline AliMpMotifMap* AliMpSector::GetMotifMap() const
148{ return fMotifMap; }
149
150#endif //ALI_MP_SECTOR_H
151