Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Root
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
为了安全,强烈建议开启2FA双因子认证:User Settings -> Account -> Enable two-factor authentication!!!
Show more breadcrumbs
cxwx
Root
Commits
41d3fbb3
Commit
41d3fbb3
authored
5 years ago
by
Sergey Linev
Committed by
Axel Naumann
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
web fitpanel: let perform fit without update of model
parent
0af242ba
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gui/fitpanelv7/inc/ROOT/RFitPanel.hxx
+1
-1
1 addition, 1 deletion
gui/fitpanelv7/inc/ROOT/RFitPanel.hxx
gui/fitpanelv7/src/RFitPanel.cxx
+20
-12
20 additions, 12 deletions
gui/fitpanelv7/src/RFitPanel.cxx
with
21 additions
and
13 deletions
gui/fitpanelv7/inc/ROOT/RFitPanel.hxx
+
1
−
1
View file @
41d3fbb3
...
@@ -52,7 +52,7 @@ class RFitPanel {
...
@@ -52,7 +52,7 @@ class RFitPanel {
int
UpdateModel
(
const
std
::
string
&
json
);
int
UpdateModel
(
const
std
::
string
&
json
);
void
DoFit
(
const
std
::
string
&
model
);
bool
DoFit
();
void
DrawContour
(
const
std
::
string
&
model
);
void
DrawContour
(
const
std
::
string
&
model
);
...
...
This diff is collapsed.
Click to expand it.
gui/fitpanelv7/src/RFitPanel.cxx
+
20
−
12
View file @
41d3fbb3
...
@@ -125,6 +125,11 @@ void ROOT::Experimental::RFitPanel::Hide()
...
@@ -125,6 +125,11 @@ void ROOT::Experimental::RFitPanel::Hide()
fWindow
->
CloseConnections
();
fWindow
->
CloseConnections
();
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
/// Return reference on model object
/// Model created if was not exists before
ROOT
::
Experimental
::
RFitPanelModel
&
ROOT
::
Experimental
::
RFitPanel
::
model
()
ROOT
::
Experimental
::
RFitPanelModel
&
ROOT
::
Experimental
::
RFitPanel
::
model
()
{
{
if
(
!
fModel
)
if
(
!
fModel
)
...
@@ -171,7 +176,9 @@ void ROOT::Experimental::RFitPanel::ProcessData(unsigned connid, const std::stri
...
@@ -171,7 +176,9 @@ void ROOT::Experimental::RFitPanel::ProcessData(unsigned connid, const std::stri
}
else
if
(
arg
.
compare
(
0
,
6
,
"DOFIT:"
)
==
0
)
{
}
else
if
(
arg
.
compare
(
0
,
6
,
"DOFIT:"
)
==
0
)
{
DoFit
(
arg
.
substr
(
6
));
if
(
UpdateModel
(
arg
.
substr
(
6
))
>=
0
)
if
(
DoFit
())
SendModel
();
}
else
if
(
arg
.
compare
(
0
,
11
,
"SETCONTOUR:"
)
==
0
)
{
}
else
if
(
arg
.
compare
(
0
,
11
,
"SETCONTOUR:"
)
==
0
)
{
...
@@ -207,6 +214,7 @@ void ROOT::Experimental::RFitPanel::ProcessData(unsigned connid, const std::stri
...
@@ -207,6 +214,7 @@ void ROOT::Experimental::RFitPanel::ProcessData(unsigned connid, const std::stri
///////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////
/// Dummy function, called when "Fit" button pressed in UI
/// Dummy function, called when "Fit" button pressed in UI
void
ROOT
::
Experimental
::
RFitPanel
::
DrawContour
(
const
std
::
string
&
model
)
void
ROOT
::
Experimental
::
RFitPanel
::
DrawContour
(
const
std
::
string
&
model
)
{
{
// FIXME: do not use static!!!
// FIXME: do not use static!!!
...
@@ -339,11 +347,12 @@ int ROOT::Experimental::RFitPanel::UpdateModel(const std::string &json)
...
@@ -339,11 +347,12 @@ int ROOT::Experimental::RFitPanel::UpdateModel(const std::string &json)
return
res
;
return
res
;
}
}
///////////////////////////////////////////////
/// Perform fitting using current model settings
/// Returns true if any action was done
void
ROOT
::
Experimental
::
RFitPanel
::
DoFit
(
const
std
::
string
&
json
)
bool
ROOT
::
Experimental
::
RFitPanel
::
DoFit
()
{
{
if
(
UpdateModel
(
json
)
<
0
)
return
;
auto
&
m
=
model
();
auto
&
m
=
model
();
ROOT
::
Math
::
MinimizerOptions
minOption
;
ROOT
::
Math
::
MinimizerOptions
minOption
;
...
@@ -377,18 +386,17 @@ void ROOT::Experimental::RFitPanel::DoFit(const std::string &json)
...
@@ -377,18 +386,17 @@ void ROOT::Experimental::RFitPanel::DoFit(const std::string &json)
TF1
*
f1
=
m
.
FindFunction
(
m
.
fSelectedFunc
,
h1
);
TF1
*
f1
=
m
.
FindFunction
(
m
.
fSelectedFunc
,
h1
);
if
(
!
h1
||
!
f1
)
return
false
;
auto
pad
=
GetDrawPad
(
h1
);
auto
pad
=
GetDrawPad
(
h1
);
// Assign the options to Fitting function
h1
->
Fit
(
f1
,
opt
.
c_str
(),
"*"
,
m
.
fRangeX
[
0
],
m
.
fRangeX
[
1
]);
if
(
h1
&&
f1
)
{
h1
->
Fit
(
f1
,
opt
.
c_str
(),
"*"
,
m
.
fRangeX
[
0
],
m
.
fRangeX
[
1
]);
if
(
pad
)
pad
->
Update
();
if
(
pad
)
pad
->
Update
();
auto
*
fres
=
m
.
UpdateFuncList
(
h1
,
true
);
auto
*
fres
=
m
.
UpdateFuncList
(
h1
,
true
);
m
.
UpdateAdvanced
(
fres
);
m
.
UpdateAdvanced
(
fres
);
}
SendModel
()
;
// provide client with latest changes
return
true
;
// provide client with latest changes
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment