AraEvent/RawAraEvent.cxx
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 #include "RawAraEvent.h" 00011 #include <iostream> 00012 #include <fstream> 00013 #include <cstring> 00014 ClassImp(RawAraEvent); 00015 00016 RawAraEvent::RawAraEvent() 00017 { 00018 //Default Constructor 00019 } 00020 00021 RawAraEvent::~RawAraEvent() { 00022 //Default Destructor 00023 } 00024 00025 00026 RawAraEvent::RawAraEvent(AraEventBody_t *bdPtr) 00027 :head(&(bdPtr->hd)),trig(&(bdPtr->trig)),hk(&(bdPtr->hk)) 00028 { 00029 for(int i=0;i<NUM_DIGITIZED_CHANNELS;i++) { 00030 chan[i].fillChannel(&(bdPtr->channel[i])); 00031 } 00032 } 00033 00034 Int_t RawAraEvent::getEarliestSample(Int_t chanIndex) 00035 { 00036 Int_t lastHitBus=this->getLastHitBus(chanIndex); 00037 Int_t firstHitbus=this->getFirstHitBus(chanIndex); 00038 Int_t wrappedHitBus=this->getWrappedHitBus(chanIndex); 00039 Int_t earliestSample=0; 00040 if(!wrappedHitBus) { 00041 earliestSample=lastHitBus+1; 00042 } 00043 else { 00044 earliestSample=firstHitbus+1; 00045 } 00046 // if(earliestSample==0) earliestSample=1; //This was needed for ANITA 00047 if(earliestSample<260) return earliestSample; 00048 return 1; 00049 } 00050 00051 Int_t RawAraEvent::getLatestSample(Int_t chanIndex) 00052 { 00053 Int_t lastHitBus=this->getLastHitBus(chanIndex); 00054 Int_t firstHitbus=this->getFirstHitBus(chanIndex); 00055 Int_t wrappedHitBus=this->getWrappedHitBus(chanIndex); 00056 Int_t latestSample=259; 00057 if(!wrappedHitBus) { 00058 latestSample=firstHitbus-1; 00059 } 00060 else { 00061 latestSample=lastHitBus-1; 00062 } 00063 if(latestSample>0) return latestSample; 00064 return 259; 00065 }
Generated on Wed Aug 8 16:18:55 2012 for ARA ROOT Test Bed Software by
