| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

RtmTraits_v1_3.cc

Go to the documentation of this file.
00001 #include "RtmReadoutFormat/RtmTraits_v1_3.h"
00002 
00003 #include "DaqReadoutFormat/BitsDefinition.h"
00004 
00005 using DybDaq::DaqTraits;
00006 using DybDaq::RtmTraits_v1_3;
00007 using std::string;
00008 
00009 const unsigned int RtmTraits_v1_3::m_indices[] = {
00010    0U,  // kRtmMarker
00011    0U,  // kRpcCFId
00012    0U,  // kTransErr
00013    0U,  // kRomAlmostFull
00014    0U,  // kRtmAlmostFull
00015    0U,  // kFullFlag
00016    0U,  // kValidGPS
00017    0U,  // kValidCLK
00018    0U,  // kUsingUTC
00019    1U,  // kSecond
00020    2U,  // kNanoSecond
00021    3U,  // kAccumulation
00022    4U,  // kTriggerRot
00023    5U   // kTriggerMap
00024 };
00025 
00026 const unsigned int RtmTraits_v1_3::m_shifts[] = {
00027    16U,  // kRtmMarker
00028    12U,  // kRpcCFId
00029     8U,  // kTransErr
00030     5U,  // kRomAlmostFull
00031     4U,  // kRtmAlmostFull
00032     3U,  // kFullFlag
00033     2U,  // kValidGPS
00034     1U,  // kValidCLK
00035     0U,  // kUsingUTC
00036     0U,  // kSecond
00037     0U,  // kNanoSecond
00038     0U,  // kAccumulation
00039     0U,  // kTriggerRot
00040     0U   // kTriggerMap
00041 };
00042 
00043 const unsigned int RtmTraits_v1_3::m_masks[] = {
00044    0x0000ffff,  // kRtmMarker
00045    0x0000000f,  // kRpcCFId
00046    0x00000001,  // kTransErr
00047    0x00000001,  // kRomAlmostFull
00048    0x00000001,  // kRtmAlmostFull
00049    0x00000001,  // kFullFlag
00050    0x00000001,  // kValidGPS
00051    0x00000001,  // kValidCLK
00052    0x00000001,  // kUsingUTC
00053    0xffffffff,  // kSecond
00054    0xffffffff,  // kNanoSecond
00055    0xffffffff,  // kAccumulation
00056    0xffffffff,  // kTriggerRot
00057    0xffffffff   // kTriggerMap
00058 };
00059 
00060 static const std::string m_description[] = {
00061     "RTM Data marker",
00062     "RTM Control FPGA Id",
00063     "RTM Trans. Error",
00064     "RTM ROM Almost Full",
00065     "RTM Almost Full",
00066     "RTM Full",
00067     "RTM Has Valid GPS",
00068     "RTM Has Valid Clock",
00069     "RTM Using UTC",
00070     "RTM Unix Time",
00071     "RTM Nanoseconds",
00072     "RTM Accumulation",
00073     "ROT Trigger",
00074     "RTM Trigger Map"
00075 };
00076 
00077 static const unsigned int kRtmDataElements[] = {
00078     0U,  // kRtmMarker
00079     1U,  // kRpcCFId
00080     2U,  // kTransErr
00081     3U,  // kRomAlmostFull
00082     4U,  // kRtmAlmostFull
00083     5U,  // kFullFlag
00084     6U,  // kValidGPS
00085     7U,  // kValidCLK
00086     8U,  // kUsingUTC
00087     9U,  // kSecond
00088    10U,  // kNanoSecond
00089    11U,  // kAccumulation
00090    12U,  // kTriggerRot
00091    13U   // kTriggerMap
00092 };
00093 
00094 static const unsigned int* m_componentFields[] = {
00095     kRtmDataElements // RTM Data
00096 };
00097 
00098 static const unsigned int m_componentFieldsEnd[] = {
00099     14U // RTM Data
00100 };
00101 
00102 static DaqTraits::Definitions* m_definitions[] = {
00103     0 // RTM Data
00104 };
00105 
00106 const char* RtmTraits_v1_3::key() {
00107    return "RTM Format 1.3";
00108 }
00109 
00110 RtmTraits_v1_3::RtmTraits_v1_3() {
00111 }
00112 
00113 RtmTraits_v1_3::~RtmTraits_v1_3() {
00114 }
00115 
00116 unsigned int RtmTraits_v1_3::majorVersion() const {
00117    return 1U;
00118 }
00119 
00120 unsigned int RtmTraits_v1_3::minorVersion() const {
00121    return 3U;
00122 }
00123 
00124 const string RtmTraits_v1_3::versionString() const {
00125    return key();
00126 }
00127 
00128 unsigned int RtmTraits_v1_3::rtmSize() const {
00129    return 6U;
00130 }
00131 
00132 void RtmTraits_v1_3::initializeRtm(char* buffer) const {
00133    *((unsigned int*)buffer) = 0xa5a50000U;
00134 }
00135 
00136 unsigned int RtmTraits_v1_3::markersEnd() const {
00137    return 0U;
00138 }
00139 
00140 const unsigned int* RtmTraits_v1_3::markers() const {
00141    return 0;
00142 }
00143 
00144 unsigned int RtmTraits_v1_3::fieldsEnd() const {
00145    return kTriggerMap + 1;
00146 }
00147 
00148 const unsigned int* RtmTraits_v1_3::indices() const {
00149    return m_indices;
00150 }
00151 
00152 const unsigned int* RtmTraits_v1_3::shifts() const {
00153         return m_shifts;
00154 }
00155 
00156 const unsigned int* RtmTraits_v1_3::masks() const {
00157         return m_masks;
00158 }
00159 
00160 const std::string* RtmTraits_v1_3::descriptions() const {
00161     return m_description;
00162 }
00163 
00164 DaqTraits::Definitions* RtmTraits_v1_3::definitions(unsigned int component) const {
00165     return m_definitions[component];
00166 }
00167 
00168 void RtmTraits_v1_3::setDefinitions(DaqTraits::Definitions* definitions,
00169                                     unsigned int component) {
00170     m_definitions[component] = definitions;
00171 }
00172 
00173 const unsigned int* RtmTraits_v1_3::componentFields(unsigned int component) const {
00174     return m_componentFields[component];
00175 }
00176 
00177 const unsigned int RtmTraits_v1_3::componentFieldsEnd(unsigned int component) const {
00178     return m_componentFieldsEnd[component];
00179 }
00180 
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:07:47 2011 for RtmReadoutFormat by doxygen 1.4.7