27#define GETPOPUPMENU(b,m) ((TGPopupMenu*)(*(void**)(((unsigned char*)b) + b->Class()->GetDataMemberOffset(#m))))
31xRooBrowser::xRooBrowser(
xRooNode *o) :
TBrowser(
"RooBrowser", o,
"RooFit Browser"), fTopNode(o)
38 for (
auto file : *
gROOT->GetListOfFiles()) {
42 for (
auto &&k : *keys) {
46 if (!in->contains(_file->GetName())) {
47 in->emplace_back(std::make_shared<xRooNode>(*_file));
49 if (!in->at(_file->GetName())->contains(
w->GetName())) {
50 in->at(_file->GetName())
51 ->emplace_back(std::make_shared<xRooNode>(*
w, in->at(_file->GetName())));
64 rb->Disconnect(
GETPOPUPMENU(rb,fMenuFile),
"Activated(Int_t)", rb,
"HandleMenu(Int_t)");
74 static const char *openFileTypes[] = {
"ROOT files",
"*.root",
"JSON files",
"*.json",
"All files",
"*", 0, 0};
79 std::vector<std::string> filesToOpen;
89 if (!filesToOpen.empty()) {
90 for (
auto &
f : filesToOpen) {
92 fTopNode->push_back(std::make_shared<xRooNode>(
f.c_str()));
94 fTopNode->push_back(std::make_shared<xRooNode>(std::make_shared<TFile>(
f.c_str())));
122 fNode->at(path)->Print();
128 auto _node =
fNode->at(path);
R__EXTERN TSystem * gSystem
void HandleMenu(Int_t id)
void ls(const char *path=nullptr) const override
List TNamed name and title.
std::shared_ptr< xRooNode > fNode
std::shared_ptr< xRooNode > fTopNode
void cd(const char *path)
The RooWorkspace is a persistable container for RooFit projects.
Using a TBrowser one can browse all ROOT objects.
TObject * GetSelected() const
TBrowserImp * GetBrowserImp() const
Bool_t InheritsFrom(const char *cl) const override
Return kTRUE if this class inherits from a class with name "classname".
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
virtual void SetValue(const char *name, const char *value, EEnvLevel level=kEnvChange, const char *type=nullptr)
Set the value of a resource or create a new resource.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
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.
const char * GetName() const override
Returns name of object.
void Print(Option_t *option="") const override
Print TNamed name and title.
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.
virtual const char * UnixPathName(const char *unixpathname)
Convert from a local pathname to a Unix pathname.
#define BEGIN_XROOFIT_NAMESPACE
#define END_XROOFIT_NAMESPACE
#define GETPOPUPMENU(b, m)