Belle II Software development
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
19class TTree;
20
21namespace 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}
A mixin class to attach a name to an object.
Definition: Named.h:23
Record the MVA variables.
Definition: Recorder.cc:28
Class to fill a tree from a set of variables.
Definition: Recorder.h:29
std::unique_ptr< Impl > m_impl
Pointer to implementation hiding the details.
Definition: Recorder.h:71
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.