10#include <arich/modules/arichRawUnpacker/ARICHRawUnpackerModule.h>
11#include <arich/dataobjects/ARICHRawDigit.h>
14#include <framework/datastore/StoreArray.h>
17#include <rawdata/dataobjects/RawARICH.h>
47 h_rate_a_all =
new TH1F(
"h_rate_a_all",
";Channel ID", 144 * 6, 0, 144 * 6);
48 h_rate_b_all =
new TH1F(
"h_rate_b_all",
";Channel ID", 144 * 6, 0, 144 * 6);
49 h_rate_c_all =
new TH1F(
"h_rate_c_all",
";Channel ID", 144 * 6, 0, 144 * 6);
50 h_rate_d_all =
new TH1F(
"h_rate_d_all",
";Channel ID", 144 * 6, 0, 144 * 6);
66 for (
auto& raw : rawdata) {
67 for (
int finesse = 0; finesse < 4; finesse++) {
68 const int* buf = (
const int*)raw.GetDetectorBuffer(0, finesse);
69 int bufSize = raw.GetDetectorNwords(0, finesse);
70 if (bufSize < 1)
continue;
77 unsigned int length_all =
calword(buf);
78 unsigned int mrg_evtno =
calword(buf);
87 unsigned int length =
calword(buf);
89 unsigned int ibyte = 0;
91 ss <<
"type=" << type_feb <<
", ver=" << ver <<
" "
92 <<
", boardid=" << boardid <<
", febno=" << febno
93 <<
", length=" << length <<
", evtno=" << evtno <<
" ";
95 long long feb_trigno = 0;
96 for (
int i = 0; i < 10; i++) {
100 feb_trigno |= (0xff & val) << (5 - i) * 8;
104 if (type_feb == 0x02) {
107 while (ibyte < length) {
111 ss <<
"ch# " << ch <<
"(" << val <<
") ";
113 if (febno < 0 || febno > 6) {
114 B2ERROR(
"FEB is bad:" <<
LogVar(
"FEB", std::to_string(febno) +
" hslb-" + std::to_string(finesse))
124 }
else if (type_feb == 0x01) {
125 if (length > 144 * 2 + 10) B2FATAL(
"error " << length);
127 while (ibyte < length) {
133 ss <<
"ch# " << ch <<
"(" << val <<
") ";
135 if (febno < 0 || febno > 6) {
136 B2ERROR(
"FEB is bad:" <<
LogVar(
"FEB", std::to_string(febno) +
" hslb-" + std::to_string(finesse))
146 rawdigit->
addFEB(feb, type, ver, boardid, febno, length, evtno, feb_trigno);
Class of ARICH raw digits.
void setCopperId(int id)
Set COPPER ID.
void setHslbId(int id)
Set HSLB ID.
void addFEB(FEBDigit &feb, int type, int ver, int boardid, int febno, unsigned int length, unsigned int trgno, unsigned int febtrgno)
Add properties of FEB.
TH1 * h_rate_d_all
Rate histogram (unused).
TH1 * h_rate_b_all
Rate histogram (unused).
unsigned int m_ibyte
Current byte number.
TH1 * h_rate_a_all
Rate histogram (unused).
TH1 * h_rate_c_all
Rate histogram (unused).
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
bool registerInDataStore(DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut)
Register the object/array in the DataStore.
Accessor to arrays stored in the data store.
T * appendNew()
Construct a new T object at the end of the array.
Class to store variables with their name which were sent to the logging service.
unsigned int calbyte(const int *buf)
Read byte with number m_ibyte from the buffer and increase the number by 1.
virtual void initialize() override
Initialize the Module.
unsigned int calword(const int *buf)
Read word (4 bytes) from the buffer and increase the byte number m_ibyte by 4.
ARICHRawUnpackerModule()
Constructor.
virtual void event() override
Event processor.
virtual ~ARICHRawUnpackerModule()
Destructor.
virtual void defineHisto() override
Definition of the histograms.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.
Struct for front-end board.
void push_back(unsigned char ich, unsigned char val)
Add channel.