Belle II Software  release-08-01-10
Recorder.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 #pragma once
9 
10 #include <tracking/trackFindingCDC/utilities/Named.h>
11 
12 #include <RtypesCore.h>
13 
14 #include <functional>
15 #include <vector>
16 #include <memory>
17 #include <string>
18 
19 class TTree;
20 
21 namespace Belle2 {
26  namespace TrackFindingCDC {
27 
29  class Recorder {
30  public:
40  Recorder(const std::function<void(TTree&)>& setBranches,
41  const std::string& rootFileName,
42  const std::string& treeName = "recorded_tree");
43 
44 
53  Recorder(const std::vector<Named<Float_t*> >& namedVariables,
54  const std::string& rootFileName,
55  const std::string& treeName = "recorded_tree");
56 
59 
61  void write();
62 
64  void capture();
65 
66  private:
68  class Impl;
69 
71  std::unique_ptr<Impl> m_impl;
72  };
73  }
75 }
Record the MVA variables.
Definition: Recorder.cc:28
Class to fill a tree from a set of variables.
Definition: Recorder.h:29
Recorder(const std::function< void(TTree &)> &setBranches, const std::string &rootFileName, const std::string &treeName="recorded_tree")
Construct the Recorder opening the given ROOT file and create the underlying TTree and add let the gi...
Definition: Recorder.cc:139
std::unique_ptr< Impl > m_impl
Pointer to implementation hiding the details.
Definition: Recorder.h:68
void capture()
Capture the registered variable values and write them out.
Definition: Recorder.cc:169
void write()
Write all captured variables to disk.
Definition: Recorder.cc:164
~Recorder()
Destructor writing the TTree and closing the ROOT File.
Abstract base class for different kinds of events.