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
0746b7f7
Commit
0746b7f7
authored
12 years ago
by
Michael Reuter
Browse files
Options
Downloads
Patches
Plain Diff
Refs #5453. Preserving events for SNS.
parent
2c60dc28
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/Mantid/Framework/WorkflowAlgorithms/src/DgsConvertToEnergyTransfer.cpp
+17
-1
17 additions, 1 deletion
...ork/WorkflowAlgorithms/src/DgsConvertToEnergyTransfer.cpp
with
17 additions
and
1 deletion
Code/Mantid/Framework/WorkflowAlgorithms/src/DgsConvertToEnergyTransfer.cpp
+
17
−
1
View file @
0746b7f7
...
@@ -106,6 +106,8 @@ namespace WorkflowAlgorithms
...
@@ -106,6 +106,8 @@ namespace WorkflowAlgorithms
const
std
::
string
inWsName
=
inputWS
->
getName
();
const
std
::
string
inWsName
=
inputWS
->
getName
();
std
::
string
outWsName
=
inWsName
+
"_et"
;
std
::
string
outWsName
=
inWsName
+
"_et"
;
bool
preserveEvents
=
false
;
// Calculate the initial energy and time zero
// Calculate the initial energy and time zero
const
std
::
string
facility
=
ConfigService
::
Instance
().
getFacility
().
name
();
const
std
::
string
facility
=
ConfigService
::
Instance
().
getFacility
().
name
();
g_log
.
notice
()
<<
"Processing for "
<<
facility
<<
std
::
endl
;
g_log
.
notice
()
<<
"Processing for "
<<
facility
<<
std
::
endl
;
...
@@ -113,6 +115,8 @@ namespace WorkflowAlgorithms
...
@@ -113,6 +115,8 @@ namespace WorkflowAlgorithms
double
initial_energy
=
0.0
;
double
initial_energy
=
0.0
;
if
(
"SNS"
==
facility
)
if
(
"SNS"
==
facility
)
{
{
// SNS wants to preserve events until the last
preserveEvents
=
true
;
const
std
::
string
instName
=
inputWS
->
getInstrument
()
->
getName
();
const
std
::
string
instName
=
inputWS
->
getInstrument
()
->
getName
();
double
t0
=
0.0
;
double
t0
=
0.0
;
if
(
"CNCS"
==
instName
||
"HYSPEC"
==
instName
)
if
(
"CNCS"
==
instName
||
"HYSPEC"
==
instName
)
...
@@ -171,7 +175,7 @@ namespace WorkflowAlgorithms
...
@@ -171,7 +175,7 @@ namespace WorkflowAlgorithms
rebin
->
setProperty
(
"InputWorkspace"
,
outWsName
);
rebin
->
setProperty
(
"InputWorkspace"
,
outWsName
);
rebin
->
setProperty
(
"OutputWorkspace"
,
outWsName
);
rebin
->
setProperty
(
"OutputWorkspace"
,
outWsName
);
rebin
->
setProperty
(
"Params"
,
et_binning
);
rebin
->
setProperty
(
"Params"
,
et_binning
);
rebin
->
setProperty
(
"PreserveEvents"
,
false
);
rebin
->
setProperty
(
"PreserveEvents"
,
preserveEvents
);
rebin
->
execute
();
rebin
->
execute
();
}
}
...
@@ -217,6 +221,18 @@ namespace WorkflowAlgorithms
...
@@ -217,6 +221,18 @@ namespace WorkflowAlgorithms
kikf
->
setProperty
(
"EMode"
,
"Direct"
);
kikf
->
setProperty
(
"EMode"
,
"Direct"
);
kikf
->
execute
();
kikf
->
execute
();
// Rebin to ensure consistency
if
(
!
et_binning
.
empty
())
{
g_log
.
notice
()
<<
"Rebinning data"
<<
std
::
endl
;
IAlgorithm_sptr
rebin
=
this
->
createSubAlgorithm
(
"Rebin"
);
rebin
->
setAlwaysStoreInADS
(
true
);
rebin
->
setProperty
(
"InputWorkspace"
,
outWsName
);
rebin
->
setProperty
(
"OutputWorkspace"
,
outWsName
);
rebin
->
setProperty
(
"Params"
,
et_binning
);
rebin
->
execute
();
}
MatrixWorkspace_sptr
outputWS
=
AnalysisDataService
::
Instance
().
retrieveWS
<
MatrixWorkspace
>
(
outWsName
);
MatrixWorkspace_sptr
outputWS
=
AnalysisDataService
::
Instance
().
retrieveWS
<
MatrixWorkspace
>
(
outWsName
);
this
->
setProperty
(
"OutputWorkspace"
,
outputWS
);
this
->
setProperty
(
"OutputWorkspace"
,
outputWS
);
}
}
...
...
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