162 #include "RConfigure.h"
171 using std::ostringstream;
172 using std::make_pair;
201 it != funcList.end(); ++it ) {
211 for (
fPrevFitIter it = look.first; it != look.second; ++it ) {
235 if ( dynamic_cast<TF3*>(f) != 0 ) {
236 TF3* fnew = (
TF3*)f->IsA()->New();
243 }
else if ( dynamic_cast<TF2*>(f) != 0 ) {
244 TF2* fnew = (
TF2*)f->IsA()->New();
253 TF1* fnew = (
TF1*)f->IsA()->New();
273 if (npar != (
int) pars.size() ) pars.resize(npar);
274 for (
Int_t i = 0; i < npar; ++i )
290 if (npar > (
int) pars.size() ) pars.resize(npar);
291 for (
Int_t i = 0; i < npar; ++i )
301 template<
class FitObject>
305 if (100 == special || 400 == special) {
310 }
else if ( 110 == special || 410 == special ) {
326 if (!textEntry)
return;
330 variablesStr = nameStr(nameStr.First(
'(') + 2, nameStr.First(
',') - nameStr.First(
'(') - 3);
332 cutsStr = nameStr( nameStr.First(
',') + 3, nameStr.First(
')') - nameStr.First(
',') - 4 );
349 gROOT->MakeDefCanvas();
356 fgFitDialog->Show(pad, obj);
427 int parts[] = { 20, 20, 20, 20, 20 };
437 gROOT->GetListOfCleanups()->Add(
this);
461 std::vector<TObject*>
v;
496 if (cw + size.
fWidth < dw) {
497 Int_t gedx = 0, gedy = 0;
499 gedy = (cy > 20) ? cy-20 : 0;
523 this,
"SetFitObject(TVirtualPad *, TObject *, Int_t)");
524 gROOT->GetListOfCleanups()->Remove(
this);
576 bgr -> SetRadioButtonExclusive();
582 fNone -> SetToolTipText(
"No operation defined");
584 fAdd -> SetToolTipText(
"Addition");
586 fNormAdd -> SetToolTipText(
"NormAddition");
588 fConv -> SetToolTipText(
"Convolution");
638 gClient->GetColorByName(
"#336666", color);
928 #ifdef R__HAS_MATHMORE
946 "minimizers to be compiled");
985 TGLabel *errlabel =
new TGLabel(hsv1,
"Error definition (default = 1): ");
988 TGLabel *tollabel =
new TGLabel(hsv1,
"Max tolerance (precision): ");
991 TGLabel *itrlabel =
new TGLabel(hsv1,
"Max number of iterations: ");
1051 fDataSet ->
Connect(
"Selected(Int_t)",
"TFitEditor",
this,
"DoDataSet(Int_t)");
1053 fTypeFit ->
Connect(
"Selected(Int_t)",
"TFitEditor",
this,
"FillFunctionList(Int_t)");
1055 fFuncList ->
Connect(
"Selected(Int_t)",
"TFitEditor",
this,
"DoFunction(Int_t)");
1059 fSetParam ->
Connect(
"Clicked()",
"TFitEditor",
this,
"DoSetParameters()");
1061 fAdd ->
Connect(
"Toggled(Bool_t)",
"TFitEditor",
this,
"DoAddition(Bool_t)");
1066 fUseRange ->
Connect(
"Toggled(Bool_t)",
"TFitEditor",
this,
"DoUseFuncRange()");
1086 fSliderX ->
Connect(
"PositionChanged()",
"TFitEditor",
this,
"DoSliderXMoved()");
1087 fSliderXMax ->
Connect(
"ValueSet(Long_t)",
"TFitEditor",
this,
"DoNumericSliderXChanged()");
1088 fSliderXMin ->
Connect(
"ValueSet(Long_t)",
"TFitEditor",
this,
"DoNumericSliderXChanged()");
1092 fSliderY ->
Connect(
"PositionChanged()",
"TFitEditor",
this,
"DoSliderYMoved()");
1093 fSliderYMax ->
Connect(
"ValueSet(Long_t)",
"TFitEditor",
this,
"DoNumericSliderYChanged()");
1094 fSliderYMin ->
Connect(
"ValueSet(Long_t)",
"TFitEditor",
this,
"DoNumericSliderYChanged()");
1097 fSliderZ ->
Connect(
"PositionChanged()",
"TFitEditor",
this,
"DoSliderZMoved()");
1103 fLibMinuit ->
Connect(
"Toggled(Bool_t)",
"TFitEditor",
this,
"DoLibrary(Bool_t)");
1105 fLibFumili ->
Connect(
"Toggled(Bool_t)",
"TFitEditor",
this,
"DoLibrary(Bool_t)");
1106 fLibGSL ->
Connect(
"Toggled(Bool_t)",
"TFitEditor",
this,
"DoLibrary(Bool_t)");
1116 fOptQuiet ->
Connect(
"Toggled(Bool_t)",
"TFitEditor",
this,
"DoPrintOpt(Bool_t)");
1203 "SetFitObject(TVirtualPad *, TObject *, Int_t)");
1204 TQObject::Connect(
"TCanvas",
"Closed()",
"TFitEditor",
this,
"DoNoSelection()");
1213 fgFitDialog->UnmapWindow();
1221 gROOT->GetListOfCleanups()->Remove(
this);
1229 if (!
gROOT->GetListOfCleanups()->FindObject(
this))
1230 gROOT->GetListOfCleanups()->Add(
this);
1232 if (!fgFitDialog->IsMapped()) {
1233 fgFitDialog->MapWindow();
1310 Error(
"UpdateGUI",
"No hist is present - this should not happen, please report."
1311 "The FitPanel might be in an inconsistent state");
1330 if (ixmin > 1 || ixmax < ixrange) {
1349 fSliderX->
Connect(
"PositionChanged()",
"TFitEditor",
this,
"DoSliderXMoved()");
1350 fSliderXMax->
Connect(
"ValueSet(Long_t)",
"TFitEditor",
this,
"DoNumericSliderXChanged()");
1351 fSliderXMin->
Connect(
"ValueSet(Long_t)",
"TFitEditor",
this,
"DoNumericSliderXChanged()");
1364 Int_t iymin = 0, iymax = 0, iyrange = 0;
1382 if (iymin > 1 || iymax < iyrange) {
1401 fSliderY->
Connect(
"PositionChanged()",
"TFitEditor",
this,
"DoSliderYMoved()");
1402 fSliderYMax->
Connect(
"ValueSet(Long_t)",
"TFitEditor",
this,
"DoNumericSliderYChanged()");
1403 fSliderYMin->
Connect(
"ValueSet(Long_t)",
"TFitEditor",
this,
"DoNumericSliderYChanged()");
1413 Int_t izmin = 0, izmax = 0, izrange = 0;
1431 if (izmin > 1 || izmax < izrange) {
1440 fSliderZ->
Connect(
"PositionChanged()",
"TFitEditor",
this,
"DoSliderZMoved()");
1478 if ( tmpStr.
Length() == 0 )
1550 if (
gROOT->GetListOfCanvases()->IsEmpty()) {
1587 "SetFitObject(TVirtualPad *, TObject *, Int_t)");
1672 if ( strncmp(f->
GetName(),
"PrevFit", 7) != 0 ) {
1679 if ( f->
GetNdim() == fDim || fDim == 0) {
1688 else if( fDim == 1 ) {
1691 }
else if( fDim == 2 ) {
1703 for (
fPrevFitIter it = look.first; it != look.second; ++it ) {
1714 else if ( fDim == 2 )
1785 TIter canvasIter(canvases);
1790 if (
TPad* can = dynamic_cast<TPad*>(obj))
1793 else if ( dynamic_cast<TH1*>(obj)
1795 || dynamic_cast<TGraph2D*>(obj)
1797 || dynamic_cast<THStack*>(obj)
1799 bool insertNew =
true;
1801 for ( std::vector<TObject*>::iterator i = objects.begin(); i != objects.end(); ++i )
1802 if ( (*i) ==
obj ) {
1808 if ( insertNew ) objects.push_back(obj);
1828 std::vector<TObject*> objects;
1835 if ( dynamic_cast<TH1*>(obj) ||
1837 dynamic_cast<TTree*>(obj) ) {
1838 objects.push_back(obj);
1851 for ( std::vector<TObject*>::iterator i = objects.begin(); i != objects.end(); ++i ) {
1856 if ( selEntryStr && name == selEntryStr )
1919 tmpTF1->
GetRange(xmin, ymin, zmin, xmax, ymax, zmax);
1980 "Error...",
"2) Verify the entered function string!",
2021 Error(
"DoFit",
"This should have never happend, the fitfunc pointer is NULL! - Please Report" );
2047 FitObject(gr, fitFunc, fitOpts, mopts, strDrawOpts, drange);
2054 FitObject(mg, fitFunc, fitOpts, mopts, strDrawOpts, drange);
2062 FitObject(g2d, fitFunc, fitOpts, mopts, strDrawOpts, drange);
2085 if ( !tree )
return;
2090 tree->
Draw(variables,cuts,
"goff candle");
2094 Error(
"DoFit",
"Player reference is NULL");
2100 Error(
"DoFit",
"Selector reference is NULL");
2107 Error(
"DoFit",
"NDIM == 0");
2111 std::vector<double *> vlist;
2112 for (
unsigned int i = 0; i < ndim; ++i) {
2113 double *
v = selector->
GetVal(i);
2114 if (v != 0) vlist.push_back(v);
2116 std::cerr <<
"pointer for variable " << i <<
" is zero" << std::endl;
2118 if (vlist.size() != ndim) {
2119 Error(
"DoFit",
"Vector is not complete");
2126 Error(
"DoFit",
"NROWS == 0");
2132 for (
int i = 0; i <
std::min(
int(fitdata->
Size()),10); ++i) {
2134 for (
unsigned int j = 0; j < ndim; ++j) {
2135 printf(
" x_%d [%d] = %f \n", j, i,*(fitdata->
Coords(i)+j) );
2157 fitFunc->
Draw(
"same");
2167 name <<
"PrevFit-" <<
fPrevFit.size() + 1;
2168 if ( strcmp(tmpTF1->
GetName(),
"PrevFitTMP") != 0 )
2169 name <<
"-" << tmpTF1->
GetName();
2170 tmpTF1->
SetName(name.str().c_str());
2174 float xmin = 0.f,
xmax = 0.f,
ymin = 0.f,
ymax = 0.f, zmin = 0.f, zmax = 0.f;
2200 if (save)
gPad = save;
2224 TF1 form(
"tmpCheck", fname);
2226 rvalue = form.
IsValid() ? 0 : -1;
2227 }
else if (
fDim == 2 ) {
2228 TF2 form(
"tmpCheck", fname);
2230 rvalue = form.
IsValid() ? 0 : -1;
2231 }
else if (
fDim == 3 ) {
2232 TF3 form(
"tmpCheck", fname);
2234 rvalue = form.
IsValid() ? 0 : -1;
2281 if (on) std::cout <<
"DoNormAddition" << std::endl;
2304 if (on) std::cout <<
"DoConvolution" << std::endl;
2319 if (!textEntry)
return;
2326 if ( className ==
"TTree" ) {
2334 objSelected =
gROOT->FindObject(lookStr);
2338 objSelected =
gROOT->FindObject(name);
2349 char variables[256] = {0};
char cuts[256] = {0};
2350 strlcpy(variables,
"Sin input!", 256);
2352 if ( strcmp ( variables,
"" ) == 0 ) {
2364 while (
TObject* canvas = static_cast<TObject*>(padIter() ) ) {
2365 if ( dynamic_cast<TPad*>(canvas) )
2366 stPad.push(dynamic_cast<TPad*>(canvas));
2369 while ( !stPad.empty() && !found ) {
2370 currentPad = stPad.front();
2373 while (
TObject* elem = static_cast<TObject*>(elemIter() ) ) {
2374 if ( elem == objSelected ) {
2377 }
else if ( dynamic_cast<TPad*>(elem) )
2378 stPad.push( dynamic_cast<TPad*>(elem) );
2409 bool editable =
false;
2525 if ( fitFunc )
delete fitFunc;
2540 "Error...",
"3) Verify the entered function string!",
2710 if (!fitFunc) {
Error(
"DoSetParameters",
"NUll function");
return; }
2751 if ( fParentPad ) fParentPad->Connect(
"RangeAxisChanged()",
"TFitEditor",
this,
"UpdateGUI()");
2777 static Int_t px1old, py1old, px2old, py2old;
2789 Int_t px1,py1,px2,py2;
2809 ymin =
gPad->GetUymin();
2810 ymax =
gPad->GetUymax();
2813 px1 =
gPad->XtoAbsPixel(xleft);
2814 py1 =
gPad->YtoAbsPixel(ymin);
2815 px2 =
gPad->XtoAbsPixel(xright);
2816 py2 =
gPad->YtoAbsPixel(ymax);
2818 if (
gPad->GetCanvas())
gPad->GetCanvas()->FeedbackMode(
kTRUE);
2819 gPad->SetLineWidth(1);
2820 gPad->SetLineColor(2);
2830 if(save)
gPad = save;
2903 "Info",
"Dialog of user method is not implemented yet",
2955 for (
int i = 0; i < variables.
Length() &&
fDim <= 2; ++i )
2956 if (
':' == variables[i] )
fDim += 1;
2967 fDim = ((
TH1*)obj)->GetDimension();
3021 bool isTree =
false;
3028 isTree = strcmp(obj->
ClassName(),
"TTree") == 0;
3030 name =
"No object selected";
3037 if ( selectedEntry ) {
3040 selectedName = selectedName(0, selectedName.
First(
' '));
3041 if ( name.
CompareTo(selectedName) == 0 ) {
3054 compareName = compareName(0, compareName.
First(
' '));
3055 if ( name.
CompareTo(compareName) == 0 ) {
3082 while ((obj =
next())) {
3256 while ((obj2 =
next())) {
3265 if ( strcmp( func->
GetName(), it->second->GetName() ) == 0 )
3267 if ( strcmp( func->
GetName(),
"PrevFitTMP" ) == 0 )
3320 (tmpStr.Contains(
"pol") || tmpStr.Contains(
"++")) )
3324 for (
Int_t i = 0; i < npar; ++i )
3456 TList *listOfFunctions = 0;
3461 listOfFunctions = ((
TH1 *)
fFitObject)->GetListOfFunctions();
3482 return listOfFunctions;
3501 const unsigned int nfuncs = 16;
3502 const char* fnames[nfuncs] = {
"gaus" ,
"gausn",
"expo",
"landau",
3503 "landaun",
"pol0",
"pol1",
"pol2",
3504 "pol3",
"pol4",
"pol5",
"pol6",
3505 "pol7",
"pol8",
"pol9",
"user"
3509 TIter functionsIter(
gROOT->GetListOfFunctions());
3511 while( ( obj = (
TObject*) functionsIter() ) ) {
3513 if (
TF1*
func = dynamic_cast<TF1*>(obj) ) {
3514 bool addFunction =
true;
3516 for (
unsigned int i = 0; i < nfuncs; ++i ) {
3517 if ( strcmp(
func->GetName(), fnames[i] ) == 0 ) {
3518 addFunction =
false;
3543 std::pair<fPrevFitIter, fPrevFitIter> look =
fPrevFit.equal_range(obj);
3544 for (
fPrevFitIter it = look.first; it != look.second; ++it ) {
3545 retList->
Add(it->second);
3566 "Error...",
"1) Verify the entered function string!",
3573 fitFunc = (
TF1*)tmpF1->IsA()->New();
3574 tmpF1->
Copy(*fitFunc);
3597 drange.
GetRange(xmin, xmax, ymin, ymax, zmin, zmax);
3614 if (
fConv -> IsOn())
3623 else if (
fDim == 2 ) {
3626 else if (
fDim == 3 ) {
3635 if ( tmpF1 != 0 && fitFunc != 0 &&
virtual void SetFunction(const char *function)
Set the function to be used in performed fit.
virtual void DoFunction(Int_t sel)
Slot connected to predefined fit function settings.
virtual void HideFrame(TGFrame *f)
Hide sub frame.
TGCheckButton * fEnableRobust
Int_t GetFirst() const
Return first bin on the axis i.e.
virtual Int_t GetNumberOfEntries() const
virtual void SetFitObject(TVirtualPad *pad, TObject *obj, Int_t event)
Slot called when the user clicks on an object inside a canvas.
virtual void DoSetParameters()
Open set parameters dialog.
std::multimap< TObject *, TF1 * > fPrevFit
TGLayoutHints * fLayoutAdd
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
TGDoubleHSlider * fSliderX
TGTextButton * fDrawAdvanced
virtual void DoSliderZMoved()
Slot connected to range settings on z-axis.
virtual Double_t GetUxmin() const =0
virtual void DoNoChi2()
Slot connected to 'no chi2' option settings.
virtual void SetParameters(const Double_t *params)
virtual void Selected(TVirtualPad *pad, TObject *obj, Int_t event)
Emit Selected() signal.
virtual void Resize(UInt_t w, UInt_t h)
Resize the listbox widget.
TGCheckButton * fUseRange
void InitParameters(TF1 *func, FitObject *fitobj)
Parameter initialization for the function.
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
static Vc_ALWAYS_INLINE int_v min(const int_v &x, const int_v &y)
virtual Double_t * GetVal(Int_t i) const
Return the last values corresponding to the i-th component of the formula being processed (where the ...
virtual void SetCursor(ECursor cursor)
Set cursor.
TGCheckButton * fNoDrawing
TGComboBox * BuildMethodList(TGFrame *parent, Int_t id)
Create method list in a combo box.
virtual void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0)
Move and/or resize the frame.
TGLayoutHints * fLayoutConv
The Histogram stack class.
void SetTolerance(double tol)
set the tolerance
void SetMaxIterations(unsigned int maxiter)
set maximum iterations (one iteration can have many function calls)
virtual void SetAlignment(ETextJustification mode=kTextLeft)
Sets the alignment of the text entry.
virtual void ReturnPressed()
Return was pressed.
TGNumberEntryField * fIterations
void SetMinimizerType(const char *type)
set minimizer type
TGRadioButton * fLibGenetics
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void DoMaxIterations()
Set the maximum number of iterations.
const TGWindow * GetParent() const
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
TF1 * HasFitFunction()
Look in the list of function for TF1.
virtual void DoAllWeights1()
Slot connected to 'set all weights to 1' setting.
void RetrieveOptions(Foption_t &, TString &, ROOT::Math::MinimizerOptions &, Int_t)
Retrieve the fitting options from all the widgets.
void variables(TString fin="TMVA.root", TString dirName="InputVariables_Id", TString title="TMVA Input Variables", Bool_t isRegression=kFALSE, Bool_t useTMVAStyle=kTRUE)
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
R__EXTERN void * gTQSender
virtual void SetTextColor(Pixel_t color, Bool_t global=kFALSE)
Changes text color.
void FillDataSetList()
Create a combo box with all the possible objects to be fitted.
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
virtual Long64_t GetSelectedRows() const
virtual Int_t GetDimension() const
void ProcessTreeInput(TObject *objSelected, Int_t selected, TString variables, TString cuts)
const TGWindow * GetRoot() const
Returns current root (i.e.
virtual void SetName(const char *name)
Change (i.e.
TGLayoutHints * fLayoutNone
TFitEditor(const TFitEditor &)
virtual void SetIntNumber(Long_t val)
Set the numeric value (integer representation).
virtual void DoAddition(Bool_t on)
Slot connected to addition of predefined functions.
A TMultiGraph is a collection of TGraph (or derived) objects.
virtual void SetRange(Double_t xmin, Double_t xmax)
Initialize the upper and lower bounds to draw the function.
virtual void SetNumber(Double_t val)
TGCheckButton * fNoStoreDrawing
TGNumberEntry * fSliderXMin
virtual void Save(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Double_t zmin, Double_t zmax)
Save values of function in array fSave.
TGRadioButton * fOptQuiet
TPluginHandler * FindHandler(const char *base, const char *uri=0)
Returns the handler if there exists a handler for the specified URI.
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
TGCheckButton * fAllWeights1
std::multimap< TObject *, TF1 * >::iterator fPrevFitIter
TGNumberEntry * fSliderYMax
TGCompositeFrame * fGeneral
virtual void InsertEntry(TGString *s, Int_t id, Int_t afterID)
Class describing the unbinned data sets (just x coordinates values) of any dimensions.
virtual void ShowFrame(TGFrame *f)
Show sub frame.
virtual Int_t GetNumberOfEntries() const
virtual void DoLibrary(Bool_t on)
Set selected minimization library in use.
virtual void Draw(Option_t *option="")
Draw this function with its current attributes.
virtual void SetState(Bool_t enable=kTRUE)
Set the active state.
virtual void SetLimits(ELimit limits=TGNumberFormat::kNELNoLimits, Double_t min=0, Double_t max=1)
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
TGCheckButton * fImproveResults
TGCheckButton * fIntegral
UInt_t GetDisplayWidth() const
Get display width.
virtual void SetRange(Float_t min, Float_t max)
virtual void Hide()
Hide the fit panel and set it to non-active state.
void SetErrorDef(double err)
set error def
virtual TGLBEntry * GetSelectedEntry() const
TVirtualTreePlayer * GetPlayer()
Load the TTreePlayer (if not already done).
void SetIconName(const char *name)
Set window icon name. This is typically done via the window manager.
TGRadioButton * fLibMinuit2
virtual void Layout()
Layout the elements of the composite frame.
virtual TVirtualPad * cd(Int_t subpadnumber=0)=0
virtual Long_t GetIntNumber() const
Get the numeric value (integer representation).
virtual const char * GetTitle() const
Returns title of object.
void ShowObjectName(TObject *obj)
Show object name on the top.
TGHorizontalFrame * fSliderXParent
virtual void DisconnectSlots()
Disconnect GUI signals from fit panel slots.
virtual void SetCanvas(TCanvas *c)
Connect to another canvas.
TGNumberEntry * fSliderYMin
TFitResultPtr UnBinFit(ROOT::Fit::UnBinData *data, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption)
fit an unbin data set (from tree or from histogram buffer) using a TF1 pointer and fit options...
const char * Data() const
void CreateGeneralTab()
Create 'General' tab.
virtual void SelectAll()
Selects all text (i.e.
TGTextButton * fResetButton
virtual void SetParent(TObject *p=0)
Class wrapping convolution of two functions.
Sequenceable collection abstract base class.
virtual void DoReset()
Reset all fit parameters.
void SetParameters(TFitEditor::FuncParams_t &pars, TF1 *func)
Restore the parameters from pars into the function.
virtual Bool_t IsValid() const
Return kTRUE if the function is valid.
Int_t GetWindowTopY()
Returns current top y position of window on screen.
TGNumberEntryField * GetNumberEntry() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
virtual TString GetExpFormula(Option_t *option="") const
virtual void ConnectSlots()
Connect GUI signals to fit panel slots.
virtual UInt_t GetOptions() const
virtual void SetText(TGString *newText)
Set new text in label.
void SetWMSizeHints(UInt_t wmin, UInt_t hmin, UInt_t wmax, UInt_t hmax, UInt_t winc, UInt_t hinc)
Give the window manager minimum and maximum size hints.
const char * GetText() const
const char * GetParName(Int_t ipar) const
Int_t CheckFunctionString(const char *str)
Check entered function string.
virtual void Copy(TObject &f1) const
Copy this F1 to a new F1.
TGCheckButton * fLinearFit
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 DoMinMethod(Int_t)
Set selected minimization method in use.
if(pyself &&pyself!=Py_None)
virtual void DoNoStoreDrawing()
Slot connected to 'no storing, no drawing' settings.
TString & Append(const char *cs)
virtual Option_t * GetOption() const
const Bool_t kIterForward
TGTextEntry * fEnteredFunc
void SetClassHints(const char *className, const char *resourceName)
Set the windows class and resource name.
TF1 * copyTF1(TF1 *f)
Copies f into a new TF1 to be stored in the fitpanel with it's own ownership.
std::vector< TF1 * >::iterator fSystemFuncIter
virtual void DoNumericSliderXChanged()
Sincronize the numeric sliders with the graphical one.
virtual void GetRange(Double_t *xmin, Double_t *xmax) const
Return range of a generic N-D function.
virtual void SetText(TGString *text, Int_t partidx=0)
Set text in partition partidx in status bar.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
virtual void RemoveAll()
Remove all entries from combo box.
TGTextButton * fFitButton
virtual void DoPrintOpt(Bool_t on)
Slot connected to print option settings.
virtual void DoAdvancedOptions()
Slot connected to advanced option button (opens a dialog).
R__EXTERN TPluginManager * gPluginMgr
void MakeTitle(TGCompositeFrame *parent, const char *title)
Create section title in the GUI.
virtual void DoUpdate()
Easy here!
void UpdateGUI()
Set the fit panel GUI according to the selected object.
virtual void GetParLimits(Int_t ipar, Double_t &parmin, Double_t &parmax) const
Return limits for parameter ipar.
virtual Double_t GetUymax() const =0
virtual Int_t GetSelected() const
TSelector * GetSelector() const
virtual Int_t GetDimension() const
virtual Double_t GetUymin() const =0
virtual void DoConvolution(Bool_t on)
Slot connected to addition of predefined functions.
virtual void Show(TVirtualPad *pad, TObject *obj)
Show the fit panel (possible only via context menu).
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 Terminate()
Called to delete the fit panel.
virtual void DoUserDialog()
Open a dialog for getting a user defined method.
virtual void DoNormAddition(Bool_t on)
Slot connected to addition of predefined functions.
void InitGaus(const ROOT::Fit::BinData &data, TF1 *f1)
compute initial parameter for gaussian function given the fit data Set the sigma limits for zero top ...
virtual void SetParLimits(Int_t ipar, Double_t parmin, Double_t parmax)
Set limits for parameter ipar.
TList * GetFitObjectListOfFunctions()
void FillData(BinData &dv, const TH1 *hist, TF1 *func=0)
fill the data vector from a TH1.
void SetMaxFunctionCalls(unsigned int maxfcn)
set maximum of function calls
TGTextButton * fCloseButton
virtual void RecursiveRemove(TObject *obj)
When obj is deleted, clear fFitObject if fFitObject = obj.
static const std::string & DefaultMinimizerType()
virtual void GetPosition(Float_t &min, Float_t &max) const
virtual TGLBEntry * FindEntry(const char *s) const
Find entry by name.
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
TF1 * FindFunction()
This method looks among the functions stored by the fitpanel, the one that is currently selected in t...
virtual Int_t XtoAbsPixel(Double_t x) const =0
A 3-Dim function with parameters.
leg AddEntry(h1,"Histogram filled with random numbers","f")
virtual Double_t GetBinUpEdge(Int_t bin) const
Return up edge of bin.
TGCompositeFrame * fMinimization
TGDoubleHSlider * fSliderY
virtual const char * ClassName() const
Returns name of class to which the object belongs.
TGComboBox * fMinMethodList
virtual TGCompositeFrame * AddTab(TGString *text)
Add a tab to the tab widget.
TGNumberEntryField * fTolerance
TGCheckButton * fDrawSame
Bool_t SetObjectType(TObject *obj)
Check whether the object suitable for fitting and set its type, dimension and method combo box accord...
static double DefaultErrorDef()
The most important graphics class in the ROOT system.
virtual Int_t GetNdim() const
char * Form(const char *fmt,...)
virtual TGListBox * GetListBox() const
TGDoubleHSlider * fSliderZ
TList * GetListOfFittingFunctions(TObject *obj=0)
virtual void DoUseFuncRange()
virtual void DoClose()
Close the fit panel.
virtual void DoSliderXMoved()
Slot connected to range settings on x-axis.
virtual void ChangeOptions(UInt_t options)
Change composite frame options. Options is an OR of the EFrameTypes.
void GetParameters(TFitEditor::FuncParams_t &pars, TF1 *func)
Stores the parameters of the given function into pars.
Class adding two functions: c1*f1+c2*f2.
virtual const char * GetName() const
Returns name of object.
virtual void DoNumericSliderYChanged()
syncronize the numeric slider with the graphical one.
void GetRanges(ROOT::Fit::DataRange &)
virtual Double_t GetNumber() const
Get the numeric value (floating point representation).
Class describing the binned data sets : vectors of x coordinates, y values and optionally error on y ...
virtual TList * GetListOfPrimitives() const =0
TGRadioButton * fLibFumili
virtual const char * GetTitle() const
Returns title of object.
TF1Convolution * fConvFunc
TF1NormSum object.
A 2-Dim function with parameters.
TGCheckButton * fBestErrors
virtual Double_t GetUxmax() const =0
std::vector< FuncParamData_t > FuncParams_t
void DrawSelection(bool restore=false)
Draws the square around the object showing where the limits for fitting are.
UInt_t GetWindowWidth() const
A specialized TSelector for TTree::Draw.
TGTextButton * fUserButton
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
Int_t GetWindowTopX()
Returns current top x position of window on screen.
virtual void DoDataSet(Int_t sel)
Selects the data set to be fitted.
virtual void DoRobustFit()
Slot connected to 'robust fitting' option settings.
virtual Int_t FindBin(Double_t x)
Find bin number corresponding to abscissa x.
virtual Int_t YtoAbsPixel(Double_t y) const =0
virtual void DoEnteredFunction()
Slot connected to entered function in text entry.
void AddRange(unsigned int icoord, double xmin, double xmax)
add a range [xmin,xmax] for the new coordinate icoord Adding a range does not delete existing one...
virtual void Modified(Bool_t flag=1)=0
static int DefaultMaxIterations()
virtual void SetRange(Double_t xmin, Double_t xmax)
Initialize the upper and lower bounds to draw the function.
void GetTreeVarsAndCuts(TGComboBox *dataSet, TString &variablesStr, TString &cutsStr)
Splits the entry in fDataSet to get the selected variables and cuts from the text.
TGCompositeFrame * fTabContainer
const char * GetParName(Int_t ipar) const
class describing the range in the coordinates it supports multiple range in a coordinate.
TGNumberEntry * fSliderXMax
void SearchCanvases(TSeqCollection *canvases, std::vector< TObject * > &objects)
virtual const char * GetName() const
Returns name of object.
void Init2DGaus(const ROOT::Fit::BinData &data, TF1 *f1)
compute initial parameter for 2D gaussian function given the fit data Set the sigma limits for zero t...
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
virtual void AddEntry(TGString *s, Int_t id)
void GetFunctionsFromSystem()
std::vector< TF1 * > fSystemFuncs
const double * Coords(unsigned int ipoint) const
return pointer to coordinate data
void CreateFunctionGroup()
Creates the Frame that contains oll the information about the function.
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
TGCheckButton * fUseGradient
virtual void Draw(Option_t *opt)
Default Draw method for all objects.
virtual Option_t * GetDrawOption() const
Get draw options of the selected object.
std::multimap< TObject *, TF1 * > FitFuncMap_t
double func(double *x, double *p)
virtual Bool_t IsMapped()
Returns kTRUE if window is mapped on screen, kFALSE otherwise.
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
TGLayoutHints * fLayoutNormAdd
TGTextButton * fUpdateButton
virtual void DoSliderYMoved()
Slot connected to range settings on y-axis.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
TGCheckButton * fAdd2FuncList
std::vector< FuncParamData_t > fFuncPars
virtual Int_t GetNumber() const
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Int_t GetLast() const
Return last bin on the axis i.e.
virtual Double_t GetParameter(Int_t ipar) const
void FillFunctionList(Int_t selected=-1)
Fills the list of functions depending on the type of fit selected.
Mother of all ROOT objects.
TGNumberEntryField * fErrorScale
virtual Double_t * GetParameters() const
TGRadioButton * fOptVerbose
virtual void UnmapWindow()
virtual void DoFit()
Perform a fit with current parameters' settings.
TList * GetListOfPrimitives() const
void SetWMPosition(Int_t x, Int_t y)
Give the window manager a window position hint.
virtual void SetNumber(Double_t val)
Set the numeric value (floating point representation).
virtual void DoLinearFit()
Slot connected to linear fit settings.
virtual UInt_t GetDefaultHeight() const
virtual void DoEmptyBinsAllWeights1()
Slot connected to 'include emtry bins and forse all weights to 1' setting.
virtual void SetRange(Double_t xmin, Double_t xmax)
Initialize the upper and lower bounds to draw the function.
virtual void Add(TObject *obj)
virtual Bool_t AddToGlobalList(Bool_t on=kTRUE)
Add to global list of functions (gROOT->GetListOfFunctions() ) return previous status (true of functi...
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
A Graph is a graphics object made of two arrays X and Y with npoints each.
void FillMinMethodList(Int_t selected=-1)
Fills the list of methods depending on the minimization library selected.
virtual void SetPosition(Float_t min, Float_t max)
void SetWMSize(UInt_t w, UInt_t h)
Give the window manager a window size hint.
virtual Int_t Sizeof() const
Returns size string will occupy on I/O buffer.
TGRadioButton * fOptDefault
virtual Float_t GetMinPosition() const
virtual void SetScale(Int_t scale)
virtual void SetParts(Int_t npart)
Divide the status bar in npart equal sized parts.
unsigned int Size() const
return number of contained points
void CreateMinimizationTab()
Create 'Minimization' tab.
virtual Double_t GetNumber() const
A TTree object has a header with a name and a title.
const char * GetString() const
virtual Float_t GetMaxPosition() const
virtual void DoNoSelection()
Slot called when users close a TCanvas or when the user select no object.
virtual void RemoveEntry(Int_t id=-1)
Remove entry. If id == -1, the currently selected entry is removed.
virtual void CloseWindow()
Close fit panel window.
static TFitEditor * fgFitDialog
virtual void SetParameter(Int_t param, Double_t value)
TFitResultPtr FitObject(TH1 *h1, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
fitting function for a TH1 (called from TH1::Fit)
TGHorizontalFrame * fSliderZParent
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
const TGString * GetText() const
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 ~TFitEditor()
Fit editor destructor.
Implement some of the functionality of the class TTree requiring access to extra libraries (Histogram...
Graphics object made of three arrays X, Y and Z with the same number of points each.
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
TGRadioButton * fLibMinuit
static double DefaultTolerance()
TGHorizontalFrame * fSliderYParent
virtual const char * GetTitle() const
Returns title of object.
TGNumberEntry * fRobustValue
void SetMWMHints(UInt_t value, UInt_t funcs, UInt_t input)
Set decoration style for MWM-compatible wm (mwm, ncdwm, fvwm?).
void SetMinimizerAlgorithm(const char *type)
set minimizer algorithm
void GetRange(unsigned int icoord, double &xmin, double &xmax) const
get the first range for given coordinate.
TGCheckButton * fEmptyBinsWghts1
virtual Int_t GetNpar() const
Ssiz_t First(char c) const
Find first occurrence of a character c.
virtual TGLBEntry * GetEntry(Int_t id) const
Returns list box entry with specified id.
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
Int_t GetState(TGFrame *f) const
Get state of sub frame.
virtual void Save(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Double_t zmin, Double_t zmax)
Save values of function in array fSave.
void SetEditable(Bool_t)
Switch ON/OFF edit mode.
virtual TCanvas * GetCanvas() const =0