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
17 # include "AliMpPad.h"
20 #ifndef ALI_MP_V_SEGMENTATION_H
21 # include "AliMpVSegmentation.h"
24 #ifndef ALI_MP_PLANE_TYPE_H
25 # include "AliMpPlaneType.h"
28 #ifndef ALI_MP_EX_MAP_H
29 #include "AliMpExMap.h"
40 #ifndef ROOT_TObjArray
41 # include "TObjArray.h"
47 class AliMpMotifPosition;
51 class AliMpSlat : public TObject
55 AliMpSlat(TRootIOCtor* ioCtor);
56 AliMpSlat(const char* id, AliMp::PlaneType bendingOrNonBending);
60 Double_t GetPositionX() const { return fPositionX; }
62 Double_t GetPositionY() const { return fPositionY; }
64 const char* GetName() const;
66 const char* GetID() const;
68 void Add(const AliMpPCB& pcbType, const TArrayI& manuList);
73 /// Find the PCB containing the pad at location (ix,any iy).
74 AliMpPCB* FindPCB(Int_t ix) const;
76 /// Find the index of the PCB containing the pad at location ix.
77 Int_t FindPCBIndex(Int_t ix) const;
79 /// Find the index of the PCB containing a given manu
80 Int_t FindPCBIndexByMotifPositionID(Int_t manuId) const;
82 /// Find the PCB containing location (x,y).
83 AliMpPCB* FindPCB(Double_t x, Double_t y) const;
85 /// Find the index of the PCB containing the pad at location (x,y).
86 Int_t FindPCBIndex(Double_t x, Double_t y) const;
88 /// Returns the i-th PCB of this slat.
89 AliMpPCB* GetPCB(Int_t i) const;
91 /// Returns the MotifPosition containing location (x,y).
92 AliMpMotifPosition* FindMotifPosition(Double_t x, Double_t y) const;
94 /// Returns the MotifPosition which id is manuid.
95 AliMpMotifPosition* FindMotifPosition(Int_t manuid) const;
97 /// Returns the MotifPosition containing the pad located at (ix,iy).
98 AliMpMotifPosition* FindMotifPosition(Int_t ix, Int_t iy) const;
100 /// Return the ids of the electronic cards (either manu or local board).
101 void GetAllMotifPositionsIDs(TArrayI& ecn) const;
103 /** Returns the max. number of pads in the x-direction contained in this slat.
104 This is a max only as for e.g. non-bending slats, the y-dimension depends
107 Int_t GetMaxNofPadsY() const;
109 /** Returns the max index useable in x-direction.
110 Note that this can be different from GetNofPadsX()-1 for rounded slats.
112 Int_t GetMaxPadIndexX() const;
114 /// Return the number of electronic cards (either manu or local board).
115 Int_t GetNofElectronicCards() const;
117 /// Returns the number of pads in the x-direction contained in this slat.
118 Int_t GetNofPadsX() const;
120 /// Returns the number of PCBs of this slat.
121 Int_t GetSize() const;
123 void Print(Option_t* option="") const;
125 /** This is normally only used by triggerSlats, as for ST345 slats,
126 the position is DX(),DY() simply.
128 void ForcePosition(Double_t x, Double_t y);
130 /// Return the plane type
131 AliMp::PlaneType PlaneType() const { return fPlaneType; }
133 /// Return the number of pads in this slat
134 Int_t NofPads() const { return fNofPads; }
140 AliMpSlat(const AliMpSlat& rhs);
142 AliMpSlat& operator=(const AliMpSlat& rhs);
144 TString fId; ///< The name of this slat, e.g. 112233N
145 AliMp::PlaneType fPlaneType; ///< Whether it's bending or non-bending plane
146 Double_t fDX; ///< Half-size in X (cm)
147 Double_t fDY; ///< Half-size in Y (cm)
148 Int_t fNofPadsX; ///< Actual number of pads in x direction
149 Int_t fMaxNofPadsY; ///< Maximum number of pads in y direction
150 mutable AliMpExMap fManuMap; ///< map of int to AliMpMotifPosition*
151 TObjArray fPCBs; ///< array of AliMpPCB*
152 Double_t fPositionX; ///< x Position of the slat center.
153 Double_t fPositionY; ///< y Position of the slat center.
154 Int_t fNofPads; ///< number of pads in this slat
156 ClassDef(AliMpSlat,3) // A slat for stations 3,4,5