Belle II Software development
BKLMDigitAnalyzerModule.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
9#pragma once
10
11/* KLM headers. */
12#include <klm/dataobjects/KLMDigit.h>
13#include <klm/dataobjects/KLMDigitEventInfo.h>
14#include <klm/dataobjects/KLMDigitRaw.h>
15
16/* Basf2 headers. */
17#include <framework/core/Module.h>
18#include <framework/datastore/StoreArray.h>
19
20/* ROOT headers. */
21#include <TFile.h>
22#include <TH1F.h>
23#include <TH2F.h>
24#include <TList.h>
25#include <TTree.h>
26
27/* C++ headers. */
28#include <sstream>
29#include <string>
30
31namespace Belle2 {
36
41
42 public:
43
48
52 ~BKLMDigitAnalyzerModule() override;
53
57 void initialize() override;
58
62 void beginRun() override;
63
67 void event() override;
68
72 void endRun() override;
73
74
75 private:
76
79
82
85
88
91
93 std::string m_outputRootName;
94
97
99 TTree* m_extraInfo = nullptr;
100
103
106
109
111 TH1F* m_histoLayer[2][8];
112
114 TH2F* m_histoChannel[2][8][2];
115
117 TH2F* m_histoStrip[2][8][2];
118
120 TH1F* m_histoTdc[2][8][2];
121
123 TH1F* m_histoCTimeDiff[2][8][2];
124
126 template <typename T>
127 static std::string toString(T val)
128 {
129 std::ostringstream stream;
130 stream << val;
131 return stream.str();
132 }
133
135 TH1F* createTH1(const char* name, const char* title, Int_t nBinsX, Double_t minX, Double_t maxX, const char* titleX,
136 const char* titleY, bool drawStat, TList* histoList = nullptr);
137
139 TH2F* createTH2(const char* name, const char* title, Int_t nBinsX, Double_t minX, Double_t maxX, const char* titleX, Int_t nBinsY,
140 Double_t minY, Double_t maxY, const char* titleY, bool drawStat, TList* histoList = nullptr);
141 };
142
144}
int m_runNumber
Run number of the current data set.
TH2F * m_histoLayerVsSector[2]
Pointer to occupancy 2D histograms (numerator, denominator) of layer vs sector.
void initialize() override
Initializer.
static std::string toString(T val)
Convert a number of type T into a string.
void event() override
This method is called for each event.
void endRun() override
This method is called if the current run ends.
TFile * m_outputRootFile
Pointer to ROOT output file.
StoreArray< KLMDigitEventInfo > m_digitEventInfo
Output data array of analyzed KLMDigit information.
TH2F * createTH2(const char *name, const char *title, Int_t nBinsX, Double_t minX, Double_t maxX, const char *titleX, Int_t nBinsY, Double_t minY, Double_t maxY, const char *titleY, bool drawStat, TList *histoList=nullptr)
Create a ROOT 2D histogram.
TH1F * m_histoLayer[2][8]
Pointer to occupancy 1D histogram of each layer for each sector.
StoreArray< KLMDigit > m_digitOutOfRange
Input BKLMDigits whose time is out of range.
TH1F * createTH1(const char *name, const char *title, Int_t nBinsX, Double_t minX, Double_t maxX, const char *titleX, const char *titleY, bool drawStat, TList *histoList=nullptr)
Create a ROOT 1D histogram.
void beginRun() override
Called when entering a new run.
StoreArray< KLMDigit > m_digit
Input KLMDigits.
TH2F * m_histoChannel[2][8][2]
Pointer to occupancy 2D histogram of each channel.
TList * m_histoList
Pointer to ROOT list of histograms.
TH2F * m_histoLayerVsSectorPerPlane[2][2]
Pointer to occupancy 2D histogram of layer vs sector for each view (=plane)
TH1F * m_histoTdc[2][8][2]
Pointer to TDC 1D histogram of each channel for each sector and view.
TH2F * m_histoStrip[2][8][2]
Pointer to occupancy 2D histogram of each strip.
std::string m_outputRootName
Output filename.
TH1F * m_histoCTimeDiff[2][8][2]
Pointer to TDC-difference 1D histogram of each channel for each sector and view.
TTree * m_extraInfo
Pointer to ROOT tree with extra info.
StoreArray< KLMDigitRaw > m_digitRaw
Input raw BLMDigits.
Module()
Constructor.
Definition Module.cc:30
Accessor to arrays stored in the data store.
Definition StoreArray.h:113
Abstract base class for different kinds of events.