Belle II Software  release-08-01-10
TOPNtupleModule.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/core/Module.h>
12 #include <string>
13 #include <top/modules/TOPNtuple/NtupleStructure.h>
14 
15 #include <TFile.h>
16 #include <TTree.h>
17 
18 namespace Belle2 {
28  class TOPNtupleModule : public Module {
29 
30  public:
31 
36 
40  virtual ~TOPNtupleModule();
41 
46  virtual void initialize() override;
47 
52  virtual void beginRun() override;
53 
57  virtual void event() override;
58 
63  virtual void endRun() override;
64 
69  virtual void terminate() override;
70 
71  private:
72 
73  std::string m_outputFileName;
75  TFile* m_file = 0;
76  TTree* m_tree = 0;
79  };
80 
82 } // Belle2 namespace
83 
Base class for Modules.
Definition: Module.h:72
Module to write out a ntuple summarizing TOP reconstruction output.
TTree * m_tree
TTree with TOPTree structure.
TOP::TOPTree m_top
ntuple structure
std::string m_outputFileName
output file name (root file)
virtual void initialize() override
Initialize the Module.
virtual void event() override
Event processor.
TOPNtupleModule()
Constructor.
virtual void endRun() override
End-of-run action.
virtual void terminate() override
Termination action.
virtual ~TOPNtupleModule()
Destructor.
virtual void beginRun() override
Called when entering a new run.
Abstract base class for different kinds of events.
Structure of a flat ntuple.