22 #include "TGPicture.h"
23 #include "TRootEmbeddedCanvas.h"
26 #include "ImageCopyLimits.xpm"
27 #include "ImageEditPlots.xpm"
28 #include "ImageGraphicalCutIcon.xpm"
29 #include "ImageHistogramIcon.xpm"
30 #include "ImageLogo.xpm"
31 #include "ImagePulseIcon.xpm"
32 #include "ImageScatterPlotIcon.xpm"
40 using std::stringstream;
44 TGVerticalFrame(p, w, h),
47 SetCleanup(kDeepCleanup);
49 fLogo =
new TGIcon(
this, gClient->GetPicturePool()->GetPicture(
"Logo", (
char**)ImageLogo), 50, 50);
50 AddFrame(
fLogo,
new TGLayoutHints(kLHintsCenterX, 0, 0, 0, 0));
52 fHistogramButton =
new TGPictureButton(
this, gClient->GetPicturePool()->GetPicture(
"HistogramIcon", (
char**)ImageHistogramIcon));
53 AddFrame(
fHistogramButton,
new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 0, 0, 15, 0));
55 fHistogramButton->Connect(
"Clicked()",
"QGPlotIconsFrame",
this,
"HandleHistogramButton()");
57 fScatterPlotButton =
new TGPictureButton(
this, gClient->GetPicturePool()->GetPicture(
"ScatterPlotIcon", (
char**)ImageScatterPlotIcon));
58 AddFrame(
fScatterPlotButton,
new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 0, 0, 0, 0));
60 fScatterPlotButton->Connect(
"Clicked()",
"QGPlotIconsFrame",
this,
"HandleScatterPlotButton()");
62 fPulsesButton =
new TGPictureButton(
this, gClient->GetPicturePool()->GetPicture(
"PulseIcon", (
char**)ImagePulseIcon));
63 AddFrame(
fPulsesButton,
new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 0, 0, 0, 0));
65 fPulsesButton->Connect(
"Clicked()",
"QGPlotIconsFrame",
this,
"HandlePulsesButton()");
67 fCopyLimitsButton =
new TGPictureButton(
this, gClient->GetPicturePool()->GetPicture(
"CopyLimits", (
char**)ImageCopyLimits));
68 AddFrame(
fCopyLimitsButton,
new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 0, 0, 0, 0));
70 fCopyLimitsButton->Connect(
"Clicked()",
"QGPlotIconsFrame",
this,
"HandleCopyLimitsButton()");
72 fGraphicalCutButton =
new TGPictureButton(
this, gClient->GetPicturePool()->GetPicture(
"GraphicalCutIcon", (
char**)ImageGraphicalCutIcon));
73 AddFrame(
fGraphicalCutButton,
new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 0, 0, 0, 0));
75 fGraphicalCutButton->Connect(
"Clicked()",
"QGPlotIconsFrame",
this,
"HandleGraphicalCutButton()");
77 fEditPlotsButton =
new TGPictureButton(
this, gClient->GetPicturePool()->GetPicture(
"EditPlots", (
char**)ImageEditPlots));
78 AddFrame(
fEditPlotsButton,
new TGLayoutHints(kLHintsCenterX | kLHintsCenterY, 0, 0, 0, 0));
80 fEditPlotsButton->Connect(
"Clicked()",
"QGPlotIconsFrame",
this,
"HandleEditPlotsButton()");
96 stringstream xLowerLimit, xUpperLimit, yLowerLimit, yUpperLimit;
97 xLowerLimit.precision(12);
98 xUpperLimit.precision(12);
99 yLowerLimit.precision(12);
100 yUpperLimit.precision(12);
101 xLowerLimit << xLow <<
" <= " << firstPlot->
GetXVariable();
102 xUpperLimit << firstPlot->
GetXVariable() <<
" < " << xHigh;
103 yLowerLimit << yLow <<
" <= " << firstPlot->
GetYVariable();
104 yUpperLimit << firstPlot->
GetYVariable() <<
" < " << yHigh;
122 list<QGPlot*>::const_iterator plotIter;
123 for (plotIter = plots.begin(); plotIter != plots.end(); ++plotIter) {
124 (*plotIter)->DisplayEditWindow();
137 graphicalCut->SetVarX(firstPlot->
GetXVariable().c_str());
138 graphicalCut->SetVarY(firstPlot->
GetYVariable().c_str());
167 list<QGPlot*>::const_iterator plotIter;
168 for (plotIter = drawnPlots.begin(); plotIter != drawnPlots.end(); ++plotIter) {
169 stringstream xLowerLimit, xUpperLimit, yLowerLimit, yUpperLimit;
170 xLowerLimit.precision(12);
171 xUpperLimit.precision(12);
172 yLowerLimit.precision(12);
173 yUpperLimit.precision(12);
174 xLowerLimit << xLow <<
" <= " << (*plotIter)->GetXVariable();
175 xUpperLimit << (*plotIter)->GetXVariable() <<
" < " << xHigh;
176 yLowerLimit << yLow <<
" <= " << (*plotIter)->GetYVariable();
177 yUpperLimit << (*plotIter)->GetYVariable() <<
" < " << yHigh;
Window containing a ROOT canvas.
void DisplayPlotFrame()
Display the plot frame.
std::list< QGPlot * > & GetPlots()
Get collection of plots associated with this window.
QGFileHandler * GetFileHandler() const
Get pointer to file handler.
std::list< QGPlot * > & GetDrawnPlots()
Get collection of drawn plots.
void UpdateFileLabel()
Update the file label.
void AddCut(const std::string &cut)
Add cut.
static void ClearCopiedCuts()
Clear copied cuts.
static void CopyCut(const std::string &cut)
Copy cut.
void SetCuts(const std::vector< std::string > &cuts)
Set cuts.
std::vector< std::string > GetFilenames()
Get a vector containing the names of the open files.
void OpenFiles(const std::vector< std::string > &files)
Open files, add them to the chain.
Class for graphical cuts.
void Create()
Create the graphical cut with the mouse.
Class for GUI histograms.
void AutoSetStyle()
Automatically set the histogram style.
void DisplayEditWindow()
Display edit window for the histogram.
QGCutsFrame * GetCutsFrame()
Get pointer to the cuts frame.
Part of a canvas window containing the ROOT canvas.
QGCanvasWindow * GetCanvasWindow()
Get pointer to the canvas window.
TRootEmbeddedCanvas * GetEmbeddedCanvas()
Get pointer to canvas.
Part of a QGPlotFrame containing buttons to add new plots.
void HandleCopyLimitsButton()
Handle copy limits button.
void HandleGraphicalCutButton()
Handle graphical cut button.
void HandleHistogramButton()
Handle histogram button.
QGPlotIconsFrame(QGPlotFrame *p, UInt_t w, UInt_t h)
Constructor.
TGPictureButton * fHistogramButton
Histogram icon button.
TGPictureButton * fScatterPlotButton
Scatter plot icon button.
void HandleEditPlotsButton()
Handle edit plots button.
virtual ~QGPlotIconsFrame()
Destructor.
TGPictureButton * fEditPlotsButton
Edit plots button.
TGPictureButton * fGraphicalCutButton
Graphical cut icon button.
void HandlePulsesButton()
Handle pulses button.
QGPlotFrame * fPlotFrame
Pointer to plot frame.
void HandleScatterPlotButton()
Handle scatter plot button.
TGPictureButton * fCopyLimitsButton
Copy limits button.
TGPictureButton * fPulsesButton
Pulses icon button.
static void Update()
Update the plot list.
Base class for GUI plots including histograms, scatter plots, pulses, and graphical cuts.
virtual void Plot()
Plot this in the associated canvas window, generating it if necessary.
virtual void SetCanvasWindow(QGCanvasWindow *window)
Set the canvas window to which the plot is associated.
virtual QGPlotEditWindow * GetEditWindow()
Get pointer to edit window.
virtual void SetXVariable(const std::string &x)
Set X-axis variable.
virtual void SetYVariable(const std::string &y)
Set Y-axis variable.
virtual const std::string & GetXVariable() const
Get x-axis variable.
virtual const std::string & GetYVariable() const
Get y-axis variable.
Class for GUI pulse plots.
void AutoSetStyle()
Automatically set the pulse style.
void DisplayEditWindow()
Display edit window.
Class for GUI scatter plots.
void DisplayEditWindow()
Display edit window.
void AutoSetStyle()
Automatically set the scatter plot style.
static void UpdateWindowDropDownBoxes()
Update window drop down boxes.