]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpPCB.h
- Reordering includes and/or
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpPCB.h
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: AliMpPCB.h,v 1.4 2005/09/19 19:01:09 ivana Exp $ 
6
7 /// \ingroup slat
8 /// \class AliMpPCB
9 /// \brief A PCB for station 3,4 or 5
10 /// 
11 /// Author: Laurent Aphecetche
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
38 class AliMpMotifPosition;
39 class AliMpMotifType;
40 class AliMpMotifSpecial;
41
42 class AliMpPCB : public TObject
43 {
44  public:
45
46 #ifdef WITH_ROOT
47   typedef Int_t  Size_t;
48 #else  
49   typedef UInt_t Size_t;
50 #endif
51   
52   AliMpPCB();
53   /** Ctor. The sizes are given in mm.
54       enveloppe is due to the fact that not all PCBs are "full" of pads,
55       e.g. the rounded or short ones miss some pads, but the enveloppe 
56       is a virtual size that should be constant across the slats, 
57       and is 400x400 mm.
58       It's a usefull notion to compute e.g. slat center in a uniform way, 
59       considering that a slat is N PCBs, of the same "virtual" size, that of 
60       the enveloppe.
61   */
62   AliMpPCB(const char* id, Double_t padSizeX, Double_t padSizeY,
63            Double_t enveloppeSizeX, Double_t enveloppeSizeY);
64   
65   AliMpPCB(const char* id, AliMpMotifSpecial* ms);
66   
67   AliMpPCB(const AliMpPCB&);
68   AliMpPCB& operator=(const AliMpPCB&);
69
70   virtual ~AliMpPCB();
71
72   TObject* Clone(const char* newname="") const;
73
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 
76       and x.
77   */    
78   AliMpPCB* Clone(const TArrayI& manuids,
79                   Int_t ixOffset, Double_t xOffset) const;
80
81   void Copy(TObject&) const;
82
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.
89     */
90   void Add(AliMpMotifType* motifType, Int_t ix, Int_t iy);
91
92   void Print(Option_t* option = "") const;
93
94   Double_t ActiveDX() const;
95   Double_t ActiveDY() const;
96
97   Double_t DX() const;
98   Double_t DY() const;
99
100   Double_t X() const;
101   Double_t Y() const;
102
103   Double_t Xmin() const;
104   Double_t Xmax() const;
105  
106   Double_t ActiveXmin() const;
107   Double_t ActiveXmax() const;
108
109   Double_t Ymin() const;
110   Double_t Ymax() const;
111
112   Double_t PadSizeX() const;
113   Double_t PadSizeY() const;
114
115   /** Returns the i-th motifPosition of this PCB.
116       i : [0..GetSize()-1]
117   */
118   AliMpMotifPosition* GetMotifPosition(Size_t i) const;
119
120   /// Returns the motifPosition which contains the pad at (ix,iy).
121   AliMpMotifPosition* FindMotifPosition(Int_t ix, Int_t iy) const;
122
123   /// Returns the motifPosition which contains the pad at (x,y).
124   AliMpMotifPosition* FindMotifPosition(Double_t x, Double_t y) const;
125
126   /// The number of motifs, aka manus.
127   Size_t GetSize() const;
128
129   Int_t GetNofPadsX() const;
130   Int_t GetNofPadsY() const;
131
132   Int_t Ixmin() const;
133   Int_t Ixmax() const;
134   
135   Int_t Iymin() const;
136   Int_t Iymax() const;
137   
138   const char* GetID() const;
139   
140  private:
141   TString fId;
142   Double_t fPadSizeX;
143   Double_t fPadSizeY;
144   Double_t fEnveloppeSizeX;
145   Double_t fEnveloppeSizeY;
146   Double_t fXoffset;
147   Double_t fActiveXmin;
148   Double_t fActiveXmax;
149   Int_t fIxmin;
150   Int_t fIxmax;
151   Int_t fIymin;
152   Int_t fIymax;
153 #ifdef WITH_ROOT
154   TObjArray fMotifs;
155 #else  
156   std::vector<AliMpMotifPosition*> fMotifs;
157 #endif
158
159   ClassDef(AliMpPCB,1) // A PCB for Stations 3,4,5
160 };
161
162 #endif