Belle II Software release-09-00-00
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
15namespace Belle2 {
28
29 public:
30
35
39 virtual ~ARICHRateCalModule();
40
44 virtual void defineHisto() override;
45
50 virtual void initialize() override;
51
56 virtual void beginRun() override;
57
61 virtual void event() override;
62
63 protected:
67 unsigned int calbyte(const int* buf);
68
72 unsigned int calword(const int* buf);
73
74 protected:
75 TH2* h_rate2D[100] = {NULL};
76 int m_nrun;
78 double m_dth;
79 double m_th0;
82 std::string m_daqdb;
83 unsigned int m_ibyte = 0;
84 int m_run_count = 0;
85 int m_evt_count = 0;
87 };
88
89 inline unsigned int ARICHRateCalModule::calbyte(const int* buf)
90 {
91 int shift = (3 - m_ibyte % 4) * 8;
92 unsigned int val = 0xff & (buf[m_ibyte / 4] >> shift);
93 m_ibyte++;
94 return val;
95 }
96
97 inline unsigned int ARICHRateCalModule::calword(const int* buf)
98 {
99 return (calbyte(buf) << 24) | (calbyte(buf) << 16)
100 | (calbyte(buf) << 8) | calbyte(buf);
101 }
102
104} // Belle2 namespace
Fill ARICHHit collection from ARICHDigits.
TH2 * h_rate2D[100]
2D histogram
int m_nrun
number of scan runs
bool m_internalmode
whether internal thscan mode is requested
std::string m_daqdb
daqdb config name
int m_nevents
number of events per run
bool m_debugmode
whether debug mode is requested
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)
Get calculated byte.
virtual void initialize() override
Initialize the Module.
unsigned int calword(const int *buf)
Get calculated word.
virtual void event() override
Event processor.
virtual void beginRun() override
Called when entering a new run.
virtual ~ARICHRateCalModule()
Destructor.
virtual void defineHisto() override
Definition of the histograms.
Abstract base class for different kinds of events.