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