11#include "KVKeyHandler.h"
14#include "KVHistoManipulator.h"
192 const Int_t kTMAX = 256;
193 static char atext[kTMAX];
206 snprintf(atext, kTMAX,
"%c", (
char) px);
208 snprintf(atext, kTMAX,
"%d,%d", px, py);
255 pad =
Pick(px, py, prevSelObj);
287 if (distX >= 0.5)
return;
297 if (distY >= 0.5)
return;
299 if ((distX <=
size) && (distY <=
size))
return;
308 if ((
X0 - dX > 0) && (X1 - dX < NbinsX)) {
312 if ((
Y0 - dY > 0) && (Y1 - dY < NbinsY)) {
350 pad =
Pick(px, py, prevSelObj);
451 pad =
Pick(px, py, prevSelObj);
494 while ((tc = (
TCanvas*)next()))
519 newXlast =
Xlast0 - dXbins;
525 if (newXfirst !=
Xf1) {
538 newYlast =
Ylast0 - dYbins;
544 if (newYfirst !=
Yf1) {
573 pad =
Pick(px, py, prevSelObj);
615 pad =
Pick(px, py, prevSelObj);
630 pad =
Pick(px, py, prevSelObj);
633 sign = (
event ==
kWheelUp ? 1 : -1);
661 if (!TheHisto)
return;
704 if (X0tmp >= X1tmp) X0tmp = X1tmp - 1;
705 if (
Sign > 0) dX = (
Int_t)(X0tmp + (X1tmp - X0tmp) * 0.5 - ax->
FindBin(px));
706 if ((X0tmp - dX) < 0) ax->
SetRange(0, X1tmp - X0tmp);
708 else ax->
SetRange(X0tmp - dX, X1tmp - dX);
747 if (X0tmp >= X1tmp) X0tmp = X1tmp - 1;
748 if (
Sign > 0) dX = (
Int_t)(X0tmp + (X1tmp - X0tmp) * 0.5 - ax->
FindBin(ppx));
749 if ((X0tmp - dX) < 0) ax->
SetRange(0, X1tmp - X0tmp);
751 else ax->
SetRange(X0tmp - dX, X1tmp - dX);
761 if (Y0tmp >= Y1tmp) Y0tmp = Y1tmp - 1;
762 if (
Sign > 0) dY = (
Int_t)(Y0tmp + (Y1tmp - Y0tmp) * 0.5 - ax->
FindBin(ppy));
763 if ((Y0tmp - dY) < 0) ax->
SetRange(0, Y1tmp - Y0tmp);
765 else ax->
SetRange(Y0tmp - dY, Y1tmp - dY);
887 while ((obj = next())) {
889 ((
TPad*)obj)->SetGrid(0, 0);
895 while ((obj = next())) {
897 ((
TPad*)obj)->SetGrid();
1027 while ((obj = it())) {
1028 ((
TF1*)obj)->SetNpx(((
TF1*)obj)->GetNpx() + 50);
1049 while ((obj = it()))((
TF1*)obj)->SetNpx(((
TF1*)obj)->GetNpx() - 50);
1081 if ((last + 2 < nBins) && (sign > 0)) {
1086 if ((
first - 2 >= 0) && (sign < 0)) {
1108 std::cout << std::endl << std::endl;
1111 while ((info = (
TNamed*)it())) {
1114 std::cout << std::endl;
1136 AddShortcutsInfo(
"<ctrl> d",
"undraw the object under cursor (object not deleted)");
1143 AddShortcutsInfo(
"<ctrl> l",
"set/unset log scale on Y axis (TH1) or Z axis (TH2)");
1169 hh->
ProfileX(
"_pfx", 1, -1,
"i,d,same");
1206 file.ReplaceAll(
"/",
"");
1208 Form(
"File name '%s' already exists, OK to owerwrite it?",
file.Data()),
1211 if (ret_val &
kMBOk) {
1217 const char* SaveAsTypes[] = {
1219 "PostScript",
"*.ps",
1220 "Encapsulated PostScript",
"*.eps",
1224 "ROOT macros",
"*.C",
1225 "ROOT files",
"*.root",
1238 static Int_t typeidx = 0;
1264 while ((hh = (
TObject*)it())) {
1281 while ((obj = it())) {
1305 while (
gROOT->FindObject(pname.
Data())) {
1322 for (
int i = 0; i < px->
GetNbinsX(); i++) {
1346 while (
gROOT->FindObject(pname.
Data())) {
1363 for (
int i = 0; i < py->
GetNbinsX(); i++) {
size_t size(const MatrixT &matrix)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint percent
char * Form(const char *fmt,...)
char * StrDup(const char *str)
R__EXTERN TSystem * gSystem
TCanvas with mouse-controlled dynamic zoom and pan & scan.
void ShowShortcutsInfos()
void ProjectionY(TH2 *hh)
Int_t Xlast0
number of bins on x-axis, initial displayed bins
void AddShortcutsInfo(const char *cut, const char *desc)
void MoveAxis(TAxis *ax, Int_t sign)
friend class KVKeyHandler
Bool_t ExpandFunctionRange()
void DisableObject(TObject *obj)
void HandleInput(EEventType event, Int_t px, Int_t py)
Int_t X0
! variables for pan & scan
void DisableClass(const char *className)
Int_t NdisYbins
number of displayed bins on X & Y
Bool_t fHasDisabledClasses
void ResetDisabledObject()
TAxis * theYaxis
the axes of the histogram
void RunAutoExec()
Execute the list of TExecs in the current pad.
Int_t Ylast0
number of bins on y-axis, initial displayed bins
void SetEnabledShortcuts(Int_t value=1)
void DrawEventStatus(Int_t event, Int_t px, Int_t py, TObject *selected)
TGFrame * fKeyHandler
handler for keys
void ZoomSelected(TH2 *TheHisto)
void DynamicZoomTH1(Int_t Sign, Int_t px, Int_t py)
Zoom in or out of histogram with mouse wheel.
void SetVenerMode(Int_t value=1)
Double_t YbinPixel
size of bins in pixels
virtual Bool_t HandleKey(Int_t, Int_t py)
virtual Bool_t HandleKey(Event_t* /*event*/){return kTRUE;}
void DynamicZoom(Int_t Sign, Int_t px, Int_t py)
void ResetDisabledClass()
Int_t Y0
coordinates of initial click in pad pixels
Int_t Yl1
last modification to axis limits
Bool_t fHasDisabledObject
void ProjectionX(TH2 *hh)
TH2 * PermuteAxis(TH2 *hh)
TGraphErrors * MakeGraphFrom(TProfile *pf, Bool_t Error=kTRUE)
virtual void SetLineColor(Color_t lcolor)
virtual void SetMarkerColor(Color_t mcolor=1)
virtual void SetMarkerStyle(Style_t mstyle=1)
virtual Int_t FindBin(const char *label)
virtual void SetRangeUser(Double_t ufirst, Double_t ulast)
virtual void SetRange(Int_t first=0, Int_t last=0)
virtual void SetStatusText(const char *text=nullptr, Int_t partidx=0)
virtual void ShowEditor(Bool_t show=kTRUE)
void EnterLeave(TPad *prevSelPad, TObject *prevSelObj)
TCanvasImp * GetCanvasImp() const override
Int_t GetEventY() const override
virtual TPad * Pick(Int_t px, Int_t py, TObject *prevSelObj)
virtual void ProcessedEvent(Int_t event, Int_t x, Int_t y, TObject *selected)
Int_t GetEventX() const override
TVirtualPad * cd(Int_t subpadnumber=0) override
TVirtualPad * GetSelectedPad() const override
TContextMenu * fContextMenu
void FeedbackMode(Bool_t set)
Bool_t Contains(const char *name) const
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
void SetName(const char *name="") override
void Draw(Option_t *chopt="") override
void SetTitle(const char *title="") override
virtual Double_t GetBinCenter(Int_t bin) const
virtual Int_t GetNbinsX() const
TList * GetListOfFunctions() const
virtual Int_t GetMaximumBin() const
virtual Double_t GetBinContent(Int_t bin) const
TH1D * ProjectionY(const char *name="_py", Int_t firstxbin=0, Int_t lastxbin=-1, Option_t *option="") const
TProfile * ProfileX(const char *name="_pfx", Int_t firstybin=1, Int_t lastybin=-1, Option_t *option="") const
TProfile * ProfileY(const char *name="_pfy", Int_t firstxbin=1, Int_t lastxbin=-1, Option_t *option="") const
TH1D * ProjectionX(const char *name="_px", Int_t firstybin=0, Int_t lastybin=-1, Option_t *option="") const
void Clear(Option_t *option="") override
void AddLast(TObject *obj) override
TObject * Remove(const TObjLinkPtr_t &lnk)
const char * GetName() const override
const char * GetTitle() const override
virtual const char * GetName() const
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual TObject * Clone(const char *newname="") const
virtual const char * ClassName() const
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual char * GetObjectInfo(Int_t px, Int_t py) const
virtual void Delete(Option_t *option="")
virtual Bool_t InheritsFrom(const char *classname) const
virtual const char * GetTitle() const
virtual void Draw(Option_t *option="")
Double_t AbsPixeltoY(Int_t py) override
Double_t GetUymax() const override
void SetGrid(Int_t valuex=1, Int_t valuey=1) override
Double_t GetUxmax() const override
Bool_t GetGridx() const override
void SetLogz(Int_t value=1) override
const char * GetTitle() const override
Double_t GetUymin() const override
TList * GetListOfPrimitives() const override
Double_t AbsPixeltoX(Int_t px) override
void Modified(Bool_t flag=1) override
void SetLogy(Int_t value=1) override
Double_t GetUxmin() const override
Bool_t GetGridy() const override
Int_t YtoAbsPixel(Double_t y) const override
void SaveAs(const char *filename="", Option_t *option="") const override
TObject * FindObject(const char *name) const override
TVirtualPad * cd(Int_t subpadnumber=0) override
void SetLogx(Int_t value=1) override
const char * GetName() const override
Int_t XtoAbsPixel(Double_t x) const override
const char * Data() const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual const char * DirName(const char *pathname)
virtual Bool_t ChangeDirectory(const char *path)
virtual const char * WorkingDirectory()
Double_t Min(Double_t a, Double_t b)
Double_t Sign(Double_t a, Double_t b)
Double_t Max(Double_t a, Double_t b)