Belle II Software development
BGOverlayInputModule.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/* Basf2 headers. */
12#include <framework/core/Module.h>
13#include <framework/datastore/DataStore.h>
14#include <framework/datastore/StoreObjPtr.h>
15#include <framework/dataobjects/EventMetaData.h>
16
17/* ROOT headers. */
18#include <TChain.h>
19
20/* C++ headers. */
21#include <string>
22#include <vector>
23#include <map>
24
25namespace Belle2 {
36
37 public:
38
43
48
53 void initialize() override;
54
59 void beginRun() override;
60
64 void event() override;
65
70 void endRun() override;
71
76 void terminate() override;
77
78 private:
79
86 bool registerBranches();
87
91 void connectBranches();
92
93 std::vector<std::string> m_inputFileNames;
94 std::string m_extensionName;
96 bool m_skipExperimentCheck = false;
97 bool m_ignoreRunNumbers = false;
99 TChain* m_tree = 0;
100 unsigned m_numEvents = 0;
101 unsigned m_eventCount = 0;
102 unsigned m_firstEvent = 0;
103 bool m_start = true;
104 std::vector<DataStore::StoreEntry*> m_storeEntries;
105 std::vector<std::string> m_branchNames;
106 std::vector<std::string> m_otherBranchNames;
107 unsigned m_index = 0;
110 std::map<int, std::vector<std::string>> m_runFileNamesMap;
111 bool m_runByRun = false;
112 };
113
115} // Belle2 namespace
116
Beam BG data input, either in form of Digits or raw data.
std::string m_BackgroundInfoInstanceName
name of BackgroundInfo branch
bool m_skipExperimentCheck
flag for skipping the check on the experiment number
std::vector< std::string > m_otherBranchNames
other branch names found in the tree
void initialize() override
Initialize the Module.
bool m_start
flag denoting first call of event function (of each run if overlay is run-dependent)
void event() override
Event processor.
void endRun() override
End-of-run action.
void connectBranches()
Connect registered branches to the data store.
void terminate() override
Termination action.
std::vector< std::string > m_inputFileNames
list of file names
StoreObjPtr< EventMetaData > m_eventMetaData
event meta data
std::string m_extensionName
name added to default branch names
bool m_runByRun
internal flag for steering between run-independent (false) and run-dependent (true) overlay
void beginRun() override
Called when entering a new run.
bool registerBranches()
Register branches of the given event tree to the data store, except EventMetaData and all relations.
bool m_ignoreRunNumbers
flag for ignoring the run numbers in run-dependent MC
std::map< int, std::vector< std::string > > m_runFileNamesMap
Map between runs and file names.
std::vector< std::string > m_branchNames
names of registered branches
unsigned m_eventCount
current event (tree entry)
unsigned m_index
index of BackgroundDescr in BackgroundInfo object
unsigned m_firstEvent
randomly choosen first event (tree entry)
unsigned m_numEvents
number of events (tree entries) in the sample
std::vector< DataStore::StoreEntry * > m_storeEntries
store entries of registered branches
Base class for Modules.
Definition: Module.h:72
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:96
Abstract base class for different kinds of events.