AliRoot Core  d69033e (d69033e)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliTPCmapper.h
Go to the documentation of this file.
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 
10 
11 #include <TObject.h>
12 
13 class AliTPCAltroMapping;
14 
15 class AliTPCmapper : public TObject{
16 
17 public:
18 
19  AliTPCmapper();
20  AliTPCmapper(const char * dirname);
21  virtual ~AliTPCmapper();
22 
23  AliTPCmapper& operator = (const AliTPCmapper& mapper);
24  AliTPCmapper(const AliTPCmapper& mapper);
25 
26  void Init(const char * dirname);
27  //
29 
30  // ALTRO mapping functions
31  Int_t GetPad(Int_t patch, Int_t hwAddress) const;
32  Int_t GetPad(Int_t patch, Int_t branch, Int_t fec, Int_t chip, Int_t channel) const;
33  Int_t GetPadRow(Int_t patch, Int_t hwAddress) const;
34  Int_t GetPadRow(Int_t patch, Int_t branch, Int_t fec, Int_t chip, Int_t channel) const;
35 
36  // ALTRO mapping functions on roc level (padrow = 0 ... kNpadrowIROC, kNpadrowOROC)
37  Int_t GetHWAddress(Int_t roc, Int_t padrow, Int_t pad) const;
38  Int_t GetRcu(Int_t roc, Int_t padrow, Int_t pad) const;
39  Int_t GetPatch(Int_t roc, Int_t padrow, Int_t pad) const;
40  Int_t GetBranch(Int_t roc, Int_t padrow, Int_t pad) const;
41  Int_t GetFEChw(Int_t roc, Int_t padrow, Int_t pad) const;
42  Int_t GetFEC(Int_t roc, Int_t padrow, Int_t pad) const;
43  Int_t GetChip(Int_t roc, Int_t padrow, Int_t pad) const;
44  Int_t GetChannel(Int_t roc, Int_t padrow, Int_t pad) const;
45 
46  // ALTRO mapping functions on sector level (globalpadrow = 0 ... kNpadrow)
47  Int_t GetGlobalPadRow(Int_t patch, Int_t hwAddress) const;
48  Int_t GetGlobalPadRow(Int_t patch, Int_t branch, Int_t fec, Int_t chip, Int_t channel) const;
49  Int_t GetHWAddressSector(Int_t globalpadrow, Int_t pad) const;
50  Int_t GetRcuSector(Int_t globalpadrow, Int_t pad) const;
51  Int_t GetPatchSector(Int_t globalpadrow, Int_t pad) const;
52  Int_t GetBranchSector(Int_t globalpadrow, Int_t pad) const;
53  Int_t GetFEChwSector(Int_t globalpadrow, Int_t pad) const;
54  Int_t GetFECSector(Int_t globalpadrow, Int_t pad) const;
55  Int_t GetChipSector(Int_t globalpadrow, Int_t pad) const;
56  Int_t GetChannelSector(Int_t globalpadrow, Int_t pad) const;
57 
58  // Coding and decoding of hardware addresses
59  Int_t CodeHWAddress(Int_t branch, Int_t fec, Int_t chip, Int_t channel) const;
60  Int_t DecodedHWAddressBranch(Int_t hwAddress) const;
61  Int_t DecodedHWAddressFECaddr(Int_t hwAddress) const;
62  Int_t DecodedHWAddressChipaddr(Int_t hwAddress) const;
63  Int_t DecodedHWAddressChanneladdr(Int_t hwAddress) const;
64 
65  // Pad Geometry on sector level (padrow = 0 ... kNpadrow)
66  Int_t GetNpads(Int_t roc, Int_t padrow) const;
67  Int_t GetNpads(Int_t globalpadrow) const;
68  Int_t GetNpadrows(Int_t roc) const;
69  /*
70  Double_t GetPadXlocal(Int_t globalpadrow) const;
71  Double_t GetPadYlocal(Int_t globalpadrow, Int_t pad) const;
72  Double_t GetPadXglobal(Int_t globalpadrow, Int_t pad, Int_t sector) const;
73  Double_t GetPadYglobal(Int_t globalpadrow, Int_t pad, Int_t sector) const;
74  Double_t GetPadWidth(Int_t globalpadrow) const;
75  Double_t GetPadLength(Int_t globalpadrow) const;
76  */
77 
78  // Conversion between hardware FEC numbering and official numbering
79  Int_t HwToOffline(Int_t patch, Int_t branch, Int_t fec) const;
80  Int_t OfflineToHwBranch(Int_t patch, Int_t fec) const;
81  Int_t OfflineToHwFec(Int_t patch, Int_t fec) const;
82 
83  // More mapping functions
84  Int_t GetEquipmentID(Int_t roc, Int_t padrow, Int_t pad) const;
85  Int_t GetEquipmentIDsector(Int_t side, Int_t sector, Int_t globalpadrow, Int_t pad) const;
86  Int_t GetEquipmentIDfromPatch(Int_t side, Int_t sector, Int_t patch) const;
87  Int_t GetSectorFromRoc(Int_t roc) const;
88  Int_t GetSideFromRoc(Int_t roc) const;
89  Int_t GetRocFromPatch(Int_t side, Int_t sector, Int_t patch) const;
90  Int_t GetRoc(Int_t side, Int_t sector, Int_t globalpadrow, Int_t pad) const;
91  Int_t GetSideFromEquipmentID(Int_t equipmentID) const;
92  Int_t GetSectorFromEquipmentID(Int_t equipmentID) const;
93  Int_t GetRocFromEquipmentID(Int_t equipmentID) const;
94  Int_t GetPatchFromEquipmentID(Int_t equipmentID) const;
95 
96  // Even more
97  Int_t GetNfec(Int_t patch, Int_t branch) const;
98  Int_t GetNfec(Int_t patch) const;
99  Bool_t IsIROC(Int_t roc) const;
100  Bool_t IsOROC(Int_t roc) const;
101 
102  Int_t GetTpcDdlOffset() const {return fTpcDdlOffset;}
103  Int_t GetNumDdl() const {return fNside*fNsector*fNrcu; }
104 
105  private:
106 
107  Int_t fNside;
108  Int_t fNsector;
109  Int_t fNrcu;
110  Int_t fNbranch;
111  Int_t fNaltro;
112  Int_t fNchannel;
113  Int_t fNpadrow;
114  Int_t fNpadrowIROC;
115  Int_t fNpadrowOROC;
116 
118 
120 
122  ClassDef(AliTPCmapper,2)
124 
125 };
126 
127 #endif
Int_t GetChipSector(Int_t globalpadrow, Int_t pad) const
Int_t DecodedHWAddressChipaddr(Int_t hwAddress) const
Bool_t IsIROC(Int_t roc) const
Int_t GetGlobalPadRow(Int_t patch, Int_t hwAddress) const
virtual ~AliTPCmapper()
Int_t GetNpads(Int_t roc, Int_t padrow) const
Int_t GetFECSector(Int_t globalpadrow, Int_t pad) const
Int_t GetRcu(Int_t roc, Int_t padrow, Int_t pad) const
Int_t GetHWAddressSector(Int_t globalpadrow, Int_t pad) const
Int_t DecodedHWAddressChanneladdr(Int_t hwAddress) const
Int_t GetRoc(Int_t side, Int_t sector, Int_t globalpadrow, Int_t pad) const
AliTPCmapper.
Definition: AliTPCmapper.h:15
Int_t GetPad(Int_t patch, Int_t hwAddress) const
Int_t GetEquipmentIDsector(Int_t side, Int_t sector, Int_t globalpadrow, Int_t pad) const
AliTPCAltroMapping * fMapping[6]
The ALTRO mapping for each patch (rcu)
Definition: AliTPCmapper.h:119
Int_t GetFEChwSector(Int_t globalpadrow, Int_t pad) const
Int_t GetNfec(Int_t patch, Int_t branch) const
Int_t OfflineToHwBranch(Int_t patch, Int_t fec) const
Int_t GetFEC(Int_t roc, Int_t padrow, Int_t pad) const
Int_t CodeHWAddress(Int_t branch, Int_t fec, Int_t chip, Int_t channel) const
Int_t GetPatch(Int_t roc, Int_t padrow, Int_t pad) const
Int_t GetEquipmentID(Int_t roc, Int_t padrow, Int_t pad) const
Int_t GetFEChw(Int_t roc, Int_t padrow, Int_t pad) const
Int_t GetSideFromEquipmentID(Int_t equipmentID) const
Int_t GetNumDdl() const
Definition: AliTPCmapper.h:103
Int_t GetChannel(Int_t roc, Int_t padrow, Int_t pad) const
Int_t GetRocFromPatch(Int_t side, Int_t sector, Int_t patch) const
Int_t GetBranchSector(Int_t globalpadrow, Int_t pad) const
Int_t DecodedHWAddressBranch(Int_t hwAddress) const
AliTPCmapper & operator=(const AliTPCmapper &mapper)
Int_t GetPadRow(Int_t patch, Int_t hwAddress) const
Int_t OfflineToHwFec(Int_t patch, Int_t fec) const
Int_t fNrcu
Sector has 6 RCUs (patches)
Definition: AliTPCmapper.h:109
Int_t fNpadrowIROC
IROC has 63 padrows.
Definition: AliTPCmapper.h:114
Int_t GetChip(Int_t roc, Int_t padrow, Int_t pad) const
Int_t GetPatchFromEquipmentID(Int_t equipmentID) const
Int_t GetTpcDdlOffset() const
Definition: AliTPCmapper.h:102
Int_t DecodedHWAddressFECaddr(Int_t hwAddress) const
Int_t fNpadrow
Sector has 159 padrows.
Definition: AliTPCmapper.h:113
Int_t fNside
TPC has 2 sides.
Definition: AliTPCmapper.h:107
Int_t GetSectorFromRoc(Int_t roc) const
Int_t fNaltro
FEC has 8 ALTROs.
Definition: AliTPCmapper.h:111
Int_t fTpcDdlOffset
DDL offset for TPC.
Definition: AliTPCmapper.h:117
Int_t fNsector
TPC side has 18 sectors.
Definition: AliTPCmapper.h:108
Int_t GetRcuSector(Int_t globalpadrow, Int_t pad) const
Int_t fNpadrowOROC
OROC has 96 padrows.
Definition: AliTPCmapper.h:115
Int_t GetEquipmentIDfromPatch(Int_t side, Int_t sector, Int_t patch) const
Int_t GetRocFromEquipmentID(Int_t equipmentID) const
Int_t GetChannelSector(Int_t globalpadrow, Int_t pad) const
Int_t fNbranch
RCU has 2 branches.
Definition: AliTPCmapper.h:110
Int_t GetSideFromRoc(Int_t roc) const
Int_t GetHWAddress(Int_t roc, Int_t padrow, Int_t pad) const
Int_t fNchannel
ALTRO has 16 channels.
Definition: AliTPCmapper.h:112
Bool_t IsOROC(Int_t roc) const
Int_t HwToOffline(Int_t patch, Int_t branch, Int_t fec) const
Int_t GetSectorFromEquipmentID(Int_t equipmentID) const
Int_t GetBranch(Int_t roc, Int_t padrow, Int_t pad) const
AliTPCAltroMapping ** GetAltroMapping()
Definition: AliTPCmapper.h:28
Int_t GetNpadrows(Int_t roc) const
void Init(const char *dirname)
Int_t GetPatchSector(Int_t globalpadrow, Int_t pad) const