Belle II Software release-09-00-00
ARICHRawUnpackerModule.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#pragma once
9
10#include <framework/core/HistoModule.h>
11#include <TH1F.h>
12
13namespace Belle2 {
26
27 public:
28
33
38
42 virtual void defineHisto() override;
43
48 virtual void initialize() override;
49
53 virtual void event() override;
54
55 protected:
56
62 unsigned int calbyte(const int* buf);
63
69 unsigned int calword(const int* buf);
70
71 protected:
72
74 bool m_debug;
75
77 unsigned int m_ibyte = 0;
78
80 TH1* h_rate_a_all = NULL;
81
83 TH1* h_rate_b_all = NULL;
84
86 TH1* h_rate_c_all = NULL;
87
89 TH1* h_rate_d_all = NULL;
90
91 };
92
93 inline unsigned int ARICHRawUnpackerModule::calbyte(const int* buf)
94 {
95 int shift = (3 - m_ibyte % 4) * 8;
96 unsigned int val = 0xff & (buf[m_ibyte / 4] >> shift);
97 m_ibyte++;
98 return val;
99 }
100
101 inline unsigned int ARICHRawUnpackerModule::calword(const int* buf)
102 {
103 return (calbyte(buf) << 24) | (calbyte(buf) << 16)
104 | (calbyte(buf) << 8) | calbyte(buf);
105 }
106
107
109} // Belle2 namespace
Fill ARICHHit collection from ARICHDigits.
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...
Definition: HistoModule.h:29
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.
virtual void event() override
Event processor.
virtual ~ARICHRawUnpackerModule()
Destructor.
virtual void defineHisto() override
Definition of the histograms.
Abstract base class for different kinds of events.