Belle II Software development
B2BIIMdstInputModule.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// File : B2BIIMdstInputModule.h
10// Description : A module to read Panther record in basf2 from Belle MDST file
11//
12//-
13
14#pragma once
15
16#include <framework/core/Module.h>
17#include <framework/datastore/DataStore.h>
18#include <framework/datastore/StoreObjPtr.h>
19#include <framework/dataobjects/EventMetaData.h>
20#include <framework/dataobjects/FileMetaData.h>
21
22#define BELLE_TARGET_H "belle-x86_64-unknown-linux-gnu-g++.h"
23#include "belle_legacy/panther/panther.h"
24#include "belle_legacy/panther/panther_group.h"
25
26#include <string>
27#include <set>
28
29namespace Belle2 {
41
42 // Public functions
43 public:
44
48 virtual ~B2BIIMdstInputModule() override;
49
51 virtual void initialize() override;
52
54 virtual void beginRun() override;
56 virtual void event() override;
58 virtual void endRun() override;
60 virtual void terminate() override;
61
62 // Data members
63 private:
64
68 std::vector<std::string> getInputFiles() const;
69
72 bool openNextFile();
75 bool readNextEvent();
76
81
82 //-----------------------------------------------------------------------------
83 // MISC
84 //-----------------------------------------------------------------------------
85
87 std::string m_inputFileName;
89 std::vector<std::string> m_inputFileNames;
93 std::vector<std::string> m_entrySequences;
94
96 Belle::Panther_FileIO* m_fd{nullptr};
97
99 int m_nevt;
100
103
106
109
112 };
113
115} // end namespace Belle2
Module reads Belle MDST files and converts Belle_event record to Belle II EventMetaData StoreObjectPo...
int m_nevt
Global event counter.
virtual ~B2BIIMdstInputModule() override
Destructor.
int m_current_file_entry
Entry counter in current file.
bool readNextEvent()
Read the next event from the currently open file.
virtual void initialize() override
Initialize the module.
virtual void event() override
Called for each event.
virtual void endRun() override
Called when the current run finished.
virtual void terminate() override
Terminates the module.
std::string m_inputFileName
Input MDST file name for backwards compatibility.
Belle::Panther_FileIO * m_fd
PantherFile.
std::vector< std::string > m_inputFileNames
List of input MDST filenames.
bool openNextFile()
Open the next file from the list of files.
StoreObjPtr< EventMetaData > m_evtMetaData
event meta data Object pointer
virtual void beginRun() override
Called when a new run is started.
std::set< int64_t > m_valid_entries_in_current_file
Entries numbers which are valid for the current file.
void initializeDataStore()
Initializes Belle II DataStore.
StoreObjPtr< FileMetaData > m_fileMetadata
File metadata to declare if we process real data or simulated data.
std::vector< std::string > getInputFiles() const
Get list of input files, taking -i command line overrides into account.
std::vector< std::string > m_entrySequences
The number sequences (e.g.
@ c_Persistent
Object is available during entire execution time.
Definition: DataStore.h:60
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.