00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include "FileReadoutFormat/FileTraits_v0_6.h"
00011
00012 #include "DaqReadoutFormat/BitsDefinition.h"
00013
00014 using DybDaq::DaqTraits;
00015 using DybDaq::FileTraits;
00016 using DybDaq::FileTraits_v0_6;
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 6U,
00033 2U,
00034 3U,
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 3U,
00060 4U,
00061 5U,
00062 6U,
00063 7U,
00064 8U,
00065 2U,
00066 3U,
00067 2U,
00068 3U,
00069 4U,
00070 5U,
00071 6U,
00072 7U,
00073 8U,
00074 9U
00075 };
00076
00077 static const unsigned int m_shifts[] = {
00078 0U,
00079 0U,
00080 0U,
00081 0U,
00082 0U,
00083 0U,
00084 0U,
00085 0U,
00086 0U,
00087 0U,
00088 0U,
00089 0U,
00090 0U,
00091 0U,
00092 0U,
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 };
00112
00113 static const unsigned int m_masks[] = {
00114 0xffffffffU,
00115 0xffffffffU,
00116 0x00000000U,
00117 0xffffffffU,
00118 0xffffffffU,
00119 0xffffffffU,
00120 0xffffffffU,
00121 0xffffffffU,
00122 0xffffffffU,
00123 0xffffffffU,
00124 0xffffffffU,
00125 0xffffffffU,
00126 0xffffffffU,
00127 0x00000001U,
00128 0xffffffffU,
00129 0xffffffffU,
00130 0xffffffffU,
00131 0xffffffffU,
00132 0xffffffffU,
00133 0xffffffffU,
00134 0xffffffffU,
00135 0xffffffffU,
00136 0xffffffffU,
00137 0xffffffffU,
00138 0xffffffffU,
00139 0xffffffffU,
00140 0xffffffffU,
00141 0xffffffffU,
00142 0xffffffffU,
00143 0xffffffffU,
00144 0xffffffffU,
00145 0xffffffffU,
00146 0xffffffffU
00147 };
00148
00149 static const std::string m_description[] = {
00150 "File Record Type",
00151 "File Record Size",
00152 "Major File Format Version",
00153 "Minor File Format Version",
00154 "File Sequence Number",
00155 "File Open Date",
00156 "File Open Time",
00157 "File Data Block Limit",
00158 "File Payload MB Limit",
00159 "Length of first File Name",
00160 "Number of Metadata entries",
00161 "Length of first Metadata",
00162 "Run Number",
00163 "Run Enabled",
00164 "Run Tigger Type",
00165 "Run Detector Mask",
00166 "Calibration Detector Id",
00167 "Calibration Axis",
00168 "Calibration Source Id",
00169 "Calibration Z Position",
00170 "Calibration Duration",
00171 "Calibration LED Frequency",
00172 "Calibration LTB Mode",
00173 "Data Block Number",
00174 "Data Block Length",
00175 "File Close Date",
00176 "File Close Time",
00177 "File Data Block Count",
00178 "File Payload size in MB",
00179 "Run Data Block Count",
00180 "Run Payload size in MB ",
00181 "End of File Status",
00182 "End of File Marker"
00183 };
00184
00185 static const unsigned int kFileStartElements[] = {
00186 0U,
00187 1U,
00188 3U,
00189 4U,
00190 5U,
00191 6U,
00192 7U,
00193 8U
00194 };
00195
00196 static const unsigned int kFileNameElements[] = {
00197 0U,
00198 1U,
00199 9U
00200 };
00201
00202 static const unsigned int kMetadataElements[] = {
00203 0U,
00204 1U,
00205 10U,
00206 11U
00207 };
00208
00209 static const unsigned int kRunParameterElements[] = {
00210 0U,
00211 1U,
00212 12U,
00213 13U,
00214 14U,
00215 15U
00216 };
00217
00218 static const unsigned int kCalibrationElements[] = {
00219 0U,
00220 1U,
00221 16U,
00222 17U,
00223 18U,
00224 19U,
00225 20U,
00226 21U,
00227 22U
00228 };
00229
00230 static const unsigned int kDataSeparatorElements[] = {
00231 0U,
00232 1U,
00233 23U,
00234 24U
00235 };
00236
00237 static const unsigned int kFileEndElements[] = {
00238 0U,
00239 1U,
00240 25U,
00241 26U,
00242 27U,
00243 28U,
00244 29U,
00245 30U,
00246 31U,
00247 32U
00248 };
00249
00250 static const unsigned int* m_componentFields[] = {
00251 kFileStartElements,
00252 kFileNameElements,
00253 kMetadataElements,
00254 kRunParameterElements,
00255 kCalibrationElements,
00256 kDataSeparatorElements,
00257 kFileEndElements
00258 };
00259
00260 static const unsigned int m_componentFieldsEnd[] = {
00261 8U,
00262 3U,
00263 4U,
00264 6U,
00265 9U,
00266 4U,
00267 10U
00268 };
00269
00270 static DaqTraits::Definitions* m_definitions[] = {
00271 0,
00272 0,
00273 0,
00274 0,
00275 0,
00276 0,
00277 0
00278 };
00279
00280 static const char* m_detectors[] = {
00281 "TST-TST",
00282 "DYB-AD1",
00283 "DYB-AD2",
00284 "UNK",
00285 "UNK",
00286 "DYB-WPI",
00287 "DYB-WPO",
00288 "DYB-RPC",
00289 "UNK",
00290 "LAN-AD1",
00291 "LAN-AD2",
00292 "UNK",
00293 "UNK",
00294 "LAN-WPI",
00295 "LAN-WPO",
00296 "LAN-RPC",
00297 "UNK",
00298 "FAR-AD1",
00299 "FAR-AD2",
00300 "FAR-AD3",
00301 "FAR-AD4",
00302 "FAR-WPI",
00303 "FAR-WPO",
00304 "FAR-RPC"
00305 };
00306
00307 FileTraits_v0_6::FileTraits_v0_6() {
00308 }
00309
00310 FileTraits_v0_6::~FileTraits_v0_6() {
00311 }
00312
00313 const char* FileTraits_v0_6::key() {
00314 return "File Format 0.6";
00315 }
00316
00317 unsigned int FileTraits_v0_6::majorVersion() const {
00318 return 0U;
00319 }
00320
00321 unsigned int FileTraits_v0_6::minorVersion() const {
00322 return 6U;
00323 }
00324
00325 const string FileTraits_v0_6::versionString() const {
00326 return key();
00327 }
00328
00329 unsigned int FileTraits_v0_6::markersEnd() const {
00330 return kEndFileMarker + 1;
00331 }
00332
00333 const unsigned int* FileTraits_v0_6::recordSizes() const {
00334 return m_recordSizes;
00335 }
00336
00337 unsigned int FileTraits_v0_6::detectorListEnd() const {
00338 return 24U;
00339 }
00340
00341 const char** FileTraits_v0_6::detectorStrings() const {
00342 return m_detectors;
00343 }
00344
00345 const unsigned int* FileTraits_v0_6::markers() const {
00346 return m_markers;
00347 }
00348
00349 unsigned int FileTraits_v0_6::fieldsEnd() const {
00350 return kEndFileMarker + 1;
00351 }
00352
00353 const unsigned int* FileTraits_v0_6::indices() const {
00354 return m_indices;
00355 }
00356
00357 const unsigned int* FileTraits_v0_6::shifts() const {
00358 return m_shifts;
00359 }
00360
00361 const unsigned int* FileTraits_v0_6::masks() const {
00362 return m_masks;
00363 }
00364
00365 const std::string* FileTraits_v0_6::descriptions() const {
00366 return m_description;
00367 }
00368
00369 DaqTraits::Definitions* FileTraits_v0_6::definitions(unsigned int component) const {
00370 return m_definitions[component];
00371 }
00372
00373 void FileTraits_v0_6::setDefinitions(DaqTraits::Definitions* definitions,
00374 unsigned int component) {
00375 m_definitions[component] = definitions;
00376 }
00377
00378 const unsigned int* FileTraits_v0_6::componentFields(unsigned int component) const {
00379 return m_componentFields[component];
00380 }
00381
00382 const unsigned int FileTraits_v0_6::componentFieldsEnd(unsigned int component) const {
00383 return m_componentFieldsEnd[component];
00384 }