--- yoda/techmodel/CalibTofReader.cpp 2004/12/03 22:08:00 2.1 +++ yoda/techmodel/CalibTofReader.cpp 2006/09/29 10:19:20 6.3 @@ -1,6 +1,6 @@ /** @file - * $Source: /home/cvsmanager/yoda/techmodel/CalibTofReader.cpp,v $ - * $Id: CalibTofReader.cpp,v 2.0 2004/09/21 20:50:54 kusanagi Exp $ + * $Source: /afs/ba.infn.it/user/pamela/src/CVS/yoda/techmodel/CalibTofReader.cpp,v $ + * $Id: CalibTofReader.cpp,v 6.2 2006/05/30 19:10:03 kusanagi Exp $ * $Author: kusanagi $ * * Implementation of the LogReader class. @@ -8,22 +8,9 @@ * Control the CRC for the entire data Packet not just for single records */ -#define UINT unsigned int -#define BYTE unsigned char -#include -#include -extern "C" { -#include -#include "CRC.h" -} -#include -#include "stdio.h" #include "ReaderAlgorithms.h" -#include "event/CalibTofEvent.h" - -using namespace pamela; using namespace pamela::techmodel; static log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger(_T("pamela.techmodel.CalibTofReader")); @@ -34,7 +21,7 @@ CalibTofReader::CalibTofReader(void): TechmodelAlgorithm(PacketType::Log, "TechmodelCalibTofReader") { logger->debug(_T("Constructor")); - CalibTof = new CalibTofEvent(); + calibTof = new CalibTofEvent(); } /** @@ -42,7 +29,7 @@ */ std::string CalibTofReader::GetVersionInfo(void) const { return - "$Header: /home/cvsmanager/yoda/techmodel/CalibTofReader.cpp,v 2.0 2004/09/21 20:50:54 kusanagi Exp $\n"; + "$Header: /afs/ba.infn.it/user/pamela/src/CVS/yoda/techmodel/CalibTofReader.cpp,v 6.2 2006/05/30 19:10:03 kusanagi Exp $\n"; } /** @@ -52,14 +39,16 @@ void CalibTofReader::Init(PamelaRun *run) { logger->debug(_T("Initialize")); SetInputStream(run); - run->WriteSubPacket(this, &CalibTof, CalibTof->Class()); + run->WriteSubPacket(this, &calibTof, calibTof->Class()); } /** * Unpack the CalibTof event from an input file. */ -void CalibTofReader::RunEvent(int EventNumber, long int length) throw (Exception){ - - +void CalibTofReader::RunEvent(int EventNumber, long int dataLength) throw (Exception){ + char subData[dataLength]; + memset(subData, 0, dataLength*sizeof(char)); + InputFile->read(subData, sizeof(subData)); + calibTof->calibTofData = new TArrayC(dataLength, subData); }