1 |
kusanagi |
1.1 |
// Implementation of the CalibTrkBothReader class. |
2 |
|
|
|
3 |
|
|
#include "ReaderAlgorithms.h" |
4 |
|
|
|
5 |
|
|
using namespace pamela::techmodel; |
6 |
|
|
|
7 |
kusanagi |
1.2 |
static log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger(_T("pamela.techmodel.CalibTrkBothReader")); |
8 |
kusanagi |
1.1 |
|
9 |
|
|
/** |
10 |
|
|
* Constructor. |
11 |
|
|
*/ |
12 |
|
|
CalibTrkBothReader::CalibTrkBothReader(void): |
13 |
|
|
TechmodelAlgorithm(PacketType::CalibTrkBoth, "TechmodelCalibTrkBothReader") { |
14 |
kusanagi |
1.2 |
logger->debug(_T("Constructor")); |
15 |
kusanagi |
1.1 |
calibTrkBoth = new CalibTrkBothEvent(); |
16 |
|
|
} |
17 |
|
|
|
18 |
|
|
/** |
19 |
|
|
* Get a string with the version info of the algorithm. |
20 |
|
|
*/ |
21 |
|
|
std::string CalibTrkBothReader::GetVersionInfo(void) const { |
22 |
|
|
return |
23 |
kusanagi |
6.1 |
"$Trailer: /home/cvsmanager/yoda/techmodel/CalibTrkBothReader.cpp,v 1.1.1.1 2004/07/06 12:20:23 Maurizio Nagni Exp $\n"; |
24 |
kusanagi |
1.1 |
} |
25 |
|
|
|
26 |
|
|
/** |
27 |
|
|
* Initialize the algorithm with a special run. This will initialize the |
28 |
|
|
* event reader routines for all packet types. |
29 |
|
|
*/ |
30 |
|
|
void CalibTrkBothReader::Init(PamelaRun *run) { |
31 |
|
|
SetInputStream(run); |
32 |
|
|
run->WriteSubPacket(this, &calibTrkBoth, calibTrkBoth->Class()); |
33 |
kusanagi |
6.1 |
logger->debug(_T("Initialize")); |
34 |
kusanagi |
1.1 |
} |
35 |
|
|
|
36 |
|
|
/** |
37 |
|
|
* Unpack the CalibTrkBoth event from an input file. |
38 |
kusanagi |
6.1 |
* The CPU does not add any CRC control at the packet end. |
39 |
|
|
* @param EventNumber |
40 |
|
|
* @param dataLength |
41 |
kusanagi |
1.1 |
*/ |
42 |
kusanagi |
6.1 |
void CalibTrkBothReader::RunEvent(int EventNumber, long int dataLength) throw (WrongCRCException){ |
43 |
|
|
char subData[dataLength]; |
44 |
|
|
InputFile->read(subData, sizeof(subData)); |
45 |
|
|
calibTrkBoth->calibTrkBothData = new TArrayC(dataLength, subData); |
46 |
kusanagi |
1.1 |
} |
47 |
|
|
|