Project
Loading...
Searching...
No Matches
TreeStreamRedirector.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
15
16#ifndef ALICEO2_TREESTREAMREDIRECTOR_H
17#define ALICEO2_TREESTREAMREDIRECTOR_H
18
19#include <Rtypes.h>
20#include <TDirectory.h>
22
23namespace o2
24{
25namespace utils
26{
42{
43 public:
44 TreeStreamRedirector(const char* fname = "", const char* option = "recreate");
45 virtual ~TreeStreamRedirector();
46 void Close();
47 TFile* GetFile() { return mDirectory->GetFile(); }
48 TDirectory* GetDirectory() { return mDirectory; }
49 virtual TreeStream& operator<<(Int_t id);
50 virtual TreeStream& operator<<(const char* name);
51 void SetDirectory(TDirectory* sfile);
52 void SetFile(TFile* sfile);
53 static void FixLeafNameBug(TTree* tree);
54
55 private:
57 TreeStreamRedirector& operator=(const TreeStreamRedirector& tsr);
58
59 std::unique_ptr<TDirectory> mOwnDirectory; // own directory of the redirector
60 TDirectory* mDirectory = nullptr; // output directory
61 std::vector<std::unique_ptr<TreeStream>> mDataLayouts; // array of data layouts
62
63 ClassDefNV(TreeStreamRedirector, 0);
64};
65} // namespace utils
66} // namespace o2
67
68#endif
static void FixLeafNameBug(TTree *tree)
virtual TreeStream & operator<<(Int_t id)
GLuint const GLchar * name
Definition glcorearb.h:781
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Common utility functions.
std::unique_ptr< TTree > tree((TTree *) flIn.Get(std::string(o2::base::NameConf::CTFTREENAME).c_str()))