]>
Commit | Line | Data |
---|---|---|
dee1d5f1 | 1 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
2 | * See cxx source for full Copyright notice */ | |
3 | ||
4 | // $Id$ | |
13985652 | 5 | // $MpId: AliMpPCB.h,v 1.9 2006/05/24 13:58:24 ivana Exp $ |
dee1d5f1 | 6 | |
7 | /// \ingroup slat | |
8 | /// \class AliMpPCB | |
9 | /// \brief A PCB for station 3,4 or 5 | |
10 | /// | |
13985652 | 11 | // Author: Laurent Aphecetche |
dee1d5f1 | 12 | |
13 | #ifndef ALIMPPCB_H | |
14 | #define ALIMPPCB_H | |
15 | ||
16 | #ifndef ROOT_TObject | |
17 | # include "TObject.h" | |
18 | #endif | |
19 | ||
20 | #ifndef ROOT_TString | |
21 | # include "TString.h" | |
22 | #endif | |
23 | ||
24 | # ifndef ROOT_TArraI | |
25 | # include "TArrayI.h" | |
26 | # endif | |
27 | ||
28 | #include "AliMpContainers.h" | |
29 | ||
30 | #ifdef WITH_ROOT | |
31 | # ifndef ROOT_TObjArray | |
32 | # include "TObjArray.h" | |
33 | # endif | |
34 | #else | |
35 | # include <vector> | |
36 | #endif | |
37 | ||
5f5c0c3d | 38 | #ifndef ALI_MP_VPAD_ITERATOR_H |
39 | # include "AliMpVPadIterator.h" | |
40 | #endif | |
41 | ||
f35ac2f6 | 42 | #ifndef ALI_MP_AREA_H |
43 | # include "AliMpArea.h" | |
44 | #endif | |
45 | ||
46 | class AliMpSlatMotifMap; | |
dee1d5f1 | 47 | class AliMpMotifPosition; |
48 | class AliMpMotifType; | |
b7762666 | 49 | class AliMpMotifSpecial; |
dee1d5f1 | 50 | |
51 | class AliMpPCB : public TObject | |
52 | { | |
53 | public: | |
54 | ||
dee1d5f1 | 55 | AliMpPCB(); |
56 | /** Ctor. The sizes are given in mm. | |
85fec35d | 57 | See full doc for the meaning of enveloppe parameters. |
dee1d5f1 | 58 | */ |
f35ac2f6 | 59 | AliMpPCB(AliMpSlatMotifMap* motifMap, |
60 | const char* id, Double_t padSizeX, Double_t padSizeY, | |
61 | Double_t enveloppeSizeX, Double_t enveloppeSizeY); | |
b7762666 | 62 | |
63 | AliMpPCB(const char* id, AliMpMotifSpecial* ms); | |
64 | ||
84aac932 | 65 | AliMpPCB(const AliMpPCB& o); |
66 | AliMpPCB& operator=(const AliMpPCB& o); | |
dee1d5f1 | 67 | |
68 | virtual ~AliMpPCB(); | |
69 | ||
70 | TObject* Clone(const char* newname="") const; | |
71 | ||
72 | /** Duplicate this PCB. The copy has the manuids of its motifs changed | |
73 | according to the manuid vector, and its x-offset according to ix | |
74 | and x. | |
75 | */ | |
76 | AliMpPCB* Clone(const TArrayI& manuids, | |
77 | Int_t ixOffset, Double_t xOffset) const; | |
78 | ||
84aac932 | 79 | void Copy(TObject& o) const; |
dee1d5f1 | 80 | |
b7762666 | 81 | /** Add a motif to this PCB. (ix,iy) are the coordinates of one corner |
82 | of the motif, in pad-units. Which corner depends on the sign(s) of (ix,iy): | |
83 | (ix>0,iy>0) : bottom-left corner | |
84 | (ix<0,iy>0) : bottom-right corner | |
85 | (ix<0,iy<0) : top-right corner | |
86 | (ix>0,iy<0) : top-left corner. | |
87 | */ | |
dee1d5f1 | 88 | void Add(AliMpMotifType* motifType, Int_t ix, Int_t iy); |
89 | ||
f35ac2f6 | 90 | AliMpArea Area() const; |
91 | ||
dee1d5f1 | 92 | void Print(Option_t* option = "") const; |
93 | ||
5f5c0c3d | 94 | Bool_t HasMotifPositionID(Int_t manuId) const; |
95 | ||
dee1d5f1 | 96 | Double_t ActiveDX() const; |
97 | Double_t ActiveDY() const; | |
98 | ||
99 | Double_t DX() const; | |
100 | Double_t DY() const; | |
101 | ||
102 | Double_t X() const; | |
103 | Double_t Y() const; | |
104 | ||
105 | Double_t Xmin() const; | |
106 | Double_t Xmax() const; | |
107 | ||
108 | Double_t ActiveXmin() const; | |
109 | Double_t ActiveXmax() const; | |
110 | ||
111 | Double_t Ymin() const; | |
112 | Double_t Ymax() const; | |
113 | ||
114 | Double_t PadSizeX() const; | |
115 | Double_t PadSizeY() const; | |
116 | ||
117 | /** Returns the i-th motifPosition of this PCB. | |
118 | i : [0..GetSize()-1] | |
119 | */ | |
630711ed | 120 | AliMpMotifPosition* GetMotifPosition(Int_t i) const; |
dee1d5f1 | 121 | |
122 | /// Returns the motifPosition which contains the pad at (ix,iy). | |
123 | AliMpMotifPosition* FindMotifPosition(Int_t ix, Int_t iy) const; | |
124 | ||
125 | /// Returns the motifPosition which contains the pad at (x,y). | |
126 | AliMpMotifPosition* FindMotifPosition(Double_t x, Double_t y) const; | |
127 | ||
128 | /// The number of motifs, aka manus. | |
630711ed | 129 | Int_t GetSize() const; |
dee1d5f1 | 130 | |
131 | Int_t GetNofPadsX() const; | |
132 | Int_t GetNofPadsY() const; | |
133 | ||
134 | Int_t Ixmin() const; | |
135 | Int_t Ixmax() const; | |
b7762666 | 136 | |
137 | Int_t Iymin() const; | |
138 | Int_t Iymax() const; | |
139 | ||
dee1d5f1 | 140 | const char* GetID() const; |
141 | ||
71a2d3aa | 142 | /// Return the number of pads in this PCB |
efb408b3 | 143 | Int_t NofPads() const { return fNofPads; } |
144 | ||
71a2d3aa | 145 | /// Return the motif map |
f35ac2f6 | 146 | AliMpSlatMotifMap* MotifMap() const { return fMotifMap; } |
147 | ||
148 | void Save() const; | |
149 | ||
dee1d5f1 | 150 | private: |
829425a5 | 151 | TString fId; ///< PCB name |
152 | Double_t fPadSizeX; ///< x-size of this PCB's pads (cm) | |
153 | Double_t fPadSizeY; ///< y-size of this PCB's pads (cm) | |
154 | Double_t fEnveloppeSizeX; ///< max x-size of this PCB (cm) | |
71a2d3aa | 155 | Double_t fEnveloppeSizeY; ///< max y-size of this PCB (cm) |
829425a5 | 156 | Double_t fXoffset; ///< x-offset = x of first pad of this PCB (cm) |
157 | Double_t fActiveXmin; ///< min x of an actual pad in this PCB (cm) | |
158 | Double_t fActiveXmax; ///< max x of an actual pad in this PCB (cm) | |
159 | Int_t fIxmin; ///< min pad index in x | |
160 | Int_t fIxmax; ///< max pad index in x | |
161 | Int_t fIymin; ///< min pad index in y | |
162 | Int_t fIymax; ///< max pad index in y | |
dee1d5f1 | 163 | #ifdef WITH_ROOT |
f35ac2f6 | 164 | TObjArray fMotifPositions; ///< array of motifs |
dee1d5f1 | 165 | #else |
f35ac2f6 | 166 | std::vector<AliMpMotifPosition*> fMotifPositions; ///< array of motif positions |
dee1d5f1 | 167 | #endif |
829425a5 | 168 | Int_t fNofPads; ///< number of pads in this PCB |
f35ac2f6 | 169 | AliMpSlatMotifMap* fMotifMap; ///< to keep track of things to avoid duplications of motif and motiftypes, and get proper deletion |
efb408b3 | 170 | |
f35ac2f6 | 171 | ClassDef(AliMpPCB,3) // A PCB for Stations 3,4,5 |
dee1d5f1 | 172 | }; |
173 | ||
174 | #endif |