Belle II Software  release-08-01-10
ARICHRateCalModule.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 <string>
12 
13 #include <TH2.h>
14 
15 namespace Belle2 {
28 
29  public:
30 
35 
39  virtual ~ARICHRateCalModule();
40 
41  virtual void defineHisto() override;
42 
47  virtual void initialize() override;
48 
53  virtual void beginRun() override;
54 
58  virtual void event() override;
59 
60  protected:
61  unsigned int calbyte(const int* buf);
62  unsigned int calword(const int* buf);
63 
64  protected:
65  TH2* h_rate2D[100] = {NULL};
66  int m_nrun;
67  int m_nevents;
68  double m_dth;
69  double m_th0;
70  bool m_debugmode;
71  bool m_internalmode;
72  std::string m_daqdb;
73  unsigned int m_ibyte = 0;
74  int m_run_count = 0;
75  int m_evt_count = 0;
76 
77  };
78 
79  inline unsigned int ARICHRateCalModule::calbyte(const int* buf)
80  {
81  int shift = (3 - m_ibyte % 4) * 8;
82  unsigned int val = 0xff & (buf[m_ibyte / 4] >> shift);
83  m_ibyte++;
84  return val;
85  }
86 
87  inline unsigned int ARICHRateCalModule::calword(const int* buf)
88  {
89  return (calbyte(buf) << 24) | (calbyte(buf) << 16)
90  | (calbyte(buf) << 8) | calbyte(buf);
91  }
92 
94 } // 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 void beginRun() override
Called when entering a new run.
virtual ~ARICHRateCalModule()
Destructor.
virtual void defineHisto() override
Function to define histograms.
Abstract base class for different kinds of events.