HardwareDisplay.h
Go to the documentation of this file.
1 ///
2 /// \file HardwareDisplay.h
3 /// \brief Map channel addresses to (x,y) coordinate for display
4 /// \author messier@indiana.edu
5 /// \version $Id: HardwareDisplay.h,v 1.2 2018/06/05 18:30:34 lackey32 Exp $
6 ///
7 #ifndef _HARDWAREDISPLAY_H
8 #define _HARDWAREDISPLAY_H
9 
10 namespace daqchannelmap {
11  ///
12  /// Map hardware addresses to a set of x,y pairs for display
13  ///
15  public:
16  ///.................................................................
17  /// Configure the mapping for a detector
18  /// \param det : Detector ID following NovaDAQConventions
19  ///
20  void SetupDet(int det);
21  void SetupNDOS();
22  void SetupNearDet();
23  void SetupFarDet();
24  void SetupTestBeam();
25 
26  ///.................................................................
27  /// Assign an x,y display location to a DAQ hardware address
28  ///
29  /// \param db - diblock number 1...14
30  /// \param dcm - DCM number 1...12
31  /// \param feb - FEB number 0...63
32  /// \param pix - pixel number 0...31
33  /// \param ix - On return, the x display location assigned
34  /// \param iy - On return, the y display location assigned
35  //
36  void DAQToXY(unsigned int db,
37  unsigned int dcm,
38  unsigned int feb,
39  unsigned int pix,
40  unsigned int* ix,
41  unsigned int* iy);
42 
43  ///.................................................................
44  /// Map an x,y location on the display to a DAQ hardware address
45  /// \param db - on return, the diblock address
46  /// \param dcm - on return, the DCM address
47  /// \param feb - on return, the FEB address
48  /// \param pix - on return, the pixel address
49  /// \param ix - input x display location
50  /// \param iy - input y display location
51  ///
52  void XYToDAQ(unsigned int* db,
53  unsigned int* dcm,
54  unsigned int* feb,
55  unsigned int* pix,
56  unsigned int ix,
57  unsigned int iy);
58 
59  ///.................................................................
60  /// Convert a DAQ address to a global plane / module / global cell
61  /// address
62  ///
63  /// \param block - on return, block number 0...27
64  /// \param plane - on return, global plane number (0...nblock*32)
65  /// \param view - on return, X measuring (vertical) or Y measuring (horizontal)
66  /// \param module - on return, Module number 0...11
67  /// \param cell - on return, Global cell number 0...nmodule*32
68  /// \param db - input DAQ diblock address
69  /// \param dcm - input DAQ DCM address
70  /// \param feb - input DAQ FEB address
71  /// \param pix - input DAQ APD pixel address
72  ///
73  void DAQToPlaneModCell(unsigned int* block,
74  unsigned int* plane,
75  unsigned int* view,
76  unsigned int* module,
77  unsigned int* cell,
78  unsigned int db,
79  unsigned int dcm,
80  unsigned int feb,
81  unsigned int pix);
82 
83  ///.................................................................
84  /// Convert a DAQ address to a plane number within a block /
85  /// module / global cell address
86  ///
87  /// \param block - on return, block number 0...27
88  /// \param pinb - on return, plane number within a block (0...31)
89  /// \param view - on return, X measuring (vertical) or Y measuring (horizontal)
90  /// \param module - on return, Module number 0...11
91  /// \param cell - on return, Global cell number 0...nmodule*32
92  /// \param db - input DAQ diblock address
93  /// \param dcm - input DAQ DCM address
94  /// \param feb - input DAQ FEB address
95  /// \param pix - input DAQ APD pixel address
96  ///
97  void DAQToPlaneInBlockModCell(unsigned int* block,
98  unsigned int* pinb,
99  unsigned int* view,
100  unsigned int* module,
101  unsigned int* cell,
102  unsigned int db,
103  unsigned int dcm,
104  unsigned int feb,
105  unsigned int pix);
106 
107  ///.................................................................
108  /// Convert a global plane and cell address to a DAQ address
109  ///
110  /// \param plane - input global plane number, 0...nblock*32
111  /// \param pinb - on return, plane number within a block (0...31)
112  /// \param view - on return, X measuring (vertical) or Y measuring (horizontal)
113  /// \param module - on return, Module number 0...11
114  /// \param cell - input global cell number 0...nmodule*32
115  /// \param db - input DAQ diblock address
116  /// \param block - on return block address
117  /// \param dcm - on return, DAQ DCM address
118  /// \param feb - on return, DAQ FEB address
119  /// \param pix - on return, DAQ APD pixel address
120  ///
121  void PlaneCellToDAQ(unsigned int plane,
122  unsigned int* pinb,
123  unsigned int* view,
124  unsigned int* module,
125  unsigned int cell,
126  unsigned int* db,
127  unsigned int* block,
128  unsigned int* dcm,
129  unsigned int* feb,
130  unsigned int* pix);
131 
132  ///.................................................................
133  /// Get the lower left hand corner on the display for a Diblock
134  /// \param db : Diblock number, 1-14...
135  /// \param ix : On return, x pixel location within the whole display
136  /// \param iy : On return, y pixel location within the whole display
137  ///
138  void DiblockXY(unsigned int db, unsigned int* ix, unsigned int* iy);
139 
140  ///.................................................................
141  /// Get the lower left hand corner on the display for a DCM
142  /// \param DCM : DCM number, 1...12
143  /// \param ix : On return, x pixel location within a Diblock block
144  /// \param iy : On return, y pixel location within a Diblock block
145  ///
146  void DCMXY(unsigned int dcm, unsigned int* ix, unsigned int* iy);
147 
148  ///.................................................................
149  /// Get the lower left hand corner on the display for an FEB
150  ///
151  /// \param FEB : FEB number, 0...63
152  /// \param ix : On return, x pixel location within a DCM block
153  /// \param iy : On return, y pixel location within a DCM block
154  //
155  void FEBXY(unsigned int feb, unsigned int* ix, unsigned int* iy);
156 
157  ///.................................................................
158  /// Get the location of a pixel on the display inside an FEB
159  ///
160  /// \param pix - Pixel number 0...31
161  /// \param ix - On return, x display location within an FEB
162  /// \param iy - On return, y display location within an FEB
163  ///
164  void PixXY(unsigned int pix, unsigned int* ix, unsigned int* iy);
165 
166  ///.................................................................
167  /// Map an x display location to a diblock address
168  /// \param db : on return, the diblock address (1...14)
169  /// \param ix : input x display location
170  ///
171  void XYDiblock(unsigned int* db, unsigned int ix);
172 
173  ///.................................................................
174  /// Map a y display location to a diblock address
175  /// \param dcm : on return, the DCM address (1...14)
176  /// \param iy : input y display location
177  ///
178  void XYDCM(unsigned int* dcm, unsigned int iy);
179 
180  ///.................................................................
181  /// Map a x,y display location to a diblock address
182  /// \param feb : on return, the FEB address (1...14)
183  /// \param ix : input x display location
184  /// \param iy : input y display location
185  ///
186  void XYFEB(unsigned int* feb, unsigned int ix, unsigned int iy);
187 
188  ///.................................................................
189  /// Map an x,y display location to a pixel address
190  /// \param pix : on return, the pixel address (1...14)
191  /// \param ix : input x display location
192  /// \param iy : input y display location
193  ///
194  void XYPix(unsigned int* pix, unsigned int ix, unsigned int iy);
195 
196  public:
197  unsigned int fDetId; ///< DAQ detector ID
198  unsigned int fNdiblocks; ///< Number of diblocks in detector
199  unsigned int fNdcmTop; ///< Number of DMC's per diblock on top of detector
200  unsigned int fNdcmSide; ///< Number of DMC's per diblock on side of detector
201  unsigned int fNfebCols; ///< Number of FEB columns in a DCM
202  unsigned int fNfebRows; ///< Number of FEB rows in a DCM
203  unsigned int fNpixCols; ///< Number of pixel columns in an FEB
204  unsigned int fNpixRows; ///< Number of pixel rows in an FEB
205  unsigned int fNxPerDB; ///< Width of 1 diblock
206  unsigned int fNyPerDCM; ///< Height of 1 DCM
207  unsigned int fNplanes; ///< Number of planes in the detector
208  unsigned int fNplanesPerBL; ///< Number of planes per block
209  unsigned int fNxcells; ///< Width of detector in units of cells
210  unsigned int fNycells; ///< Height of detector in units of cells
211  unsigned int fXmax; ///< Width of entire view
212  unsigned int fYmax; ///< Height of entire view
213  unsigned int fNcellPerMod; ///< Number of cells per module
214  };
215 }
216 #endif
217 ////////////////////////////////////////////////////////////////////////
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)
unsigned int fNxPerDB
Width of 1 diblock.
unsigned int fXmax
Width of entire view.
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)
unsigned int fNdcmSide
Number of DMC&#39;s per diblock on side of detector.
void XYFEB(unsigned int *feb, unsigned int ix, unsigned int iy)
void DAQToXY(unsigned int db, unsigned int dcm, unsigned int feb, unsigned int pix, unsigned int *ix, unsigned int *iy)
unsigned int fDetId
DAQ detector ID.
void XYToDAQ(unsigned int *db, unsigned int *dcm, unsigned int *feb, unsigned int *pix, unsigned int ix, unsigned int iy)
unsigned int fNcellPerMod
Number of cells per module.
void DiblockXY(unsigned int db, unsigned int *ix, unsigned int *iy)
unsigned int fNdiblocks
Number of diblocks in detector.
block
print "ROW IS " print row
Definition: elec2geo.py:31
unsigned int fNfebRows
Number of FEB rows in a DCM.
unsigned int fNdcmTop
Number of DMC&#39;s per diblock on top of detector.
unsigned int fNycells
Height of detector in units of cells.
unsigned int fNplanes
Number of planes in the detector.
unsigned int fYmax
Height of entire view.
void FEBXY(unsigned int feb, unsigned int *ix, unsigned int *iy)
unsigned int fNxcells
Width of detector in units of cells.
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)
unsigned int fNfebCols
Number of FEB columns in a DCM.
unsigned int fNyPerDCM
Height of 1 DCM.
unsigned int fNpixCols
Number of pixel columns in an FEB.
unsigned int fNplanesPerBL
Number of planes per block.
void XYDiblock(unsigned int *db, unsigned int ix)
unsigned int fNpixRows
Number of pixel rows in an FEB.
void PixXY(unsigned int pix, unsigned int *ix, unsigned int *iy)