1 |
kusanagi |
1.1 |
/** @file |
2 |
kusanagi |
1.2 |
* $Source: /home/cvsmanager/yoda/techmodel/CalibTofReader.cpp,v $ |
3 |
kusanagi |
6.2 |
* $Id: CalibTofReader.cpp,v 6.1 2006/05/30 19:10:01 kusanagi Exp $ |
4 |
kusanagi |
6.0 |
* $Author: kusanagi $ |
5 |
kusanagi |
1.1 |
* |
6 |
|
|
* Implementation of the LogReader class. |
7 |
|
|
* ToBeDone: |
8 |
|
|
* Control the CRC for the entire data Packet not just for single records |
9 |
|
|
*/ |
10 |
|
|
|
11 |
|
|
|
12 |
|
|
#include "ReaderAlgorithms.h" |
13 |
|
|
|
14 |
|
|
using namespace pamela::techmodel; |
15 |
|
|
|
16 |
kusanagi |
1.2 |
static log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger(_T("pamela.techmodel.CalibTofReader")); |
17 |
kusanagi |
1.1 |
|
18 |
|
|
/** |
19 |
|
|
* Constructor. |
20 |
|
|
*/ |
21 |
|
|
CalibTofReader::CalibTofReader(void): |
22 |
|
|
TechmodelAlgorithm(PacketType::Log, "TechmodelCalibTofReader") { |
23 |
kusanagi |
1.2 |
logger->debug(_T("Constructor")); |
24 |
kusanagi |
6.1 |
calibTof = new CalibTofEvent(); |
25 |
kusanagi |
1.1 |
} |
26 |
|
|
|
27 |
|
|
/** |
28 |
|
|
* Get a string with the version info of the algorithm. |
29 |
|
|
*/ |
30 |
|
|
std::string CalibTofReader::GetVersionInfo(void) const { |
31 |
|
|
return |
32 |
kusanagi |
6.2 |
"$Header: /home/cvsmanager/yoda/techmodel/CalibTofReader.cpp,v 6.1 2006/05/30 19:10:01 kusanagi Exp $\n"; |
33 |
kusanagi |
1.1 |
} |
34 |
|
|
|
35 |
|
|
/** |
36 |
|
|
* Initialize the algorithm with a special run. This will initialize the |
37 |
|
|
* event reader routines for all packet types. |
38 |
|
|
*/ |
39 |
|
|
void CalibTofReader::Init(PamelaRun *run) { |
40 |
kusanagi |
1.2 |
logger->debug(_T("Initialize")); |
41 |
kusanagi |
1.1 |
SetInputStream(run); |
42 |
kusanagi |
6.1 |
run->WriteSubPacket(this, &calibTof, calibTof->Class()); |
43 |
kusanagi |
1.1 |
} |
44 |
|
|
|
45 |
|
|
/** |
46 |
|
|
* Unpack the CalibTof event from an input file. |
47 |
|
|
*/ |
48 |
kusanagi |
6.1 |
void CalibTofReader::RunEvent(int EventNumber, long int dataLength) throw (Exception){ |
49 |
|
|
char subData[dataLength]; |
50 |
|
|
InputFile->read(subData, sizeof(subData)); |
51 |
|
|
calibTof->calibTofData = new TArrayC(dataLength, subData); |
52 |
kusanagi |
1.1 |
} |
53 |
|
|
|