This program demonstrates simultaneous update of histogram and fitted function.
Every second new random entries add and histogram fitted again. Required at least JSROOT version 5.1.1 to see correct fit function update in browser
void histfitserver(void)
{
auto h1 =
new TH1F(
"h1",
"histogram 1", 100, -5, 5);
auto f1 =
new TF1(
"f1",
"gaus", -10, 10);
}
}
R__EXTERN TSystem * gSystem
bool Update(const std::shared_ptr< ROOT::Math::Minimizer > &min, const ROOT::Fit::FitConfig &fconfig, bool isValid, unsigned int ncalls=0)
Update the fit result with a new minimization status To be run only if same fit is performed with sam...
1-D histogram with a float per channel (see TH1 documentation)}
virtual void FillRandom(const char *fname, Int_t ntimes=5000, TRandom *rng=nullptr)
Fill histogram following distribution in function fname.
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Double_t xmin=0, Double_t xmax=0)
Fit histogram with function fname.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
virtual void Sleep(UInt_t milliSec)
Sleep milliSec milli seconds.
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
- Author
- Sergey Linev
Definition in file histfitserver.C.