Belle II Software  release-08-01-10
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 
15 /* ROOT headers. */
16 #include <TChain.h>
17 
18 /* C++ headers. */
19 #include <string>
20 
21 namespace Belle2 {
31  class BGOverlayInputModule : public Module {
32 
33  public:
34 
39 
44 
49  void initialize() override;
50 
55  void beginRun() override;
56 
60  void event() override;
61 
66  void endRun() override;
67 
72  void terminate() override;
73 
74  private:
75 
76  typedef std::vector<DataStore::StoreEntry*> StoreEntries;
84  bool connectBranches();
85 
86  std::vector<std::string> m_inputFileNames;
87  std::string m_extensionName;
88  std::string m_BackgroundInfoInstanceName = "";
89  bool m_skipExperimentCheck = false;
91  TChain* m_tree = 0;
92  unsigned m_numEvents = 0;
93  unsigned m_eventCount = 0;
94  unsigned m_firstEvent = 0;
95  bool m_start = true;
97  unsigned m_index = 0;
99  };
100 
102 } // Belle2 namespace
103 
Beam BG data input, either in form of Digits or raw data.
std::string m_BackgroundInfoInstanceName
name BackgroundInfo name
bool m_skipExperimentCheck
flag for skipping the check on the experiment number
StoreEntries m_storeEntries
store entries with connected branches
void initialize() override
Initialize the Module.
bool m_start
flag denoting first call of event function
void event() override
Event processor.
void endRun() override
End-of-run action.
void terminate() override
Termination action.
bool connectBranches()
Connect branches of the given event tree to the data store, except EventMetaData and all relations.
std::vector< std::string > m_inputFileNames
list of file names
std::string m_extensionName
name added to default branch names
void beginRun() override
Called when entering a new run.
std::vector< DataStore::StoreEntry * > StoreEntries
DataStore entries.
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
Base class for Modules.
Definition: Module.h:72
Abstract base class for different kinds of events.