@@ -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,29 @@ 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
147
+ * @param period :: Period if the file has several periods
148
+ * @param workspaceOptional :: Whether a workspace is present or not
145
149
* @return Vector of workspace indices to fit
146
150
*/
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) {
151
+ void appendInputSpectraToList (std::vector<InputSpectraToFit> &nameList, const std::string &name ,
152
+ const std::shared_ptr<API::MatrixWorkspace> &ws , int workspaceIndex, int spectrumNumber ,
153
+ double start, double end, int period, const bool &workspaceOptional) {
150
154
auto mws = workspaceOptional ? ws : nullptr ;
151
155
if (workspaceIndex >= 0 ) {
152
- nameList.emplace_back (ws-> getName () , workspaceIndex, -1 , -1 , period, mws);
156
+ nameList.emplace_back (name , workspaceIndex, -1 , -1 , period, mws);
153
157
return ;
154
158
}
155
159
@@ -159,14 +163,14 @@ void appendInputSpectraToList(std::vector<InputSpectraToFit> &nameList, const st
159
163
for (int i = 0 ; i < axis->length (); ++i) {
160
164
auto s = double (axis->spectraNo (i));
161
165
if (s >= start && s <= end) {
162
- nameList.emplace_back (ws-> getName () , i, s, -1 , period, mws);
166
+ nameList.emplace_back (name , i, s, -1 , period, mws);
163
167
}
164
168
}
165
169
} else {
166
170
for (int i = 0 ; i < axis->length (); ++i) {
167
171
int j = axis->spectraNo (i);
168
172
if (j == spectrumNumber) {
169
- nameList.emplace_back (ws-> getName () , i, j, -1 , period, mws);
173
+ nameList.emplace_back (name , i, j, -1 , period, mws);
170
174
break ;
171
175
}
172
176
}
@@ -179,7 +183,7 @@ void appendInputSpectraToList(std::vector<InputSpectraToFit> &nameList, const st
179
183
for (int i = 0 ; i < axis->length (); ++i) {
180
184
double s = (*axis)(i);
181
185
if (s >= start && s <= end) {
182
- nameList.emplace_back (ws-> getName () , i, -1 , s, period, mws);
186
+ nameList.emplace_back (name , i, -1 , s, period, mws);
183
187
}
184
188
}
185
189
}
0 commit comments