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
41 private:
45 void initialize() override final;
46
50 void beginRun() override final;
51
55 void event() override final;
56
60 void addToHistList(std::vector<TH1*>& inputHistList, std::string dirname, TKey* key);
61
68 bool hnamePatternMatch(std::string pattern, std::string text);
69
70 // Data members
72 std::vector<std::string> m_fileList;
73
75 TFile* m_file = nullptr;
76
80 TCanvas* m_c_info{nullptr};
81
84
86 std::vector<std::string> m_histograms;
87
89 int m_expno = 0;
91 int m_count = 0;
92
94 std::string m_runType;
95
97 int m_fillNEvent = 0;
98
103 std::vector<int> m_eventsList;
104
106 std::vector<int> m_runList;
107
109 unsigned int m_interval = 0;
110
112 unsigned int m_run_idx = 0;
113
115 TH1F* m_h_expno{nullptr};
117 TH1F* m_h_runno{nullptr};
119 TH1F* m_h_rtype{nullptr};
121 TH1F* m_h_fillNEvent{nullptr};
122
124 int m_lastRun{-1};
126 int m_lastExp{-1};
127 };
129} // end namespace Belle2
130
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.
TH1F * m_h_fillNEvent
emulated histogram from daq, nevent
std::vector< std::string > m_fileList
The list of names of the input root file.
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.
std::vector< int > m_eventsList
List of total number of events for each run.
unsigned int m_interval
Time between two events in second.
void beginRun() override final
Called when entering a new run.
void addToHistList(std::vector< TH1 * > &inputHistList, std::string dirname, TKey *key)
Read histogram from key and add to list vector.
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:95
Abstract base class for different kinds of events.