74#define GETPOPUPMENU(b, m) \
75 reinterpret_cast<TGPopupMenu *>( \
76 *reinterpret_cast<void **>(reinterpret_cast<unsigned char *>(b) + b->Class()->GetDataMemberOffset(#m)))
80xRooBrowser::xRooBrowser(
xRooNode *o) :
TBrowser(
"RooBrowser", o,
"RooFit Browser"), fTopNode(o)
87 for (
auto file : *
gROOT->GetListOfFiles()) {
88 auto _file =
dynamic_cast<TFile *
>(file);
91 for (
auto &&k : *keys) {
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())));
168 return fTopNode->emplace_back(std::make_shared<xRooNode>(std::make_shared<TFile>(
filename))).get();
182 fNode->at(path)->Print();
188 auto _node =
fNode->at(path);
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
R__EXTERN TSystem * gSystem
A version of the TBrowser that can be used to interact with RooFit models and datasets.
void HandleMenu(Int_t id)
std::shared_ptr< xRooNode > fTopNode
void ls(const char *path=nullptr) const override
List TNamed name and title.
std::shared_ptr< xRooNode > fNode
xRooNode * Open(const char *filename)
void cd(const char *path)
The xRooNode class is designed to wrap over a TObject and provide functionality to aid with interacti...
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 an on-disk file, usually with extension .root, that stores objects in a file-system-li...
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.
virtual void Print(Option_t *option="") const
This method must be overridden when a class wants to print itself.
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)