Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
OTFIOManager.h
1/*
2 * OTFIOManager.h
3 *
4 * Created on: 28 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_EXAMPLES_ONTHEFLY_OTFIOMANAGER_H_
10#define HAL_EXAMPLES_ONTHEFLY_OTFIOMANAGER_H_
11
12#include "IOManager.h"
13#include <vector>
14
15#include <RtypesCore.h>
16#include <TString.h>
17
18class TTree;
19class TBranch;
20namespace HalOTF {
21 class Source;
22 class IOManager : public Hal::IOManager {
23 TString fInFileName;
24 TString fOutFileName;
25 TString fOutTreeName;
26 Int_t fEntries;
27 TFile* fInFile;
28 TFile* fOutFile;
29 TTree* fOutTree;
30 HalOTF::Source* fSource;
31
32 protected:
33 void RegisterInternal(const char* name, const char* folderName, TNamed* obj, Bool_t toFile);
34 void RegisterInternal(const char* name, const char* Foldername, TCollection* obj, Bool_t toFile);
35 Bool_t InitInternal();
36
37 public:
38 IOManager(TString name = "root_virtual.root", HalOTF::Source* source = nullptr, Int_t entries = 1);
39 void SetOutput(TString name) { fOutFileName = name; }
40 void SetOutTreeName(TString name) { fOutTreeName = name; }
41 Int_t GetEntries() const;
42 Int_t GetEntry(Int_t i, Int_t flag);
43 TFile* GetInFile();
44 void AddFriend(TString /*name*/) {};
45 void SetInChain(TChain* tempChain, Int_t ident = -1);
46 void FillTree();
47 virtual void CloseManager();
48 virtual ~IOManager();
49 ClassDef(IOManager, 1)
50 };
51} // namespace HalOTF
52
53#endif /* HAL_EXAMPLES_ONTHEFLY_OTFIOMANAGER_H_ */
void SetOutput(TString name)
Int_t GetEntries() const
void SetInChain(TChain *tempChain, Int_t ident=-1)
virtual void CloseManager()
void RegisterInternal(const char *name, const char *folderName, TNamed *obj, Bool_t toFile)
Int_t GetEntry(Int_t i, Int_t flag)