9#include "OTFIOManager.h"
12#include "InputDataInfo.h"
19#include <TObjString.h>
27 IOManager::IOManager(TString name,
HalOTF::Source* source, Int_t entries) :
28 Hal::IOManager(new
Hal::InputDataInfo(name)),
30 fOutTreeName(
"HalTree"),
37 Bool_t IOManager::InitInternal() {
39 fInFile =
new TFile(fInFileName,
"recreate");
40 fOutFile =
new TFile(fOutFileName,
"recreate");
41 fOutTree =
new TTree(fOutTreeName, fOutTreeName);
43 fSource->RegisterOutputs(
this);
47 Int_t IOManager::GetEntries()
const {
return fEntries; }
49 IOManager::~IOManager() {
50 if (fInFile)
delete fInFile;
51 if (fOutFile)
delete fOutFile;
52 gSystem->Exec(Form(
"rm %s", fInFileName.Data()));
55 TFile* IOManager::GetInFile() {
return fInFile; }
57 void IOManager::RegisterInternal(
const char* name,
const char* , TNamed* obj, Bool_t toFile) {
58 if (toFile) { fOutTree->Branch(name, obj); }
61 void IOManager::RegisterInternal(
const char* name,
const char* , TCollection* obj, Bool_t toFile) {
62 if (toFile) { fOutTree->Branch(name, obj); }
65 void IOManager::SetInChain(TChain* , Int_t ) {}
67 Int_t IOManager::GetEntry(Int_t i, Int_t ) {
69 if (fSource) fSource->GetEvent();
75 void IOManager::FillTree() { fOutTree->Fill(); }
77 void IOManager::CloseManager() {
static void PrintInfo(TString text, Hal::EInfo status)