--- yoda/techmodel/NdInitReader.cpp 2005/05/28 10:44:11 4.4 +++ yoda/techmodel/NdInitReader.cpp 2006/09/29 10:19:24 6.1 @@ -1,21 +1,13 @@ +/** @file + * $Author: kusanagi $ + * $Date: 2006/02/07 17:11:09 $ + * $Revision: 6.0 $ + * + * Implementation of the NdInitReader class. + */ -// Implementation of the NdInitReader class. - - -#define UINT unsigned int -#define BYTE unsigned char -#include -#include -extern "C" { - #include "CRC.h" -} - -#include -#include "stdio.h" #include "ReaderAlgorithms.h" - -using namespace pamela; using namespace pamela::techmodel; static log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger(_T("pamela.techmodel.NdInitReader")); @@ -34,7 +26,7 @@ */ std::string NdInitReader::GetVersionInfo(void) const { return - "$Trailer: /home/cvsmanager/yoda/techmodel/NdInitReader.cpp,v 1.1.1.1 2004/07/06 12:20:23 kusanagi Exp $\n"; + "$Trailer: /home/cvsmanager/yoda/techmodel/NdInitReader.cpp,v 1.1.1.1 2004/07/06 12:20:23 Maurizio Nagni Exp $\n"; } /** @@ -48,15 +40,15 @@ } /** - * Unpack the AcInit event from an input file. + * Unpack the NdInit event, which is a dummy packet, from an input file. + * The CPU does not add any CRC control at the packet end. + * @param EventNumber + * @param dataLength */ -void NdInitReader::RunEvent(int EventNumber, long int length) throw (WrongCRCException){ -/* - rec = new NeutronRecord(); //aggiungo un nuovo NeutronRecord all'evento - rec->upperTrig = (((BYTE)data[lenght-offset])>>4); - rec->bottomTrig = (((BYTE)data[lenght-offset])&0x0F); - rec->upperBack = (((BYTE)data[lenght-offset+1])>>4); - rec->bottomBack = (((BYTE)data[lenght-offset+1])&0x0F); - */ +void NdInitReader::RunEvent(int EventNumber, long int dataLength) throw (WrongCRCException){ + char subData[dataLength]; + memset(subData, 0, dataLength*sizeof(char)); + InputFile->read(subData, sizeof(subData)); + ndInit->ndInitData = new TArrayC(dataLength, subData); }