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

In This Package:

CbltTraits_v0_0.cc

Go to the documentation of this file.
00001 /*
00002  *  CbltTraits_v0_0.cc
00003  *  CbltReadoutFormat
00004  *
00005  *  Created by Simon Patton on 7/21/10.
00006  *  Copyright 2010 DayaBay Collaboration. All rights reserved.
00007  *
00008  */
00009 
00010 #include "CbltReadoutFormat/CbltTraits_v0_0.h"
00011 
00012 #include "DaqReadoutFormat/BitsDefinition.h"
00013 
00014 using DybDaq::DaqTraits;
00015 using DybDaq::CbltTraits_v0_0;
00016 using std::string;
00017 
00018 static const unsigned int m_indices[] = {
00019     0U, // kHeadModuleAddress
00020     0U, // kHeadModuleType
00021     0U, // kFootModuleAddress
00022     0U  // kFootDataLength
00023 };
00024 
00025 static const unsigned int m_shifts[] = {
00026     23U, // kHeadModuleAddress
00027     16U, // kHeadModuleType
00028     23U, // kFootModuleAddress
00029     0U   // kFootDataLength
00030 };
00031 
00032 static const unsigned int m_masks[] = {
00033     0x0000001f, // kHeadModuleAddress
00034     0x0000000f, // kHeadModuleType
00035     0x0000001f, // kFootModuleAddress
00036     0x0000ffff  // kFootDataLength
00037 };
00038 
00039 static const std::string m_description[] = {
00040     "CBLT Module Address",
00041     "CBLT Module Type",
00042     "CBLT Module Address",
00043     "CBLT Data Length"
00044 };
00045 
00046 static const unsigned int kCbltHeadElements[] = {
00047     0U, // kHeadModuleAddress
00048     1U  // kHeadModuleType
00049 };
00050 
00051 static const unsigned int kCbltBodyElements[] = {
00052 };
00053 
00054 static const unsigned int kCbltFootElements[] = {
00055     2U, // kFootModuleAddress
00056     3U  // kFootDataLength
00057 };
00058 
00059 static const unsigned int* m_componentFields[] = {
00060     kCbltHeadElements, // CBLT Head
00061     kCbltBodyElements, // CBLT Body
00062     kCbltFootElements  // CBLT Foot
00063 };
00064 
00065 static const unsigned int m_componentFieldsEnd[] = {
00066     2U, // CBLT Head
00067     0U, // CBLT Body
00068     2U  // CBLT Foot
00069 };
00070 
00071 static DaqTraits::Definitions* m_definitions[] = {
00072     0, // CBLT Head
00073     0, // CBLT Body
00074     0  // CBLT Foot
00075 };
00076 
00077 static const unsigned int m_moduleTypes[] = {
00078     1U, // kFeeModule
00079     2U, // kFadcModule
00080     3U, // kLtbModule
00081     4U, // kRpcRomModule
00082     5U, // kRpcRtmModule
00083     6U  // kMtbModule
00084 };
00085 
00086 static const char* m_moduleTypeStrings[] = {
00087     "UNK",
00088     "PMT_FEE",
00089     "Flash_ADC",
00090     "Local_Trigger",
00091     "RPC_ROM",
00092     "RPC_RTM",
00093     "Master_Trigger"
00094 };
00095 
00096 const char* CbltTraits_v0_0::key() {
00097         return "CBLT Format 0.0";
00098 }
00099 
00100 CbltTraits_v0_0::CbltTraits_v0_0() {
00101 }
00102 
00103 CbltTraits_v0_0::~CbltTraits_v0_0() {
00104 }
00105 
00106 unsigned int CbltTraits_v0_0::majorVersion() const {
00107         return 0U;
00108 }
00109 
00110 unsigned int CbltTraits_v0_0::minorVersion() const {
00111         return 0U;
00112 }
00113 
00114 const string CbltTraits_v0_0::versionString() const {
00115         return key();
00116 }
00117 
00118 unsigned int CbltTraits_v0_0::markersEnd() const {
00119     return 0U;
00120 }
00121 
00122 const unsigned int* CbltTraits_v0_0::markers() const {
00123     return 0;
00124 }
00125 
00126 unsigned int CbltTraits_v0_0::fieldsEnd() const {
00127         return kFootDataLength + 1;
00128 }
00129 
00130 const unsigned int* CbltTraits_v0_0::indices() const {
00131         return m_indices;
00132 }
00133 
00134 const unsigned int* CbltTraits_v0_0::shifts() const {
00135         return m_shifts;
00136 }
00137 
00138 const unsigned int* CbltTraits_v0_0::masks() const {
00139         return m_masks;
00140 }
00141 
00142 const std::string* CbltTraits_v0_0::descriptions() const {
00143     return m_description;
00144 }
00145 
00146 DaqTraits::Definitions* CbltTraits_v0_0::definitions(unsigned int component) const {
00147     return m_definitions[component];
00148 }
00149 
00150 void CbltTraits_v0_0::setDefinitions(DaqTraits::Definitions* definitions,
00151                                     unsigned int component) {
00152     m_definitions[component] = definitions;
00153 }
00154 
00155 const unsigned int* CbltTraits_v0_0::componentFields(unsigned int component) const {
00156     return m_componentFields[component];
00157 }
00158 
00159 const unsigned int CbltTraits_v0_0::componentFieldsEnd(unsigned int component) const {
00160     return m_componentFieldsEnd[component];
00161 }
00162 
00163 unsigned int CbltTraits_v0_0::maxModuleType() const {
00164     return 6U;
00165 }
00166 
00167 const unsigned int* CbltTraits_v0_0::moduleTypes() const {
00168         return m_moduleTypes;
00169 }
00170 
00171 const char** CbltTraits_v0_0::moduleTypeStrings() const {
00172     return m_moduleTypeStrings;
00173 }
00174 
00175 unsigned int CbltTraits_v0_0::headSize() const {
00176     return 1U;
00177 }
00178 
00179 unsigned int CbltTraits_v0_0::footSize() const {
00180     return 1U;
00181 }
00182 
00183 void CbltTraits_v0_0::initializeHead(char* buffer) const {
00184     *((unsigned int*)buffer)       = 0x20000000U; // Head four bytes
00185 }
00186 
00187 void CbltTraits_v0_0::initializeFoot(char* buffer) const {
00188     *((unsigned int*)buffer)       = 0xc0000000U; // Foot four bytes
00189 }
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:08:16 2011 for CbltReadoutFormat by doxygen 1.4.7