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

In This Package:

FecTraits_v1_3.cc

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

Generated on Mon Apr 11 20:07:52 2011 for FecReadoutFormat by doxygen 1.4.7