00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include "FileReadoutFormat/FileTraits_v0_8.h"
00011
00012 #include "DaqReadoutFormat/BitsDefinition.h"
00013
00014 using DybDaq::DaqTraits;
00015 using DybDaq::FileTraits;
00016 using DybDaq::FileTraits_v0_8;
00017 using std::string;
00018
00019 static const unsigned int m_markers[] = {
00020 0x1234aaaaU,
00021 0x1234aabbU,
00022 0x1234aabcU,
00023 0x1234bbbbU,
00024 0x1234bbddU,
00025 0x1234ccccU,
00026 0x1234ddddU,
00027 0x1234eeeeU
00028 };
00029
00030 static const unsigned int m_recordSizes[] = {
00031 8U,
00032 2U,
00033 3U,
00034 6U,
00035 21U,
00036 4U,
00037 10U,
00038 0U
00039 };
00040
00041 static const unsigned int m_indices[] = {
00042 0U,
00043 1U,
00044 2U,
00045 2U,
00046 3U,
00047 4U,
00048 5U,
00049 6U,
00050 7U,
00051 2U,
00052 2U,
00053 3U,
00054 2U,
00055 3U,
00056 4U,
00057 5U,
00058 2U,
00059 4U,
00060 4U,
00061 5U,
00062 10U,
00063 15U,
00064 17U,
00065 2U,
00066 3U,
00067 2U,
00068 3U,
00069 4U,
00070 5U,
00071 6U,
00072 7U,
00073 8U,
00074 9U,
00075 3U,
00076 11U,
00077 12U,
00078 13U,
00079 14U,
00080 16U,
00081 4U,
00082 5U,
00083 6U,
00084 7U,
00085 8U,
00086 9U,
00087 18U,
00088 19U,
00089 20U
00090 };
00091
00092 static const unsigned int m_shifts[] = {
00093 0U,
00094 0U,
00095 0U,
00096 0U,
00097 0U,
00098 0U,
00099 0U,
00100 0U,
00101 0U,
00102 0U,
00103 0U,
00104 0U,
00105 0U,
00106 0U,
00107 0U,
00108 0U,
00109 0U,
00110 0U,
00111 0U,
00112 0U,
00113 0U,
00114 0U,
00115 0U,
00116 0U,
00117 0U,
00118 0U,
00119 0U,
00120 0U,
00121 0U,
00122 0U,
00123 0U,
00124 0U,
00125 0U,
00126 0U,
00127 0U,
00128 0U,
00129 0U,
00130 0U,
00131 0U,
00132 0U,
00133 0U,
00134 0U,
00135 0U,
00136 0U,
00137 0U,
00138 0U,
00139 0U,
00140 0U
00141 };
00142
00143 static const unsigned int m_masks[] = {
00144 0xffffffffU,
00145 0xffffffffU,
00146 0x00000000U,
00147 0xffffffffU,
00148 0xffffffffU,
00149 0xffffffffU,
00150 0xffffffffU,
00151 0xffffffffU,
00152 0xffffffffU,
00153 0xffffffffU,
00154 0xffffffffU,
00155 0xffffffffU,
00156 0xffffffffU,
00157 0x00000001U,
00158 0xffffffffU,
00159 0xffffffffU,
00160 0xffffffffU,
00161 0x00000000U,
00162 0xffffffffU,
00163 0xffffffffU,
00164 0xffffffffU,
00165 0xffffffffU,
00166 0xffffffffU,
00167 0xffffffffU,
00168 0xffffffffU,
00169 0xffffffffU,
00170 0xffffffffU,
00171 0xffffffffU,
00172 0xffffffffU,
00173 0xffffffffU,
00174 0xffffffffU,
00175 0xffffffffU,
00176 0xffffffffU,
00177 0xffffffffU,
00178 0xffffffffU,
00179 0xffffffffU,
00180 0xffffffffU,
00181 0xffffffffU,
00182 0xffffffffU,
00183 0xffffffffU,
00184 0xffffffffU,
00185 0xffffffffU,
00186 0xffffffffU,
00187 0xffffffffU,
00188 0xffffffffU,
00189 0xffffffffU,
00190 0xffffffffU,
00191 0xffffffffU
00192 };
00193
00194 static const std::string m_description[] = {
00195 "File Record Type",
00196 "File Record Size",
00197 "Major File Format Version",
00198 "Minor File Format Version",
00199 "File Sequence Number",
00200 "File Open Date",
00201 "File Open Time",
00202 "File Data Block Limit",
00203 "File Payload MB Limit",
00204 "Length of first File Name",
00205 "Number of Metadata entries",
00206 "Length of first Metadata",
00207 "Run Number",
00208 "Run Enabled",
00209 "Run Tigger Type",
00210 "Run Detector Mask",
00211 "Calibration Detector Id",
00212 "Calibration Axis",
00213 "Calibration Source Id",
00214 "Calibration Z Position",
00215 "Calibration Duration",
00216 "Calibration LED Frequency",
00217 "Calibration LTB Mode",
00218 "Data Block Number",
00219 "Data Block Length",
00220 "File Close Date",
00221 "File Close Time",
00222 "File Data Block Count",
00223 "File Payload size in MB",
00224 "Run Data Block Count",
00225 "Run Payload size in MB ",
00226 "End of File Status",
00227 "End of File Marker",
00228 "Calibration AD Number",
00229 "Calibration LED 1",
00230 "Calibration LED 2",
00231 "Calibration LED 1 Voltage",
00232 "Calibration LED 2 Voltage",
00233 "Calibration LED Pulse Sep.",
00234 "Calibration Source A",
00235 "Calibration Z of Source A",
00236 "Calibration Source B",
00237 "Calibration Z of Source B",
00238 "Calibration Source C",
00239 "Calibration Z of Source C",
00240 "Calibration Motor Power",
00241 "Calibration Camera Power",
00242 "Calibration LED Flashing"
00243 };
00244
00245 static const unsigned int kFileStartElements[] = {
00246 0U,
00247 1U,
00248 3U,
00249 4U,
00250 5U,
00251 6U,
00252 7U,
00253 8U
00254 };
00255
00256 static const unsigned int kFileNameElements[] = {
00257 0U,
00258 1U,
00259 9U
00260 };
00261
00262 static const unsigned int kMetadataElements[] = {
00263 0U,
00264 1U,
00265 10U,
00266 11U
00267 };
00268
00269 static const unsigned int kRunParameterElements[] = {
00270 0U,
00271 1U,
00272 12U,
00273 13U,
00274 14U,
00275 15U
00276 };
00277
00278 static const unsigned int kCalibrationElements[] = {
00279 0U,
00280 1U,
00281 16U,
00282 18U,
00283 19U,
00284 20U,
00285 21U,
00286 22U,
00287 33U,
00288 34U,
00289 35U,
00290 36U,
00291 37U,
00292 38U,
00293 39U,
00294 40U,
00295 41U,
00296 42U,
00297 43U,
00298 44U,
00299 45U,
00300 46U,
00301 47U
00302 };
00303
00304 static const unsigned int kDataSeparatorElements[] = {
00305 0U,
00306 1U,
00307 23U,
00308 24U
00309 };
00310
00311 static const unsigned int kFileEndElements[] = {
00312 0U,
00313 1U,
00314 25U,
00315 26U,
00316 27U,
00317 28U,
00318 29U,
00319 30U,
00320 31U,
00321 32U
00322 };
00323
00324 static const unsigned int* m_componentFields[] = {
00325 kFileStartElements,
00326 kFileNameElements,
00327 kMetadataElements,
00328 kRunParameterElements,
00329 kCalibrationElements,
00330 kDataSeparatorElements,
00331 kFileEndElements
00332 };
00333
00334 static const unsigned int m_componentFieldsEnd[] = {
00335 8U,
00336 3U,
00337 4U,
00338 6U,
00339 23U,
00340 4U,
00341 10U
00342 };
00343
00344 static DaqTraits::Definitions* m_definitions[] = {
00345 0,
00346 0,
00347 0,
00348 0,
00349 0,
00350 0,
00351 0
00352 };
00353
00354 static const char* m_detectors[] = {
00355 "TST-TST",
00356 "DBN-AD1",
00357 "DBN-AD2",
00358 "UNK",
00359 "UNK",
00360 "DBN-WPI",
00361 "DBN-WPO",
00362 "DBN-RPC",
00363 "UNK",
00364 "LAN-AD1",
00365 "LAN-AD2",
00366 "UNK",
00367 "UNK",
00368 "LAN-WPI",
00369 "LAN-WPO",
00370 "LAN-RPC",
00371 "UNK",
00372 "FAR-AD1",
00373 "FAR-AD2",
00374 "FAR-AD3",
00375 "FAR-AD4",
00376 "FAR-WPI",
00377 "FAR-WPO",
00378 "FAR-RPC"
00379 };
00380
00381 FileTraits_v0_8::FileTraits_v0_8() {
00382 }
00383
00384 FileTraits_v0_8::~FileTraits_v0_8() {
00385 }
00386
00387 const char* FileTraits_v0_8::key() {
00388 return "File Format 0.8";
00389 }
00390
00391 unsigned int FileTraits_v0_8::majorVersion() const {
00392 return 0U;
00393 }
00394
00395 unsigned int FileTraits_v0_8::minorVersion() const {
00396 return 8U;
00397 }
00398
00399 const string FileTraits_v0_8::versionString() const {
00400 return key();
00401 }
00402
00403 unsigned int FileTraits_v0_8::markersEnd() const {
00404 return kEndFileMarker + 1;
00405 }
00406
00407 const unsigned int* FileTraits_v0_8::recordSizes() const {
00408 return m_recordSizes;
00409 }
00410
00411 unsigned int FileTraits_v0_8::detectorListEnd() const {
00412 return 24U;
00413 }
00414
00415 const char** FileTraits_v0_8::detectorStrings() const {
00416 return m_detectors;
00417 }
00418
00419 const unsigned int* FileTraits_v0_8::markers() const {
00420 return m_markers;
00421 }
00422
00423 unsigned int FileTraits_v0_8::fieldsEnd() const {
00424 return kCalibrationLedFlashing + 1;
00425 }
00426
00427 const unsigned int* FileTraits_v0_8::indices() const {
00428 return m_indices;
00429 }
00430
00431 const unsigned int* FileTraits_v0_8::shifts() const {
00432 return m_shifts;
00433 }
00434
00435 const unsigned int* FileTraits_v0_8::masks() const {
00436 return m_masks;
00437 }
00438
00439 const std::string* FileTraits_v0_8::descriptions() const {
00440 return m_description;
00441 }
00442
00443 DaqTraits::Definitions* FileTraits_v0_8::definitions(unsigned int component) const {
00444 return m_definitions[component];
00445 }
00446
00447 void FileTraits_v0_8::setDefinitions(DaqTraits::Definitions* definitions,
00448 unsigned int component) {
00449 m_definitions[component] = definitions;
00450 }
00451
00452 const unsigned int* FileTraits_v0_8::componentFields(unsigned int component) const {
00453 return m_componentFields[component];
00454 }
00455
00456 const unsigned int FileTraits_v0_8::componentFieldsEnd(unsigned int component) const {
00457 return m_componentFieldsEnd[component];
00458 }