Belle II Software development
DQMHistAnalysisInputRootFile.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#include <framework/dataobjects/EventMetaData.h>
12#include <framework/datastore/StoreObjPtr.h>
13
14#include <dqm/core/DQMHistAnalysis.h>
15
16#include <TCanvas.h>
17#include <TFile.h>
18
19#include <string>
20#include <map>
21#include <vector>
22
23namespace Belle2 {
33
34 public:
35
40
44 void initialize() override final;
45
49 void beginRun() override final;
50
54 void event() override final;
55
56 private:
63 bool hnamePatternMatch(std::string pattern, std::string text);
64
66 std::vector<std::string> m_fileList;
67
69 TFile* m_file = nullptr;
70
74 TCanvas* m_c_info{nullptr};
75
78
80 std::vector<std::string> m_histograms;
81
83 unsigned int m_expno = 0;
85 unsigned int m_count = 0;
86
88 std::string m_runType;
89
91 int m_fillEvent = 0;
92
97 std::vector<unsigned int> m_eventsList;
98
100 std::vector<unsigned int> m_runList;
101
103 unsigned int m_interval = 0;
104
106 unsigned int m_run_idx = 0;
107
109 bool m_nullHistoMode = false;
110
114 TH1F* m_h_expno{nullptr};
116 TH1F* m_h_runno{nullptr};
118 TH1F* m_h_rtype{nullptr};
119 };
121} // end namespace Belle2
122
Class to read histograms from a root file for offline testing of analysis modules.
TH1F * m_h_runno
emulated histogram from runcontrol, runno
void initialize() override final
Initialize the module.
std::vector< unsigned int > m_eventsList
List of total number of events for each run.
std::vector< std::string > m_fileList
The list of names of the input root file.
bool m_nullHistoMode
Test mode for null histograms.
bool m_add_runcontrol_hist
Whether to add the run control histograms.
bool m_enable_run_info
Whether to enable the run info to be displayed.
std::vector< std::string > m_histograms
List of histogram name patterns to process.
TH1F * m_h_expno
emulated histogram from runcontrol, expno
bool hnamePatternMatch(std::string pattern, std::string text)
Pattern match for histogram name.
TH1F * m_h_rtype
emulated histogram from runcontrol, runtype
TFile * m_file
The TFile object for the input file.
unsigned int m_interval
Time between two events in second.
void beginRun() override final
Called when entering a new run.
std::vector< unsigned int > m_runList
List of runs.
StoreObjPtr< EventMetaData > m_eventMetaDataPtr
Global EventMetaData for run number and event number.
TCanvas * m_c_info
The canvas hold the basic DQM info.
unsigned int m_run_idx
Index in the list of runs, events and files.
The base class for the histogram analysis module.
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:96
Abstract base class for different kinds of events.