]>
Commit | Line | Data |
---|---|---|
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 | |
0e75e410 | 8 | class AliTPCmapper : public TObject{ |
bb18c002 | 9 | |
10 | ||
11 | public: | |
12 | ||
13 | AliTPCmapper(); | |
14 | virtual ~AliTPCmapper(); | |
15 | ||
16 | void Init(); | |
17 | ||
18 | Int_t ReadMapping(); | |
19 | ||
20 | ||
0e75e410 | 21 | Int_t GetRow(Int_t rcu, Int_t branch, Int_t fec, Int_t altro, Int_t channel) const{ |
bb18c002 | 22 | return fAddressToRow[rcu][branch][fec][altro][channel];} |
23 | ||
0e75e410 | 24 | Int_t GetPad(Int_t rcu, Int_t branch, Int_t fec, Int_t altro, Int_t channel) const { |
bb18c002 | 25 | return fAddressToPad[rcu][branch][fec][altro][channel];} |
26 | ||
0e75e410 | 27 | Int_t GetPadSector(Int_t rcu, Int_t branch, Int_t fec, Int_t altro, Int_t channel) const { |
bb18c002 | 28 | return fRowPadToPadsec[fAddressToPad[rcu][branch][fec][altro][channel]] |
29 | [fAddressToPad[rcu][branch][fec][altro][channel]];} | |
30 | ||
31 | ||
0e75e410 | 32 | Int_t GetRow(Int_t altroaddr) const; |
bb18c002 | 33 | |
0e75e410 | 34 | Int_t GetPad(Int_t altroaddr) const; |
bb18c002 | 35 | |
0e75e410 | 36 | Int_t GetPadFromPadSector(Int_t padsector) const{ |
bb18c002 | 37 | return fPadsecToPad[padsector];} |
38 | ||
0e75e410 | 39 | Int_t GetRowFromPadSector(Int_t padsector) const { |
bb18c002 | 40 | return fPadsecToRow[padsector];} |
41 | ||
0e75e410 | 42 | Int_t GetPadSector(Int_t row,Int_t pad) const{ |
bb18c002 | 43 | return fRowPadToPadsec[row][pad];} |
44 | ||
0e75e410 | 45 | Int_t GetPadsInRowS(Int_t row) const; |
bb18c002 | 46 | |
0e75e410 | 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; | |
bb18c002 | 55 | |
56 | ||
0e75e410 | 57 | Int_t GetRCUs(Int_t row, Int_t pad) const{ |
bb18c002 | 58 | return fRowPadToRCU[row][pad];} |
59 | ||
0e75e410 | 60 | Int_t GetBranchS(Int_t row, Int_t pad) const { |
bb18c002 | 61 | return fRowPadToBranch[row][pad];} |
62 | ||
0e75e410 | 63 | Int_t GetFECs(Int_t row, Int_t pad) const { |
bb18c002 | 64 | return fRowPadToFEC[row][pad];} |
65 | ||
0e75e410 | 66 | Int_t GetAltroS(Int_t row, Int_t pad) const{ |
bb18c002 | 67 | return fRowPadToAltro[row][pad];} |
68 | ||
0e75e410 | 69 | Int_t GetChannelS(Int_t row, Int_t pad) const { |
bb18c002 | 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 | ||
11c5d692 | 77 | Int_t GetAltroAddrwPatch(Int_t row, Int_t pad) const; |
bb18c002 | 78 | |
11c5d692 | 79 | Int_t GetAltroAddrwPatch(Int_t padsector) const; |
bb18c002 | 80 | |
81 | //for aliroot compatibility (sector == roc) | |
0e75e410 | 82 | Int_t GetPadsInRowS(Int_t row, Int_t sector) const { |
bb18c002 | 83 | return GetPadsInRowS(row+(sector/36)*63);} |
0e75e410 | 84 | Double_t GetPadXlocal (Int_t row, Int_t pad, Int_t sector) const { |
bb18c002 | 85 | return GetPadXlocalS(row+(sector/36)*63,pad);} |
0e75e410 | 86 | Double_t GetPadYlocal (Int_t row, Int_t pad, Int_t sector) const { |
bb18c002 | 87 | return GetPadYlocalS(row+(sector/36)*63,pad);} |
0e75e410 | 88 | Double_t GetPadXglobal (Int_t row, Int_t pad, Int_t sector) const { |
bb18c002 | 89 | return GetPadXlocalS(row+(sector/36)*63,pad);} |
0e75e410 | 90 | Double_t GetPadYglobal (Int_t row, Int_t pad, Int_t sector) const{ |
bb18c002 | 91 | return GetPadYlocalS(row+(sector/36)*63,pad);} |
0e75e410 | 92 | Int_t GetRCU(Int_t row, Int_t pad, Int_t sector) const { |
bb18c002 | 93 | return GetRCUs(row+(sector/36)*63,pad);} |
0e75e410 | 94 | Int_t GetBranch(Int_t row, Int_t pad, Int_t sector) const { |
bb18c002 | 95 | return GetBranchS(row+(sector/36)*63,pad);} |
0e75e410 | 96 | Int_t GetFEC(Int_t row, Int_t pad, Int_t sector) const { |
bb18c002 | 97 | return GetFECs(row+(sector/36)*63,pad);} |
0e75e410 | 98 | Int_t GetAltro(Int_t row, Int_t pad, Int_t sector) const { |
bb18c002 | 99 | return GetAltroS(row+(sector/36)*63,pad);} |
0e75e410 | 100 | Int_t GetChannel(Int_t row, Int_t pad, Int_t sector) const { |
bb18c002 | 101 | return GetChannelS(row+(sector/36)*63,pad);} |
0e75e410 | 102 | Double_t GetPadWidth (Int_t row, Int_t sector) const { |
bb18c002 | 103 | return GetPadWidthS(row+(sector/36)*63);} |
0e75e410 | 104 | Double_t GetPadLength (Int_t row, Int_t sector) const{ |
bb18c002 | 105 | return GetPadLengthS(row+(sector/36)*63);} |
106 | ||
0e75e410 | 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 | ||
bb18c002 | 137 | |
138 | ClassDef(AliTPCmapper,0) | |
139 | }; | |
140 | ||
141 | #endif |