--- yoda/techmodel/CalibAcReader.cpp 2004/07/08 12:31:42 1.1 +++ yoda/techmodel/CalibAcReader.cpp 2004/07/17 20:03:38 1.2 @@ -1,6 +1,6 @@ /** @file - * $Source: /home/cvsmanager/yoda/techmodel/ArrDumpReader.cpp,v $ - * $Id: ArrDumpReader.cpp,v 1.1.1.1 2004/07/06 12:20:23 kusanagi Exp $ + * $Source: /home/cvsmanager/yoda/techmodel/CalibAcReader.cpp,v $ + * $Id: CalibAcReader.cpp,v 1.1 2004/07/08 12:31:42 kusanagi Exp $ * $Author: kusanagi $ * * Implementation of the ArrDumpReader class. @@ -12,8 +12,8 @@ #include "stdio.h" extern "C" { #include "CRC.h" - #include "forroutines/anticoinc/ACcalib.h" - int ACcalib(unsigned short* datapointer, struct datastruct* calibpointer); + #include "forroutines/anticounter/ACcalib.h" + extern int ACcalib(int length, unsigned short* datapointer, struct datastruct* calibpointer); } #include "ReaderAlgorithms.h" @@ -21,6 +21,7 @@ using namespace pamela; using namespace pamela::techmodel; + static log4cpp::Category& cat = log4cpp::Category::getInstance("pamela.techmodel.CalibAcReader"); /** @@ -35,7 +36,7 @@ * Get a string with the version info of the algorithm. */ std::string CalibAcReader::GetVersionInfo(void) const { - return "$Header: /home/cvsmanager/yoda/techmodel/CalibAcReader.cpp,v 1.1.1.1 2004/07/06 12:20:23 kusanagi Exp $\n"; + return "$Header: /home/cvsmanager/yoda/techmodel/CalibAcReader.cpp,v 1.1 2004/07/08 12:31:42 kusanagi Exp $\n"; } /** @@ -70,24 +71,23 @@ readCRC = (((UINT16)(eventCRC[0]<<8))&0xFF00) + (((UINT16)eventCRC[1])&0x00FF); if (subCRC == readCRC){ - datastruct output; - int ERROR; - ERROR = ACcalib((unsigned short*)subData, &output); + datastruct output; + int ERROR; + ERROR = ACcalib(dataLength, (unsigned short*)subData, &output); - CalibAc->header = output.header; - memcpy(CalibAc->status, output.status, sizeof(CalibAc->status)); - memcpy(CalibAc->DAC, output.DAC, sizeof(CalibAc->DAC)); - memcpy(CalibAc->regist, output.regist, sizeof(CalibAc->regist)); - memcpy(CalibAc->time, output.time, sizeof(CalibAc->time)); - CalibAc->n_tr = output.n_tr; - memcpy(CalibAc->hitmap_tr, output.hitmap_tr, sizeof(CalibAc->hitmap_tr)); - memcpy(CalibAc->curve1, output.curve1, sizeof(CalibAc->curve1)); - memcpy(CalibAc->curve2, output.curve2, sizeof(CalibAc->curve2)); - CalibAc->iCRC = output.iCRC; - CalibAc->tail = output.tail; - CalibAc->CRC = output.CRC; - - free(subData); + CalibAc->header = output.header; + memcpy(CalibAc->status, output.status, sizeof(CalibAc->status)); + memcpy(CalibAc->DAC, output.DAC, sizeof(CalibAc->DAC)); + memcpy(CalibAc->regist, output.regist, sizeof(CalibAc->regist)); + memcpy(CalibAc->time, output.time, sizeof(CalibAc->time)); + CalibAc->n_tr = output.n_tr; + memcpy(CalibAc->hitmap_tr, output.hitmap_tr, sizeof(CalibAc->hitmap_tr)); + memcpy(CalibAc->curve1, output.curve1, sizeof(CalibAc->curve1)); + memcpy(CalibAc->curve2, output.curve2, sizeof(CalibAc->curve2)); + CalibAc->iCRC = output.iCRC; + CalibAc->tail = output.tail; + CalibAc->CRC = output.CRC; + free(subData); } else { cat << log4cpp::Priority::ERROR << "Wrong CRC on Subpacket in ArrDump Packet "