Digits and raw data updated for commissioning
[u/mrichter/AliRoot.git] / TPC / AliTPCmapper.h
CommitLineData
bb18c002 1#ifndef AliTPCmapper_H
2#define AliTPCmapper_H
3/* Copyright(c) 1998-2006, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
0e75e410 6#include <TObject.h>
bb18c002 7
accfa4d9 8class AliTPCAltroMapping;
9class AliTPCROC;
bb18c002 10
accfa4d9 11class AliTPCmapper : public TObject{
bb18c002 12
13public:
14
accfa4d9 15 AliTPCmapper();
16 virtual ~AliTPCmapper();
17
18 AliTPCmapper& operator = (const AliTPCmapper& mapper);
19 AliTPCmapper(const AliTPCmapper& mapper);
20
21 void Init();
22
23 // ALTRO mapping functions
24 Int_t GetPad(Int_t patch, Int_t hwAddress) const;
25 Int_t GetPad(Int_t patch, Int_t branch, Int_t fec, Int_t chip, Int_t channel) const;
26
27 // ALTRO mapping functions on roc level (padrow = 0 ... kNpadrowIROC, kNpadrowOROC)
28 Int_t GetHWAddress(Int_t roc, Int_t padrow, Int_t pad) const;
29 Int_t GetRcu(Int_t roc, Int_t padrow, Int_t pad) const;
30 Int_t GetPatch(Int_t roc, Int_t padrow, Int_t pad) const;
31 Int_t GetPadRow(Int_t roc, Int_t hwAddress) const;
32 Int_t GetPadRow(Int_t roc, Int_t branch, Int_t fec, Int_t chip, Int_t channel) const;
33 Int_t GetBranch(Int_t roc, Int_t padrow, Int_t pad) const;
34 Int_t GetFEChw(Int_t roc, Int_t padrow, Int_t pad) const;
35 Int_t GetFEC(Int_t roc, Int_t padrow, Int_t pad) const;
36 Int_t GetChip(Int_t roc, Int_t padrow, Int_t pad) const;
37 Int_t GetChannel(Int_t roc, Int_t padrow, Int_t pad) const;
38
39 // ALTRO mapping functions on sector level (sectorpadrow = 0 ... kNpadrow)
40 Int_t GetSectorPadRow(Int_t patch, Int_t hwAddress) const;
41 Int_t GetSectorPadRow(Int_t patch, Int_t branch, Int_t fec, Int_t chip, Int_t channel) const;
42 Int_t GetHWAddressSector(Int_t sectorpadrow, Int_t pad) const;
43 Int_t GetRcuSector(Int_t sectorpadrow, Int_t pad) const;
44 Int_t GetPatchSector(Int_t sectorpadrow, Int_t pad) const;
45 Int_t GetBranchSector(Int_t sectorpadrow, Int_t pad) const;
46 Int_t GetFEChwSector(Int_t sectorpadrow, Int_t pad) const;
47 Int_t GetFECSector(Int_t sectorpadrow, Int_t pad) const;
48 Int_t GetChipSector(Int_t sectorpadrow, Int_t pad) const;
49 Int_t GetChannelSector(Int_t sectorpadrow, Int_t pad) const;
50
51 // Coding and decoding of hardware addresses
52 Int_t CodeHWAddress(Int_t branch, Int_t fec, Int_t chip, Int_t channel) const;
53 Int_t DecodedHWAddressBranch(Int_t hwAddress) const;
54 Int_t DecodedHWAddressFECaddr(Int_t hwAddress) const;
55 Int_t DecodedHWAddressChipaddr(Int_t hwAddress) const;
56 Int_t DecodedHWAddressChanneladdr(Int_t hwAddress) const;
57
58 // Pad Geometry on sector level (padrow = 0 ... kNpadrow)
59 Int_t GetNpads(Int_t roc, Int_t padrow) const;
60 Int_t GetNpads(Int_t sectorpadrow) const;
61 Int_t GetNpadrows(Int_t roc) const;
62 /*
63 Double_t GetPadXlocal(Int_t sectorpadrow) const;
64 Double_t GetPadYlocal(Int_t sectorpadrow, Int_t pad) const;
65 Double_t GetPadXglobal(Int_t sectorpadrow, Int_t pad, Int_t sector) const;
66 Double_t GetPadYglobal(Int_t sectorpadrow, Int_t pad, Int_t sector) const;
67 Double_t GetPadWidth(Int_t sectorpadrow) const;
68 Double_t GetPadLength(Int_t sectorpadrow) const;
69 */
70
71 // Conversion between hardware FEC numbering and official numbering
72 Int_t HwToOffline(Int_t patch, Int_t branch, Int_t fec) const;
73 Int_t OfflineToHwBranch(Int_t patch, Int_t fec) const;
74 Int_t OfflineToHwFec(Int_t patch, Int_t fec) const;
75
76 // More mapping functions
77 Int_t GetEquipmentID(Int_t roc, Int_t padrow, Int_t pad) const;
78 Int_t GetEquipmentIDsector(Int_t side, Int_t sector, Int_t sectorpadrow, Int_t pad) const;
79 Int_t GetEquipmentIDfromPatch(Int_t side, Int_t sector, Int_t patch) const;
80 Int_t GetSectorFromRoc(Int_t roc) const;
81 Int_t GetSideFromRoc(Int_t roc) const;
82 Int_t GetRocFromPatch(Int_t side, Int_t sector, Int_t patch) const;
83 Int_t GetRoc(Int_t side, Int_t sector, Int_t sectorpadrow, Int_t pad) const;
84 Int_t GetSideFromEquipmentID(Int_t equipmentID) const;
85 Int_t GetSectorFromEquipmentID(Int_t equipmentID) const;
86 Int_t GetRocFromEquipmentID(Int_t equipmentID) const;
87 Int_t GetPatchFromEquipmentID(Int_t equipmentID) const;
88
89 // Even more
90 Int_t GetNfec(Int_t patch, Int_t branch) const;
91 Int_t GetNfec(Int_t patch) const;
92 Bool_t IsIROC(Int_t roc) const;
93 Bool_t IsOROC(Int_t roc) const;
94
95 private:
96
97 Int_t fNside;
98 Int_t fNsector;
99 Int_t fNrcu;
100 Int_t fNbranch;
101 Int_t fNaltro;
102 Int_t fNchannel;
103 Int_t fNpadrow;
104 Int_t fNpadrowIROC;
105 Int_t fNpadrowOROC;
106
107 AliTPCAltroMapping *fMapping[6]; // The ALTRO mapping for each patch (rcu)
108 AliTPCROC *fROC; // ROC object containing some relevant functions
109
110 ClassDef(AliTPCmapper,1)
bb18c002 111
bb18c002 112};
113
114#endif