Line data Source code
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.8 2006/05/24 13:58:24 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 : #ifndef ALI_MP_PAD_H
17 : # include "AliMpPad.h"
18 : #endif
19 :
20 : #ifndef ALI_MP_V_SEGMENTATION_H
21 : # include "AliMpVSegmentation.h"
22 : #endif
23 :
24 : #ifndef ALI_MP_PLANE_TYPE_H
25 : # include "AliMpPlaneType.h"
26 : #endif
27 :
28 : #ifndef ALI_MP_EX_MAP_H
29 : #include "AliMpExMap.h"
30 : #endif
31 :
32 : #ifndef ROOT_TObject
33 : #include <TObject.h>
34 : #endif
35 :
36 : #ifndef ROOT_TString
37 : # include "TString.h"
38 : #endif
39 :
40 : #ifndef ROOT_TObjArray
41 : # include "TObjArray.h"
42 : #endif
43 :
44 : class TArrayI;
45 :
46 :
47 : class AliMpMotifPosition;
48 : class AliMpPCB;
49 : class TArrayI;
50 :
51 : class AliMpSlat : public TObject
52 : {
53 : public:
54 :
55 : AliMpSlat(TRootIOCtor* ioCtor);
56 : AliMpSlat(const char* id, AliMp::PlaneType bendingOrNonBending);
57 : virtual ~AliMpSlat();
58 :
59 : /// Return x position
60 2606028 : Double_t GetPositionX() const { return fPositionX; }
61 : /// Return y position
62 2606028 : Double_t GetPositionY() const { return fPositionY; }
63 :
64 : const char* GetName() const;
65 :
66 : const char* GetID() const;
67 :
68 : void Add(const AliMpPCB& pcbType, const TArrayI& manuList);
69 :
70 : Double_t DX() const;
71 : Double_t DY() const;
72 :
73 : /// Find the PCB containing the pad at location (ix,any iy).
74 : AliMpPCB* FindPCB(Int_t ix) const;
75 :
76 : /// Find the index of the PCB containing the pad at location ix.
77 : Int_t FindPCBIndex(Int_t ix) const;
78 :
79 : /// Find the index of the PCB containing a given manu
80 : Int_t FindPCBIndexByMotifPositionID(Int_t manuId) const;
81 :
82 : /// Find the PCB containing location (x,y).
83 : AliMpPCB* FindPCB(Double_t x, Double_t y) const;
84 :
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;
87 :
88 : /// Returns the i-th PCB of this slat.
89 : AliMpPCB* GetPCB(Int_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 : /// Return the ids of the electronic cards (either manu or local board).
101 : void GetAllMotifPositionsIDs(TArrayI& ecn) const;
102 :
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
105 : on the x-position.
106 : */
107 : Int_t GetMaxNofPadsY() const;
108 :
109 : /** Returns the max index useable in x-direction.
110 : Note that this can be different from GetNofPadsX()-1 for rounded slats.
111 : */
112 : Int_t GetMaxPadIndexX() const;
113 :
114 : /// Return the number of electronic cards (either manu or local board).
115 : Int_t GetNofElectronicCards() const;
116 :
117 : /// Returns the number of pads in the x-direction contained in this slat.
118 : Int_t GetNofPadsX() const;
119 :
120 : /// Returns the number of PCBs of this slat.
121 : Int_t GetSize() const;
122 :
123 : void Print(Option_t* option="") const;
124 :
125 : /** This is normally only used by triggerSlats, as for ST345 slats,
126 : the position is DX(),DY() simply.
127 : */
128 : void ForcePosition(Double_t x, Double_t y);
129 :
130 : /// Return the plane type
131 898 : AliMp::PlaneType PlaneType() const { return fPlaneType; }
132 :
133 : /// Return the number of pads in this slat
134 2240 : Int_t NofPads() const { return fNofPads; }
135 :
136 : private:
137 : /// Not implemented
138 : AliMpSlat();
139 : /// Not implemented
140 : AliMpSlat(const AliMpSlat& rhs);
141 : /// Not implemented
142 : AliMpSlat& operator=(const AliMpSlat& rhs);
143 :
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
155 :
156 22336 : ClassDef(AliMpSlat,3) // A slat for stations 3,4,5
157 : };
158 :
159 : #endif
|