ARA ROOT Test BEd Software

AraEvent/RawAtriStationEvent.cxx

00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 #include "RawAtriStationEvent.h"
00011 #include <iostream>
00012 #include <fstream>
00013 #include <cstring>
00014 ClassImp(RawAtriStationEvent);
00015 
00016 RawAtriStationEvent::RawAtriStationEvent()   
00017 {  
00018   //Default Constructor
00019 }
00020 
00021 RawAtriStationEvent::~RawAtriStationEvent() {
00022    //Default Destructor
00023 }
00024 
00025 
00026 RawAtriStationEvent::RawAtriStationEvent(AraStationEventHeader_t *hdPtr, char *dataBuffer) 
00027   :/*RawAraGenericHeader(&(hdPtr->gHdr)),*/RawAraStationEvent(hdPtr->gHdr.stationId, &(hdPtr->gHdr))
00028 {
00029   
00030    unixTime=hdPtr->unixTime; 
00031    unixTimeUs=hdPtr->unixTimeUs; 
00032    eventNumber=hdPtr->eventNumber; 
00033    ppsNumber=hdPtr->ppsNumber; 
00034    numStationBytes=hdPtr->numBytes; 
00035    //   std::cerr << eventNumber << "\t" << ppsNumber << "\t" << numStationBytes;
00036    timeStamp=hdPtr->timeStamp; 
00037    eventId=hdPtr->eventId; 
00038    numReadoutBlocks=hdPtr->numReadoutBlocks; 
00039    
00040    for(int trig=0;trig<MAX_TRIG_BLOCKS;trig++) {
00041      triggerPattern[trig]=hdPtr->triggerPattern[trig];
00042      triggerInfo[trig]=hdPtr->triggerInfo[trig];
00043      triggerBlock[trig]=hdPtr->triggerBlock[trig];
00044    }
00045 
00046    int uptoByte=0;
00047    //   std::cerr << "numReadoutBlocks " << numReadoutBlocks << "\n";
00048    for(int block=0;block<numReadoutBlocks;block++) {
00049      AraStationEventBlockHeader_t *blkPtr = (AraStationEventBlockHeader_t*)&dataBuffer[uptoByte];     
00050      uptoByte+=sizeof(AraStationEventBlockHeader_t);
00051      AraStationEventBlockChannel_t *chanPtr = (AraStationEventBlockChannel_t*)&dataBuffer[uptoByte];
00052      RawAtriStationBlock blocky(blkPtr,chanPtr);
00053      blockVec.push_back(blocky);
00054      int numChan=blocky.getNumChannels();
00055 
00056      // std::cout << "block " << block << " numChan " << numChan 
00057      //                <<  " irsBlockNumber " << (blkPtr->irsBlockNumber&0x1ff)
00058      //                << " channelMask " << blkPtr->channelMask << "\t"
00059      //                << " uptoByte " << uptoByte << "\n";
00060      // numChan=8; //HArd wire for testing
00061      uptoByte+=sizeof(AraStationEventBlockChannel_t)*numChan;
00062    }
00063    //   std::cerr << sizeof(AraStationEventHeader_t) << "\n";
00064    if(uptoByte!=int(numStationBytes))    
00065      std::cerr << "Error assigned " << uptoByte <<  " bytes out of " << numStationBytes << "\n";
00066 }

Generated on Wed Aug 8 16:20:07 2012 for ARA ROOT Test Bed Software by doxygen 1.4.7