Resolving all symbols in the library
[u/mrichter/AliRoot.git] / TOF / CheckTOFnumbering.C
CommitLineData
5f72a2bf 1//
2// This macro is useful to check the correct corrispondence
3// between the TOF volume GEANT numbering
4// (i.e. sector [0;17], module [0;4], strip [0;14/18], padZ [0;1], padX [0;47])
5// and the equipment identification
6// (i.e. DDL [0;71], TRM [3/4;12], TDC [0;14], chain [0;1]; channel [0;7]).
7//
8// Author: A. De Caro (decaro@sa.infn.it - annalisa.de.caro@cern.ch)
9//
10
11#if !defined( __CINT__) || defined(__MAKECINT__)
12#include <Riostream.h>
13
14#include "AliTOFRawStream.h"
15#endif
16
17void CheckEQID2GEANT2EQID(Int_t drmCheck=0, Int_t trmCheck=3);
18void CheckGEANT2EQID2GEANT(Int_t selectedSector=0);
19
20void CheckEQID2GEANT2EQID(Int_t drmCheck, Int_t trmCheck)
21{
22
23 Int_t iDDL = -1;
24 Int_t iSector = -1;
25 Int_t iPlate = -1;
26 Int_t iStrip = -1;
27 Int_t iPadZ = -1;
28 Int_t iPadX = -1;
29
30 Int_t vol[5] = {-1, -1, -1, -1, -1};
31
32 Int_t sDDL = -1;
33 Int_t sTRM = -1;
34 Int_t sTDC = -1;
35 Int_t sChain = -1;
36 Int_t sChannel = -1;
37
38 Int_t ddlInf = drmCheck;
39 Int_t ddlSup = drmCheck+1;
40 Int_t trmInf = trmCheck;
41 Int_t trmSup = trmCheck+1;
42
43 if (drmCheck==-1) ddlInf = 0, ddlSup = 72;
44 if (trmCheck==-1) trmInf = 3, trmSup = 12;
45 for (Int_t nDDL=ddlInf; nDDL<ddlSup; nDDL++) {
46 iSector = AliTOFRawStream::GetSectorNumber(nDDL);
47
48 iDDL = AliTOFRawStream::GetDDLnumberPerSector(nDDL);
49
50 for (Int_t nTRM=trmInf; nTRM<=trmSup; nTRM++) {
51 for (Int_t nTDC=0 ; nTDC<15; nTDC++) {
52 if (
53 (nDDL%2==1 && nTRM==3 && nTDC>2)
54 ||
55 (nDDL%2==0 && nTRM==3)
56 )
57 continue;
58
59 iPlate = AliTOFRawStream::Equip2VolNplate(iDDL, nTRM, nTDC);
60 iStrip = AliTOFRawStream::Equip2VolNstrip(iDDL, nTRM, nTDC);
61
62 for (Int_t nChain=0; nChain<2; nChain++) {
63 for (Int_t nChannel=0 ; nChannel<8; nChannel++) {
64
65 //iPad = AliTOFRawStream::Equip2VolNpad(iDDL, nChain, nTDC, nChannel);
66 iPadX = AliTOFRawStream::Equip2VolNpadX(iDDL, nChain, nTDC, nChannel);
67 iPadZ = AliTOFRawStream::Equip2VolNpadZ(iDDL, nChain, nTDC, nChannel);
68
69 vol[0] = iSector, vol[1] = iPlate, vol[2] = iStrip, vol[3] = iPadZ, vol[4] = iPadX;
70
71 sDDL = AliTOFRawStream::Geant2DDL(vol);
72 sTRM = AliTOFRawStream::Geant2TRM(vol);
73 sTDC = AliTOFRawStream::Geant2TDC(vol);
74 sChain = AliTOFRawStream::Geant2Chain(vol);
75 sChannel = AliTOFRawStream::Geant2Channel(vol);
76
77 if (
78 sDDL!=nDDL ||
79 sTRM!=nTRM ||
80 sTDC!=nTDC ||
81 sChain!=nChain ||
82 sChannel!=nChannel
83 )
84 {
85 printf(" %2i, %2i, %2i, %1i, %1i ---> ",
86 nDDL,
87 nTRM,
88 nTDC,
89 nChain,
90 nChannel
91 );
92 printf(" %2i %1i %2i %1i %2i ---> ",
93 iSector, iPlate, iStrip, iPadZ, iPadX);
94 printf(" %2i, %2i, %2i, %1i, %1i\n",
95 sDDL,
96 sTRM,
97 sTDC,
98 sChain,
99 sChannel
100 );
101 }
102
103 }
104 }
105 }
106 }
107
108 }
109
110
111}
112
113
114
115void CheckGEANT2EQID2GEANT(Int_t selectedSector)
116{
117
118 Int_t iSector = -1;
119 Int_t iPlate = -1;
120 Int_t iStrip = -1;
121 Int_t iPadZ = -1;
122 Int_t iPadX = -1;
123
124 Int_t vol[5] = {-1, -1, -1, -1, -1};
125
126 Int_t nDDL = -1;
127 Int_t iDDL = -1;
128 Int_t iTRM = -1;
129 Int_t iTDC = -1;
130 Int_t iChain = -1;
131 Int_t iChannel = -1;
132
133 Int_t infSector= selectedSector;
134 Int_t supSector= selectedSector+1;
135
136 if (selectedSector==-1) infSector = 0, supSector = 18;
137
138 for (Int_t nSector=infSector; nSector<supSector; nSector++) {
139 for (Int_t nPlate=0; nPlate<5; nPlate++) {
140 if ((nSector==13 || nSector==14 || nSector==15) && nPlate==2) continue;
141 for (Int_t nStrip=0; nStrip<AliTOFGeometry::NStrip(nPlate); nStrip++) {
142 for (Int_t nPadZ=0; nPadZ<2; nPadZ++) {
143 for (Int_t nPadX=0; nPadX<48; nPadX++) {
144
145 vol[0] = nSector, vol[1] = nPlate, vol[2] = nStrip, vol[3] = nPadZ, vol[4] = nPadX;
146
147 nDDL = AliTOFRawStream::Geant2DDL(vol);
148 iDDL = AliTOFRawStream::GetDDLnumberPerSector(nDDL);
149
150 iTRM = AliTOFRawStream::Geant2TRM(vol);
151 iTDC = AliTOFRawStream::Geant2TDC(vol);
152 iChain = AliTOFRawStream::Geant2Chain(vol);
153 iChannel = AliTOFRawStream::Geant2Channel(vol);
154
155 iSector = AliTOFRawStream::GetSectorNumber(nDDL);
156 iPlate = AliTOFRawStream::Equip2VolNplate(iDDL, iTRM, iTDC);
157 iStrip = AliTOFRawStream::Equip2VolNstrip(iDDL, iTRM, iTDC);
158 iPadX = AliTOFRawStream::Equip2VolNpadX(iDDL, iChain, iTDC, iChannel);
159 iPadZ = AliTOFRawStream::Equip2VolNpadZ(iDDL, iChain, iTDC, iChannel);
160
161 if (
162 nSector!= iSector ||
163 nPlate!= iPlate ||
164 nStrip!= iStrip ||
165 nPadZ!= iPadZ ||
166 nPadX!= iPadX
167 )
168 {
169 printf(" %2i %1i %2i %1i %2i ---> ",
170 iSector, iPlate, iStrip, iPadZ, iPadX);
171 printf(" %2i, %2i, %2i, %1i, %1i ---> ",
172 iDDL,
173 iTRM,
174 iTDC,
175 iChain,
176 iChannel
177 );
178 printf(" %2i %1i %2i %1i %2i\n ",
179 nSector, nPlate, nStrip, nPadZ, nPadX);
180 }
181
182 }
183 }
184 }
185 }
186 }
187
188
189}