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
bf9c5f0d
Commit
bf9c5f0d
authored
10 years ago
by
Ricardo Ferraz Leal
Browse files
Options
Downloads
Patches
Plain Diff
Re #9336 Monitor binning equal to detector binning.
parent
4a7bc14e
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadILL.h
+1
-1
1 addition, 1 deletion
...d/Framework/DataHandling/inc/MantidDataHandling/LoadILL.h
Code/Mantid/Framework/DataHandling/src/LoadILL.cpp
+7
-31
7 additions, 31 deletions
Code/Mantid/Framework/DataHandling/src/LoadILL.cpp
with
8 additions
and
32 deletions
Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadILL.h
+
1
−
1
View file @
bf9c5f0d
...
...
@@ -76,7 +76,7 @@ private:
void
initWorkSpace
(
NeXus
::
NXEntry
&
entry
,
const
std
::
vector
<
std
::
vector
<
int
>
>&
);
void
initInstrumentSpecific
();
void
addAllNexusFieldsAsProperties
(
std
::
string
filename
);
void
addEnergyToRun
(
NeXus
::
NXEntry
&
entry
);
void
addEnergyToRun
();
void
loadExperimentDetails
(
NeXus
::
NXEntry
&
entry
);
int
getDetectorElasticPeakPosition
(
const
NeXus
::
NXInt
&
data
);
...
...
This diff is collapsed.
Click to expand it.
Code/Mantid/Framework/DataHandling/src/LoadILL.cpp
+
7
−
31
View file @
bf9c5f0d
...
...
@@ -149,7 +149,7 @@ void LoadILL::exec() {
loadDataIntoTheWorkSpace
(
dataFirstEntry
,
monitors
,
calculatedDetectorElasticPeakPosition
);
addEnergyToRun
(
dataFirstEntry
);
addEnergyToRun
();
loadExperimentDetails
(
dataFirstEntry
);
// load the instrument from the IDF if it exists
...
...
@@ -375,7 +375,7 @@ void LoadILL::addAllNexusFieldsAsProperties(std::string filename){
*
* @param entry :: The Nexus entry
*/
void
LoadILL
::
addEnergyToRun
(
NXEntry
&
entry
)
{
void
LoadILL
::
addEnergyToRun
()
{
API
::
Run
&
runDetails
=
m_localWorkspace
->
mutableRun
();
double
ei
=
m_loader
.
calculateEnergy
(
m_wavelength
);
...
...
@@ -519,10 +519,9 @@ void LoadILL::loadDataIntoTheWorkSpace(NeXus::NXEntry& entry,
NXInt
data
=
dataGroup
.
openIntData
();
// load the counts from the file into memory
data
.
load
();
/*
* Detector: Find real elastic peak in the detector.
* Looks for a few elastic peaks on the equatorial line of the detector.
*/
// Detector: Find real elastic peak in the detector.
// Looks for a few elastic peaks on the equatorial line of the detector.
int
calculatedDetectorElasticPeakPosition
;
if
(
vanaCalculatedDetectorElasticPeakPosition
==
-
1
)
calculatedDetectorElasticPeakPosition
=
getDetectorElasticPeakPosition
(
...
...
@@ -545,11 +544,7 @@ void LoadILL::loadDataIntoTheWorkSpace(NeXus::NXEntry& entry,
+
m_channelWidth
*
static_cast
<
double
>
(
static_cast
<
int
>
(
i
)
-
calculatedDetectorElasticPeakPosition
)
-
m_channelWidth
/
2
;
// to make sure the bin is in the middle of the elastic peak
}
//g_log.debug() << "Detector TOF bins: ";
//for (auto i : detectorTofBins) g_log.debug() << i << " ";
//g_log.debug() << "\n";
g_log
.
information
()
<<
"T1+T2 : Theoretical = "
<<
theoreticalElasticTOF
;
g_log
.
information
()
<<
" :: Calculated bin = ["
...
...
@@ -557,37 +552,18 @@ void LoadILL::loadDataIntoTheWorkSpace(NeXus::NXEntry& entry,
<<
detectorTofBins
[
calculatedDetectorElasticPeakPosition
+
1
]
<<
"]"
<<
std
::
endl
;
// This is completely absurd but there are no X units in the ILL monitors
// So, we are going to assume the same as in the data
// The binning for monitors is considered the same as for detectors
size_t
spec
=
0
;
for
(
auto
it
=
monitors
.
begin
();
it
!=
monitors
.
end
();
++
it
)
{
double
distanceSourceToMonitor
=
m_loader
.
getDistanceSourceToMonitor
(
m_localWorkspace
,
spec
);
double
monitorTheoreticalElasticTOF
=
m_loader
.
calculateTOF
(
distanceSourceToMonitor
,
m_wavelength
)
*
1e6
;
double
monitorTheoreticalElasticTOFToSubtract
=
theoreticalElasticTOF
-
(
theoreticalElasticTOF
-
monitorTheoreticalElasticTOF
);
std
::
vector
<
double
>
thisMonitorBin
(
detectorTofBins
.
begin
(),
m_localWorkspace
->
dataX
(
spec
).
assign
(
detectorTofBins
.
begin
(),
detectorTofBins
.
end
());
for
(
size_t
i
=
0
;
i
<
thisMonitorBin
.
size
();
i
++
)
thisMonitorBin
[
i
]
=
thisMonitorBin
[
i
]
-
monitorTheoreticalElasticTOFToSubtract
;
m_localWorkspace
->
dataX
(
spec
).
assign
(
thisMonitorBin
.
begin
(),
thisMonitorBin
.
end
());
// Assign Y
m_localWorkspace
->
dataY
(
spec
).
assign
(
it
->
begin
(),
it
->
end
());
// Assign Error
MantidVec
&
E
=
m_localWorkspace
->
dataE
(
spec
);
std
::
transform
(
it
->
begin
(),
it
->
end
(),
E
.
begin
(),
LoadILL
::
calculateError
);
++
spec
;
}
...
...
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