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
3b6e48cb
Commit
3b6e48cb
authored
5 years ago
by
Sergey Linev
Committed by
Axel Naumann
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fitpanel: more c++11 when using std::multimap
parent
e306f872
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gui/fitpanel/src/TFitEditor.cxx
+7
-13
7 additions, 13 deletions
gui/fitpanel/src/TFitEditor.cxx
with
7 additions
and
13 deletions
gui/fitpanel/src/TFitEditor.cxx
+
7
−
13
View file @
3b6e48cb
...
@@ -187,9 +187,6 @@ typedef std::multimap<TObject*, TF1*> FitFuncMap_t;
...
@@ -187,9 +187,6 @@ typedef std::multimap<TObject*, TF1*> FitFuncMap_t;
TF1
*
TFitEditor
::
FindFunction
()
TF1
*
TFitEditor
::
FindFunction
()
{
{
// Get the list of functions from the system
std
::
vector
<
TF1
*>&
funcList
(
fSystemFuncs
);
// Get the title/name of the function from fFuncList
// Get the title/name of the function from fFuncList
TGTextLBEntry
*
te
=
(
TGTextLBEntry
*
)
fFuncList
->
GetSelectedEntry
();
TGTextLBEntry
*
te
=
(
TGTextLBEntry
*
)
fFuncList
->
GetSelectedEntry
();
if
(
!
te
)
return
0
;
if
(
!
te
)
return
0
;
...
@@ -197,9 +194,7 @@ TF1* TFitEditor::FindFunction()
...
@@ -197,9 +194,7 @@ TF1* TFitEditor::FindFunction()
// Look for a system function if it's USER DEFINED function
// Look for a system function if it's USER DEFINED function
if
(
fTypeFit
->
GetSelected
()
==
kFP_UFUNC
)
{
if
(
fTypeFit
->
GetSelected
()
==
kFP_UFUNC
)
{
for
(
fSystemFuncIter
it
=
funcList
.
begin
();
for
(
auto
f
:
fSystemFuncs
)
{
it
!=
funcList
.
end
();
++
it
)
{
TF1
*
f
=
(
*
it
);
if
(
strcmp
(
f
->
GetName
(),
name
)
==
0
)
if
(
strcmp
(
f
->
GetName
(),
name
)
==
0
)
// If found, return it.
// If found, return it.
return
f
;
return
f
;
...
@@ -260,6 +255,7 @@ TF1* copyTF1(TF1* f)
...
@@ -260,6 +255,7 @@ TF1* copyTF1(TF1* f)
fnew
->
Save
(
xmin
,
xmax
,
0
,
0
,
0
,
0
);
fnew
->
Save
(
xmin
,
xmax
,
0
,
0
,
0
,
0
);
fnew
->
SetParent
(
0
);
fnew
->
SetParent
(
0
);
fnew
->
AddToGlobalList
(
false
);
fnew
->
AddToGlobalList
(
false
);
printf
(
"Create TF1 %s %p
\n
"
,
fnew
->
GetName
(),
fnew
);
return
fnew
;
return
fnew
;
}
}
}
}
...
@@ -1681,9 +1677,7 @@ void TFitEditor::FillFunctionList(Int_t)
...
@@ -1681,9 +1677,7 @@ void TFitEditor::FillFunctionList(Int_t)
Int_t
newid
=
kFP_ALTFUNC
;
Int_t
newid
=
kFP_ALTFUNC
;
// Add system functions
// Add system functions
for
(
fSystemFuncIter
it
=
fSystemFuncs
.
begin
();
for
(
auto
f
:
fSystemFuncs
)
{
it
!=
fSystemFuncs
.
end
();
++
it
)
{
TF1
*
f
=
(
*
it
);
// Don't include system functions that has been previously
// Don't include system functions that has been previously
// used to fit, as those are included under the kFP_PREVFIT
// used to fit, as those are included under the kFP_PREVFIT
// section.
// section.
...
@@ -2186,14 +2180,14 @@ void TFitEditor::DoFit()
...
@@ -2186,14 +2180,14 @@ void TFitEditor::DoFit()
GetParameters
(
fFuncPars
,
fitFunc
);
GetParameters
(
fFuncPars
,
fitFunc
);
// Save fit data for future use as a PrevFit function.
// Save fit data for future use as a PrevFit function.
TF1
*
tmpTF1
=
static_cast
<
TF1
*>
(
copyTF1
(
fitFunc
)
)
;
TF1
*
tmpTF1
=
copyTF1
(
fitFunc
);
ostringstream
name
;
ostringstream
name
;
name
<<
"PrevFit-"
<<
fPrevFit
.
size
()
+
1
;
name
<<
"PrevFit-"
<<
fPrevFit
.
size
()
+
1
;
if
(
strcmp
(
tmpTF1
->
GetName
(),
"PrevFitTMP"
)
!=
0
)
if
(
strcmp
(
tmpTF1
->
GetName
(),
"PrevFitTMP"
)
!=
0
)
name
<<
"-"
<<
tmpTF1
->
GetName
();
name
<<
"-"
<<
tmpTF1
->
GetName
();
tmpTF1
->
SetName
(
name
.
str
().
c_str
());
tmpTF1
->
SetName
(
name
.
str
().
c_str
());
fPrevFit
.
insert
(
FitFuncMap_t
::
value_typ
e
(
fFitObject
,
tmpTF1
)
)
;
fPrevFit
.
emplac
e
(
fFitObject
,
tmpTF1
);
fSystemFuncs
.
push
_back
(
copyTF1
(
tmpTF1
)
);
fSystemFuncs
.
emplace
_back
(
copyTF1
(
tmpTF1
)
);
float
xmin
=
0.
f
,
xmax
=
0.
f
,
ymin
=
0.
f
,
ymax
=
0.
f
,
zmin
=
0.
f
,
zmax
=
0.
f
;
float
xmin
=
0.
f
,
xmax
=
0.
f
,
ymin
=
0.
f
,
ymax
=
0.
f
,
zmin
=
0.
f
,
zmax
=
0.
f
;
if
(
fParentPad
)
{
if
(
fParentPad
)
{
...
@@ -3311,7 +3305,7 @@ TF1* TFitEditor::HasFitFunction()
...
@@ -3311,7 +3305,7 @@ TF1* TFitEditor::HasFitFunction()
// breaks in the loops would make it to be different to
// breaks in the loops would make it to be different to
// fPrevFit.end() if the function is already stored
// fPrevFit.end() if the function is already stored
if
(
it
==
fPrevFit
.
end
()
)
{
if
(
it
==
fPrevFit
.
end
()
)
{
fPrevFit
.
insert
(
FitFuncMap_t
::
value_typ
e
(
fFitObject
,
static_cast
<
TF1
*>
(
copyTF1
(
func
)
)
)
);
fPrevFit
.
emplac
e
(
fFitObject
,
copyTF1
(
func
)
);
}
}
}
}
}
}
...
...
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