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]).
8 // Author: A. De Caro (decaro@sa.infn.it - annalisa.de.caro@cern.ch)
11 #if !defined( __CINT__) || defined(__MAKECINT__)
12 #include <Riostream.h>
14 #include "AliTOFRawStream.h"
17 void CheckEQID2GEANT2EQID(Int_t drmCheck=0, Int_t trmCheck=3);
18 void CheckGEANT2EQID2GEANT(Int_t selectedSector=0);
20 void CheckEQID2GEANT2EQID(Int_t drmCheck, Int_t trmCheck)
30 Int_t vol[5] = {-1, -1, -1, -1, -1};
38 Int_t ddlInf = drmCheck;
39 Int_t ddlSup = drmCheck+1;
40 Int_t trmInf = trmCheck;
41 Int_t trmSup = trmCheck+1;
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);
48 iDDL = AliTOFRawStream::GetDDLnumberPerSector(nDDL);
50 for (Int_t nTRM=trmInf; nTRM<=trmSup; nTRM++) {
51 for (Int_t nTDC=0 ; nTDC<15; nTDC++) {
53 (nDDL%2==1 && nTRM==3 && nTDC>2)
55 (nDDL%2==0 && nTRM==3)
59 iPlate = AliTOFRawStream::Equip2VolNplate(iDDL, nTRM, nTDC);
60 iStrip = AliTOFRawStream::Equip2VolNstrip(iDDL, nTRM, nTDC);
62 for (Int_t nChain=0; nChain<2; nChain++) {
63 for (Int_t nChannel=0 ; nChannel<8; nChannel++) {
65 //iPad = AliTOFRawStream::Equip2VolNpad(iDDL, nChain, nTDC, nChannel);
66 iPadX = AliTOFRawStream::Equip2VolNpadX(iDDL, nChain, nTDC, nChannel);
67 iPadZ = AliTOFRawStream::Equip2VolNpadZ(iDDL, nChain, nTDC, nChannel);
69 vol[0] = iSector, vol[1] = iPlate, vol[2] = iStrip, vol[3] = iPadZ, vol[4] = iPadX;
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);
85 printf(" %2i, %2i, %2i, %1i, %1i ---> ",
92 printf(" %2i %1i %2i %1i %2i ---> ",
93 iSector, iPlate, iStrip, iPadZ, iPadX);
94 printf(" %2i, %2i, %2i, %1i, %1i\n",
115 void CheckGEANT2EQID2GEANT(Int_t selectedSector)
124 Int_t vol[5] = {-1, -1, -1, -1, -1};
133 Int_t infSector= selectedSector;
134 Int_t supSector= selectedSector+1;
136 if (selectedSector==-1) infSector = 0, supSector = 18;
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++) {
145 vol[0] = nSector, vol[1] = nPlate, vol[2] = nStrip, vol[3] = nPadZ, vol[4] = nPadX;
147 nDDL = AliTOFRawStream::Geant2DDL(vol);
148 iDDL = AliTOFRawStream::GetDDLnumberPerSector(nDDL);
150 iTRM = AliTOFRawStream::Geant2TRM(vol);
151 iTDC = AliTOFRawStream::Geant2TDC(vol);
152 iChain = AliTOFRawStream::Geant2Chain(vol);
153 iChannel = AliTOFRawStream::Geant2Channel(vol);
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);
169 printf(" %2i %1i %2i %1i %2i ---> ",
170 iSector, iPlate, iStrip, iPadZ, iPadX);
171 printf(" %2i, %2i, %2i, %1i, %1i ---> ",
178 printf(" %2i %1i %2i %1i %2i\n ",
179 nSector, nPlate, nStrip, nPadZ, nPadX);