Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
6c09ad2f
Commit
6c09ad2f
authored
7 years ago
by
Zhou, Wenduo
Browse files
Options
Downloads
Patches
Plain Diff
Refs #20796. Made several methods to be public.
parent
404695b5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Framework/Algorithms/inc/MantidAlgorithms/FindPeakBackground.h
+21
-31
21 additions, 31 deletions
...work/Algorithms/inc/MantidAlgorithms/FindPeakBackground.h
Framework/Algorithms/src/FindPeakBackground.cpp
+10
-0
10 additions, 0 deletions
Framework/Algorithms/src/FindPeakBackground.cpp
with
31 additions
and
31 deletions
Framework/Algorithms/inc/MantidAlgorithms/FindPeakBackground.h
+
21
−
31
View file @
6c09ad2f
...
...
@@ -53,6 +53,25 @@ public:
/// Algorithm's category for identification overriding a virtual method
const
std
::
string
category
()
const
override
{
return
"Utility
\\
Calculation"
;
}
/// set sigma constant
void
setSigma
(
const
double
&
sigma
);
/// set background order
void
setBackgroundOrder
(
size_t
order
);
/// set fit window
void
setFitWindow
(
const
std
::
vector
<
double
>
&
window
);
/// find fit window's data point index
void
findWindowIndex
(
const
HistogramData
::
Histogram
&
histogram
,
size_t
&
l0
,
size_t
&
n
);
/// main method to calculate background
int
findBackground
(
const
HistogramData
::
Histogram
&
histogram
,
const
size_t
&
l0
,
const
size_t
&
n
,
std
::
vector
<
size_t
>
&
peak_min_max_indexes
,
std
::
vector
<
double
>
&
bkgd3
);
private
:
std
::
string
m_backgroundType
;
//< The type of background to fit
...
...
@@ -74,29 +93,9 @@ private:
/// create output workspace
void
createOutputWorkspaces
();
//
/ set h
istogram
data to
find
background
//
void setHistogram(const HistogramData::Histogram &histogram);
//
H
istogram
cannot be de
fin
e
d
due to lack of default constructor. shared_ptr
//
will do the copy
/// set sigma constant
void
setSigma
(
const
double
&
sigma
);
/// set background order
void
setBackgroundOrder
(
size_t
order
);
/// set fit window
void
setFitWindow
(
const
std
::
vector
<
double
>
&
window
);
int
findBackground
(
const
HistogramData
::
Histogram
&
histogram
,
const
size_t
&
l0
,
const
size_t
&
n
,
std
::
vector
<
size_t
>
&
peak_min_max_indexes
,
std
::
vector
<
double
>
&
bkgd3
);
/// Histogram cannot be defined due to lack of default constructor. shared_ptr
/// will do the copy
/// histogram data to find peak background
/// boost::shared_ptr<const HistogramData::Histogram> m_histogram;
// HistogramData::Histogram& m_histogram;
/// fit window
std
::
vector
<
double
>
m_vecFitWindows
;
/// background order: 0 for flat, 1 for linear, 2 for quadratic
...
...
@@ -110,15 +109,6 @@ private:
/// workspace index
size_t
m_inputWSIndex
;
// /// find background (main algorithm)
// void findPeakBackground();
// /// get result
// void getBackgroundResult();
void
findWindowIndex
(
const
HistogramData
::
Histogram
&
histogram
,
size_t
&
l0
,
size_t
&
n
);
struct
cont_peak
{
size_t
start
;
size_t
stop
;
...
...
This diff is collapsed.
Click to expand it.
Framework/Algorithms/src/FindPeakBackground.cpp
+
10
−
0
View file @
6c09ad2f
...
...
@@ -122,6 +122,16 @@ void FindPeakBackground::exec() {
setProperty
(
"OutputWorkspace"
,
m_outPeakTableWS
);
}
//----------------------------------------------------------------------------------------------
/**
* @brief FindPeakBackground::findBackground
* @param histogram
* @param l0
* @param n
* @param peak_min_max_indexes
* @param bkgd3
* @return
*/
int
FindPeakBackground
::
findBackground
(
const
HistogramData
::
Histogram
&
histogram
,
const
size_t
&
l0
,
const
size_t
&
n
,
std
::
vector
<
size_t
>
&
peak_min_max_indexes
,
...
...
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