-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTrHeaders.cc
49 lines (33 loc) · 1.05 KB
/
TrHeaders.cc
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
#include <iostream>
#include "TrHeaders.hh"
TrHistogramHeader::TrHistogramHeader() {}
TrHistogramHeader::TrHistogramHeader(int board, int bank, int channel, int type) {
channelInfo = 0x0;
channelInfo |= ((char)(board & 0xFF) << 16);
//std::cout << "Board " << board << std::endl;
//std::cout << std::hex << channelInfo << std::endl;
channelInfo |= ((char)(bank & 0xFF) << 8);
channelInfo |= ((char)(channel & 0xFF));
channelInfo |= ((char)(type & 0xFF) << 24);
//std::cout << std::hex << channelInfo << std::endl;
}
int TrHistogramHeader::getChannelInfo() {
return channelInfo;
}
int TrHistogramHeader::getBoard() {
return (channelInfo & 0xFF0000) >> 16;
}
int TrHistogramHeader::getBank() {
return (channelInfo & 0xFF00) >> 8;
}
int TrHistogramHeader::getChannel() {
return (channelInfo & 0xFF);
}
int TrHistogramHeader::getType() {
return (channelInfo & 0xFF000000) >> 24;
}
void TrHistogramHeader::copy(TrHistogramHeader* other) {
channelInfo = other->getChannelInfo();
}
//TrSpillHeader::TrSpillHeader() {}
//TrDataHeader::TrDataHeader() {}