66const char *
filetypes[] = {
"ROOT files",
"*.root",
"All files",
"*",
nullptr,
nullptr};
68const char *
rcfiletypes[] = {
"All files",
"*",
nullptr,
nullptr};
85 void DoRedraw()
override {}
89 Int_t ty = 0,
Int_t th = 0,
const char *col =
"#ffffff");
92 virtual void CloseWindow();
95 TH1 *GetHisto()
const {
return fHist; }
96 const char *GetText()
const {
return fText.
Data(); }
98 void SetHisto(
TH1 *hist);
99 void SetText(
const char *
text);
128 void SetLabel(
Int_t col,
const char *label) { fLabels[col] = label; }
212 void HandleMenu(
Int_t id);
219 void ToggleOrthoRotate();
220 void ToggleOrthoDolly();
237TGHtml *SplitGLView::fgHtml =
nullptr;
241 Int_t th,
const char *col)
257 if ((
cx > 0) && (
cy > 0) && (cw > 0) && (ch > 0)) {
265 Resize(fBgnd->GetWidth(), fBgnd->GetHeight());
269TGShapedToolTip::~TGShapedToolTip()
280void TGShapedToolTip::CloseWindow()
288void TGShapedToolTip::Refresh()
292 const char *str = fText.
Data();
293 char *
string =
strdup(str);
296 char *s =
strtok((
char *)
string,
"\n");
299 while ((s =
strtok(
nullptr,
"\n"))) {
303 img->PaintImage(fId, 0, 0, 0, 0, 0, 0,
"opaque");
320 Resize(fBgnd->GetWidth(), fBgnd->GetHeight());
335 Resize(fBgnd->GetWidth(), fBgnd->GetHeight());
342void TGShapedToolTip::SetHisto(
TH1 *hist)
350 fEc->GetCanvas()->Clear();
354 fEc->GetCanvas()->SetBorderMode(0);
355 fEc->GetCanvas()->SetFillColor(10);
356 fEc->GetCanvas()->cd();
358 fEc->GetCanvas()->Update();
364void TGShapedToolTip::SetText(
const char *
text)
376void TGShapedToolTip::SetTextColor(
const char *col)
414 fEc->GetCanvas()->SetBorderMode(0);
415 fEc->GetCanvas()->SetFillColor(10);
416 fEc->GetCanvas()->cd();
418 fEc->GetCanvas()->Update();
429 fValues =
new TArrayF[fNFields];
430 for (
int i = 0; i < fNFields; i++)
431 fValues[i].Set(
nvals);
432 fLabels =
new TString[fNFields];
436HtmlObjTable::~HtmlObjTable()
445void HtmlObjTable::Build()
449 fHtml =
"<table width=100% border=1 cellspacing=0 cellpadding=0 bgcolor=f0f0f0> ",
452 if (fExpand && (fNFields > 0) && (
fNValues > 0)) {
461void HtmlObjTable::BuildTitle()
465 fHtml +=
"<tr><td colspan=";
466 fHtml +=
Form(
"%d>", fNFields + 1);
467 fHtml +=
"<table width=100% border=0 cellspacing=2 cellpadding=0 bgcolor=6e6ea0>";
468 fHtml +=
"<tr><td align=left>";
469 fHtml +=
"<font face=Verdana size=3 color=ffffff><b><i>";
471 fHtml +=
"</i></b></font></td>";
473 fHtml +=
"<td align=right> ";
474 fHtml +=
"<font face=Verdana size=3 color=ffffff><b><i>";
476 fHtml +=
"</i></b></font></td></tr>";
478 fHtml +=
"</td></tr>";
482void HtmlObjTable::BuildLabels()
487 fHtml +=
"<tr bgcolor=c0c0ff>";
488 fHtml +=
"<th> </th>";
489 for (i = 0; i < fNFields; i++) {
498void HtmlObjTable::BuildTable()
502 for (
int i = 0; i <
fNValues; i++) {
504 fHtml +=
"<tr bgcolor=e0e0ff>";
506 fHtml +=
"<tr bgcolor=ffffff>";
509 name.ReplaceAll(
" ",
"_");
511 fHtml +=
"<td bgcolor=d0d0ff align=\"center\">";
512 fHtml +=
"<input type=\"checkbox\" name=\"";
514 fHtml +=
Form(
"[%d]\">", i);
517 for (
int j = 0;
j < fNFields;
j++) {
518 fHtml +=
"<td width=";
519 fHtml +=
Form(
"%d%%", 100 / fNFields);
520 fHtml +=
" align=\"center\"";
522 fHtml +=
Form(
"%1.4f", fValues[
j][i]);
530HtmlSummary::HtmlSummary(
const char *title) :
fNTables(0), fTitle(title)
538HtmlSummary::~HtmlSummary()
562void HtmlSummary::Clear(
Option_t *option)
566 if (option && option[0] ==
'D')
584void HtmlSummary::Build()
589 for (
int i = 0; i <
fNTables; i++) {
590 GetTable(i)->Build();
591 fHtml += GetTable(i)->Html();
597void HtmlSummary::MakeHeader()
601 fHeader =
"<html><head><title>";
603 fHeader +=
"</title></head><body>";
604 fHeader +=
"<center><h2><font color=#2222ee><i>";
606 fHeader +=
"</i></font></h2></center>";
611void HtmlSummary::MakeFooter()
615 fFooter =
"<br><p><br><center><strong><font size=2 color=#2222ee>";
616 fFooter +=
"Example of using Html widget to display tabular data";
618 fFooter +=
"(c) 2007-2010 Bertrand Bellenot";
619 fFooter +=
"</font></strong></center></body></html>";
637 fMenuFile->AddEntry(
"&Open...",
kFileOpen);
638 fMenuFile->AddSeparator();
640 fMenuFile->AddSeparator();
643 fMenuFile->AddSeparator();
648 fMenuCamera->AddEntry(
"Perspective (Floor XOZ)", kGLPerspXOZ);
649 fMenuCamera->AddEntry(
"Perspective (Floor YOZ)", kGLPerspYOZ);
650 fMenuCamera->AddEntry(
"Perspective (Floor XOY)", kGLPerspXOY);
651 fMenuCamera->AddEntry(
"Orthographic (XOY)", kGLXOY);
652 fMenuCamera->AddEntry(
"Orthographic (XOZ)", kGLXOZ);
653 fMenuCamera->AddEntry(
"Orthographic (ZOY)", kGLZOY);
655 fMenuCamera->AddEntry(
"Ortho allow rotate", kGLOrthoRotate);
656 fMenuCamera->AddEntry(
"Ortho allow dolly", kGLOrthoDolly);
676 fMenuFile->Connect(
"Activated(Int_t)",
"SplitGLView",
this,
"HandleMenu(Int_t)");
677 fMenuCamera->Connect(
"Activated(Int_t)",
"SplitGLView",
this,
"HandleMenu(Int_t)");
678 fMenuScene->Connect(
"Activated(Int_t)",
"SplitGLView",
this,
"HandleMenu(Int_t)");
679 fMenuHelp->Connect(
"Activated(Int_t)",
"SplitGLView",
this,
"HandleMenu(Int_t)");
688 fStatusBar->SetParts(
parts, 4);
694 fPad->SetFillColor(
kBlack);
703 fSplitFrame->GetSecond()->GetSecond()->VSplit(266);
708 frm->SetName(
"Main_View");
713 but1->Connect(
"Clicked(TGLViewerBase*)",
"SplitGLView",
this,
"SwapToMainView(TGLViewerBase*)");
715 but2->Connect(
"Clicked(TGLViewerBase*)",
"SplitGLView",
this,
"UnDock(TGLViewerBase*)");
720 fViewer0->Connect(
"MouseOver(TGLPhysicalShape*)",
"SplitGLView",
this,
"OnMouseOver(TGLPhysicalShape*)");
721 fViewer0->Connect(
"Activated()",
"SplitGLView",
this,
"OnViewerActivated()");
722 fViewer0->Connect(
"MouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)",
"SplitGLView",
this,
723 "OnMouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)");
724 fViewer0->Connect(
"Clicked(TObject*)",
"SplitGLView",
this,
"OnClicked(TObject*)");
725 fViewer[0] =
new TEveViewer(
"SplitGLViewer[0]");
727 fViewer[0]->IncDenyDestroy();
743 frm->SetName(
"Bottom_Left");
748 but3->Connect(
"Clicked(TGLViewerBase*)",
"SplitGLView",
this,
"SwapToMainView(TGLViewerBase*)");
750 but4->Connect(
"Clicked(TGLViewerBase*)",
"SplitGLView",
this,
"UnDock(TGLViewerBase*)");
756 fViewer1->Connect(
"MouseOver(TGLPhysicalShape*)",
"SplitGLView",
this,
"OnMouseOver(TGLPhysicalShape*)");
757 fViewer1->Connect(
"Activated()",
"SplitGLView",
this,
"OnViewerActivated()");
758 fViewer1->Connect(
"MouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)",
"SplitGLView",
this,
759 "OnMouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)");
760 fViewer1->Connect(
"Clicked(TObject*)",
"SplitGLView",
this,
"OnClicked(TObject*)");
761 fViewer[1] =
new TEveViewer(
"SplitGLViewer[1]");
763 fViewer[1]->IncDenyDestroy();
767 fViewer[1]->AddScene(s);
782 frm->SetName(
"Bottom_Center");
787 but5->Connect(
"Clicked(TGLViewerBase*)",
"SplitGLView",
this,
"SwapToMainView(TGLViewerBase*)");
789 but6->Connect(
"Clicked(TGLViewerBase*)",
"SplitGLView",
this,
"UnDock(TGLViewerBase*)");
795 fViewer2->Connect(
"MouseOver(TGLPhysicalShape*)",
"SplitGLView",
this,
"OnMouseOver(TGLPhysicalShape*)");
796 fViewer2->Connect(
"Activated()",
"SplitGLView",
this,
"OnViewerActivated()");
797 fViewer2->Connect(
"MouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)",
"SplitGLView",
this,
798 "OnMouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)");
799 fViewer2->Connect(
"Clicked(TObject*)",
"SplitGLView",
this,
"OnClicked(TObject*)");
800 fViewer[2] =
new TEveViewer(
"SplitGLViewer[2]");
802 fViewer[2]->IncDenyDestroy();
806 fViewer[2]->AddScene(s);
813 frm->SetName(
"Bottom_Right");
820 button->SetToolTipText(
"Swap to big view");
822 button->Connect(
"Clicked()",
"SplitGLView",
this,
"SwapToMainView(TGLViewerBase*=0)");
831 "ItemClicked(TGListTreeItem*, Int_t, Int_t, Int_t)");
835 Resize(GetDefaultSize());
842SplitGLView::~SplitGLView()
847 fMenuFile->Disconnect(
"Activated(Int_t)",
this,
"HandleMenu(Int_t)");
848 fMenuCamera->Disconnect(
"Activated(Int_t)",
this,
"HandleMenu(Int_t)");
849 fMenuScene->Disconnect(
"Activated(Int_t)",
this,
"HandleMenu(Int_t)");
850 fMenuHelp->Disconnect(
"Activated(Int_t)",
this,
"HandleMenu(Int_t)");
851 fViewer0->Disconnect(
"MouseOver(TGLPhysicalShape*)",
this,
"OnMouseOver(TGLPhysicalShape*)");
852 fViewer0->Disconnect(
"Activated()",
this,
"OnViewerActivated()");
853 fViewer0->Disconnect(
"MouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)",
this,
854 "OnMouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)");
855 fViewer1->Disconnect(
"MouseOver(TGLPhysicalShape*)",
this,
"OnMouseOver(TGLPhysicalShape*)");
856 fViewer1->Disconnect(
"Activated()",
this,
"OnViewerActivated()");
857 fViewer1->Disconnect(
"MouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)",
this,
858 "OnMouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)");
859 fViewer2->Disconnect(
"MouseOver(TGLPhysicalShape*)",
this,
"OnMouseOver(TGLPhysicalShape*)");
860 fViewer2->Disconnect(
"Activated()",
this,
"OnViewerActivated()");
861 fViewer2->Disconnect(
"MouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)",
this,
862 "OnMouseIdle(TGLPhysicalShape*,UInt_t,UInt_t)");
887void SplitGLView::HandleMenu(
Int_t id)
959 case kGLOrthoRotate: ToggleOrthoRotate();
break;
960 case kGLOrthoDolly: ToggleOrthoDolly();
break;
999void SplitGLView::OnClicked(
TObject *obj)
1004 fStatusBar->SetText(
Form(
"User clicked on: \"%s\"", obj->
GetName()), 1);
1006 fStatusBar->SetText(
"", 1);
1021 TF1 *
sqroot =
new TF1(
"sqroot",
"x*gaus(0) + [3]*form1", 0, 10);
1022 sqroot->SetParameters(10, 4, 1, 20);
1024 h1f =
new TH1F(
"h1f",
"", 50, 0, 10);
1026 h1f->SetFillColor(45);
1027 h1f->SetStats(
false);
1028 h1f->FillRandom(
"sqroot", 200);
1043 Form(
"%s\n \n%s", shape->
GetLogical()->GetExternal()->IsA()->GetName(),
1044 shape->
GetLogical()->GetExternal()->GetName()),
1058 fStatusBar->SetText(
Form(
"Mouse Over: \"%s\"", shape->
GetLogical()->GetExternal()->GetName()), 0);
1060 fStatusBar->SetText(
"", 0);
1064void SplitGLView::OnViewerActivated()
1072 fActViewer->GetFrame()->ChangeBackground(GetDefaultFrameBackground());
1079 printf(
"dyncast failed ...\n");
1092 if (
fActViewer->GetOrthoXOYCamera()->GetDollyToZoom() &&
fActViewer->GetOrthoXOZCamera()->GetDollyToZoom() &&
1093 fActViewer->GetOrthoZOYCamera()->GetDollyToZoom())
1098 if (
fActViewer->GetOrthoXOYCamera()->GetEnableRotate() &&
fActViewer->GetOrthoXOYCamera()->GetEnableRotate() &&
1099 fActViewer->GetOrthoXOYCamera()->GetEnableRotate())
1106void SplitGLView::OpenFile(
const char *
fname)
1125 fPad->GetListOfPrimitives()->Delete();
1135void SplitGLView::ToggleOrthoRotate()
1145 fActViewer->GetOrthoXOYCamera()->SetEnableRotate(state);
1146 fActViewer->GetOrthoXOYCamera()->SetEnableRotate(state);
1147 fActViewer->GetOrthoXOYCamera()->SetEnableRotate(state);
1152void SplitGLView::ToggleOrthoDolly()
1162 fActViewer->GetOrthoXOYCamera()->SetDollyToZoom(state);
1163 fActViewer->GetOrthoXOZCamera()->SetDollyToZoom(state);
1164 fActViewer->GetOrthoZOYCamera()->SetDollyToZoom(state);
1181 if (
v->InheritsFrom(
"TGLEmbeddedViewer")) {
1183 gVirtualX->SetInputFocus(
ev->GetGLWidget()->GetId());
1189void SplitGLView::LoadConfig(
const char *
fname)
1237void SplitGLView::SaveConfig(
const char *
fname)
1251 env->SetValue(
"MainView.Height", (
Int_t)
frm->GetHeight());
1254 env->SetValue(
"Bottom.Left.Width", (
Int_t)
frm->GetWidth());
1257 env->SetValue(
"Bottom.Center.Width", (
Int_t)
frm->GetWidth());
1260 env->SetValue(
"Bottom.Right.Width", (
Int_t)
frm->GetWidth());
1291 while (parent && !parent->
InheritsFrom(
"TGSplitFrame")) {
1322void SplitGLView::UpdateSummary()
1334 for (i =
mgr->BeginChildren(); i !=
mgr->EndChildren(); ++i) {
1351 table->SetLabel(0,
"Momentum");
1352 table->SetLabel(1,
"P_t");
1353 table->SetLabel(2,
"Phi");
1354 table->SetLabel(3,
"Theta");
1355 table->SetLabel(4,
"Eta");
1359 table->SetValue(0, k,
p);
1361 table->SetValue(1, k,
pt);
1363 table->SetValue(2, k, phi);
1365 table->SetValue(3, k, theta);
1367 table->SetValue(4, k, eta);
1382 printf(
"This script is used via ACLiC by the macro \"alice_esd_split.C\"\n");
1383 printf(
"To see it in action, just run \".x alice_esd_split.C\"\n");
Handle_t Window_t
Window handle.
ULong_t Pixel_t
Pixel value.
R__EXTERN const char gHelpAbout[]
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
bool Bool_t
Boolean (0=false, 1=true) (bool)
int Int_t
Signed integer 4 bytes (int)
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int)
float Float_t
Float 4 bytes (float)
constexpr Ssiz_t kNPOS
The equivalent of std::string::npos for the ROOT class TString.
const char Option_t
Option string (const char)
#define ClassDef(name, id)
#define ClassDefOverride(name, id)
R__EXTERN TApplication * gApplication
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
R__EXTERN TEveManager * gEve
winID h TVirtualViewer3D TVirtualGLPainter p
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
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 Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t sel
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize MapSubwindows
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t button
Option_t Option_t TPoint TPoint const char text
R__EXTERN TGeoManager * gGeoManager
void Reset(Option_t *option="") override
R__EXTERN void * gTQSender
Binding & operator=(OUT(*fun)(void))
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
R__EXTERN TSystem * gSystem
virtual void Terminate(Int_t status=0)
Terminate the application by call TSystem::Exit() unless application has been told to return from Run...
Array of floats (32 bits per element).
void SetAt(Double_t v, Int_t i) override
The TEnv class reads config files, by default named .rootrc.
void EveMenu(Int_t id)
Handle events from Eve menu.
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
virtual void AddElement(TEveElement *el)
Add el to the list of children.
Base class for event management and navigation.
Exception class thrown by TEve classes and macros.
TGListTree * GetListTree() const
Get default list-tree widget.
TEveViewerList * GetViewers() const
TEveSelection * GetSelection() const
TEveScene * GetGlobalScene() const
TEveBrowser * GetBrowser() const
TGListTreeItem * AddToListTree(TEveElement *re, Bool_t open, TGListTree *lt=nullptr)
TEveScene * SpawnNewScene(const char *name, const char *title="")
Create a new scene.
TEveSelection * GetHighlight() const
TEveScene * GetEventScene() const
TEveEventManager * GetCurrentEvent() const
This was intended as a TPad wrapper to allow smart updates of groups of pads.
TEvePointSet is a render-element holding a collection of 3D points with optional per-point TRef and a...
const char * GetElementTitle() const override
Virtual function for retrieving title of the render-element.
const char * GetElementName() const override
Virtual function for retrieving name of the element.
Axes for non-linear projections.
Manager class for steering of projections and managing projected objects.
Eve representation of TGLScene.
Int_t GetPickToSelect() const
A list of tracks supporting change of common attributes and selection based on track parameters.
Visual representation of a track.
void AddElement(TEveElement *el) override
Call base-class implementation.
Eve representation of TGLViewer.
The base class for composite widgets (menu bars, list boxes, etc.).
A frame with handles that allow it to be undocked (i.e.
This class creates a file selection dialog.
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
A composite frame that layout their children in horizontal way.
Minimal GL-viewer that can be embedded in a standard ROOT frames.
Concrete physical shape - a GL drawable.
const TGLLogicalShape * GetLogical() const
Base class for GL viewers.
Base GL viewer object - used by both standalone and embedded (in pad) GL.
This class describes layout hints used by the layout classes.
Defines top level windows that interact with the system Window Manager.
Provides a StatusBar widget.
ROOT GUI Window base class.
const TGWindow * GetParent() const
static TGeoManager * Import(const char *filename, const char *name="", Option_t *option="")
static function Import a geometry from a gdml or ROOT file
void DefaultColors()
Set default volume colors according to A of material.
TGeoVolume * GetTopVolume() const
1-D histogram with a float per channel (see TH1 documentation)
TH1 is the base class of all histogram classes in ROOT.
void Draw(Option_t *option="") override
Draw this histogram with options.
TObject * Clone(const char *newname="") const override
Make a complete copy of the underlying object.
An abstract interface to image processing library.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
This is the ROOT implementation of the Qt object communication mechanism (see also http://www....
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
static const TString & GetBinDir()
Get the binary directory in the installation. Static utility function.
TGTab * GetTabBottom() const
TGStatusBar * GetStatusBar() const
TGTab * GetTabRight() const
This class creates a TGCanvas in which a TCanvas is created.
A TRootHelpDialog is used to display help text (or any text in a dialog window).
void ToLower()
Change string to lower-case.
const char * Data() const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual Int_t Exec(const char *shellcmd)
Execute a command.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual int Rename(const char *from, const char *to)
Rename a file.
TFile * OpenFile(const TString &fin)