Belle II Software  release-06-00-14
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/analysis/modules/DQMHistAnalysis.h>
15 
16 #include <TFile.h>
17 #include <TCanvas.h>
18 
19 #include <string>
20 #include <map>
21 #include <vector>
22 
23 namespace Belle2 {
34 
35  public:
36 
41 
45  void initialize() override final;
46 
50  void beginRun() override final;
51 
55  void event() override final;
56 
60  void endRun() override final;
61 
65  void terminate() override final;
66 
67  private:
74  bool hname_pattern_match(std::string pattern, std::string text);
75 
77  std::vector<std::string> m_file_list;
78 
80  TFile* m_file = nullptr;
81 
84 
86  std::map<std::string, TCanvas*> m_cs;
87 
89  std::vector<std::string> m_histograms;
90 
92  unsigned int m_expno = 0;
93 
95  unsigned int m_count = 0;
96 
98  std::vector<unsigned int> m_events_list;
99 
101  std::vector<unsigned int> m_run_list;
102 
104  unsigned int m_interval = 0;
105 
107  unsigned int m_run_idx = 0;
108 
110  bool m_null_histo_mode = false;
112  bool m_autocanvas = true;
113  };
115 } // end namespace Belle2
116 
Class to read histograms from a root file for offline testing of analysis modules.
void initialize() override final
Initialize the module.
std::vector< unsigned int > m_events_list
List of total number of events for each run.
bool m_autocanvas
Whether to automatically generate canvases for histograms.
std::vector< std::string > m_histograms
List of histogram name patterns to process.
std::vector< unsigned int > m_run_list
List of runs.
std::vector< std::string > m_file_list
The list of names of the input root file.
void terminate() override final
Termination action.
bool m_null_histo_mode
Test mode for null histograms.
bool hname_pattern_match(std::string pattern, std::string text)
Pattern match for histogram name.
TFile * m_file
The TFile object for the input file.
void endRun() override final
End-of-run action.
unsigned int m_interval
Time between two events in second.
void beginRun() override final
Called when entering a new run.
std::map< std::string, TCanvas * > m_cs
The map between canvas name and canvas object.
StoreObjPtr< EventMetaData > m_eventMetaDataPtr
Global EventMetaData for run number and event number.
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.