Belle II Software  release-08-01-10
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 <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 
57  private:
64  bool hnamePatternMatch(std::string pattern, std::string text);
65 
67  std::vector<std::string> m_fileList;
68 
70  TFile* m_file = nullptr;
71 
74 
76  std::vector<std::string> m_histograms;
77 
79  unsigned int m_expno = 0;
80 
82  unsigned int m_count = 0;
83 
85  std::string m_runType;
86 
88  int m_fillEvent = 0;
89 
94  std::vector<unsigned int> m_eventsList;
95 
97  std::vector<unsigned int> m_runList;
98 
100  unsigned int m_interval = 0;
101 
103  unsigned int m_run_idx = 0;
104 
106  bool m_nullHistoMode = false;
107  };
109 } // end namespace Belle2
110 
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_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.
std::vector< std::string > m_histograms
List of histogram name patterns to process.
bool hnamePatternMatch(std::string pattern, std::string text)
Pattern match for histogram name.
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.
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.