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
28 #include "AliMpContainers.h"
31 # ifndef ROOT_TObjArray
32 # include "TObjArray.h"
39 # include "AliMpArea.h"
42 class AliMpSlatMotifMap;
43 class AliMpMotifPosition;
45 class AliMpMotifSpecial;
47 class AliMpPCB : public TObject
54 typedef UInt_t Size_t;
58 /** Ctor. The sizes are given in mm.
59 See full doc for the meaning of enveloppe parameters.
61 AliMpPCB(AliMpSlatMotifMap* motifMap,
62 const char* id, Double_t padSizeX, Double_t padSizeY,
63 Double_t enveloppeSizeX, Double_t enveloppeSizeY);
65 AliMpPCB(const char* id, AliMpMotifSpecial* ms);
67 AliMpPCB(const AliMpPCB& o);
68 AliMpPCB& operator=(const AliMpPCB& o);
72 TObject* Clone(const char* newname="") const;
74 /** Duplicate this PCB. The copy has the manuids of its motifs changed
75 according to the manuid vector, and its x-offset according to ix
78 AliMpPCB* Clone(const TArrayI& manuids,
79 Int_t ixOffset, Double_t xOffset) const;
81 void Copy(TObject& o) const;
83 /** Add a motif to this PCB. (ix,iy) are the coordinates of one corner
84 of the motif, in pad-units. Which corner depends on the sign(s) of (ix,iy):
85 (ix>0,iy>0) : bottom-left corner
86 (ix<0,iy>0) : bottom-right corner
87 (ix<0,iy<0) : top-right corner
88 (ix>0,iy<0) : top-left corner.
90 void Add(AliMpMotifType* motifType, Int_t ix, Int_t iy);
92 AliMpArea Area() const;
94 void Print(Option_t* option = "") const;
96 Double_t ActiveDX() const;
97 Double_t ActiveDY() const;
105 Double_t Xmin() const;
106 Double_t Xmax() const;
108 Double_t ActiveXmin() const;
109 Double_t ActiveXmax() const;
111 Double_t Ymin() const;
112 Double_t Ymax() const;
114 Double_t PadSizeX() const;
115 Double_t PadSizeY() const;
117 /** Returns the i-th motifPosition of this PCB.
120 AliMpMotifPosition* GetMotifPosition(Size_t i) const;
122 /// Returns the motifPosition which contains the pad at (ix,iy).
123 AliMpMotifPosition* FindMotifPosition(Int_t ix, Int_t iy) const;
125 /// Returns the motifPosition which contains the pad at (x,y).
126 AliMpMotifPosition* FindMotifPosition(Double_t x, Double_t y) const;
128 /// The number of motifs, aka manus.
129 Size_t GetSize() const;
131 Int_t GetNofPadsX() const;
132 Int_t GetNofPadsY() const;
140 const char* GetID() const;
142 Int_t NofPads() const { return fNofPads; }
144 AliMpSlatMotifMap* MotifMap() const { return fMotifMap; }
149 TString fId; ///< PCB name
150 Double_t fPadSizeX; ///< x-size of this PCB's pads (cm)
151 Double_t fPadSizeY; ///< y-size of this PCB's pads (cm)
152 Double_t fEnveloppeSizeX; ///< max x-size of this PCB (cm)
153 Double_t fEnveloppeSizeY; // max y-size of this PCB (cm)
154 Double_t fXoffset; ///< x-offset = x of first pad of this PCB (cm)
155 Double_t fActiveXmin; ///< min x of an actual pad in this PCB (cm)
156 Double_t fActiveXmax; ///< max x of an actual pad in this PCB (cm)
157 Int_t fIxmin; ///< min pad index in x
158 Int_t fIxmax; ///< max pad index in x
159 Int_t fIymin; ///< min pad index in y
160 Int_t fIymax; ///< max pad index in y
162 TObjArray fMotifPositions; ///< array of motifs
164 std::vector<AliMpMotifPosition*> fMotifPositions; ///< array of motif positions
166 Int_t fNofPads; ///< number of pads in this PCB
167 AliMpSlatMotifMap* fMotifMap; ///< to keep track of things to avoid duplications of motif and motiftypes, and get proper deletion
169 ClassDef(AliMpPCB,3) // A PCB for Stations 3,4,5