Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
S
src
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
70
Issues
70
List
Boards
Labels
Service Desk
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Code Review
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OPAL
src
Commits
5841034d
Commit
5841034d
authored
May 02, 2018
by
snuverink_j
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add header line for histogram data; improve logic
parent
23a11c92
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
src/Classic/Structure/PeakFinder.cpp
src/Classic/Structure/PeakFinder.cpp
+10
-8
No files found.
src/Classic/Structure/PeakFinder.cpp
View file @
5841034d
...
...
@@ -298,18 +298,16 @@ void PeakFinder::createHistogram_m() {
if
(
globMax_m
<
-
1e9
)
nBins_m
=
10
;
// no particles in probe
else
{
// calculate bins, round up so that histogram is large enough
nBins_m
=
static_cast
<
unsigned
int
>
(
std
::
ceil
((
globMax_m
-
globMin_m
)
/
binWidth_m
));
// calculate bins, round up so that histogram is large enough
(add one for safety)
nBins_m
=
static_cast
<
unsigned
int
>
(
std
::
ceil
((
globMax_m
-
globMin_m
)
/
binWidth_m
))
+
1
;
}
globHist_m
.
resize
(
nBins_m
+
1
);
container_t
locHist
(
nBins_m
+
1
);
globHist_m
.
resize
(
nBins_m
);
container_t
locHist
(
nBins_m
,
0.0
);
double
invBinWidth
=
1.0
/
binWidth_m
;
for
(
container_t
::
iterator
it
=
radius_m
.
begin
();
it
!=
radius_m
.
end
();
++
it
)
{
int
bin
=
std
::
abs
(
*
it
-
globMin_m
)
*
invBinWidth
;
int
bin
=
static_cast
<
int
>
(
std
::
abs
(
*
it
-
globMin_m
)
*
invBinWidth
);
++
locHist
[
bin
];
}
...
...
@@ -351,7 +349,11 @@ void PeakFinder::saveASCII_m() {
for
(
auto
&
radius
:
peakRadii_m
)
os_m
<<
radius
<<
std
::
endl
;
hos_m
<<
"# Histogram bin counts ()"
<<
std
::
endl
;
hos_m
<<
"# Histogram bin counts (min, max, nbins, binsize) "
<<
globMin_m
<<
" "
<<
globMax_m
<<
" "
<<
nBins_m
<<
" "
<<
binWidth_m
<<
std
::
endl
;
for
(
auto
binCount
:
globHist_m
)
hos_m
<<
binCount
<<
std
::
endl
;
}
...
...
snuverink_j
@snuverink_j
mentioned in issue
pyOPALTools#13 (closed)
·
May 02, 2018
mentioned in issue
pyOPALTools#13 (closed)
mentioned in issue pyOPALTools#13
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment