| 1 |
kusanagi |
1.1 |
|
| 2 |
|
|
// Implementation of the TrkInitReader class. |
| 3 |
|
|
|
| 4 |
|
|
|
| 5 |
|
|
#define UINT unsigned int |
| 6 |
|
|
#define BYTE unsigned char |
| 7 |
|
|
#include <string> |
| 8 |
|
|
#include <log4cpp/Category.hh> |
| 9 |
|
|
extern "C" { |
| 10 |
|
|
#include <sys/time.h> |
| 11 |
|
|
#include "CRC.h" |
| 12 |
|
|
} |
| 13 |
|
|
|
| 14 |
|
|
#include <fstream> |
| 15 |
|
|
#include "stdio.h" |
| 16 |
|
|
#include "ReaderAlgorithms.h" |
| 17 |
|
|
|
| 18 |
|
|
#include "event/TrkInitEvent.h" |
| 19 |
|
|
|
| 20 |
|
|
using namespace pamela; |
| 21 |
|
|
using namespace pamela::techmodel; |
| 22 |
|
|
|
| 23 |
|
|
static log4cpp::Category& cat = log4cpp::Category::getInstance("pamela.techmodel.TrkInitReader"); |
| 24 |
|
|
|
| 25 |
|
|
/** |
| 26 |
|
|
* Constructor. |
| 27 |
|
|
*/ |
| 28 |
|
|
TrkInitReader::TrkInitReader(void): |
| 29 |
|
|
TechmodelAlgorithm(PacketType::TrkInit, "TechmodelTrkInitReader") { |
| 30 |
|
|
cat << log4cpp::Priority::DEBUG |
| 31 |
|
|
<< "Constructor " |
| 32 |
|
|
<< "\n " << log4cpp::CategoryStream::ENDLINE; |
| 33 |
|
|
trkInit = new TrkInitEvent(); |
| 34 |
|
|
} |
| 35 |
|
|
|
| 36 |
|
|
/** |
| 37 |
|
|
* Get a string with the version info of the algorithm. |
| 38 |
|
|
*/ |
| 39 |
|
|
std::string TrkInitReader::GetVersionInfo(void) const { |
| 40 |
|
|
return |
| 41 |
|
|
"$Trailer: /home/cvsmanager/yoda/techmodel/TrkInitReader.cpp,v 1.1.1.1 2004/07/06 12:20:23 kusanagi Exp $\n"; |
| 42 |
|
|
} |
| 43 |
|
|
|
| 44 |
|
|
/** |
| 45 |
|
|
* Initialize the algorithm with a special run. This will initialize the |
| 46 |
|
|
* event reader routines for all packet types. |
| 47 |
|
|
*/ |
| 48 |
|
|
void TrkInitReader::Init(PamelaRun *run) { |
| 49 |
|
|
SetInputStream(run); |
| 50 |
|
|
run->WriteSubPacket(this, &trkInit, trkInit->Class()); |
| 51 |
|
|
} |
| 52 |
|
|
|
| 53 |
|
|
/** |
| 54 |
|
|
* Unpack the TrkInit event from an input file. |
| 55 |
|
|
*/ |
| 56 |
|
|
void TrkInitReader::RunEvent(int EventNumber, long int length) { |
| 57 |
|
|
|
| 58 |
|
|
|
| 59 |
|
|
} |
| 60 |
|
|
|