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