]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/mapping/AliMpPCB.h
Generates realistic DDL sharing and buspatch number calculated from DDL (Christian)
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpPCB.h
CommitLineData
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
38class AliMpMotifPosition;
39class AliMpMotifType;
b7762666 40class AliMpMotifSpecial;
dee1d5f1 41
42class 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.
85fec35d 54 See full doc for the meaning of enveloppe parameters.
dee1d5f1 55 */
56 AliMpPCB(const char* id, Double_t padSizeX, Double_t padSizeY,
57 Double_t enveloppeSizeX, Double_t enveloppeSizeY);
b7762666 58
59 AliMpPCB(const char* id, AliMpMotifSpecial* ms);
60
84aac932 61 AliMpPCB(const AliMpPCB& o);
62 AliMpPCB& operator=(const AliMpPCB& o);
dee1d5f1 63
64 virtual ~AliMpPCB();
65
66 TObject* Clone(const char* newname="") const;
67
68 /** Duplicate this PCB. The copy has the manuids of its motifs changed
69 according to the manuid vector, and its x-offset according to ix
70 and x.
71 */
72 AliMpPCB* Clone(const TArrayI& manuids,
73 Int_t ixOffset, Double_t xOffset) const;
74
84aac932 75 void Copy(TObject& o) const;
dee1d5f1 76
b7762666 77 /** Add a motif to this PCB. (ix,iy) are the coordinates of one corner
78 of the motif, in pad-units. Which corner depends on the sign(s) of (ix,iy):
79 (ix>0,iy>0) : bottom-left corner
80 (ix<0,iy>0) : bottom-right corner
81 (ix<0,iy<0) : top-right corner
82 (ix>0,iy<0) : top-left corner.
83 */
dee1d5f1 84 void Add(AliMpMotifType* motifType, Int_t ix, Int_t iy);
85
86 void Print(Option_t* option = "") const;
87
88 Double_t ActiveDX() const;
89 Double_t ActiveDY() const;
90
91 Double_t DX() const;
92 Double_t DY() const;
93
94 Double_t X() const;
95 Double_t Y() const;
96
97 Double_t Xmin() const;
98 Double_t Xmax() const;
99
100 Double_t ActiveXmin() const;
101 Double_t ActiveXmax() const;
102
103 Double_t Ymin() const;
104 Double_t Ymax() const;
105
106 Double_t PadSizeX() const;
107 Double_t PadSizeY() const;
108
109 /** Returns the i-th motifPosition of this PCB.
110 i : [0..GetSize()-1]
111 */
112 AliMpMotifPosition* GetMotifPosition(Size_t i) const;
113
114 /// Returns the motifPosition which contains the pad at (ix,iy).
115 AliMpMotifPosition* FindMotifPosition(Int_t ix, Int_t iy) const;
116
117 /// Returns the motifPosition which contains the pad at (x,y).
118 AliMpMotifPosition* FindMotifPosition(Double_t x, Double_t y) const;
119
120 /// The number of motifs, aka manus.
121 Size_t GetSize() const;
122
123 Int_t GetNofPadsX() const;
124 Int_t GetNofPadsY() const;
125
126 Int_t Ixmin() const;
127 Int_t Ixmax() const;
b7762666 128
129 Int_t Iymin() const;
130 Int_t Iymax() const;
131
dee1d5f1 132 const char* GetID() const;
133
efb408b3 134 Int_t NofPads() const { return fNofPads; }
135
dee1d5f1 136 private:
829425a5 137 TString fId; ///< PCB name
138 Double_t fPadSizeX; ///< x-size of this PCB's pads (cm)
139 Double_t fPadSizeY; ///< y-size of this PCB's pads (cm)
140 Double_t fEnveloppeSizeX; ///< max x-size of this PCB (cm)
85fec35d 141 Double_t fEnveloppeSizeY; // max y-size of this PCB (cm)
829425a5 142 Double_t fXoffset; ///< x-offset = x of first pad of this PCB (cm)
143 Double_t fActiveXmin; ///< min x of an actual pad in this PCB (cm)
144 Double_t fActiveXmax; ///< max x of an actual pad in this PCB (cm)
145 Int_t fIxmin; ///< min pad index in x
146 Int_t fIxmax; ///< max pad index in x
147 Int_t fIymin; ///< min pad index in y
148 Int_t fIymax; ///< max pad index in y
dee1d5f1 149#ifdef WITH_ROOT
829425a5 150 TObjArray fMotifs; ///< array of motifs
dee1d5f1 151#else
829425a5 152 std::vector<AliMpMotifPosition*> fMotifs; ///< array of motifs
dee1d5f1 153#endif
829425a5 154 Int_t fNofPads; ///< number of pads in this PCB
efb408b3 155
156 ClassDef(AliMpPCB,2) // A PCB for Stations 3,4,5
dee1d5f1 157};
158
159#endif