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 {
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
77 void terminate() override;
78
79
80 private:
81
84
87
90
93
96
98 std::string m_outputRootName;
99
102
104 TTree* m_extraInfo = nullptr;
105
108
111
114
116 TH1F* m_histoLayer[2][8];
117
119 TH2F* m_histoChannel[2][8][2];
120
122 TH2F* m_histoStrip[2][8][2];
123
125 TH1F* m_histoTdc[2][8][2];
126
128 TH1F* m_histoCTimeDiff[2][8][2];
129
131 template <typename T>
132 std::string toString(T val)
133 {
134 std::ostringstream stream;
135 stream << val;
136 return stream.str();
137 }
138
140 TH1F* createTH1(const char* name, const char* title, Int_t nBinsX, Double_t minX, Double_t maxX, const char* titleX,
141 const char* titleY, bool drawStat, TList* histoList = nullptr);
142
144 TH2F* createTH2(const char* name, const char* title, Int_t nBinsX, Double_t minX, Double_t maxX, const char* titleX, Int_t nBinsY,
145 Double_t minY, Double_t maxY, const char* titleY, bool drawStat, TList* histoList = nullptr);
146 };
147
149}
Module useful to quickly analyze BKLM unpacked data.
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.
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.
void terminate() override
This method is called at the end of the event processing.
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.
~BKLMDigitAnalyzerModule() override
Destructor.
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 toString(T val)
Convert a number of type T into a string.
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.
Base class for Modules.
Definition: Module.h:72
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
Abstract base class for different kinds of events.