]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/mapping/AliMpSlat.h
Updated det element names (Christian)
[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$
13985652 5// $MpId: AliMpSlat.h,v 1.8 2006/05/24 13:58:24 ivana Exp $
dee1d5f1 6
7/// \ingroup slat
8/// \class AliMpSlat
9/// \brief A slat (building block of stations 3, 4 and 5)
10///
13985652 11// Author: Laurent Aphecetche
dee1d5f1 12
13#ifndef ALI_MP_SLAT_H
14#define ALI_MP_SLAT_H
15
16#include <TObject.h>
17
18#ifndef ROOT_TString
19b51aad 19# include "TString.h"
20#endif
21
22#ifndef ALI_MP_PAD_H
23# include "AliMpPad.h"
dee1d5f1 24#endif
25
26#ifndef ALI_MP_V_SEGMENTATION_H
19b51aad 27# include "AliMpVSegmentation.h"
dee1d5f1 28#endif
29
19b51aad 30#ifndef ALI_MP_PLANE_TYPE_H
31# include "AliMpPlaneType.h"
dee1d5f1 32#endif
33
34#include "AliMpContainers.h"
0f60374b 35#include "AliMpExMap.h"
dee1d5f1 36
37class TArrayI;
38
39#ifdef WITH_ROOT
dee1d5f1 40# include "TObjArray.h"
41#else
42# include <vector>
0f60374b 43//# include <map>
dee1d5f1 44#endif
45
46class AliMpMotifPosition;
47class AliMpPCB;
19b51aad 48class TArrayI;
dee1d5f1 49
50class AliMpSlat : public TObject
51{
52 public:
53
54#ifdef WITH_ROOT
55 typedef Int_t Size_t;
56#else
57 typedef UInt_t Size_t;
58#endif
59
60 AliMpSlat();
cddd101e 61 AliMpSlat(const char* id, AliMp::PlaneType bendingOrNonBending);
dee1d5f1 62 virtual ~AliMpSlat();
63
64 TVector2 Dimensions() const;
efb408b3 65 TVector2 Position() const { return fPosition; }
19b51aad 66
67 const char* GetName() const;
68
dee1d5f1 69 const char* GetID() const;
70
d21dc4b0 71 void Add(const AliMpPCB& pcbType, const TArrayI& manuList);
dee1d5f1 72
73 Double_t DX() const;
74 Double_t DY() const;
75
76 /// Find the PCB containing the pad at location (ix,any iy).
77 AliMpPCB* FindPCB(Int_t ix) const;
78
79 /** Find the index of the PCB containing the pad at location ix.
80 Should not be needed except to comply with Sector(), Dpx(), Dpy()
81 interface of old AliMUONVGeometrySegmentation.
82 FIXME: Remove me when VGeometrySegmentation dies at last.
83 */
84 Int_t FindPCBIndex(Int_t ix) const;
85
86 /// Find the PCB containing location (x,y).
87 AliMpPCB* FindPCB(Double_t x, Double_t y) const;
88
62abf021 89 /// Find the index of the PCB containing the pad at location (x,y).
dee1d5f1 90 Int_t FindPCBIndex(Double_t x, Double_t y) const;
91
92 /// Returns the i-th PCB of this slat.
93 AliMpPCB* GetPCB(Size_t i) const;
94
95 /// Returns the MotifPosition containing location (x,y).
96 AliMpMotifPosition* FindMotifPosition(Double_t x, Double_t y) const;
97
98 /// Returns the MotifPosition which id is manuid.
99 AliMpMotifPosition* FindMotifPosition(Int_t manuid) const;
100
101 /// Returns the MotifPosition containing the pad located at (ix,iy).
102 AliMpMotifPosition* FindMotifPosition(Int_t ix, Int_t iy) const;
103
19b51aad 104 /// Return the ids of the electronic cards (either manu or local board).
c9da0af9 105 void GetAllMotifPositionsIDs(TArrayI& ecn) const;
19b51aad 106
107 /** Returns the max. number of pads in the x-direction contained in this slat.
108 This is a max only as for e.g. non-bending slats, the y-dimension depends
109 on the x-position.
110 */
111 Int_t GetMaxNofPadsY() const;
112
16e8fffd 113 /** Returns the max index useable in x-direction.
114 Note that this can be different from GetNofPadsX()-1 for rounded slats.
115 */
116 Int_t GetMaxPadIndexX() const;
117
19b51aad 118 /// Return the number of electronic cards (either manu or local board).
119 Int_t GetNofElectronicCards() const;
120
dee1d5f1 121 /// Returns the number of pads in the x-direction contained in this slat.
122 Int_t GetNofPadsX() const;
123
19b51aad 124 /// Returns the number of PCBs of this slat.
125 Size_t GetSize() const;
126
dee1d5f1 127 void Print(Option_t* option="") const;
128
19b51aad 129 /** This is normally only used by triggerSlats, as for ST345 slats,
130 the position is DX(),DY() simply.
131 */
132 void ForcePosition(const TVector2& pos);
133
cddd101e 134 AliMp::PlaneType PlaneType() const { return fPlaneType; }
efb408b3 135
136 Int_t NofPads() const { return fNofPads; }
137
13e7956b 138 private:
efb408b3 139 AliMpSlat(const AliMpSlat& rhs);
140 AliMpSlat& operator=(const AliMpSlat& rhs);
13e7956b 141
829425a5 142 TString fId; ///< The name of this slat, e.g. 112233N
cddd101e 143 AliMp::PlaneType fPlaneType; ///< Whether it's bending or non-bending plane
829425a5 144 Double_t fDX; ///< Half-size in X (cm)
145 Double_t fDY; ///< Half-size in Y (cm)
146 Int_t fNofPadsX; ///< Actual number of pads in x direction
147 Int_t fMaxNofPadsY; ///< Maximum number of pads in y direction
148 mutable AliMpExMap fManuMap; ///< map of int to AliMpMotifPosition*
dee1d5f1 149#ifdef WITH_ROOT
829425a5 150 TObjArray fPCBs; ///< array of AliMpPCB*
dee1d5f1 151#else
829425a5 152 std::vector<AliMpPCB*> fPCBs; ///< array of AliMpPCB*
dee1d5f1 153#endif
829425a5 154 TVector2 fPosition; ///< Position of the slat center.
155 Int_t fNofPads; ///< number of pads in this slat
dee1d5f1 156
efb408b3 157 ClassDef(AliMpSlat,2) // A slat for stations 3,4,5
dee1d5f1 158};
159
160#endif