Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
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
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
a815776f
Commit
a815776f
authored
4 years ago
by
Pospelov, Gennady
Browse files
Options
Downloads
Patches
Plain Diff
Simplify detector mask handling
parent
afb39989
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Core/Instrument/DetectorMask.cpp
+1
-7
1 addition, 7 deletions
Core/Instrument/DetectorMask.cpp
Core/Instrument/DetectorMask.h
+1
-1
1 addition, 1 deletion
Core/Instrument/DetectorMask.h
Core/Instrument/SimulationArea.cpp
+2
-9
2 additions, 9 deletions
Core/Instrument/SimulationArea.cpp
with
4 additions
and
17 deletions
Core/Instrument/DetectorMask.cpp
+
1
−
7
View file @
a815776f
...
@@ -81,13 +81,7 @@ void DetectorMask::initMaskData(const OutputData<double>& data)
...
@@ -81,13 +81,7 @@ void DetectorMask::initMaskData(const OutputData<double>& data)
bool
DetectorMask
::
isMasked
(
size_t
index
)
const
bool
DetectorMask
::
isMasked
(
size_t
index
)
const
{
{
if
(
!
m_mask_data
.
isInitialized
())
return
m_number_of_masked_channels
==
0
?
false
:
m_mask_data
[
index
];
return
false
;
if
(
index
>=
m_mask_data
.
getAllocatedSize
())
throw
Exceptions
::
RuntimeErrorException
(
"DetectorMask::isMasked() -> Error. "
"Index is out of range "
+
std
::
to_string
(
index
));
return
m_mask_data
[
index
];
}
}
Histogram2D
*
DetectorMask
::
createHistogram
()
const
Histogram2D
*
DetectorMask
::
createHistogram
()
const
...
...
This diff is collapsed.
Click to expand it.
Core/Instrument/DetectorMask.h
+
1
−
1
View file @
a815776f
...
@@ -53,7 +53,7 @@ public:
...
@@ -53,7 +53,7 @@ public:
void
removeMasks
();
void
removeMasks
();
//! returns true if has masks
//! returns true if has masks
bool
hasMasks
()
const
{
return
numberOfMasks
()
>
0
;
}
bool
hasMasks
()
const
{
return
!
m_shapes
.
empty
()
;
}
int
numberOfMaskedChannels
()
const
{
return
m_number_of_masked_channels
;
}
int
numberOfMaskedChannels
()
const
{
return
m_number_of_masked_channels
;
}
...
...
This diff is collapsed.
Click to expand it.
Core/Instrument/SimulationArea.cpp
+
2
−
9
View file @
a815776f
...
@@ -52,15 +52,8 @@ SimulationAreaIterator SimulationArea::end()
...
@@ -52,15 +52,8 @@ SimulationAreaIterator SimulationArea::end()
bool
SimulationArea
::
isMasked
(
size_t
index
)
const
bool
SimulationArea
::
isMasked
(
size_t
index
)
const
{
{
if
(
index
>=
totalSize
())
{
auto
masks
=
m_detector
->
detectorMask
();
std
::
ostringstream
message
;
return
(
masks
&&
masks
->
hasMasks
()
&&
masks
->
isMasked
(
detectorIndex
(
index
)));
message
<<
"SimulationArea::isActive: index "
<<
index
<<
" is out of range, "
<<
"total size = "
<<
totalSize
();
throw
std
::
runtime_error
(
message
.
str
());
}
return
(
m_detector
->
detectorMask
()
&&
m_detector
->
detectorMask
()
->
isMasked
(
detectorIndex
(
index
)));
}
}
size_t
SimulationArea
::
roiIndex
(
size_t
index
)
const
size_t
SimulationArea
::
roiIndex
(
size_t
index
)
const
...
...
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