ARA ROOT v3.4 Software

AraEvent/AraRawIcrrRFChannel.cxx

00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 #include "AraRawIcrrRFChannel.h"
00010 #include <iostream>
00011 #include <fstream>
00012 #include <cstring>
00013 ClassImp(AraRawIcrrRFChannel);
00014 
00015 AraRawIcrrRFChannel::AraRawIcrrRFChannel() 
00016 {
00017    //Default Constructor
00018 }
00019 
00020 AraRawIcrrRFChannel::~AraRawIcrrRFChannel() {
00021    //Default Destructor
00022 }
00023 
00024 
00025 AraRawIcrrRFChannel::AraRawIcrrRFChannel(IcrrRFChannelFull_t *rfPtr)
00026 {
00027   fillChannel(rfPtr);
00028 }
00029 
00030 void AraRawIcrrRFChannel::fillChannel(IcrrRFChannelFull_t *rfPtr)
00031 {
00032   chanId=rfPtr->header.chanId;
00033   chipIdFlag=rfPtr->header.chipIdFlag;
00034   firstHitbus=rfPtr->header.firstHitbus;
00035   lastHitbus=rfPtr->header.lastHitbus;
00036   memcpy(data,rfPtr->data,MAX_NUMBER_SAMPLES_LAB3*sizeof(UShort_t));
00037 }
00038 
00039 Int_t AraRawIcrrRFChannel::getEarliestSample()
00040 {
00041  Int_t lastHitBus=this->getLastHitBus();
00042  Int_t firstHitbus=this->getFirstHitBus();
00043  Int_t wrappedHitBus=this->getWrappedHitBus();
00044  Int_t earliestSample=0;
00045  if(!wrappedHitBus) {
00046    earliestSample=lastHitBus+1;
00047  }
00048  else {
00049    earliestSample=firstHitbus+1;
00050  }
00051  if(earliestSample==0) earliestSample=1;
00052  if(earliestSample<260) return earliestSample;
00053  return 1;
00054 }
00055 
00056 Int_t AraRawIcrrRFChannel::getLatestSample()
00057 {
00058  Int_t lastHitBus=this->getLastHitBus();
00059  Int_t firstHitbus=this->getFirstHitBus();
00060  Int_t wrappedHitBus=this->getWrappedHitBus();
00061  Int_t latestSample=259;
00062  if(!wrappedHitBus) {
00063    latestSample=firstHitbus-1;
00064  }
00065  else {
00066    latestSample=lastHitBus-1;
00067  }
00068  if(latestSample>0) return latestSample;
00069  return 259;
00070 }
00071 

Generated on Mon Mar 18 16:00:44 2013 for ARA ROOT v3.4 Software by doxygen 1.4.7