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