-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUnpacker.h
42 lines (30 loc) · 894 Bytes
/
Unpacker.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* written by: Vadim Wagner <[email protected]> */
#ifndef UNPACKER_H
#define UNPACKER_H
#include "TString.h"
#include <vector>
using std::vector;
#include <map>
using std::map;
#include <zlib.h>
#include "Detector.h"
enum STATUS : int {DONE, ERR_OPEN, ERR_CREATE, ERR_UNKNOWN_FORMAT, ERR_UNEXPECTED_EOF, ERR_UNKNOWN_DATA_STRUCTURE,
ERR_UNIMPLEMENTED, ERR_EVENT_NUMBER_MISMATCH};
class Unpacker{
public:
Unpacker();
void AddDetector(Detector* detector){
detectors[detector->GetFieldID()] = detector;
}
void SetName(TString& name){
this->name = name;
}
void SetName(const char* name){
this->name = name;
}
STATUS Unpack(TString& filein, TString& fileout, uint32_t maxevents = -1);
private:
TString name;
map<UShort_t, Detector*> detectors;
};
#endif