1 |
kusanagi |
1.1 |
/** @file |
2 |
mocchiut |
6.4 |
* $Author: pam-rm2 $ |
3 |
|
|
* $Date: 2006/08/23 14:39:44 $ |
4 |
|
|
* $Revision: 6.3 $ |
5 |
kusanagi |
1.1 |
* |
6 |
|
|
* Header file for the algorithms used to read the techmodel data file. |
7 |
|
|
*/ |
8 |
|
|
|
9 |
|
|
#include "TechmodelPamelaRun.h" |
10 |
|
|
#include "TechmodelAlgorithm.h" |
11 |
|
|
|
12 |
|
|
namespace pamela { |
13 |
|
|
namespace techmodel { |
14 |
|
|
/** |
15 |
|
|
* Main event reader algorithm. It handles all other specific |
16 |
|
|
* reader algorithms. |
17 |
|
|
*/ |
18 |
|
|
class EventReader: public TechmodelAlgorithm { |
19 |
|
|
private: |
20 |
|
|
/** |
21 |
|
|
* A map with an algorithm to read the techmodel file with the packet |
22 |
|
|
* type as key. |
23 |
|
|
*/ |
24 |
|
|
typedef std::map<const PacketType *, TechmodelAlgorithm *> AlgorithmMap; |
25 |
|
|
/** |
26 |
|
|
* The map that links every packet type to an algorithm that reads it. |
27 |
|
|
*/ |
28 |
|
|
AlgorithmMap TechmodelAlgorithmMap; //! |
29 |
|
|
/** |
30 |
|
|
* The event header. |
31 |
|
|
*/ |
32 |
|
|
EventHeader* Header; //! |
33 |
|
|
/** |
34 |
|
|
* The Run that is processed. |
35 |
|
|
*/ |
36 |
|
|
TechmodelPamelaRun *Run; //! |
37 |
kusanagi |
4.5 |
void UnpackPscuHeader(void) throw (WrongCRCHeaderException, LengthException, BackwardCounterException); |
38 |
kusanagi |
1.1 |
void UnpackPscuTrailer(void) throw (std::exception); |
39 |
kusanagi |
1.3 |
|
40 |
|
|
/** |
41 |
|
|
maxPackets define the maximum number of packets |
42 |
|
|
the user wants to get from the raw file. |
43 |
|
|
By default is initialized to -1 (no limit) |
44 |
|
|
*/ |
45 |
|
|
static unsigned int maxPackets; |
46 |
|
|
|
47 |
|
|
/** |
48 |
|
|
prevPckCounter and prevPckOBT are used to check the |
49 |
|
|
integrity of the raw file stream |
50 |
|
|
*/ |
51 |
kusanagi |
1.2 |
static unsigned int prevPckCounter; |
52 |
|
|
static unsigned int prevPckOBT; |
53 |
kusanagi |
2.1 |
std::stringstream oss; |
54 |
kusanagi |
6.1 |
ofstream corruptedPacketFile; |
55 |
mocchiut |
6.4 |
unsigned int fPL; |
56 |
|
|
bool jgood; |
57 |
|
|
bool notfirst; |
58 |
|
|
|
59 |
kusanagi |
2.1 |
public: |
60 |
kusanagi |
1.3 |
//EventReader(void); |
61 |
|
|
EventReader(int); |
62 |
kusanagi |
1.1 |
virtual void Init(PamelaRun *); |
63 |
|
|
virtual void RunEvent(int); |
64 |
|
|
virtual std::string GetVersionInfo(void) const; |
65 |
pam-rm2 |
6.3 |
virtual bool FindStart(void) throw (std::exception); |
66 |
kusanagi |
6.1 |
int archiveCorruptedPacket(long int, long int); |
67 |
kusanagi |
1.1 |
ClassDef(EventReader, 1) |
68 |
|
|
}; |
69 |
|
|
} |
70 |
|
|
} |