Belle II Software  release-08-01-10
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 
13 namespace Belle2 {
26 
27  public:
28 
33 
37  virtual ~ARICHRawUnpackerModule();
38 
39  virtual void defineHisto() override;
44  virtual void initialize() override;
45 
49  virtual void event() override;
50 
51  protected:
52  unsigned int calbyte(const int* buf);
53  unsigned int calword(const int* buf);
54 
55  protected:
56  bool m_debug;
57  unsigned int m_ibyte = 0;
58  TH1* h_rate_a_all = NULL;//yone
59  TH1* h_rate_b_all = NULL;//yone
60  TH1* h_rate_c_all = NULL;//yone
61  TH1* h_rate_d_all = NULL;//yone
62 
63  };
64 
65  inline unsigned int ARICHRawUnpackerModule::calbyte(const int* buf)
66  {
67  int shift = (3 - m_ibyte % 4) * 8;
68  unsigned int val = 0xff & (buf[m_ibyte / 4] >> shift);
69  m_ibyte++;
70  return val;
71  }
72 
73  inline unsigned int ARICHRawUnpackerModule::calword(const int* buf)
74  {
75  return (calbyte(buf) << 24) | (calbyte(buf) << 16)
76  | (calbyte(buf) << 8) | calbyte(buf);
77  }
78 
79 
81 } // Belle2 namespace
Fill ARICHHit collection from ARICHDigits.
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
Definition: HistoModule.h:29
virtual void initialize() override
Initialize the Module.
virtual void event() override
Event processor.
virtual ~ARICHRawUnpackerModule()
Destructor.
virtual void defineHisto() override
Function to define histograms.
Abstract base class for different kinds of events.