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