1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
5 // $MpId: AliMpSlat.h,v 1.8 2006/05/24 13:58:24 ivana Exp $
9 /// \brief A slat (building block of stations 3, 4 and 5)
11 // Author: Laurent Aphecetche
23 # include "AliMpPad.h"
26 #ifndef ALI_MP_V_SEGMENTATION_H
27 # include "AliMpVSegmentation.h"
30 #ifndef ALI_MP_PLANE_TYPE_H
31 # include "AliMpPlaneType.h"
34 #include "AliMpContainers.h"
35 #include "AliMpExMap.h"
40 # include "TObjArray.h"
46 class AliMpMotifPosition;
50 class AliMpSlat : public TObject
55 /// Type def for the array size
58 /// Type def for the array size
59 typedef UInt_t Size_t;
63 AliMpSlat(const char* id, AliMp::PlaneType bendingOrNonBending);
66 TVector2 Dimensions() const;
69 TVector2 Position() const { return fPosition; }
71 const char* GetName() const;
73 const char* GetID() const;
75 void Add(const AliMpPCB& pcbType, const TArrayI& manuList);
80 /// Find the PCB containing the pad at location (ix,any iy).
81 AliMpPCB* FindPCB(Int_t ix) const;
83 /// Find the index of the PCB containing the pad at location ix.
84 Int_t FindPCBIndex(Int_t ix) const;
86 /// Find the index of the PCB containing a given manu
87 Int_t FindPCBIndexByMotifPositionID(Int_t manuId) const;
89 /// Find the PCB containing location (x,y).
90 AliMpPCB* FindPCB(Double_t x, Double_t y) const;
92 /// Find the index of the PCB containing the pad at location (x,y).
93 Int_t FindPCBIndex(Double_t x, Double_t y) const;
95 /// Returns the i-th PCB of this slat.
96 AliMpPCB* GetPCB(Size_t i) const;
98 /// Returns the MotifPosition containing location (x,y).
99 AliMpMotifPosition* FindMotifPosition(Double_t x, Double_t y) const;
101 /// Returns the MotifPosition which id is manuid.
102 AliMpMotifPosition* FindMotifPosition(Int_t manuid) const;
104 /// Returns the MotifPosition containing the pad located at (ix,iy).
105 AliMpMotifPosition* FindMotifPosition(Int_t ix, Int_t iy) const;
107 /// Return the ids of the electronic cards (either manu or local board).
108 void GetAllMotifPositionsIDs(TArrayI& ecn) const;
110 /** Returns the max. number of pads in the x-direction contained in this slat.
111 This is a max only as for e.g. non-bending slats, the y-dimension depends
114 Int_t GetMaxNofPadsY() const;
116 /** Returns the max index useable in x-direction.
117 Note that this can be different from GetNofPadsX()-1 for rounded slats.
119 Int_t GetMaxPadIndexX() const;
121 /// Return the number of electronic cards (either manu or local board).
122 Int_t GetNofElectronicCards() const;
124 /// Returns the number of pads in the x-direction contained in this slat.
125 Int_t GetNofPadsX() const;
127 /// Returns the number of PCBs of this slat.
128 Size_t GetSize() const;
130 void Print(Option_t* option="") const;
132 /** This is normally only used by triggerSlats, as for ST345 slats,
133 the position is DX(),DY() simply.
135 void ForcePosition(const TVector2& pos);
137 /// Return the plane type
138 AliMp::PlaneType PlaneType() const { return fPlaneType; }
140 /// Return the number of pads in this slat
141 Int_t NofPads() const { return fNofPads; }
145 AliMpSlat(const AliMpSlat& rhs);
147 AliMpSlat& operator=(const AliMpSlat& rhs);
149 TString fId; ///< The name of this slat, e.g. 112233N
150 AliMp::PlaneType fPlaneType; ///< Whether it's bending or non-bending plane
151 Double_t fDX; ///< Half-size in X (cm)
152 Double_t fDY; ///< Half-size in Y (cm)
153 Int_t fNofPadsX; ///< Actual number of pads in x direction
154 Int_t fMaxNofPadsY; ///< Maximum number of pads in y direction
155 mutable AliMpExMap fManuMap; ///< map of int to AliMpMotifPosition*
157 TObjArray fPCBs; ///< array of AliMpPCB*
159 std::vector<AliMpPCB*> fPCBs; ///< array of AliMpPCB*
161 TVector2 fPosition; ///< Position of the slat center.
162 Int_t fNofPads; ///< number of pads in this slat
164 ClassDef(AliMpSlat,2) // A slat for stations 3,4,5