/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

FeeHit.cc
Go to the documentation of this file.
00001 /*
00002  *  FeeHit.cc
00003  *  FeeReadoutFormat
00004  *
00005  *  Created by Simon Patton on 7/21/10.
00006  *  Copyright 2010 DayaBay Collaboration. All rights reserved.
00007  *
00008  */
00009 #include "FeeReadoutFormat/FeeHit.h"
00010 
00011 #include "DaqReadoutFormat/ByteBuffer.h"
00012 #include "FeeReadoutFormat/FeeTraits.h"
00013 
00014 using DybDaq::FeeHit;
00015 
00016 FeeHit::FeeHit(const unsigned int channelId,
00017                const unsigned int peakCycle,
00018                const bool highRangeAdc,
00019                const unsigned int preAdc,
00020                const unsigned int adc,
00021                const unsigned int hitNumber,
00022                const unsigned int tdc,
00023                const FeeTraits& traits) :
00024 FeeBuffer(new char[traits.hitSize() * kBytesInInt],
00025           traits) {
00026     traits.initializeHit(buffer());
00027     setChannelId(channelId);
00028     setPeakCycle(peakCycle);
00029     setHighRangeAdc(highRangeAdc);
00030     setPreAdc(preAdc);
00031     setAdc(adc);
00032     setHitNumber(hitNumber);
00033     setTdc(tdc);
00034 }
00035 
00036 FeeHit::FeeHit(const ByteBuffer& byteBuffer,
00037                const FeeTraits& traits) :
00038 FeeBuffer(byteBuffer,
00039           traits) {
00040         byteBuffer.position(byteBuffer.position() + (feeTraits().hitSize() * kBytesInInt));
00041 }
00042 
00043 FeeHit::~FeeHit() {
00044 }
00045 
00046 unsigned int FeeHit::formatComponent() const {
00047     return FeeTraits::kHit;
00048 }
00049 
00050 unsigned int FeeHit::channelId() const {
00051         return readUnsignedInt(FeeTraits::kChargeChannelId);
00052 }
00053 
00054 unsigned int FeeHit::adcChannelId() const {
00055         return readUnsignedInt(FeeTraits::kChargeChannelId);
00056 }
00057 
00058 unsigned int FeeHit::peakCycle() const {
00059         return readUnsignedInt(FeeTraits::kPeakCycle);
00060 }
00061 
00062 bool FeeHit::isHighRangeAdc() const {
00063         return readBool(FeeTraits::kHighRangeAdc);
00064 }
00065 
00066 unsigned int FeeHit::preAdc() const {
00067         return readUnsignedInt(FeeTraits::kPreAdc);
00068 }
00069 
00070 unsigned int FeeHit::adc() const {
00071         return readUnsignedInt(FeeTraits::kAdc);
00072 }
00073 
00074 unsigned int FeeHit::tdcChannelId() const {
00075         return readUnsignedInt(FeeTraits::kTimeChannelId);
00076 }
00077 
00078 unsigned int FeeHit::hitNumber() const {
00079         return readUnsignedInt(FeeTraits::kHitNumber);
00080 }
00081 
00082 unsigned int FeeHit::tdc() const {
00083         return readUnsignedInt(FeeTraits::kTdc);
00084 }
00085 
00086 unsigned int FeeHit::bufferSize() const {
00087     return feeTraits().hitSize();
00088 }
00089 
00090 void FeeHit::setChannelId(const unsigned int channelId) {
00091     writeField(channelId,
00092                FeeTraits::kChargeChannelId);
00093     writeField(channelId,
00094                FeeTraits::kTimeChannelId);
00095 }
00096 
00097 void FeeHit::setPeakCycle(const unsigned int peakCycle) {
00098     writeField(peakCycle,
00099                FeeTraits::kPeakCycle);
00100 }
00101 
00102 void FeeHit::setHighRangeAdc(const bool highRangeAdc) {
00103     writeField(highRangeAdc,
00104                FeeTraits::kHighRangeAdc);
00105 }
00106 
00107 void FeeHit::setPreAdc(const unsigned int value) {
00108     writeField(value,
00109                FeeTraits::kPreAdc);
00110 }
00111 
00112 void FeeHit::setAdc(const unsigned int value) {
00113     writeField(value,
00114                FeeTraits::kAdc);
00115 }
00116 
00117 void FeeHit::setHitNumber(const unsigned int hitNumber) {
00118     writeField(hitNumber,
00119                FeeTraits::kHitNumber);
00120 }
00121 
00122 void FeeHit::setTdc(const unsigned int value) {
00123     writeField(value,
00124                FeeTraits::kTdc);
00125 }
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:53:02 for FeeReadoutFormat by doxygen 1.7.4