11 #ifndef ARICHRAWUNPACKERMODULE_H
12 #define ARICHRAWUNPACKERMODULE_H
14 #include <framework/core/HistoModule.h>
29 class ARICHRawUnpackerModule :
public HistoModule {
59 virtual void event()
override;
65 virtual void endRun()
override;
74 unsigned int calbyte(
const int* buf);
75 unsigned int calword(
const int* buf);
79 unsigned int m_ibyte = 0;
80 TH1* h_rate_a_all = NULL;
81 TH1* h_rate_b_all = NULL;
82 TH1* h_rate_c_all = NULL;
83 TH1* h_rate_d_all = NULL;
87 inline unsigned int ARICHRawUnpackerModule::calbyte(
const int* buf)
89 int shift = (3 - m_ibyte % 4) * 8;
90 unsigned int val = 0xff & (buf[m_ibyte / 4] >> shift);
95 inline unsigned int ARICHRawUnpackerModule::calword(
const int* buf)
97 return (calbyte(buf) << 24) | (calbyte(buf) << 16)
98 | (calbyte(buf) << 8) | calbyte(buf);