]>
Commit | Line | Data |
---|---|---|
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 | ||
6 | #include <TObject.h> | |
7 | ||
8 | class AliTPCmapper : public TObject{ | |
9 | ||
10 | ||
11 | public: | |
12 | ||
13 | AliTPCmapper(); | |
14 | virtual ~AliTPCmapper(); | |
15 | ||
16 | void Init(); | |
17 | ||
18 | Int_t ReadMapping(); | |
19 | ||
20 | ||
21 | Int_t GetRow(Int_t rcu, Int_t branch, Int_t fec, Int_t altro, Int_t channel) const{ | |
22 | return fAddressToRow[rcu][branch][fec][altro][channel];} | |
23 | ||
24 | Int_t GetPad(Int_t rcu, Int_t branch, Int_t fec, Int_t altro, Int_t channel) const { | |
25 | return fAddressToPad[rcu][branch][fec][altro][channel];} | |
26 | ||
27 | Int_t GetPadSector(Int_t rcu, Int_t branch, Int_t fec, Int_t altro, Int_t channel) const { | |
28 | return fRowPadToPadsec[fAddressToPad[rcu][branch][fec][altro][channel]] | |
29 | [fAddressToPad[rcu][branch][fec][altro][channel]];} | |
30 | ||
31 | ||
32 | Int_t GetRow(Int_t altroaddr) const; | |
33 | ||
34 | Int_t GetPad(Int_t altroaddr) const; | |
35 | ||
36 | Int_t GetPadFromPadSector(Int_t padsector) const{ | |
37 | return fPadsecToPad[padsector];} | |
38 | ||
39 | Int_t GetRowFromPadSector(Int_t padsector) const { | |
40 | return fPadsecToRow[padsector];} | |
41 | ||
42 | Int_t GetPadSector(Int_t row,Int_t pad) const{ | |
43 | return fRowPadToPadsec[row][pad];} | |
44 | ||
45 | Int_t GetPadsInRowS(Int_t row) const; | |
46 | ||
47 | Double_t GetPadXlocalS (Int_t row, Int_t pad) const; | |
48 | Double_t GetPadXlocalS (Int_t padsector) const; | |
49 | Double_t GetPadYlocalS (Int_t row, Int_t pad) const; | |
50 | Double_t GetPadYlocalS (Int_t padsector) const; | |
51 | Double_t GetPadXglobalS(Int_t row, Int_t pad, Int_t sector) const; | |
52 | Double_t GetPadYglobalS(Int_t row, Int_t pad, Int_t sector) const; | |
53 | Double_t GetPadWidthS (Int_t row) const; | |
54 | Double_t GetPadLengthS (Int_t row) const; | |
55 | ||
56 | ||
57 | Int_t GetRCUs(Int_t row, Int_t pad) const{ | |
58 | return fRowPadToRCU[row][pad];} | |
59 | ||
60 | Int_t GetBranchS(Int_t row, Int_t pad) const { | |
61 | return fRowPadToBranch[row][pad];} | |
62 | ||
63 | Int_t GetFECs(Int_t row, Int_t pad) const { | |
64 | return fRowPadToFEC[row][pad];} | |
65 | ||
66 | Int_t GetAltroS(Int_t row, Int_t pad) const{ | |
67 | return fRowPadToAltro[row][pad];} | |
68 | ||
69 | Int_t GetChannelS(Int_t row, Int_t pad) const { | |
70 | return fRowPadToChannel[row][pad];} | |
71 | ||
72 | void PrintRBFACinfo(Int_t row, Int_t pad); | |
73 | ||
74 | void PrintAddressArray(Int_t row, Int_t pad); | |
75 | ||
76 | ||
77 | Int_t GetAltroAddrwPatch(Int_t row, Int_t pad) const; | |
78 | ||
79 | Int_t GetAltroAddrwPatch(Int_t padsector) const; | |
80 | ||
81 | //for aliroot compatibility (sector == roc) | |
82 | Int_t GetPadsInRowS(Int_t row, Int_t sector) const { | |
83 | return GetPadsInRowS(row+(sector/36)*63);} | |
84 | Double_t GetPadXlocal (Int_t row, Int_t pad, Int_t sector) const { | |
85 | return GetPadXlocalS(row+(sector/36)*63,pad);} | |
86 | Double_t GetPadYlocal (Int_t row, Int_t pad, Int_t sector) const { | |
87 | return GetPadYlocalS(row+(sector/36)*63,pad);} | |
88 | Double_t GetPadXglobal (Int_t row, Int_t pad, Int_t sector) const { | |
89 | return GetPadXlocalS(row+(sector/36)*63,pad);} | |
90 | Double_t GetPadYglobal (Int_t row, Int_t pad, Int_t sector) const{ | |
91 | return GetPadYlocalS(row+(sector/36)*63,pad);} | |
92 | Int_t GetRCU(Int_t row, Int_t pad, Int_t sector) const { | |
93 | return GetRCUs(row+(sector/36)*63,pad);} | |
94 | Int_t GetBranch(Int_t row, Int_t pad, Int_t sector) const { | |
95 | return GetBranchS(row+(sector/36)*63,pad);} | |
96 | Int_t GetFEC(Int_t row, Int_t pad, Int_t sector) const { | |
97 | return GetFECs(row+(sector/36)*63,pad);} | |
98 | Int_t GetAltro(Int_t row, Int_t pad, Int_t sector) const { | |
99 | return GetAltroS(row+(sector/36)*63,pad);} | |
100 | Int_t GetChannel(Int_t row, Int_t pad, Int_t sector) const { | |
101 | return GetChannelS(row+(sector/36)*63,pad);} | |
102 | Double_t GetPadWidth (Int_t row, Int_t sector) const { | |
103 | return GetPadWidthS(row+(sector/36)*63);} | |
104 | Double_t GetPadLength (Int_t row, Int_t sector) const{ | |
105 | return GetPadLengthS(row+(sector/36)*63);} | |
106 | ||
107 | private: | |
108 | enum { | |
109 | kNrcu = 6, | |
110 | kNbranch = 2, | |
111 | kNfecMax = 13, | |
112 | kNaltro = 8, | |
113 | kNchannel = 16, | |
114 | kNpadrow = 159, | |
115 | kNpadMax = 140, | |
116 | kNaddrSize = 20, | |
117 | kNpadSector = 15488 | |
118 | }; | |
119 | ||
120 | Int_t fAddressToRow[kNrcu][kNbranch][kNfecMax][kNaltro][kNchannel]; //fAddressToRow | |
121 | Int_t fAddressToPad[kNrcu][kNbranch][kNfecMax][kNaltro][kNchannel]; //fAddressToPad | |
122 | ||
123 | Int_t fRowPadToRCU[kNpadrow][kNpadMax]; //fRowPadToRCU | |
124 | Int_t fRowPadToBranch[kNpadrow][kNpadMax]; //fRowPadToBranch | |
125 | Int_t fRowPadToFEC[kNpadrow][kNpadMax]; //fRowPadToFEC | |
126 | Int_t fRowPadToAltro[kNpadrow][kNpadMax]; // fRowPadToAltro | |
127 | Int_t fRowPadToChannel[kNpadrow][kNpadMax]; //RowPadToChannel | |
128 | ||
129 | Int_t fPadsecToRow[kNpadSector]; //PadsecToRow | |
130 | Int_t fPadsecToPad[kNpadSector]; //PadsecToPad | |
131 | ||
132 | Int_t fRowPadToPadsec[kNpadrow][kNpadMax]; //RowPadToPadsec | |
133 | ||
134 | Char_t fMapfileName[255]; //MapfileName | |
135 | ||
136 | ||
137 | ||
138 | ClassDef(AliTPCmapper,0) | |
139 | }; | |
140 | ||
141 | #endif |