13#include "InputDataInfo.h"
15#include "PackageTable.h"
24#include <RtypesCore.h>
28#include <TObjString.h>
35 if (str.GetBranchName().EqualTo(name))
return;
38 fBranchNameList.push_back(name);
43 if (branch.GetBranchName().EqualTo(name))
return branch;
45 BranchInfo br(name,
nullptr, BranchInfo::EFlag::kNull);
46 br.GetBranchName() = name;
52 AddBranch(name, obj, BranchInfo::EFlag::kOut);
54 AddBranch(name, obj, BranchInfo::EFlag::kVirtual);
61 AddBranch(name, obj, BranchInfo::EFlag::kOut);
63 AddBranch(name, obj, BranchInfo::EFlag::kVirtual);
70 TString name = BrName;
72 if (branch.GetBranchName().EqualTo(name))
return branch.GetFlag();
74 return BranchInfo::EFlag::kNull;
78 TString name = BrName;
80 if (branch.GetBranchName().EqualTo(name)) {
81 if (branch.GetFlag() == BranchInfo::EFlag::kInPassive) { branch.SetFlag(BranchInfo::EFlag::kInActive); }
82 auto pointer = branch.GetPointer();
83 if (!pointer) {
Hal::Cout::PrintInfo(Form(
"Branch %s exists, but contains non-TObject", name.Data()), EInfo::kError); }
90 if (branch.GetBranchName().EqualTo(name)) {
91 if (branch.GetFlag() == BranchInfo::EFlag::kInPassive) { branch.SetFlag(BranchInfo::EFlag::kInActive); }
92 auto pointer = branch.GetPointer();
93 if (!pointer) {
Hal::Cout::PrintInfo(Form(
"Branch %s exists, but contains non-TObject", name.Data()), EInfo::kError); }
102 if (branch.GetBranchName().EqualTo(brName)) {
103 if (branch.GetFlag() == BranchInfo::EFlag::kInPassive) {
104 branch.SetFlag(BranchInfo::EFlag::kInActive);
112 if (branch.GetBranchName().EqualTo(brName)) {
113 if (branch.GetFlag() == BranchInfo::EFlag::kInPassive) {
114 branch.SetFlag(BranchInfo::EFlag::kInActive);
124 Cout::PrintInfo(Form(
"Input file %s", fDataInfo->GetSourceName().Data()), EInfo::kInfo);
127 TString types[] = {
"Input (Active)",
"Input (Passive)",
"Output",
"Virtual"};
128 BranchInfo::EFlag flags[] = {
129 BranchInfo::EFlag::kInActive, BranchInfo::EFlag::kInPassive, BranchInfo::EFlag::kOut, BranchInfo::EFlag::kVirtual};
130 for (
int i = 0; i < 4; i++) {
132 if (branch.GetFlag() == flags[i])
Cout::Database({branch.GetBranchName(), types[i]});
137 IOManager::~IOManager() {
138 if (fDataInfo)
delete fDataInfo;
142 TList* list =
new TList();
143 list->SetName(Form(
"Branch List"));
145 auto getStr = [](BranchInfo::EFlag flag) {
146 TString flagStr =
"unknown";
148 case BranchInfo::EFlag::kInActive: {
149 flagStr =
"INPUT (ACTIVE)";
151 case BranchInfo::EFlag::kInPassive: {
152 flagStr =
"INPUT (PASSIVE)";
154 case BranchInfo::EFlag::kOut: {
157 case BranchInfo::EFlag::kVirtual: {
160 case BranchInfo::EFlag::kNull: {
168 TString flagStr = getStr(branch.GetFlag());
169 TString name = branch.GetBranchName();
170 TObject* obj = branch.GetPointer();
171 TString className =
"unknown";
172 if (obj) { className = obj->ClassName(); }
173 list->Add(
new ParameterString(Form(
"Branch: %s", name.Data()), Form(
"%s [%s]", className.Data(), flagStr.Data())));
187 return InitInternal();
static void PrintInfo(TString text, Hal::EInfo status)
static void Database(Int_t no...)
Int_t GetFriendsLevel() const
virtual TList * GetBranchesList() const
virtual void UpdateBranches()
BranchInfo::EFlag GetBranchStatus(const char *BrName)
void ActivateBranch(TString brName)
std::vector< TString > GetFileNameList(Int_t level) const
TString GetFirstDataFileName() const
std::vector< TString > GetFilesNames(Int_t entry=0) const
void AddFriend(TString friendName, Int_t level)
std::vector< Hal::BranchInfo > fBranches
BranchInfo FindBranch(TString name) const
void Register(const char *name, const char *folderName, TNamed *obj, Bool_t toFile)
void AddFile(TString name)
TString GetSourceName() const
void AddBranch(TString name, TObject *object, BranchInfo::EFlag flag)
TString GetFirstFriendFileName(Int_t level) const
virtual TObject * GetObject(const char *BrName)
virtual void RegisterInternal(const char *name, const char *folderName, TNamed *obj, Bool_t toFile)=0