00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include "FileReadoutFormat/FileTraits_v0_9.h"
00011
00012 #include "DaqReadoutFormat/BitsDefinition.h"
00013
00014 using DybDaq::DaqTraits;
00015 using DybDaq::FileTraits;
00016 using DybDaq::FileTraits_v0_9;
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 21U,
00091 22U,
00092 23U
00093 };
00094
00095 static const unsigned int m_shifts[] = {
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 0U,
00142 0U,
00143 0U,
00144 0U,
00145 0U,
00146 0U
00147 };
00148
00149 static const unsigned int m_masks[] = {
00150 0xffffffffU,
00151 0xffffffffU,
00152 0x00000000U,
00153 0xffffffffU,
00154 0xffffffffU,
00155 0xffffffffU,
00156 0xffffffffU,
00157 0xffffffffU,
00158 0xffffffffU,
00159 0xffffffffU,
00160 0xffffffffU,
00161 0xffffffffU,
00162 0xffffffffU,
00163 0x00000001U,
00164 0xffffffffU,
00165 0xffffffffU,
00166 0xffffffffU,
00167 0x00000000U,
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 0xffffffffU,
00193 0xffffffffU,
00194 0xffffffffU,
00195 0xffffffffU,
00196 0xffffffffU,
00197 0xffffffffU,
00198 0xffffffffU,
00199 0xffffffffU,
00200 0xffffffffU
00201 };
00202
00203 static const std::string m_description[] = {
00204 "File Record Type",
00205 "File Record Size",
00206 "Major File Format Version",
00207 "Minor File Format Version",
00208 "File Sequence Number",
00209 "File Open Date",
00210 "File Open Time",
00211 "File Data Block Limit",
00212 "File Payload MB Limit",
00213 "Length of first File Name",
00214 "Number of Metadata entries",
00215 "Length of first Metadata",
00216 "Run Number",
00217 "Run Enabled",
00218 "Run Tigger Type",
00219 "Run Detector Mask",
00220 "Calibration Detector Id",
00221 "Calibration Axis",
00222 "Calibration Source Id",
00223 "Calibration Z Position",
00224 "Calibration Duration",
00225 "Calibration LED Frequency",
00226 "Calibration LTB Mode",
00227 "Data Block Number",
00228 "Data Block Length",
00229 "File Close Date",
00230 "File Close Time",
00231 "File Data Block Count",
00232 "File Payload size in MB",
00233 "Run Data Block Count",
00234 "Run Payload size in MB ",
00235 "End of File Status",
00236 "End of File Marker",
00237 "Calibration AD Number",
00238 "Calibration LED 1",
00239 "Calibration LED 2",
00240 "Calibration LED 1 Voltage",
00241 "Calibration LED 2 Voltage",
00242 "Calibration LED Pulse Sep.",
00243 "Calibration Source A",
00244 "Calibration Z of Source A",
00245 "Calibration Source B",
00246 "Calibration Z of Source B",
00247 "Calibration Source C",
00248 "Calibration Z of Source C",
00249 "Calibration Motor Power",
00250 "Calibration Camera Power",
00251 "Calibration LED Flashing",
00252 "Calibration Home A",
00253 "Calibration Home B",
00254 "Calibration Home C"
00255 };
00256
00257 static const unsigned int kFileStartElements[] = {
00258 0U,
00259 1U,
00260 3U,
00261 4U,
00262 5U,
00263 6U,
00264 7U,
00265 8U
00266 };
00267
00268 static const unsigned int kFileNameElements[] = {
00269 0U,
00270 1U,
00271 9U
00272 };
00273
00274 static const unsigned int kMetadataElements[] = {
00275 0U,
00276 1U,
00277 10U,
00278 11U
00279 };
00280
00281 static const unsigned int kRunParameterElements[] = {
00282 0U,
00283 1U,
00284 12U,
00285 13U,
00286 14U,
00287 15U
00288 };
00289
00290 static const unsigned int kCalibrationElements[] = {
00291 0U,
00292 1U,
00293 16U,
00294 18U,
00295 19U,
00296 20U,
00297 21U,
00298 22U,
00299 33U,
00300 34U,
00301 35U,
00302 36U,
00303 37U,
00304 38U,
00305 39U,
00306 40U,
00307 41U,
00308 42U,
00309 43U,
00310 44U,
00311 45U,
00312 46U,
00313 47U,
00314 48U,
00315 49U,
00316 50U
00317 };
00318
00319 static const unsigned int kDataSeparatorElements[] = {
00320 0U,
00321 1U,
00322 23U,
00323 24U
00324 };
00325
00326 static const unsigned int kFileEndElements[] = {
00327 0U,
00328 1U,
00329 25U,
00330 26U,
00331 27U,
00332 28U,
00333 29U,
00334 30U,
00335 31U,
00336 32U
00337 };
00338
00339 static const unsigned int* m_componentFields[] = {
00340 kFileStartElements,
00341 kFileNameElements,
00342 kMetadataElements,
00343 kRunParameterElements,
00344 kCalibrationElements,
00345 kDataSeparatorElements,
00346 kFileEndElements
00347 };
00348
00349 static const unsigned int m_componentFieldsEnd[] = {
00350 8U,
00351 3U,
00352 4U,
00353 6U,
00354 23U,
00355 4U,
00356 10U
00357 };
00358
00359 static DaqTraits::Definitions* m_definitions[] = {
00360 0,
00361 0,
00362 0,
00363 0,
00364 0,
00365 0,
00366 0
00367 };
00368
00369 static const char* m_detectors[] = {
00370 "TST-TST",
00371 "DBN-AD1",
00372 "DBN-AD2",
00373 "UNK",
00374 "UNK",
00375 "DBN-WPI",
00376 "DBN-WPO",
00377 "DBN-RPC",
00378 "UNK",
00379 "LAN-AD1",
00380 "LAN-AD2",
00381 "UNK",
00382 "UNK",
00383 "LAN-WPI",
00384 "LAN-WPO",
00385 "LAN-RPC",
00386 "UNK",
00387 "FAR-AD1",
00388 "FAR-AD2",
00389 "FAR-AD3",
00390 "FAR-AD4",
00391 "FAR-WPI",
00392 "FAR-WPO",
00393 "FAR-RPC"
00394 };
00395
00396 FileTraits_v0_9::FileTraits_v0_9() {
00397 }
00398
00399 FileTraits_v0_9::~FileTraits_v0_9() {
00400 }
00401
00402 const char* FileTraits_v0_9::key() {
00403 return "File Format 0.9";
00404 }
00405
00406 unsigned int FileTraits_v0_9::majorVersion() const {
00407 return 0U;
00408 }
00409
00410 unsigned int FileTraits_v0_9::minorVersion() const {
00411 return 9U;
00412 }
00413
00414 const string FileTraits_v0_9::versionString() const {
00415 return key();
00416 }
00417
00418 unsigned int FileTraits_v0_9::markersEnd() const {
00419 return kEndFileMarker + 1;
00420 }
00421
00422 const unsigned int* FileTraits_v0_9::recordSizes() const {
00423 return m_recordSizes;
00424 }
00425
00426 unsigned int FileTraits_v0_9::detectorListEnd() const {
00427 return 24U;
00428 }
00429
00430 const char** FileTraits_v0_9::detectorStrings() const {
00431 return m_detectors;
00432 }
00433
00434 const unsigned int* FileTraits_v0_9::markers() const {
00435 return m_markers;
00436 }
00437
00438 unsigned int FileTraits_v0_9::fieldsEnd() const {
00439 return kCalibrationHomeC + 1;
00440 }
00441
00442 const unsigned int* FileTraits_v0_9::indices() const {
00443 return m_indices;
00444 }
00445
00446 const unsigned int* FileTraits_v0_9::shifts() const {
00447 return m_shifts;
00448 }
00449
00450 const unsigned int* FileTraits_v0_9::masks() const {
00451 return m_masks;
00452 }
00453
00454 const std::string* FileTraits_v0_9::descriptions() const {
00455 return m_description;
00456 }
00457
00458 DaqTraits::Definitions* FileTraits_v0_9::definitions(unsigned int component) const {
00459 return m_definitions[component];
00460 }
00461
00462 void FileTraits_v0_9::setDefinitions(DaqTraits::Definitions* definitions,
00463 unsigned int component) {
00464 m_definitions[component] = definitions;
00465 }
00466
00467 const unsigned int* FileTraits_v0_9::componentFields(unsigned int component) const {
00468 return m_componentFields[component];
00469 }
00470
00471 const unsigned int FileTraits_v0_9::componentFieldsEnd(unsigned int component) const {
00472 return m_componentFieldsEnd[component];
00473 }