@@ -122,7 +122,7 @@ std::vector<InputSpectraToFit> makeNames(const std::string &inputList, int defau
122
122
void addMatrixworkspace (std::vector<InputSpectraToFit> &nameList, double start, double end, const std::string &name,
123
123
int wi, int spec, int period, const std::optional<API::Workspace_sptr> &workspaceOptional,
124
124
const std::shared_ptr<API::MatrixWorkspace> &wsMatrix) {
125
- appendInputSpectraToList (nameList, wsMatrix, wi, spec, start, end, period, workspaceOptional.has_value ());
125
+ appendInputSpectraToList (nameList, name, wsMatrix, wi, spec, start, end, period, workspaceOptional.has_value ());
126
126
}
127
127
void addGroupWorkspace (std::vector<InputSpectraToFit> &nameList, double start, double end, int wi, int spec, int period,
128
128
const std::shared_ptr<API::WorkspaceGroup> &wsg) {
@@ -131,25 +131,28 @@ void addGroupWorkspace(std::vector<InputSpectraToFit> &nameList, double start, d
131
131
for (const auto &wsName : wsNames) {
132
132
if (auto workspace =
133
133
std::dynamic_pointer_cast<API::MatrixWorkspace>(API::AnalysisDataService::Instance ().retrieve (wsName))) {
134
- appendInputSpectraToList (nameList, workspace, wi, spec, start, end, period, true );
134
+ appendInputSpectraToList (nameList, wsName, workspace, wi, spec, start, end, period, true );
135
135
}
136
136
}
137
137
}
138
138
139
139
/* * Get a workspace identified by an InputSpectraToFit structure.
140
+ * @param nameList :: List of spectra to fit
141
+ * @param name :: Workspace name
140
142
* @param ws :: Workspace to fit required to work out indices
141
143
* @param workspaceIndex :: workspace index to use
142
144
* @param spectrumNumber :: spectrum number to use
143
145
* @param start :: Start of range for value based spectrum range
144
146
* @param end :: End of range for value based spectrum range
145
- * @return Vector of workspace indices to fit
147
+ * @param period :: Period if the file has several periods
148
+ * @param workspaceOptional :: Whether a workspace is present or not
146
149
*/
147
- void appendInputSpectraToList (std::vector<InputSpectraToFit> &nameList, const std::shared_ptr<API::MatrixWorkspace> &ws ,
148
- int workspaceIndex , int spectrumNumber, double start, double end, int period ,
149
- const bool &workspaceOptional) {
150
+ void appendInputSpectraToList (std::vector<InputSpectraToFit> &nameList, const std::string &name ,
151
+ const std::shared_ptr<API::MatrixWorkspace> &ws , int workspaceIndex, int spectrumNumber ,
152
+ double start, double end, int period, const bool &workspaceOptional) {
150
153
auto mws = workspaceOptional ? ws : nullptr ;
151
154
if (workspaceIndex >= 0 ) {
152
- nameList.emplace_back (ws-> getName () , workspaceIndex, -1 , -1 , period, mws);
155
+ nameList.emplace_back (name , workspaceIndex, -1 , -1 , period, mws);
153
156
return ;
154
157
}
155
158
@@ -159,14 +162,14 @@ void appendInputSpectraToList(std::vector<InputSpectraToFit> &nameList, const st
159
162
for (int i = 0 ; i < axis->length (); ++i) {
160
163
auto s = double (axis->spectraNo (i));
161
164
if (s >= start && s <= end) {
162
- nameList.emplace_back (ws-> getName () , i, s, -1 , period, mws);
165
+ nameList.emplace_back (name , i, s, -1 , period, mws);
163
166
}
164
167
}
165
168
} else {
166
169
for (int i = 0 ; i < axis->length (); ++i) {
167
170
int j = axis->spectraNo (i);
168
171
if (j == spectrumNumber) {
169
- nameList.emplace_back (ws-> getName () , i, j, -1 , period, mws);
172
+ nameList.emplace_back (name , i, j, -1 , period, mws);
170
173
break ;
171
174
}
172
175
}
@@ -179,7 +182,7 @@ void appendInputSpectraToList(std::vector<InputSpectraToFit> &nameList, const st
179
182
for (int i = 0 ; i < axis->length (); ++i) {
180
183
double s = (*axis)(i);
181
184
if (s >= start && s <= end) {
182
- nameList.emplace_back (ws-> getName () , i, -1 , s, period, mws);
185
+ nameList.emplace_back (name , i, -1 , s, period, mws);
183
186
}
184
187
}
185
188
}
0 commit comments