DAQChannelMapConstantsOLD.h
Go to the documentation of this file.
1 /*
2  * File: DAQChannelMapConstantsOLD.h
3  * Author: denis
4  *
5  * Created on February 3, 2012, 1:46 PM
6  */
7 
8 #ifndef _DAQCHANNELMAPCONSTANTSOLD_H
9 #define _DAQCHANNELMAPCONSTANTSOLD_H
10 #include <stdint.h>
11 
12 namespace daqchannelmap { //!< DAQ Channel Map Package
13 
14  //typedef uint32_t dchan; //!< DAQ Channel number (packed) for DAQ/Online
15  //typedef uint32_t lchan; //!< Logical Channel number (packed) for Offline
16 
17  /// Offline cell counts from 0 as follows:
18  /// Horizontal: Cell 0 is at the lowest X in the detector coordinates
19  /// Vertical: Cell 0 is at the lowest Y in the detector coordinates
20  typedef uint32_t offline_cell_t;
21  /// Online cell counts as follows:
22  /// Cell 0 is at the pixel 0 of the first DCM in the view.
23  /// For Horizontal planes that would the farthest pixel if you look from catwalk and incidentally it's the same as offline cell.
24  /// For Vertical planes that would the highest pixel if you look from catwalk and in this case it counts in the reverse order than offline cell.
25  typedef uint32_t online_cell_t;
26 
27  /// Type for offline plane. Offline counts from 0
28  typedef uint32_t offline_plane_t;
29 
30  /// Type for diblock and block number. Blocks count from 0, Diblocks count from 1
31  typedef uint32_t diblock_t;
32  typedef uint32_t block_t;
33 
34  /// Type for DCM number. Counts from 1
35  //typedef uint32_t dcm_id_t;
36 
37  /// Type for DCM link (to FEB). Counts from 0.
38  typedef uint32_t dcm_link_t;
39 
40  /// Type for pixel number. Counts from 0 - it's in nanoslice format.
41  typedef uint32_t pixel_t;
42  typedef uint32_t apd_pixel_t;
43 
44  /*enum BlockNumerationOffset{
45  BLOCK_OFFSET = 0 ///< do we count blocks from 0 or 1
46  ,DIBLOCK_OFFSET = 1 ///< do we count diblocks from 0 or 1
47  };
48 
49 
50  // Public Enumerations
51  enum DAQValidRange{
52  MIN_PIXEL = 0,
53  MAX_PIXEL = 31,
54  MIN_PORT = 0,
55  MAX_PORT = 63,
56  MIN_DCM = 1,
57  MAX_DCM = 12,
58  MIN_DIBLOCK = 1,
59  MAX_DIBLOCK = 17,
60  MIN_DCMCELL = 0,
61  MAX_DCMCELL = 63,
62  MIN_DCMPLANE = 0,
63  MAX_DCMPLANE = 31,
64  MAX_MC_DCMPLANE = 6, // Max plane for the NDOS muon catcher
65  MAX_MC_ND_DCMPLANE = 11 // Max plane for the NearDet muon catcher
66  };
67 
68  /// Shifts and masks for unique online channel
69  enum DAQChanMASKS{
70  MASK_DETECTOR = 0xF0000000, //!< Detector ID, (4bit), valid range 1-4
71  MASK_DIBLOCK = 0x0FC00000, //!< Diblock ID, (6bit), valid range 1-15
72  MASK_DCMID = 0x003F0000, //!< DCM ID, (6bit), valid range 1-12
73  MASK_DCMPORT = 0x0000FF00, //!< DCM Link Port (8bit), valid range 0-63
74  MASK_PIXELID = 0x000000FF, //!< APD Pixel Number (8bit), valid range 0-31
75 
76  SHIFT_DETECTOR = 28,
77  SHIFT_DIBLOCK = 22,
78  SHIFT_DCMID = 16,
79  SHIFT_DCMPORT = 8,
80  SHIFT_PIXELID = 0
81  };
82 
83  /// Shifts and masks for unique offline channel
84  enum OfflineChanMASKS{
85  MASK_OFFLINE_DETECTOR = 0xF0000000, //!< Detector ID, (4bit), valid range 1-4
86  MASK_OFFLINE_PLANE = 0x0FFFFC00, //!< Plane Number,(18bit), valid range 0-930 (far det)
87  MASK_OFFLINE_CELL = 0x000003FF, //!< Cell Number, (10bit), valid range 1-384 (far det)
88 
89  SHIFT_OFFLINE_DETECTOR = 28,
90  SHIFT_OFFLINE_PLANE = 10,
91  SHIFT_OFFLINE_CELL = 0,
92  };
93 
94  /// Types of Block
95  enum DetBlock_TYPE {
96  MIN_BLOCK_TYPE = 1,
97  A_BLOCK = 1, //!< Identifier for an "A" type detector block (starts with X measuring plane)
98  B_BLOCK , //!< Identifier for a "B" type detector block (starts with Y measuring plane)
99  AFULL_BLOCK, //!< Identifier for an "AFULL" type detector block (starts with X measuring plane). 32 planes block
100  M_BLOCK, //!< NDOS Muon catcher Block
101  MC_ND_BLOCK, //!< NearDet Muon catcher Block
102  MAX_BLOCK_TYPE=MC_ND_BLOCK
103  };
104 
105  /// Types of Diblock
106  enum DiBlock_TYPE {
107  MIN_DIBLOCK_TYPE = 1, //!< Identifier for diblocks of configuration A-B
108  AB_DIBLOCK = 1, //!< Identifier for diblocks of configuration A-B
109  BA_DIBLOCK , //!< Identifier for diblocks of configuration B-A
110  AA_DIBLOCK , //!< Identifier for diblocks of configuration A-A
111  AFULLAFULL_DIBLOCK, //!< Identifier for diblocks using a 32/32 configuration
112  MC_DIBLOCK, //!< Identifider for NDOS Muon catcher
113  MC_ND_DIBLOCK, //!< Identifider for NearDet Muon catcher
114  MAX_DIBLOCK_TYPE = MC_ND_DIBLOCK
115  };
116 
117  /// Types of Detector View
118  enum DetView_TYPE {
119  X_VIEW = 1, //!< Identifier for the X measuring view of the detector (top)
120  Y_VIEW //!< Identifier for the Y measuring view of the detector (side)
121  };
122 
123  /// Types of Detector Plane
124  enum DetPlane_TYPE {
125  XZ_PLANE = 1,//!< Identifier for the horizontal plane
126  YZ_PLANE //!< Identifier for the vertical plane
127  };
128 
129  /// Size of the detectors in blocks
130  enum DetBlockSizes {
131  DetSize_IPND = 4, //!< Size of the IP/ND detector in blocks (4)
132  DetSize_NDOS = 8, //!< Size of the NDOS detector in blocks (6)
133  DetSize_NEARDET = 8, //!< Size of the Near detector in blocks (6)
134  DetSize_FARDET = 30, //!< Size of the Far detector in blocks (30)
135  DetSize_FARDET_16K = 32, //!< Size of the Far detector in blocks (32)
136  DetSize_FARDET_17K = 32, //!< Size of the Far detector in blocks (32)
137  DetSize_TESTBEAM_2Block_1x1 = 2,
138  DetSize_TESTBEAM_3Block_1x1 = 3,
139  DetSize_TESTBEAM_2Block_2x2 = 2,
140  DetSize_TESTBEAM_3Block_2x2 = 3
141  };
142 
143  enum DetDiBlockSizes {
144  NUM_DIBLOCK_IPND = 2 //!< Size of the IP/ND detector in diblocks
145  ,NUM_DIBLOCK_NDOS = 4 //!< Size of the NDOS detector in diblocks including muon catcher
146  ,NUM_DIBLOCK_NEARDET = 4 //!< Size of the Near detector in diblocks including muon catcher
147  ,NUM_DIBLOCK_FARDET = 15 //!< Size of the Far detector in diblocks
148  ,NUM_DIBLOCK_FARDET_16K = 16 //!< Size of the Far detector in diblocks
149  ,NUM_DIBLOCK_FARDET_17K = 17 //!< Size of the Far detector in diblocks
150  ,NUM_DIBLOCK_TESTBEAM_2Block_1x1 = 1
151  ,NUM_DIBLOCK_TESTBEAM_3Block_1x1 = 2
152  ,NUM_DIBLOCK_TESTBEAM_2Block_2x2 = 1
153  ,NUM_DIBLOCK_TESTBEAM_3Block_2x2 = 2
154  };
155 
156  enum ModuleParameters {
157  NUM_DCM_PORTS = 64,
158  NUM_PIXELS = 32,
159  NUM_CELLS = 32,
160  NUM_CELLS_PER_DCM = 64,
161 
162  NUM_XZ_PLANES_AFULL_BLOCK = 16,
163  NUM_XZ_PLANES_A_BLOCK = 16,
164  NUM_XZ_PLANES_B_BLOCK = 15,
165  NUM_XZ_PLANES_MC_BLOCK = 6,
166  NUM_XZ_PLANES_MC_ND_BLOCK = 11,
167 
168  NUM_YZ_PLANES_AFULL_BLOCK = 16,
169  NUM_YZ_PLANES_A_BLOCK = 15,
170  NUM_YZ_PLANES_B_BLOCK = 16,
171 
172  NUM_YZ_PLANES_MC_BLOCK = 7,
173  NUM_YZ_PLANES_MC_ND_BLOCK = 11,
174 
175  NUM_X_MODULES_IPND = 2,
176  NUM_Y_MODULES_IPND = 3,
177  NUM_X_MODULES_NDOS = 2,
178  NUM_Y_MODULES_NDOS = 3,
179  NUM_X_MODULES_NEARDET = 3,
180  NUM_Y_MODULES_NEARDET = 3,
181  NUM_X_MODULES_FARDET = 12,
182  NUM_Y_MODULES_FARDET = 12,
183  NUM_X_MODULES_TESTBEAM_2Block_1x1 = 1,
184  NUM_Y_MODULES_TESTBEAM_2Block_1x1 = 1,
185  NUM_X_MODULES_TESTBEAM_3Block_1x1 = 1,
186  NUM_Y_MODULES_TESTBEAM_3Block_1x1 = 1,
187  NUM_X_MODULES_TESTBEAM_2Block_2x2 = 2,
188  NUM_Y_MODULES_TESTBEAM_2Block_2x2 = 2,
189  NUM_X_MODULES_TESTBEAM_3Block_2x2 = 2,
190  NUM_Y_MODULES_TESTBEAM_3Block_2x2 = 2,
191 
192  NUM_DCMS_DIBLOCK_IPND = 3,
193  NUM_DCMS_DIBLOCK_NDOS = 3,
194  NUM_DCMS_DIBLOCK_NEARDET = 4,
195  NUM_DCMS_DIBLOCK_FARDET = 12,
196  NUM_DCMS_MUONCATCHER = 2,
197  NUM_DCMS_DIBLOCK_TESTBEAM_2Block_1x1 = 2,
198  NUM_DCMS_DIBLOCK_TESTBEAM_3Block_1x1 = 2,
199  NUM_DCMS_DIBLOCK_TESTBEAM_2Block_2x2 = 2,
200  NUM_DCMS_DIBLOCK_TESTBEAM_3Block_2x2 = 2,
201 
202  NUM_X_DCMS_IPND = 1,
203  NUM_X_DCMS_NDOS = 1,
204  NUM_X_DCMS_NEARDET = 2,
205  NUM_X_DCMS_FARDET = 6,
206  NUM_X_DCMS_TESTBEAM_2Block_1x1 = 1,
207  NUM_X_DCMS_TESTBEAM_3Block_1x1 = 1,
208  NUM_X_DCMS_TESTBEAM_2Block_2x2 = 1,
209  NUM_X_DCMS_TESTBEAM_3Block_2x2 = 1,
210 
211  NUM_Y_DCMS_IPND = 2,
212  NUM_Y_DCMS_NDOS = 2,
213  NUM_Y_DCMS_NEARDET = 2,
214  NUM_Y_DCMS_FARDET = 6,
215  NUM_Y_DCMS_TESTBEAM_2Block_1x1 = 1,
216  NUM_Y_DCMS_TESTBEAM_3Block_1x1 = 1,
217  NUM_Y_DCMS_TESTBEAM_2Block_2x2 = 1,
218  NUM_Y_DCMS_TESTBEAM_3Block_2x2 = 1,
219 
220  NUM_CHAN_X_PLANE_IPND = 64,
221  NUM_CHAN_X_PLANE_NDOS = 64,
222  NUM_CHAN_X_PLANE_NEARDET = 96,
223  NUM_CHAN_X_PLANE_FARDET = 384,
224  NUM_CHAN_X_PLANE_TESTBEAM_2Block_1x1 = 32,
225  NUM_CHAN_X_PLANE_TESTBEAM_3Block_1x1 = 32,
226  NUM_CHAN_X_PLANE_TESTBEAM_2Block_2x2 = 64,
227  NUM_CHAN_X_PLANE_TESTBEAM_3Block_2x2 = 64,
228 
229  NUM_CHAN_Y_PLANE_IPND = 96,
230  NUM_CHAN_Y_PLANE_NDOS = 96,
231  NUM_CHAN_Y_PLANE_NEARDET = 96,
232  NUM_CHAN_Y_PLANE_FARDET = 384,
233  NUM_CHAN_Y_PLANE_TESTBEAM_2Block_1x1 = 32,
234  NUM_CHAN_Y_PLANE_TESTBEAM_3Block_1x1 = 32,
235  NUM_CHAN_Y_PLANE_TESTBEAM_2Block_2x2 = 64,
236  NUM_CHAN_Y_PLANE_TESTBEAM_3Block_2x2 = 64,
237 
238  NULL_TERM = 0x0,
239  TERM_CHAR = 0xFDFCFBFA
240  };
241  */
242 }// end of namespace daqchannelmap
243 
244 #endif /* _DAQCHANNELMAPCONSTANTSOLD_H */
245 
uint32_t pixel_t
Type for physical pixel on APD.
uint32_t offline_plane_t
Type for offline plane. Offline counts from 0.
uint32_t offline_cell_t
< DAQ Channel Map Package
uint32_t dcm_link_t
Type for DCM number. Counts from 1.
uint32_t diblock_t
Type for diblocks and blocks.