-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCHINP.h
95 lines (70 loc) · 1.38 KB
/
CHINP.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*!
Unpacker for XLM/HINP version
*/
#ifndef __CHINP_H
#define __CHINP_H
#ifndef __CMODULEUNPACKER_H
#include "CModuleUnpacker.h"
#endif
class CTreeParameterArray;
class CHIPFunctions {
public:
};
class CHINP : public CModuleUnpacker
{
public:
// Canonicals:
CHINP();
virtual ~CHINP();
// The unpacker entry:
public:
virtual unsigned int operator()(CEvent& rEvent,
std::vector<unsigned short>& event,
unsigned int offset,
CParamMapCommand::AdcMapping* pMap);
virtual uint32_t chipTime(uint32_t time,int chip,string& modName){
return 16384 - time; ;
}
virtual uint32_t chipEnergy(uint32_t energy,int chip,string& modName){
int val;
if( (val=modName.compare("hinp1"))==0){
switch (chip) {
case 1:
case 2:
case 5:
case 6:
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
energy=16384 - energy;
break;
default:
energy=energy;
break;
}
}
if( (val=modName.compare("hinp2"))==0){
switch (chip) {
case 1:
case 2:
case 5:
case 6:
case 9:
case 10:
energy=16384 - energy;
break;
default:
energy=energy;
break;
}
}
return energy;
}
private:
CTreeParameterArray*** getTree(CParamMapCommand::AdcMapping* pMap,
CEvent& rEvent);
};
#endif