Belle II Software development
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 {
25
26 public:
27
32
36 virtual ~ARICHRateCalModule();
37
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:
64 unsigned int calbyte(const int* buf);
65
69 unsigned int calword(const int* buf);
70
71 protected:
72 TH2* h_rate2D[100] = {NULL};
73 int m_nrun;
75 double m_dth;
76 double m_th0;
79 std::string m_daqdb;
80 unsigned int m_ibyte = 0;
81 int m_run_count = 0;
82 int m_evt_count = 0;
84 };
85
86 inline unsigned int ARICHRateCalModule::calbyte(const int* buf)
87 {
88 int shift = (3 - m_ibyte % 4) * 8;
89 unsigned int val = 0xff & (buf[m_ibyte / 4] >> shift);
90 m_ibyte++;
91 return val;
92 }
93
94 inline unsigned int ARICHRateCalModule::calword(const int* buf)
95 {
96 return (calbyte(buf) << 24) | (calbyte(buf) << 16)
97 | (calbyte(buf) << 8) | calbyte(buf);
98 }
99
101} // 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.