/search.css" rel="stylesheet" type="text/css"/> /search.js">
00001 /* 00002 * FeeFoot.cc 00003 * FeeReadoutFormat 00004 * 00005 * Created by Simon Patton on 7/21/10. 00006 * Copyright 2010 DayaBay Collaboration. All rights reserved. 00007 * 00008 */ 00009 00010 #include "DaqReadoutFormat/ByteBuffer.h" 00011 #include "FeeReadoutFormat/FeeHead.h" 00012 #include "FeeReadoutFormat/FeeTraits.h" 00013 00014 #include "FeeReadoutFormat/FeeFoot.h" 00015 00016 using DybDaq::FeeFoot; 00017 using DybDaq::FeeHead; 00018 using DybDaq::FeeTraits; 00019 00020 FeeFoot::FeeFoot(const FeeHead& head) : 00021 FeeBuffer(new char[head.feeTraits().footSize() * kBytesInInt], 00022 head.feeTraits()) { 00023 const FeeTraits& traits = feeTraits(); 00024 traits.initializeFoot(buffer()); 00025 setTriggerNumber(head.triggerNumber()); 00026 setDataLength((traits.headSize() + traits.footSize()) * kBytesInInt); 00027 } 00028 00029 FeeFoot::FeeFoot(const ByteBuffer& byteBuffer, 00030 const FeeTraits& traits) : 00031 FeeBuffer(byteBuffer, 00032 traits) { 00033 byteBuffer.position(byteBuffer.position() + kBytesInInt); 00034 } 00035 00036 FeeFoot::~FeeFoot() { 00037 } 00038 00039 unsigned int FeeFoot::formatComponent() const { 00040 return FeeTraits::kFoot; 00041 } 00042 00043 unsigned int FeeFoot::triggerNumber() const { 00044 return readUnsignedInt(FeeTraits::kFootTriggerNumber); 00045 } 00046 00047 unsigned int FeeFoot::dataLength() const { 00048 return readUnsignedInt(FeeTraits::kFootDataLength); 00049 } 00050 00051 unsigned int FeeFoot::bufferSize() const { 00052 return feeTraits().footSize(); 00053 } 00054 00055 void FeeFoot::setTriggerNumber(const unsigned int triggerNumber) { 00056 writeField(triggerNumber, 00057 FeeTraits::kFootTriggerNumber); 00058 } 00059 00060 void FeeFoot::setDataLength(const unsigned int dataLength) { 00061 writeField(dataLength, 00062 FeeTraits::kFootDataLength); 00063 }