1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
5 // $MpId: AliMpPCB.h,v 1.9 2006/05/24 13:58:24 ivana Exp $
9 /// \brief A PCB for station 3,4 or 5
11 // Author: Laurent Aphecetche
16 #ifndef ALI_MP_VPAD_ITERATOR_H
17 # include "AliMpVPadIterator.h"
21 # include "AliMpArea.h"
37 #ifndef ROOT_TObjArray
38 # include "TObjArray.h"
41 class AliMpSlatMotifMap;
42 class AliMpMotifPosition;
44 class AliMpMotifSpecial;
46 class AliMpPCB : public TObject
51 /** Ctor. The sizes are given in mm.
52 See full doc for the meaning of enveloppe parameters.
54 AliMpPCB(AliMpSlatMotifMap* motifMap,
55 const char* id, Double_t padSizeX, Double_t padSizeY,
56 Double_t enveloppeSizeX, Double_t enveloppeSizeY);
58 AliMpPCB(const char* id, AliMpMotifSpecial* ms);
60 AliMpPCB(const AliMpPCB& o);
61 AliMpPCB& operator=(const AliMpPCB& o);
65 TObject* Clone(const char* newname="") const;
67 /** Duplicate this PCB. The copy has the manuids of its motifs changed
68 according to the manuid vector, and its x-offset according to ix
71 AliMpPCB* Clone(const TArrayI& manuids,
72 Int_t ixOffset, Double_t xOffset) const;
74 void Copy(TObject& o) const;
76 /** Add a motif to this PCB. (ix,iy) are the coordinates of one corner
77 of the motif, in pad-units. Which corner depends on the sign(s) of (ix,iy):
78 (ix>0,iy>0) : bottom-left corner
79 (ix<0,iy>0) : bottom-right corner
80 (ix<0,iy<0) : top-right corner
81 (ix>0,iy<0) : top-left corner.
83 void Add(AliMpMotifType* motifType, Int_t ix, Int_t iy);
85 AliMpArea Area() const;
87 void Print(Option_t* option = "") const;
89 Bool_t HasMotifPositionID(Int_t manuId) const;
91 Double_t ActiveDX() const;
92 Double_t ActiveDY() const;
100 Double_t Xmin() const;
101 Double_t Xmax() const;
103 Double_t ActiveXmin() const;
104 Double_t ActiveXmax() const;
106 Double_t Ymin() const;
107 Double_t Ymax() const;
109 Double_t PadSizeX() const;
110 Double_t PadSizeY() const;
112 /** Returns the i-th motifPosition of this PCB.
115 AliMpMotifPosition* GetMotifPosition(Int_t i) const;
117 /// Returns the motifPosition which contains the pad at (ix,iy).
118 AliMpMotifPosition* FindMotifPosition(Int_t ix, Int_t iy) const;
120 /// Returns the motifPosition which contains the pad at (x,y).
121 AliMpMotifPosition* FindMotifPosition(Double_t x, Double_t y) const;
123 /// The number of motifs, aka manus.
124 Int_t GetSize() const;
126 Int_t GetNofPadsX() const;
127 Int_t GetNofPadsY() const;
135 const char* GetID() const;
137 /// Return the number of pads in this PCB
138 Int_t NofPads() const { return fNofPads; }
140 /// Return the motif map
141 AliMpSlatMotifMap* MotifMap() const { return fMotifMap; }
146 TString fId; ///< PCB name
147 Double_t fPadSizeX; ///< x-size of this PCB's pads (cm)
148 Double_t fPadSizeY; ///< y-size of this PCB's pads (cm)
149 Double_t fEnveloppeSizeX; ///< max x-size of this PCB (cm)
150 Double_t fEnveloppeSizeY; ///< max y-size of this PCB (cm)
151 Double_t fXoffset; ///< x-offset = x of first pad of this PCB (cm)
152 Double_t fActiveXmin; ///< min x of an actual pad in this PCB (cm)
153 Double_t fActiveXmax; ///< max x of an actual pad in this PCB (cm)
154 Int_t fIxmin; ///< min pad index in x
155 Int_t fIxmax; ///< max pad index in x
156 Int_t fIymin; ///< min pad index in y
157 Int_t fIymax; ///< max pad index in y
158 TObjArray fMotifPositions; ///< array of motifs
159 Int_t fNofPads; ///< number of pads in this PCB
160 AliMpSlatMotifMap* fMotifMap; ///< to keep track of things to avoid duplications of motif and motiftypes, and get proper deletion
162 ClassDef(AliMpPCB,3) // A PCB for Stations 3,4,5