74#define GETPOPUPMENU(b, m) \
75 reinterpret_cast<TGPopupMenu *>( \
76 *reinterpret_cast<void **>(reinterpret_cast<unsigned char *>(b) + b->Class()->GetDataMemberOffset(#m)))
87 for (
auto file : *
gROOT->GetListOfFiles()) {
88 auto _file =
dynamic_cast<TFile *
>(file);
91 for (
auto &&k : *keys) {
94 if (
auto w = _file->Get<
RooWorkspace>(k->GetName()); w) {
95 if (!in->contains(_file->GetName())) {
96 in->emplace_back(std::make_shared<xRooNode>(*_file));
98 if (!in->at(_file->GetName())->contains(w->GetName())) {
99 in->at(_file->GetName())
100 ->emplace_back(std::make_shared<xRooNode>(*w, in->at(_file->GetName())));
113 rb->Disconnect(
GETPOPUPMENU(rb, fMenuFile),
"Activated(Int_t)", rb,
"HandleMenu(Int_t)");
123 static const char *openFileTypes[] = {
"ROOT files",
"*.root",
"JSON files",
"*.json",
124 "All files",
"*",
nullptr,
nullptr};
129 std::vector<std::string> filesToOpen;
133 while ((el =
static_cast<TObjString *
>(next()))) {
139 if (!filesToOpen.empty()) {
140 for (
auto &
f : filesToOpen) {
142 fTopNode->push_back(std::make_shared<xRooNode>(
f.c_str()));
144 fTopNode->push_back(std::make_shared<xRooNode>(std::make_shared<TFile>(
f.c_str())));
155 gEnv->SetValue(
"X11.UseXft",
"no");
156 gEnv->SetValue(
"X11.Sync",
"no");
157 gEnv->SetValue(
"X11.FindBestVisual",
"no");
158 gEnv->SetValue(
"Browser.Name",
"TRootBrowser");
159 gEnv->SetValue(
"Canvas.Name",
"TRootCanvas");
168 return fTopNode->emplace_back(std::make_shared<xRooNode>(std::make_shared<TFile>(filename))).get();
170 return fTopNode->emplace_back(std::make_shared<xRooNode>(filename)).get();
182 fNode->at(path)->Print();
188 auto _node =
fNode->at(path);
int Int_t
Signed integer 4 bytes (int).
std::shared_ptr< xRooNode > fTopNode
!
void cd(const char *path)
std::shared_ptr< xRooNode > fNode
!
xRooNode * Open(const char *filename)
void ls(const char *path=nullptr) const override
List TNamed name and title.
void HandleMenu(Int_t id)
The xRooNode class is designed to wrap over a TObject and provide functionality to aid with interacti...
Persistable container for RooFit projects.
TBrowser(const TBrowser &)=delete
TObject * GetSelected() const
TBrowserImp * GetBrowserImp() const
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
TList * GetListOfKeys() const override
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
This class creates a file selection dialog.
TList * fFileNamesList
list of selected file names
char * fFilename
selected file name
const char ** fFileTypes
file types used to filter selectable files
char * fIniDir
on input: initial directory, on output: new directory
Bool_t fMultipleSelection
if true, allow multiple file selection
void SetIniDir(const char *inidir)
Set directory name.
Book space in a file, create I/O buffers, to fill them, (un)compress them.
Collectable string class.
const TString & GetString() const
virtual const char * ClassName() const
Returns name of class to which the object belongs.
This class creates a ROOT object browser, constituted by three main tabs.
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
bool EndsWith(std::string_view string, std::string_view suffix)
#define BEGIN_XROOFIT_NAMESPACE
#define END_XROOFIT_NAMESPACE
#define GETPOPUPMENU(b, m)