]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/mapping/AliMpSlat.h
AliMUONDigitCalibrator
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpSlat.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: AliMpSlat.h,v 1.8 2006/05/24 13:58:24 ivana Exp $
dee1d5f1 6
7/// \ingroup slat
8/// \class AliMpSlat
9/// \brief A slat (building block of stations 3, 4 and 5)
10///
13985652 11// Author: Laurent Aphecetche
dee1d5f1 12
13#ifndef ALI_MP_SLAT_H
14#define ALI_MP_SLAT_H
15
16#include <TObject.h>
17
18#ifndef ROOT_TString
19b51aad 19# include "TString.h"
20#endif
21
22#ifndef ALI_MP_PAD_H
23# include "AliMpPad.h"
dee1d5f1 24#endif
25
26#ifndef ALI_MP_V_SEGMENTATION_H
19b51aad 27# include "AliMpVSegmentation.h"
dee1d5f1 28#endif
29
19b51aad 30#ifndef ALI_MP_PLANE_TYPE_H
31# include "AliMpPlaneType.h"
dee1d5f1 32#endif
33
34#include "AliMpContainers.h"
0f60374b 35#include "AliMpExMap.h"
dee1d5f1 36
37class TArrayI;
38
39#ifdef WITH_ROOT
dee1d5f1 40# include "TObjArray.h"
41#else
42# include <vector>
0f60374b 43//# include <map>
dee1d5f1 44#endif
45
46class AliMpMotifPosition;
47class AliMpPCB;
19b51aad 48class TArrayI;
dee1d5f1 49
50class AliMpSlat : public TObject
51{
52 public:
53
630711ed 54 AliMpSlat(TRootIOCtor* ioCtor);
cddd101e 55 AliMpSlat(const char* id, AliMp::PlaneType bendingOrNonBending);
dee1d5f1 56 virtual ~AliMpSlat();
57
58 TVector2 Dimensions() const;
71a2d3aa 59
60 /// Return position
efb408b3 61 TVector2 Position() const { return fPosition; }
19b51aad 62
63 const char* GetName() const;
64
dee1d5f1 65 const char* GetID() const;
66
d21dc4b0 67 void Add(const AliMpPCB& pcbType, const TArrayI& manuList);
dee1d5f1 68
69 Double_t DX() const;
70 Double_t DY() const;
71
72 /// Find the PCB containing the pad at location (ix,any iy).
73 AliMpPCB* FindPCB(Int_t ix) const;
74
db95e382 75 /// Find the index of the PCB containing the pad at location ix.
76 Int_t FindPCBIndex(Int_t ix) const;
77
78 /// Find the index of the PCB containing a given manu
79 Int_t FindPCBIndexByMotifPositionID(Int_t manuId) const;
80
dee1d5f1 81 /// Find the PCB containing location (x,y).
82 AliMpPCB* FindPCB(Double_t x, Double_t y) const;
83
db95e382 84 /// Find the index of the PCB containing the pad at location (x,y).
85 Int_t FindPCBIndex(Double_t x, Double_t y) const;
dee1d5f1 86
87 /// Returns the i-th PCB of this slat.
630711ed 88 AliMpPCB* GetPCB(Int_t i) const;
dee1d5f1 89
90 /// Returns the MotifPosition containing location (x,y).
91 AliMpMotifPosition* FindMotifPosition(Double_t x, Double_t y) const;
92
93 /// Returns the MotifPosition which id is manuid.
94 AliMpMotifPosition* FindMotifPosition(Int_t manuid) const;
95
96 /// Returns the MotifPosition containing the pad located at (ix,iy).
97 AliMpMotifPosition* FindMotifPosition(Int_t ix, Int_t iy) const;
98
19b51aad 99 /// Return the ids of the electronic cards (either manu or local board).
c9da0af9 100 void GetAllMotifPositionsIDs(TArrayI& ecn) const;
19b51aad 101
102 /** Returns the max. number of pads in the x-direction contained in this slat.
103 This is a max only as for e.g. non-bending slats, the y-dimension depends
104 on the x-position.
105 */
106 Int_t GetMaxNofPadsY() const;
107
16e8fffd 108 /** Returns the max index useable in x-direction.
109 Note that this can be different from GetNofPadsX()-1 for rounded slats.
110 */
111 Int_t GetMaxPadIndexX() const;
112
19b51aad 113 /// Return the number of electronic cards (either manu or local board).
114 Int_t GetNofElectronicCards() const;
115
dee1d5f1 116 /// Returns the number of pads in the x-direction contained in this slat.
117 Int_t GetNofPadsX() const;
118
19b51aad 119 /// Returns the number of PCBs of this slat.
630711ed 120 Int_t GetSize() const;
19b51aad 121
dee1d5f1 122 void Print(Option_t* option="") const;
123
19b51aad 124 /** This is normally only used by triggerSlats, as for ST345 slats,
125 the position is DX(),DY() simply.
126 */
127 void ForcePosition(const TVector2& pos);
128
71a2d3aa 129 /// Return the plane type
cddd101e 130 AliMp::PlaneType PlaneType() const { return fPlaneType; }
efb408b3 131
71a2d3aa 132 /// Return the number of pads in this slat
efb408b3 133 Int_t NofPads() const { return fNofPads; }
134
13e7956b 135 private:
630711ed 136 /// Not implemented
137 AliMpSlat();
71a2d3aa 138 /// Not implemented
efb408b3 139 AliMpSlat(const AliMpSlat& rhs);
71a2d3aa 140 /// Not implemented
efb408b3 141 AliMpSlat& operator=(const AliMpSlat& rhs);
13e7956b 142
829425a5 143 TString fId; ///< The name of this slat, e.g. 112233N
cddd101e 144 AliMp::PlaneType fPlaneType; ///< Whether it's bending or non-bending plane
829425a5 145 Double_t fDX; ///< Half-size in X (cm)
146 Double_t fDY; ///< Half-size in Y (cm)
147 Int_t fNofPadsX; ///< Actual number of pads in x direction
148 Int_t fMaxNofPadsY; ///< Maximum number of pads in y direction
149 mutable AliMpExMap fManuMap; ///< map of int to AliMpMotifPosition*
dee1d5f1 150#ifdef WITH_ROOT
829425a5 151 TObjArray fPCBs; ///< array of AliMpPCB*
dee1d5f1 152#else
829425a5 153 std::vector<AliMpPCB*> fPCBs; ///< array of AliMpPCB*
dee1d5f1 154#endif
829425a5 155 TVector2 fPosition; ///< Position of the slat center.
156 Int_t fNofPads; ///< number of pads in this slat
dee1d5f1 157
efb408b3 158 ClassDef(AliMpSlat,2) // A slat for stations 3,4,5
dee1d5f1 159};
160
161#endif