]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/mapping/AliMpSlat.h
Added a function to get the name of a planeType
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpSlat.h
CommitLineData
dee1d5f1 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: AliMpSlat.h,v 1.2 2005/09/19 19:01:09 ivana Exp $
6
7/// \ingroup slat
8/// \class AliMpSlat
9/// \brief A slat (building block of stations 3, 4 and 5)
10///
11/// Author: Laurent Aphecetche
12
13#ifndef ALI_MP_SLAT_H
14#define ALI_MP_SLAT_H
15
16#include <TObject.h>
17
18#ifndef ROOT_TString
19#include "TString.h"
20#endif
21
22#ifndef ALI_MP_V_SEGMENTATION_H
23#include "AliMpVSegmentation.h"
24#endif
25
26#ifndef ALI_MP_PAD_H
27#include "AliMpPad.h"
28#endif
29
30#include "AliMpContainers.h"
31
32class TArrayI;
33
34#ifdef WITH_ROOT
35# include "TExMap.h"
36# include "TObjArray.h"
37#else
38# include <vector>
39# include <map>
40#endif
41
42class AliMpMotifPosition;
43class AliMpPCB;
44
45class AliMpSlat : public TObject
46{
47 public:
48
49#ifdef WITH_ROOT
50 typedef Int_t Size_t;
51#else
52 typedef UInt_t Size_t;
53#endif
54
55 AliMpSlat();
56 AliMpSlat(const char* id);
57 virtual ~AliMpSlat();
58
59 TVector2 Dimensions() const;
60
61 const char* GetID() const;
62
63 void Add(AliMpPCB* pcbType, const TArrayI& manuList);
64
65 Double_t DX() const;
66 Double_t DY() const;
67
68 /// Find the PCB containing the pad at location (ix,any iy).
69 AliMpPCB* FindPCB(Int_t ix) const;
70
71 /** Find the index of the PCB containing the pad at location ix.
72 Should not be needed except to comply with Sector(), Dpx(), Dpy()
73 interface of old AliMUONVGeometrySegmentation.
74 FIXME: Remove me when VGeometrySegmentation dies at last.
75 */
76 Int_t FindPCBIndex(Int_t ix) const;
77
78 /// Find the PCB containing location (x,y).
79 AliMpPCB* FindPCB(Double_t x, Double_t y) const;
80
81 /** Find the index of the PCB containing the pad at location (x,y).
82 Should not be needed except to comply with Sector(), Dpx(), Dpy()
83 interface of old AliMUONVGeometrySegmentation.
84 FIXME: Remove me when VGeometrySegmentation dies at last.
85 */
86 Int_t FindPCBIndex(Double_t x, Double_t y) const;
87
88 /// Returns the i-th PCB of this slat.
89 AliMpPCB* GetPCB(Size_t i) const;
90
91 /// Returns the MotifPosition containing location (x,y).
92 AliMpMotifPosition* FindMotifPosition(Double_t x, Double_t y) const;
93
94 /// Returns the MotifPosition which id is manuid.
95 AliMpMotifPosition* FindMotifPosition(Int_t manuid) const;
96
97 /// Returns the MotifPosition containing the pad located at (ix,iy).
98 AliMpMotifPosition* FindMotifPosition(Int_t ix, Int_t iy) const;
99
100 /// Returns the number of PCBs of this slat.
101 Size_t GetSize() const;
102
103 /// Returns the number of pads in the x-direction contained in this slat.
104 Int_t GetNofPadsX() const;
105
106 /** Returns the max. number of pads in the x-direction contained in this slat.
107 This is a max only as for e.g. non-bending slats, the y-dimension depends
108 on the x-position.
109 */
110 Int_t GetMaxNofPadsY() const;
111
112 void Print(Option_t* option="") const;
113
114 private:
115 TString fId;
116 Double_t fDX;
117 Double_t fDY;
118 Int_t fNofPadsX;
119 Int_t fMaxNofPadsY;
120#ifdef WITH_ROOT
121 TObjArray fPCBs; // array of AliMpPCB*
122 mutable TExMap fManuMap; // map of int to AliMpMotifPosition*
123#else
124 std::vector<AliMpPCB*> fPCBs;
125 std::map<int,AliMpMotifPosition*> fManuMap;
126#endif
127
128 ClassDef(AliMpSlat,1) // A slat for stations 3,4,5
129};
130
131#endif