8 #include <FairLogger.h>
9 #include <FairRootManager.h>
10 #include <FairRunAna.h>
13 #include <TClonesArray.h>
14 #include <TEveBrowser.h>
15 #include <TEveManager.h>
18 #include <TRootBrowser.h>
31 constexpr
auto cRED =
"\033[1;31m";
34 constexpr
auto cGREEN =
"\033[1;32m";
35 constexpr
auto cBLUE =
"\033[1;34m";
50 if (fInstance !=
nullptr)
51 LOG(fatal) <<
"Attempting to create a second instance of AtViewerManager! Only one is allowed!";
56 TEveManager::Create(
true,
"IV");
57 TEveBrowser *browser = gEve->GetBrowser();
60 browser->StartEmbedding(TRootBrowser::kLeft);
66 browser->StopEmbedding();
67 browser->SetTabTitle(
"Control", TRootBrowser::kLeft);
70 browser->StartEmbedding(TRootBrowser::kBottom);
76 browser->StopEmbedding();
77 browser->SetTabTitle(
"Control", TRootBrowser::kBottom);
90 FairRunAna::Instance()->AddTask(task);
94 fTabs.push_back(std::move(tab));
100 gStyle->SetPalette(55);
102 FairRunAna::Instance()->Init();
103 for (
auto &tab : fTabs)
107 GenerateBranchLists();
112 FairRootManager *ioMan = FairRootManager::Instance();
113 if (ioMan ==
nullptr) {
114 LOG(fatal) <<
"Cannot find RootManager!";
118 std::cout <<
"End of AtViewerManager" << std::endl;
121 void AtViewerManager::GenerateBranchLists()
123 LOG(info) <<
"Generating branch list";
125 auto ioMan = FairRootManager::Instance();
129 for (
int i = 0; i < ioMan->GetBranchNameList()->GetSize(); i++) {
131 auto branchName = ioMan->GetBranchName(i);
132 auto branchArray =
dynamic_cast<TClonesArray *
>(ioMan->GetObject(branchName));
133 if (branchArray ==
nullptr)
138 while (branchArray->GetEntries() == 0 &&
event < 5) {
142 if (branchArray->GetEntries() == 0) {
143 LOG(error) <<
"Failed to find type of branch " << branchName << std::endl;
147 LOG(debug) <<
"Examining " << branchArray->At(0);
148 LOG(debug) <<
"With type " << branchArray->At(0)->ClassName();
150 if (branchArray->At(0) ==
nullptr)
151 LOG(error) <<
"Failed to determine type of " << branchName <<
"! The TCLonesArray contains a nullptr.";
153 auto type = branchArray->At(0)->ClassName();
154 fBranchNames[type].push_back(branchName);
155 LOG(info) <<
"Found " << branchName <<
" with type " << type << std::endl;
157 LOG(info) <<
"Done generating branch list";
160 void AtViewerManager::GotoEventImpl()
162 for (
auto &tab : fTabs)
170 if (subject == &fEntry) {
179 if (fCheckGood ==
false) {
181 }
else if (fCheckEvt->GetInfo()->IsGood())
190 if (fCheckGood ==
false) {
192 }
else if (fCheckEvt->GetInfo()->IsGood())