154 kTYPE_HIST, kTYPE_LEGO, kTYPE_LEGO1, kTYPE_LEGO2,
155 kTYPE_SURF, kTYPE_SURF1, kTYPE_SURF2, kTYPE_SURF3, kTYPE_SURF4, kTYPE_SURF5,
156 kCOORDS_CAR, kCOORDS_CYL, kCOORDS_POL, kCOORDS_PSR, kCOORDS_SPH,
157 kERRORS_NO, kERRORS_SIMPLE, kERRORS_EDGES,
158 kERRORS_REC, kERRORS_FILL, kERRORS_CONTOUR,
159 kHIST_TYPE, kCOORD_TYPE, kERROR_TYPE, kMARKER_ONOFF, kB_ONOFF, kBAR_ONOFF,
160 kADD_TYPE, kADD_NONE, kADD_SIMPLE, kADD_SMOOTH, kADD_FILL,
162 kDIM_SIMPLE, kDIM_COMPLEX,
163 kPERCENT_TYPE, kPER_0, kPER_10, kPER_20, kPER_30, kPER_40,
164 kBAR_H, kBAR_WIDTH, kBAR_OFFSET,
165 kSLIDER_MAX, kSLIDER_MIN,
167 kBINSLIDER, kBINSLIDER1, kBINOFFSET
358 gROOT->GetListOfCleanups()->Add(
this);
541 gROOT->GetListOfCleanups()->Remove(
this);
559 fAddB->
Connect(
"Toggled(Bool_t)",
"TH1Editor",
this,
"DoAddB(Bool_t)");
560 fAddBar->
Connect(
"Toggled(Bool_t)",
"TH1Editor",
this,
"DoAddBar(Bool_t)");
561 fTitle->
Connect(
"TextChanged(const char *)",
"TH1Editor",
this,
"DoTitle(const char *)");
565 fAddCombo->
Connect(
"Selected(Int_t)",
"TH1Editor",
this,
"DoHistChanges()");
566 fAddMarker->
Connect(
"Toggled(Bool_t)",
"TH1Editor",
this,
"DoAddMarker(Bool_t)");
567 fAddSimple->
Connect(
"Toggled(Bool_t)",
"TH1Editor",
this,
"DoAddSimple(Bool_t)");
583 fBinSlider->
Connect(
"PositionChanged(Int_t)",
"TH1Editor",
this,
"DoBinMoved(Int_t)");
589 fApply->
Connect(
"Clicked()",
"TH1Editor",
this,
"DoApply()");
601 fSlider->
Connect(
"PositionChanged()",
"TH1Editor",
this,
"DoSliderMoved()");
602 fSlider->
Connect(
"Pressed()",
"TH1Editor",
this,
"DoSliderPressed()");
603 fSlider->
Connect(
"Released()",
"TH1Editor",
this,
"DoSliderReleased()");
604 fSldMin->
Connect(
"ReturnPressed()",
"TH1Editor",
this,
"DoAxisRange()");
605 fSldMax->
Connect(
"ReturnPressed()",
"TH1Editor",
this,
"DoAxisRange()");
615 ((
TH1*)obj)->GetDimension()!=1 ||
616 ((
TH1*)obj)->GetEntries() == 0
658 if (str.
IsNull() || str==
"" ) {
842 Int_t nxbinmin =
fHist -> GetXaxis() -> GetFirst();
843 Int_t nxbinmax =
fHist -> GetXaxis() -> GetLast();
873 if (div[0]-1 <= 1) up = 2;
880 while ( div[i] != nx) i ++;
949 if (str.
Contains(
"POL")) str = dum +
"POL";
950 if (str.
Contains(
"SPH")) str = dum +
"SPH";
951 if (str.
Contains(
"PSR")) str = dum +
"PSR";
953 if ((str==
"HIST") || (str==
"") ||
1000 !(str==
"" || str==
"HIST" ||
1108 fAddMarker->
Connect(
"Toggled(Bool_t)",
"TH1Editor",
this,
"DoAddMarker(Bool_t)");
1143 fAddMarker->
Connect(
"Toggled(Bool_t)",
"TH1Editor",
this,
"DoAddMarker(Bool_t)");
1233 fAddCombo->
Connect(
"Selected(Int_t)",
"TH1Editor",
this,
"DoHistChanges()");
1345 fAddCombo->
Connect(
"Selected(Int_t)",
"TH1Editor",
this,
"DoHistChanges()");
1465 case (kPER_0) :{ str +=
"BAR";
break;}
1466 case (kPER_10):{ str +=
"BAR1";
break;}
1467 case (kPER_20):{ str +=
"BAR2";
break;}
1468 case (kPER_30):{ str +=
"BAR3";
break;}
1469 case (kPER_40):{ str +=
"BAR4";
break;}
1512 static Int_t px1,py1,px2,py2;
1541 static Float_t p1[3],
p2[3],
p3[3], p4[3], p5[3], p6[3], p7[3], p8[3];
1548 p1[0] = p4[0] = p5[0] = p8[0] =
1550 p2[0] = p3[0] = p6[0] = p7[0] =
1552 p1[1] = p2[1] = p3[1] = p4[1] = rmin[1];
1553 p5[1] = p6[1] = p7[1] = p8[1] = rmax[1];
1554 p1[2] = p2[2] = p5[2] = p6[2] = rmin[2];
1555 p3[2] = p4[2] = p7[2] = p8[2] = rmax[2];
1562 for (
Int_t i = 0; i<3; i++){
1787 if (maxx==1) maxx=2;
1828 "TH1 Editor",
"It is not possible to rebin the histogram",
1845 if (number==5)
return;
1847 Int_t binNumber = 0;
1850 if (number > 5) fact = number - 4;
1851 else fact = number - 6;
1853 if (!player)
return;
1866 if (fact > 0) binNumber = fact*
nx;
1867 if (fact < 0) binNumber = (
Int_t) ((-1)*nx/fact+0.5);
1868 if (binNumber < 1) binNumber = 1;
1869 if (binNumber > 10000) binNumber= 10000;
1873 min-oldOffset+newOffset,
1874 max-oldOffset+newOffset);
1886 xaxis->
FindBin(rmax-binWidth/2));
1911 Int_t binNumber = 0;
1912 if (number >= 5) fact = number - 4;
1913 else fact = number - 6;
1914 if (fact > 0) binNumber = fact*
n;
1915 if (fact < 0) binNumber = (
Int_t) ((-1)*n/fact+0.5);
1916 if (binNumber < 1) binNumber = 1;
1917 if (binNumber > 10000) binNumber= 10000;
1936 for (
Int_t i = 2; i <= div[0]; i++) {
1962 if (!player)
return;
1975 Int_t binNumber = (
Int_t) ((max-min)/(rmax - rmin)*num + 0.5);
1976 if (binNumber < 1) binNumber = 1;
1977 if (binNumber > 10000) binNumber = 10000;
1981 min-oldOffset+offset,
1982 max-oldOffset+offset);
1994 xaxis->
FindBin(rmax-binWidth/2));
2027 Double_t offset = 1.*num/100*binWidth;
2031 if (!player)
return;
2043 min+offset-oldOffset,
2044 max+offset-oldOffset);
2052 xaxis->
FindBin(rmax+offset-oldOffset-binWidth/2));
2073 Double_t offset = 1.*num/100*binWidth;
2078 if (!player)
return;
2090 min+offset-oldOffset,
2091 max+offset-oldOffset);
2099 xaxis->
FindBin(rmax+offset-oldOffset-binWidth/2));
2122 if (!player)
return;
2134 min+offset-oldOffset,
2135 max+offset-oldOffset);
2143 xaxis->
FindBin(rmax+offset-oldOffset-binWidth/2));
2157 "TH1 Editor",
"Replace origin histogram with rebinned one?",
2167 if (div[0]-1 <= 1) up = 2;
2217 case (-1) : {s =
"LEGO";
break;}
2218 case (kTYPE_LEGO ): {s =
"LEGO";
break;}
2219 case (kTYPE_LEGO1): {s =
"LEGO1";
break;}
2220 case (kTYPE_LEGO2): {s =
"LEGO2";
break;}
2221 case (kTYPE_SURF ): {s =
"SURF";
break;}
2222 case (kTYPE_SURF1): {s =
"SURF1";
break;}
2223 case (kTYPE_SURF2): {s =
"SURF2";
break;}
2224 case (kTYPE_SURF3): {s =
"SURF3";
break;}
2225 case (kTYPE_SURF4): {s =
"SURF4";
break;}
2226 case (kTYPE_SURF5): {s =
"SURF5";
break;}
2241 case (-1) : {s =
"POL";
break;}
2242 case (kCOORDS_CAR): {s =
"";
break;}
2243 case (kCOORDS_POL): {s =
"POL";
break;}
2244 case (kCOORDS_CYL): {s =
"CYL";
break;}
2245 case (kCOORDS_SPH): {s =
"SPH";
break;}
2246 case (kCOORDS_PSR): {s =
"PSR";
break;}
2261 case (-1) : {s =
"";
break;}
2262 case (kERRORS_NO) : {s =
"";
break;}
2263 case (kERRORS_SIMPLE) : {s =
"E";
break;}
2264 case (kERRORS_EDGES) : {s =
"E1";
break;}
2265 case (kERRORS_REC) : {s =
"E2";
break;}
2266 case (kERRORS_FILL) : {s =
"E3";
break;}
2267 case (kERRORS_CONTOUR): {s =
"E4";
break;}
2281 case (-1) : {s =
"" ;
break;}
2282 case (kADD_NONE) : {s =
"" ;
break;}
2283 case (kADD_SMOOTH): {s =
"C";
break;}
2284 case (kADD_SIMPLE): {s =
"L";
break;}
2285 case (kADD_FILL) : {s =
"LF2";
break;}
2293 case (kPER_0) : { s +=
"BAR" ;
break;}
2294 case (kPER_10): { s +=
"BAR1";
break;}
2295 case (kPER_20): { s +=
"BAR2";
break;}
2296 case (kPER_30): { s +=
"BAR3";
break;}
2297 case (kPER_40): { s +=
"BAR4";
break;}
2331 c->
AddEntry(
"Cartesian", kCOORDS_CAR);
2332 c->
AddEntry(
"Cylindric", kCOORDS_CYL);
2334 c->
AddEntry(
"Rapidity", kCOORDS_PSR);
2335 c->
AddEntry(
"Spheric", kCOORDS_SPH);
2349 c->
AddEntry(
"No Errors", kERRORS_NO);
2350 c->
AddEntry(
"Simple", kERRORS_SIMPLE);
2351 c->
AddEntry(
"Edges", kERRORS_EDGES);
2352 c->
AddEntry(
"Rectangles",kERRORS_REC);
2354 c->
AddEntry(
"Contour", kERRORS_CONTOUR);
2367 c->
AddEntry(
"Simple Line", kADD_SIMPLE);
2368 c->
AddEntry(
"Smooth Line", kADD_SMOOTH);
2369 c->
AddEntry(
"Fill Area",kADD_FILL);
2448 }
else if (n == 1) {
2457 for (
Int_t i=2; i <= n/2; i++) {
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Int_t GetFirst() const
Return first bin on the axis i.e.
virtual const char * GetTitle() const
Returns title of object.
virtual void SetLineWidth(Width_t lwidth)
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
TGNumberEntry * fBarOffset
TString GetHistTypeLabel()
Returns the selected histogram type (HIST, LEGO1-2, SURF1-5).
virtual void SetBarOffset(Float_t offset=0.25)
void FeedbackMode(Bool_t set)
Turn rubberband feedback mode on or off.
virtual Int_t GetNfill() const
TGCompositeFrame * fBinCont
virtual void Resize(UInt_t w, UInt_t h)
Resize the listbox widget.
static Vc_ALWAYS_INLINE int_v min(const int_v &x, const int_v &y)
virtual void ConnectSignals2Slots()
Connect signals to slots.
virtual void DoPercent()
Slot connected to the bar percentage settings.
static double p3(double t, double a, double b, double c, double d)
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void DoHistComplex()
Slot connected to the 3D radio button.
virtual void SetDirectory(TDirectory *dir)
By default when an histogram is created, it is added to the list of histogram objects in the current ...
virtual void SetRange(Int_t min, Int_t max)
virtual Double_t * GetRmax()=0
static TGComboBox * BuildHistCoordsComboBox(TGFrame *parent, Int_t id)
Create coordinate system type combo box.
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
static TGComboBox * BuildHistAddComboBox(TGFrame *parent, Int_t id)
Create Line/Bar combo box.
virtual void SetBins(Int_t nx, Double_t xmin, Double_t xmax)
Redefine x axis parameters.
TGCheckButton * fAddMarker
virtual void DoBinOffset()
Slot connected to the OffSetNumberEntry which is related to the OffSetSlider changes the origin of th...
virtual void DoCancel()
Slot connected to the Cancel button of the Binning tab.
virtual void SetIntNumber(Long_t val)
Set the numeric value (integer representation).
virtual void SetNumber(Double_t val)
void ToUpper()
Change string to upper case.
TGNumberEntry * fBarWidth
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
virtual void TakeAction()
Execute action for object obj fNfill times.
virtual void ShowFrame(TGFrame *f)
Show sub frame.
virtual TVirtualPad * GetPad() const
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width.
virtual void DoAddBar(Bool_t)
Slot connected to the bar Add check box.
virtual void DoBarOffset()
Slot connected to the Bar Offset of the Bar Charts.
TH1 * GetHistogram() const
virtual void SetRange(Float_t min, Float_t max)
TString GetHistAddLabel()
Return the selected shape of the histogram (C, L, LF2).
TGComboBox * fPercentCombo
virtual Double_t GetEntries() const
return the current number of entries
TGNumberEntryField * fOffsetNumberEntry
TString & Insert(Ssiz_t pos, const char *s)
void ChangeErrorCombo(Int_t i)
Change the error combo box entry.
virtual void Layout()
Layout the elements of the composite frame.
TGCheckButton * fDelaydraw
virtual void PaintLine3D(Float_t *p1, Float_t *p2)=0
virtual void DoBinPressed()
Slot connected to the rebin slider in case of a not ntuple histogram.
virtual TVirtualPad * cd(Int_t subpadnumber=0)=0
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
TObject * Clone(const char *newname=0) const
Make a complete copy of the underlying object.
virtual void SetBarWidth(Float_t width=0.5)
TGNumberEntryField * fSldMin
const char * Data() const
virtual void SetRangeUser(Double_t ufirst, Double_t ulast)
Set the viewing range for the axis from ufirst to ulast (in user coordinates).
virtual void PaintBox3D(Float_t *p1, Float_t *p2, Float_t *p3, Float_t *p4)
Paint a 3D box.
TGNumberEntryField * GetNumberEntry() const
void CreateBinTab()
Create binning tab.
virtual void DoBinMoved(Int_t number)
Slot connected to the rebin slider in case of a not ntuple histogram (does the Rebinning of the histo...
virtual void DoSliderMoved()
Slot connected to the x-Slider for redrawing of the histogram according to the new Slider range...
static double p2(double t, double a, double b, double c)
virtual void Update()
Update the current pad when an attribute is changed via GUI.
virtual void Select(Int_t id, Bool_t emit=kTRUE)
Make the selected item visible in the combo box window and emit signals according to the second param...
TGCompositeFrame(const TGCompositeFrame &)
virtual void DoApply()
Slot connected to the Apply button of the Binning tab.
virtual TGVerticalFrame * CreateEditorTabSubFrame(const char *name)
Create a vertical frame to be used by 'owner' in extra tab 'name'.
virtual void SetModel(TObject *obj)
Pick up current values of histogram attributes.
virtual void DoBinMoved1()
Slot connected to the rebin slider in case of an ntuple histogram.
virtual void DoBarWidth()
Slot connected to the Bar Width of the Bar Charts.
static TVirtualTreePlayer * GetCurrentPlayer()
Static function: return the current player (if any)
TGCheckButton * fAddSimple
virtual TView * GetView() const =0
virtual Double_t GetUymax() const =0
virtual Int_t GetSelected() const
virtual void SetLimits(ELimit limits=kNELNoLimits, Double_t min=0, Double_t max=1)
Set the numerical limits.
virtual void RecursiveRemove(TObject *obj)
If the contained histogram obj is deleted we must set its pointer to zero.
TSelector * GetSelector() const
virtual Double_t GetUymin() const =0
virtual void DoAddSimple(Bool_t on)
Slot connected to fAddSimple check box for drawing a simple histogram without errors (== HIST draw op...
virtual void SetLineColor(Color_t lcolor)
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...
virtual void SetRange(Int_t first=0, Int_t last=0)
Set the viewing range for the axis from bin first to last.
TGHButtonGroup * fDimGroup
virtual Int_t GetPosition() const
TString GetHistCoordsLabel()
Return the selected coordinate system of the histogram (POL,CYL,SPH,PSR).
virtual void DoSliderPressed()
Slot connected to the x-axis Range slider for initialising the values of the slider movement...
Class to manage histogram axis.
virtual Int_t XtoAbsPixel(Double_t x) const =0
leg AddEntry(h1,"Histogram filled with random numbers","f")
virtual Double_t GetBinUpEdge(Int_t bin) const
Return up edge of bin.
TGNumberEntryField * fBinNumberEntry1
Int_t * Dividers(Int_t n)
Return an array of dividers of n (without the trivial divider n).
virtual Bool_t AcceptModel(TObject *model)
Check if object is able to configure with this editor.
virtual TH1 * Rebin(Int_t ngroup=2, const char *newname="", const Double_t *xbins=0)
Rebin this histogram.
virtual void Refresh(TObject *model)
Refresh the GUI info about the object attributes.
virtual TGListBox * GetListBox() const
virtual void SetPosition(Int_t pos)
virtual void ChangeOptions(UInt_t options)
Change composite frame options. Options is an OR of the EFrameTypes.
ClassImp(TH1Editor) enum ETH1Wid
virtual Double_t GetNumber() const
Get the numeric value (floating point representation).
static double p1(double t, double a, double b)
virtual Int_t GetMaxPosition() const
void Reset(Detail::TBranchProxy *x)
virtual void DoOffsetMoved(Int_t num)
Slot connected to the OffSetSlider.
TGCompositeFrame * fBinCont1
virtual void DoBinLabel1()
Slot connected to the Bin number entry of the Rebinning tab.
virtual void DoBinReleased()
Slot connected to the rebin slider in case of a not ntuple histogram Updates some other widgets which...
virtual Double_t * GetRmin()=0
static TGComboBox * BuildHistTypeComboBox(TGFrame *parent, Int_t id)
Create histogram type combo box.
A specialized TSelector for TTree::Draw.
virtual void DoBinReleased1()
Slot connected to the BinNumber Slider in case of a ntuple histogram (does the Rebinning of the histo...
virtual void DoHistView()
Slot connected to the 'Plot' button group.
virtual void DoAxisRange()
Slot connected to the number entry fields containing the Max/Min value of the x-axis.
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
virtual void SetScale(Int_t scale)
virtual Int_t FindBin(Double_t x)
Find bin number corresponding to abscissa x.
virtual Int_t YtoAbsPixel(Double_t y) const =0
TString & Remove(Ssiz_t pos)
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
virtual void DoBinLabel()
Slot connected to the Bin number entry of the Rebinning tab.
Bool_t Contains(Int_t x, Int_t y) const
TGNumberEntryField * fSldMax
virtual void Resize(UInt_t w, UInt_t h)
Resize the frame.
virtual void SetDrawOption(Option_t *option="")
Set drawing option for object.
virtual void AddEntry(TGString *s, Int_t id)
TGCheckButton * fMakeHBar
TString GetHistErrorLabel()
Return the selected error type (E,E1-5).
static TGComboBox * BuildHistErrorComboBox(TGFrame *parent, Int_t id)
Create error type combo box.
virtual void DoHBar(Bool_t on)
Slot connected to the Horizontal Bar check button.
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)
virtual Bool_t Add(TF1 *h1, Double_t c1=1, Option_t *option="")
Performs the operation: this = this + c1*f1 if errors are defined (see TH1::Sumw2), errors are also recalculated.
Int_t GetLast() const
Return last bin on the axis i.e.
virtual UInt_t SetCanExtend(UInt_t extendBitMask)
make the histogram axes extendable / not extendable according to the bit mask returns the previous bi...
Mother of all ROOT objects.
TGHSlider * fBinOffsetSld
virtual void DoTitle(const char *text)
Slot connected to the histogram title setting.
virtual void SetNumber(Double_t val)
Set the numeric value (floating point representation).
virtual UInt_t GetDefaultHeight() const
virtual Option_t * GetDrawOption() const
Get draw options of the selected object.
virtual void DoHistChanges()
Slot connected to the histogram type, the coordinate type, the error type and the Add combo box...
double f2(const double *x)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual void SetPosition(Float_t min, Float_t max)
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
virtual Float_t GetMinPosition() const
virtual void DoAddB(Bool_t)
Slot connected to the bar Add check box.
TGComboBox * fCoordsCombo
virtual Double_t GetNumber() const
virtual Float_t GetMaxPosition() const
virtual void RemoveEntry(Int_t id=-1)
Remove entry. If id == -1, the currently selected entry is removed.
virtual void SetTitle(const char *title)
Change (i.e.
static TGComboBox * BuildPercentComboBox(TGFrame *parent, Int_t id)
Create Percentage combo box for bar option.
virtual void SetText(const char *text, Bool_t emit=kTRUE)
Sets text entry to text, clears the selection and moves the cursor to the end of the line...
virtual void DoAddMarker(Bool_t on)
Slot connected to the show markers check box.
Implement some of the functionality of the class TTree requiring access to extra libraries (Histogram...
TH1Editor(const TGWindow *p=0, Int_t width=140, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Constructor of histogram attribute GUI.
virtual void DoSliderReleased()
Slot connected to the x-axis Range slider for finalizing the values of the slider movement...
TGDoubleHSlider * fSlider
virtual void RemoveEntries(Int_t from_ID, Int_t to_ID)
virtual Float_t GetBarWidth() const
virtual void MakeTitle(const char *title)
Create attribute frame title.
virtual void DoHistSimple()
Slot connected to the 2D radio button.
virtual void DoOffsetReleased()
Slot connected to the OffSetSlider.
Ssiz_t First(char c) const
Find first occurrence of a character c.
virtual Float_t GetBarOffset() const
virtual void DoOffsetPressed()
Slot connected to the OffSetSlider that saves the OldBinOffset (nessesary for delay draw mode)...
virtual ~TH1Editor()
Destructor of TH1 editor.
TGNumberEntryField * fBinNumberEntry
virtual TCanvas * GetCanvas() const =0
virtual void SetEnabled(Int_t tabIndex, Bool_t on=kTRUE)
Enable or disable tab.