]>
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 | ||
f35ac2f6 | 38 | #ifndef ALI_MP_AREA_H |
39 | # include "AliMpArea.h" | |
40 | #endif | |
41 | ||
42 | class AliMpSlatMotifMap; | |
dee1d5f1 | 43 | class AliMpMotifPosition; |
44 | class AliMpMotifType; | |
b7762666 | 45 | class AliMpMotifSpecial; |
dee1d5f1 | 46 | |
47 | class AliMpPCB : public TObject | |
48 | { | |
49 | public: | |
50 | ||
51 | #ifdef WITH_ROOT | |
71a2d3aa | 52 | /// Type def for the array size |
dee1d5f1 | 53 | typedef Int_t Size_t; |
54 | #else | |
71a2d3aa | 55 | /// Type def for the array size |
dee1d5f1 | 56 | typedef UInt_t Size_t; |
57 | #endif | |
58 | ||
59 | AliMpPCB(); | |
60 | /** Ctor. The sizes are given in mm. | |
85fec35d | 61 | See full doc for the meaning of enveloppe parameters. |
dee1d5f1 | 62 | */ |
f35ac2f6 | 63 | AliMpPCB(AliMpSlatMotifMap* motifMap, |
64 | const char* id, Double_t padSizeX, Double_t padSizeY, | |
65 | Double_t enveloppeSizeX, Double_t enveloppeSizeY); | |
b7762666 | 66 | |
67 | AliMpPCB(const char* id, AliMpMotifSpecial* ms); | |
68 | ||
84aac932 | 69 | AliMpPCB(const AliMpPCB& o); |
70 | AliMpPCB& operator=(const AliMpPCB& o); | |
dee1d5f1 | 71 | |
72 | virtual ~AliMpPCB(); | |
73 | ||
74 | TObject* Clone(const char* newname="") const; | |
75 | ||
76 | /** Duplicate this PCB. The copy has the manuids of its motifs changed | |
77 | according to the manuid vector, and its x-offset according to ix | |
78 | and x. | |
79 | */ | |
80 | AliMpPCB* Clone(const TArrayI& manuids, | |
81 | Int_t ixOffset, Double_t xOffset) const; | |
82 | ||
84aac932 | 83 | void Copy(TObject& o) const; |
dee1d5f1 | 84 | |
b7762666 | 85 | /** Add a motif to this PCB. (ix,iy) are the coordinates of one corner |
86 | of the motif, in pad-units. Which corner depends on the sign(s) of (ix,iy): | |
87 | (ix>0,iy>0) : bottom-left corner | |
88 | (ix<0,iy>0) : bottom-right corner | |
89 | (ix<0,iy<0) : top-right corner | |
90 | (ix>0,iy<0) : top-left corner. | |
91 | */ | |
dee1d5f1 | 92 | void Add(AliMpMotifType* motifType, Int_t ix, Int_t iy); |
93 | ||
f35ac2f6 | 94 | AliMpArea Area() const; |
95 | ||
dee1d5f1 | 96 | void Print(Option_t* option = "") const; |
97 | ||
98 | Double_t ActiveDX() const; | |
99 | Double_t ActiveDY() const; | |
100 | ||
101 | Double_t DX() const; | |
102 | Double_t DY() const; | |
103 | ||
104 | Double_t X() const; | |
105 | Double_t Y() const; | |
106 | ||
107 | Double_t Xmin() const; | |
108 | Double_t Xmax() const; | |
109 | ||
110 | Double_t ActiveXmin() const; | |
111 | Double_t ActiveXmax() const; | |
112 | ||
113 | Double_t Ymin() const; | |
114 | Double_t Ymax() const; | |
115 | ||
116 | Double_t PadSizeX() const; | |
117 | Double_t PadSizeY() const; | |
118 | ||
119 | /** Returns the i-th motifPosition of this PCB. | |
120 | i : [0..GetSize()-1] | |
121 | */ | |
122 | AliMpMotifPosition* GetMotifPosition(Size_t i) const; | |
123 | ||
124 | /// Returns the motifPosition which contains the pad at (ix,iy). | |
125 | AliMpMotifPosition* FindMotifPosition(Int_t ix, Int_t iy) const; | |
126 | ||
127 | /// Returns the motifPosition which contains the pad at (x,y). | |
128 | AliMpMotifPosition* FindMotifPosition(Double_t x, Double_t y) const; | |
129 | ||
130 | /// The number of motifs, aka manus. | |
131 | Size_t GetSize() const; | |
132 | ||
133 | Int_t GetNofPadsX() const; | |
134 | Int_t GetNofPadsY() const; | |
135 | ||
136 | Int_t Ixmin() const; | |
137 | Int_t Ixmax() const; | |
b7762666 | 138 | |
139 | Int_t Iymin() const; | |
140 | Int_t Iymax() const; | |
141 | ||
dee1d5f1 | 142 | const char* GetID() const; |
143 | ||
71a2d3aa | 144 | /// Return the number of pads in this PCB |
efb408b3 | 145 | Int_t NofPads() const { return fNofPads; } |
146 | ||
71a2d3aa | 147 | /// Return the motif map |
f35ac2f6 | 148 | AliMpSlatMotifMap* MotifMap() const { return fMotifMap; } |
149 | ||
150 | void Save() const; | |
151 | ||
dee1d5f1 | 152 | private: |
829425a5 | 153 | TString fId; ///< PCB name |
154 | Double_t fPadSizeX; ///< x-size of this PCB's pads (cm) | |
155 | Double_t fPadSizeY; ///< y-size of this PCB's pads (cm) | |
156 | Double_t fEnveloppeSizeX; ///< max x-size of this PCB (cm) | |
71a2d3aa | 157 | Double_t fEnveloppeSizeY; ///< max y-size of this PCB (cm) |
829425a5 | 158 | Double_t fXoffset; ///< x-offset = x of first pad of this PCB (cm) |
159 | Double_t fActiveXmin; ///< min x of an actual pad in this PCB (cm) | |
160 | Double_t fActiveXmax; ///< max x of an actual pad in this PCB (cm) | |
161 | Int_t fIxmin; ///< min pad index in x | |
162 | Int_t fIxmax; ///< max pad index in x | |
163 | Int_t fIymin; ///< min pad index in y | |
164 | Int_t fIymax; ///< max pad index in y | |
dee1d5f1 | 165 | #ifdef WITH_ROOT |
f35ac2f6 | 166 | TObjArray fMotifPositions; ///< array of motifs |
dee1d5f1 | 167 | #else |
f35ac2f6 | 168 | std::vector<AliMpMotifPosition*> fMotifPositions; ///< array of motif positions |
dee1d5f1 | 169 | #endif |
829425a5 | 170 | Int_t fNofPads; ///< number of pads in this PCB |
f35ac2f6 | 171 | AliMpSlatMotifMap* fMotifMap; ///< to keep track of things to avoid duplications of motif and motiftypes, and get proper deletion |
efb408b3 | 172 | |
f35ac2f6 | 173 | ClassDef(AliMpPCB,3) // A PCB for Stations 3,4,5 |
dee1d5f1 | 174 | }; |
175 | ||
176 | #endif |