7 #include "DAQChannelMap/HardwareDisplay.h" 8 #include "DAQChannelMap/DAQChannelMap.h" 11 #include "NovaDAQConventions/DAQConventions.h" 18 case kNDOS: this->SetupNDOS();
break;
19 case kNEARDET: this->SetupNearDet();
break;
20 case kFARDET: this->SetupFarDet();
break;
21 case kTESTBEAM:this->SetupTestBeam();
break;
23 std::cerr << __FILE__ <<
" : " << __LINE__
24 <<
" Invalid detector type " << det
44 fNxPerDB = fNfebCols*fNpixCols;
45 fNyPerDCM = fNfebRows*fNpixRows;
47 fXmax = fNdiblocks*fNxPerDB;
48 fYmax = (fNdcmTop+fNdcmSide)*fNyPerDCM;
51 fNplanes = 2*fNplanesPerBL*fNdiblocks;
71 fNxPerDB = fNfebCols*fNpixCols;
72 fNyPerDCM = fNfebRows*fNpixRows;
74 fXmax = fNdiblocks*fNxPerDB;
75 fYmax = (fNdcmTop+fNdcmSide)*fNyPerDCM;
78 fNplanes = 2*fNplanesPerBL*fNdiblocks;
98 fNxPerDB = fNfebCols*fNpixCols;
99 fNyPerDCM = fNfebRows*fNpixRows;
101 fXmax = fNdiblocks*fNxPerDB;
102 fYmax = (fNdcmTop+fNdcmSide)*fNyPerDCM;
105 fNplanes = 2*fNplanesPerBL*fNdiblocks;
125 fNxPerDB = fNfebCols*fNpixCols;
126 fNyPerDCM = fNfebRows*fNpixRows;
128 fXmax = fNdiblocks*fNxPerDB;
129 fYmax = (fNdcmTop+fNdcmSide)*fNyPerDCM;
132 fNplanes = 2*fNplanesPerBL*fNdiblocks-1;
145 *ix = fNxPerDB*(fNdiblocks -
db);
156 *iy = fYmax - dcm*fNyPerDCM;
165 *ix = (feb%fNfebCols)*fNpixCols;
166 *iy = ((fNfebRows - 1) - feb/fNfebCols)*fNpixRows;
175 static unsigned int x[32] = {
176 3,3,3,3,3,3,3,3, 2,2,2,2,2,2,2,2,
177 1,1,1,1,1,1,1,1, 0,0,0,0,0,0,0,0
179 static unsigned int y[32] = {
180 1,0,3,2,5,4,7,6, 1,0,3,2,5,4,6,7,
181 7,6,4,5,2,3,0,1, 6,7,4,5,2,3,0,1
197 unsigned int x1,
x2, x3, x4;
198 unsigned int y1,
y2, y3, y4;
200 this->DiblockXY(db, &x1, &y1);
201 this->DCMXY (dcm, &x2, &y2);
202 this->FEBXY (feb, &x3, &y3);
203 this->PixXY (pix, &x4, &y4);
219 *db = fNdiblocks - ix/fNxPerDB;
227 *dcm = (fNdcmTop + fNdcmSide) - iy/fNyPerDCM;
236 unsigned int x1 = (ix%fNxPerDB)/fNpixCols;
237 unsigned int y1 = (iy%fNyPerDCM)/fNpixRows;
239 *feb = fNfebCols*(fNfebRows - 1 -
y1) + x1;
248 static unsigned int P[8][4] = {{30,22,9,1},
257 unsigned int x1 = ix%fNpixCols;
258 unsigned int y1 = iy%fNpixRows;
272 this->XYDiblock(db, ix);
273 this->XYDCM (dcm, iy);
274 this->XYFEB (feb, ix, iy);
275 this->XYPix (pix, ix, iy);
283 unsigned int* module,
300 *module = ((*cell)/fNcellPerMod);
308 unsigned int* module,
325 *module = ((*cell)/fNcellPerMod);
333 unsigned int* module,
351 *dcm = cmap->
getDCM (dchan);
352 *feb = cmap->
getFEB(dchan);
354 *module = ((
cell)/fNcellPerMod);
void PlaneCellToDAQ(unsigned int plane, unsigned int *pinb, unsigned int *view, unsigned int *module, unsigned int cell, unsigned int *db, unsigned int *block, unsigned int *dcm, unsigned int *feb, unsigned int *pix)
void XYPix(unsigned int *pix, unsigned int ix, unsigned int iy)
Float_t y1[n_points_granero]
void DAQToPlaneInBlockModCell(unsigned int *block, unsigned int *pinb, unsigned int *view, unsigned int *module, unsigned int *cell, unsigned int db, unsigned int dcm, unsigned int feb, unsigned int pix)
void XYDCM(unsigned int *dcm, unsigned int iy)
Float_t x1[n_points_granero]
void XYFEB(unsigned int *feb, unsigned int ix, unsigned int iy)
virtual DetView_TYPE getView(dchan daqchan) const =0
Which view (X or Y) does this daq channel readout?
void DAQToXY(unsigned int db, unsigned int dcm, unsigned int feb, unsigned int pix, unsigned int *ix, unsigned int *iy)
void XYToDAQ(unsigned int *db, unsigned int *dcm, unsigned int *feb, unsigned int *pix, unsigned int ix, unsigned int iy)
cell_t getCell(lchan logicalchan) const
Decode the cell number from an lchan.
lchan encodeLChan(int detId, plane_t plane, cell_t cell) const
void DiblockXY(unsigned int db, unsigned int *ix, unsigned int *iy)
#define P(a, b, c, d, e, x)
block
print "ROW IS " print row
static DAQChannelMap * getInstance(int detID)
Prototype Near Detector on the surface at FNAL.
pixel_t getPixel(dchan daqchan) const
Decode the pixel id from a dchan.
void FEBXY(unsigned int feb, unsigned int *ix, unsigned int *iy)
void DCMXY(unsigned int dcm, unsigned int *ix, unsigned int *iy)
void DAQToPlaneModCell(unsigned int *block, unsigned int *plane, unsigned int *view, unsigned int *module, unsigned int *cell, unsigned int db, unsigned int dcm, unsigned int feb, unsigned int pix)
plane_t getPlane(lchan logicalchan) const
Decode the plane number from an lchan.
cmap::CMap class source code
dcm_id_t getDCM(dchan daqchan) const
Decode the dcm ID from a dchan.
dchan encodeDChan(int detID, diblock_t diblock, dcm_id_t dcm, feb_t feb, pixel_t pixel) const
virtual block_t computeBlock(lchan logicalchan) const =0
Which block is this lchan in?
uint32_t dchan
< DAQ Channel Map Package
virtual plane_t computePlaneInBlock(lchan logicalchan) const =0
Which global plane in this lchan in?
diblock_t getDiBlock(dchan daqchan) const
Decode the diblock ID from a dchan.
void XYDiblock(unsigned int *db, unsigned int ix)
void PixXY(unsigned int pix, unsigned int *ix, unsigned int *iy)
feb_t getFEB(dchan daqchan) const
Decode the feb id from a dchan.