Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
RootIOManager.h
1/*
2 * RootIoManager.h
3 *
4 * Created on: 6 maj 2022
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9#ifndef HAL_FEATURES_IO_ROOTIOMANAGER_H_
10#define HAL_FEATURES_IO_ROOTIOMANAGER_H_
11
12#include "IOManager.h"
13#include <vector>
14
15#include <RtypesCore.h>
16#include <TList.h>
17#include <TString.h>
18
19class TTree;
20class TBranch;
24namespace Hal {
25
26 class RootIOManager : public IOManager {
27 Int_t fEntries = {0};
28 TString fOutFileName;
29 TString fOutTreeName;
30 TFile* fOutFile = {nullptr};
31 TTree* fOutTree = {nullptr};
32 TChain* fInChain = {nullptr};
33 std::vector<TObject**> fObjects; // just to call delete?
34
35 protected:
39 void PushTObject(TObject** obj);
40 virtual void RegisterInternal(const char* name, const char* folderName, TNamed* obj, Bool_t toFile);
41 virtual void RegisterInternal(const char* name, const char* Foldername, TCollection* obj, Bool_t toFile);
42 TChain* GetInChain() { return fInChain; }
43 virtual Bool_t InitInternal();
44
45 public:
50 RootIOManager(TString name);
60 void SetOutput(TString name) { fOutFileName = name; }
64 void SetOutTreeName(TString name) { fOutTreeName = name; }
69 Int_t GetEntries() const;
76 Int_t GetEntry(Int_t i, Int_t flag = 1);
77 virtual void UpdateBranches();
78 void LockUnusedBranches();
79 void SetInChain(TChain* tempChain, Int_t ident = -1);
80 void FillTree();
87 static std::vector<TString> GetListOfBranches(TChain* chain, Bool_t friends);
88 virtual void CloseManager();
89 virtual ~RootIOManager();
90 ClassDef(RootIOManager, 1)
91 };
92
93} /* namespace Hal */
94
95#endif /* HAL_FEATURES_IO_ROOTIOMANAGER_H_ */
void SetOutput(TString name)
virtual void UpdateBranches()
virtual void RegisterInternal(const char *name, const char *folderName, TNamed *obj, Bool_t toFile)
void PushTObject(TObject **obj)
static std::vector< TString > GetListOfBranches(TChain *chain, Bool_t friends)
virtual void CloseManager()
Int_t GetEntry(Int_t i, Int_t flag=1)
void SetOutTreeName(TString name)
RootIOManager(TString name)
void SetInChain(TChain *tempChain, Int_t ident=-1)
Int_t GetEntries() const