Mantid
Loading...
Searching...
No Matches
DiffractionEventCalibrateDetectors.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
10#include "MantidAPI/IFunction.h"
13#include "MantidAPI/TableRow.h"
14#include "MantidAPI/TextAxis.h"
27
28#include <Poco/File.h>
29#include <cmath>
30#include <fstream>
31#include <numeric>
32#include <sstream>
33
34namespace Mantid::Algorithms {
35
36// Register the class into the algorithm factory
37DECLARE_ALGORITHM(DiffractionEventCalibrateDetectors)
38
39using namespace Kernel;
40using namespace API;
41using namespace Geometry;
42using namespace DataObjects;
43using Types::Core::DateAndTime;
44
51static double gsl_costFunction(const gsl_vector *v, void *params) {
52 double x, y, z, rotx, roty, rotz;
53 std::string detname, inname, outname, peakOpt, rb_param, groupWSName;
54 auto *p = reinterpret_cast<std::string *>(params);
55 detname = p[0];
56 inname = p[1];
57 outname = p[2];
58 peakOpt = p[3];
59 rb_param = p[4];
60 groupWSName = p[5];
61 x = gsl_vector_get(v, 0);
62 y = gsl_vector_get(v, 1);
63 z = gsl_vector_get(v, 2);
64 rotx = gsl_vector_get(v, 3);
65 roty = gsl_vector_get(v, 4);
66 rotz = gsl_vector_get(v, 5);
68 return u.intensity(x, y, z, rotx, roty, rotz, detname, inname, outname, peakOpt, rb_param, groupWSName);
69}
70
83void DiffractionEventCalibrateDetectors::movedetector(double x, double y, double z, double rotx, double roty,
84 double rotz, const std::string &detname,
85 const EventWorkspace_sptr &inputW) {
86
87 auto alg1 = createChildAlgorithm("MoveInstrumentComponent");
88 alg1->setProperty<EventWorkspace_sptr>("Workspace", inputW);
89 alg1->setPropertyValue("ComponentName", detname);
90 // Move in cm for small shifts
91 alg1->setProperty("X", x * 0.01);
92 alg1->setProperty("Y", y * 0.01);
93 alg1->setProperty("Z", z * 0.01);
94 alg1->setPropertyValue("RelativePosition", "1");
95 alg1->executeAsChildAlg();
96
97 auto algx = createChildAlgorithm("RotateInstrumentComponent");
98 algx->setProperty<EventWorkspace_sptr>("Workspace", inputW);
99 algx->setPropertyValue("ComponentName", detname);
100 algx->setProperty("X", 1.0);
101 algx->setProperty("Y", 0.0);
102 algx->setProperty("Z", 0.0);
103 algx->setProperty("Angle", rotx);
104 algx->setPropertyValue("RelativeRotation", "1");
105 algx->executeAsChildAlg();
106
107 auto algy = createChildAlgorithm("RotateInstrumentComponent");
108 algy->setProperty<EventWorkspace_sptr>("Workspace", inputW);
109 algy->setPropertyValue("ComponentName", detname);
110 algy->setProperty("X", 0.0);
111 algy->setProperty("Y", 1.0);
112 algy->setProperty("Z", 0.0);
113 algy->setProperty("Angle", roty);
114 algy->setPropertyValue("RelativeRotation", "1");
115 algy->executeAsChildAlg();
116
117 auto algz = createChildAlgorithm("RotateInstrumentComponent");
118 algz->setProperty<EventWorkspace_sptr>("Workspace", inputW);
119 algz->setPropertyValue("ComponentName", detname);
120 algz->setProperty("X", 0.0);
121 algz->setProperty("Y", 0.0);
122 algz->setProperty("Z", 1.0);
123 algz->setProperty("Angle", rotz);
124 algz->setPropertyValue("RelativeRotation", "1");
125 algz->executeAsChildAlg();
126}
144double DiffractionEventCalibrateDetectors::intensity(double x, double y, double z, double rotx, double roty,
145 double rotz, const std::string &detname, const std::string &inname,
146 const std::string &outname, const std::string &peakOpt,
147 const std::string &rb_param, const std::string &groupWSName) {
148
149 EventWorkspace_sptr inputW =
150 std::dynamic_pointer_cast<EventWorkspace>(AnalysisDataService::Instance().retrieve(inname));
151
152 CPUTimer tim;
153
154 movedetector(x, y, z, rotx, roty, rotz, detname, inputW);
155 g_log.debug() << tim << " to movedetector()\n";
156
157 auto alg3 = createChildAlgorithm("ConvertUnits");
158 alg3->setProperty<EventWorkspace_sptr>("InputWorkspace", inputW);
159 alg3->setPropertyValue("OutputWorkspace", outname);
160 alg3->setPropertyValue("Target", "dSpacing");
161 alg3->executeAsChildAlg();
162 MatrixWorkspace_sptr outputW = alg3->getProperty("OutputWorkspace");
163
164 g_log.debug() << tim << " to ConvertUnits\n";
165
166 auto alg4 = createChildAlgorithm("DiffractionFocussing");
167 alg4->setProperty<MatrixWorkspace_sptr>("InputWorkspace", outputW);
168 alg4->setProperty<MatrixWorkspace_sptr>("OutputWorkspace", outputW);
169 alg4->setPropertyValue("GroupingFileName", "");
170 alg4->setPropertyValue("GroupingWorkspace", groupWSName);
171 alg4->executeAsChildAlg();
172 outputW = alg4->getProperty("OutputWorkspace");
173
174 // Remove file
175 g_log.debug() << tim << " to DiffractionFocussing\n";
176
177 auto alg5 = createChildAlgorithm("Rebin");
178 alg5->setProperty<MatrixWorkspace_sptr>("InputWorkspace", outputW);
179 alg5->setProperty<MatrixWorkspace_sptr>("OutputWorkspace", outputW);
180 alg5->setPropertyValue("Params", rb_param);
181 alg5->executeAsChildAlg();
182 outputW = alg5->getProperty("OutputWorkspace");
183
184 g_log.debug() << tim << " to Rebin\n";
185
186 // Find point of peak centre
187 const MantidVec &yValues = outputW->readY(0);
188 auto it = std::max_element(yValues.begin(), yValues.end());
189 double peakHeight = *it;
190 if (peakHeight == 0)
191 return -0.000;
192 double peakLoc = outputW->readX(0)[it - yValues.begin()];
193
194 IAlgorithm_sptr fit_alg;
195 try {
196 // set the ChildAlgorithm no to log as this will be run once per spectra
197 fit_alg = createChildAlgorithm("Fit", -1, -1, false);
198 } catch (Exception::NotFoundError &) {
199 g_log.error("Can't locate Fit algorithm");
200 throw;
201 }
202 std::ostringstream fun_str;
203 fun_str << "name=Gaussian,Height=" << peakHeight << ",Sigma=0.01,PeakCentre=" << peakLoc;
204 fit_alg->setProperty("Function", fun_str.str());
205 fit_alg->setProperty("InputWorkspace", outputW);
206 fit_alg->setProperty("WorkspaceIndex", 0);
207 fit_alg->setProperty("StartX", outputW->readX(0)[0]);
208 fit_alg->setProperty("EndX", outputW->readX(0)[outputW->blocksize()]);
209 fit_alg->setProperty("MaxIterations", 200);
210 fit_alg->setProperty("Output", "fit");
211 fit_alg->executeAsChildAlg();
212
213 g_log.debug() << tim << " to Fit\n";
214
215 std::vector<double> params; // = fit_alg->getProperty("Parameters");
216 Mantid::API::IFunction_sptr fun_res = fit_alg->getProperty("Function");
217 for (size_t i = 0; i < fun_res->nParams(); ++i) {
218 params.emplace_back(fun_res->getParameter(i));
219 }
220 peakHeight = params[0];
221 peakLoc = params[1];
222
223 movedetector(-x, -y, -z, -rotx, -roty, -rotz, detname, inputW);
224
225 g_log.debug() << tim << " to movedetector()\n";
226
227 // Optimize C/peakheight + |peakLoc-peakOpt| where C is scaled by number of
228 // events
229 EventWorkspace_const_sptr inputE = std::dynamic_pointer_cast<const EventWorkspace>(inputW);
230 return (static_cast<int>(inputE->getNumberEvents()) / 1.e6) / peakHeight +
231 std::fabs(peakLoc - boost::lexical_cast<double>(peakOpt));
232}
233
237 declareProperty(std::make_unique<WorkspaceProperty<EventWorkspace>>("InputWorkspace", "", Direction::Input,
238 std::make_shared<InstrumentValidator>()),
239 "The workspace containing the geometry to be calibrated.");
240
241 declareProperty("Params", "",
242 "A comma separated list of first bin boundary, width, last "
243 "bin boundary. Optionally "
244 "this can be followed by a comma and more widths and last "
245 "boundary pairs. "
246 "Use bin boundaries close to peak you wish to maximize. "
247 "Negative width values indicate logarithmic binning.");
248
249 auto mustBePositive = std::make_shared<BoundedValidator<int>>();
250 declareProperty("MaxIterations", 10, mustBePositive,
251 "Stop after this number of iterations if a good fit is not found");
252
253 auto dblmustBePositive = std::make_shared<BoundedValidator<double>>();
254 declareProperty("LocationOfPeakToOptimize", 2.0308, dblmustBePositive,
255 "Optimize this location of peak by moving detectors");
256
257 declareProperty(std::make_unique<API::FileProperty>("DetCalFilename", "", API::FileProperty::Save, ".DetCal"),
258 "The output filename of the ISAW DetCal file");
259
260 declareProperty(std::make_unique<PropertyWithValue<std::string>>("BankName", "", Direction::Input),
261 "Optional: To only calibrate one bank. Any bank whose name does not "
262 "match the given string will have no events.");
263
264 // Disable default gsl error handler (which is to call abort!)
265 gsl_set_error_handler_off();
266}
267
273 // Try to retrieve optional properties
274 const int maxIterations = getProperty("MaxIterations");
275 const double peakOpt = getProperty("LocationOfPeakToOptimize");
276
277 // Get the input workspace
278 EventWorkspace_sptr inputW = getProperty("InputWorkspace");
279
280 // retrieve the properties
281 const std::string rb_params = getProperty("Params");
282
283 // Get some stuff from the input workspace
284 // We make a copy of the instrument since we will be moving detectors in
285 // `inputW` but want to access original positions (etc.) via `detList` below.
286 const auto &dummyW = create<EventWorkspace>(*inputW, 1, inputW->binEdges(0));
287 Instrument_const_sptr inst = dummyW->getInstrument();
288
289 // Build a list of Rectangular Detectors
290 std::vector<std::shared_ptr<RectangularDetector>> detList;
291 // --------- Loading only one bank ----------------------------------
292 std::string onebank = getProperty("BankName");
293 bool doOneBank = (!onebank.empty());
294 for (int i = 0; i < inst->nelements(); i++) {
295 std::shared_ptr<RectangularDetector> det;
296 std::shared_ptr<ICompAssembly> assem;
297 std::shared_ptr<ICompAssembly> assem2;
298
299 det = std::dynamic_pointer_cast<RectangularDetector>((*inst)[i]);
300 if (det) {
301 if (det->getName() == onebank)
302 detList.emplace_back(det);
303 if (!doOneBank)
304 detList.emplace_back(det);
305 } else {
306 // Also, look in the first sub-level for RectangularDetectors (e.g. PG3).
307 // We are not doing a full recursive search since that will be very long
308 // for lots of pixels.
309 assem = std::dynamic_pointer_cast<ICompAssembly>((*inst)[i]);
310 if (assem) {
311 for (int j = 0; j < assem->nelements(); j++) {
312 det = std::dynamic_pointer_cast<RectangularDetector>((*assem)[j]);
313 if (det) {
314 if (det->getName() == onebank)
315 detList.emplace_back(det);
316 if (!doOneBank)
317 detList.emplace_back(det);
318
319 } else {
320 // Also, look in the second sub-level for RectangularDetectors (e.g.
321 // PG3).
322 // We are not doing a full recursive search since that will be very
323 // long for lots of pixels.
324 assem2 = std::dynamic_pointer_cast<ICompAssembly>((*assem)[j]);
325 if (assem2) {
326 for (int k = 0; k < assem2->nelements(); k++) {
327 det = std::dynamic_pointer_cast<RectangularDetector>((*assem2)[k]);
328 if (det) {
329 if (det->getName() == onebank)
330 detList.emplace_back(det);
331 if (!doOneBank)
332 detList.emplace_back(det);
333 }
334 }
335 }
336 }
337 }
338 }
339 }
340 }
341
342 // set-up minimizer
343
344 std::string inname = getProperty("InputWorkspace");
345 std::string outname = inname + "2"; // getProperty("OutputWorkspace");
346
347 auto algS = createChildAlgorithm("SortEvents");
348 algS->setProperty("InputWorkspace", inputW);
349 algS->setPropertyValue("SortBy", "X Value");
350 algS->executeAsChildAlg();
351
352 // Write DetCal File
353 std::string filename = getProperty("DetCalFilename");
354 std::fstream outfile;
355 outfile.open(filename.c_str(), std::ios::out);
356
357 if (detList.size() > 1) {
358 outfile << "#\n";
359 outfile << "# Mantid Optimized .DetCal file for SNAP with TWO detector "
360 "panels\n";
361 outfile << "# Old Panel, nominal size and distance at -90 degrees.\n";
362 outfile << "# New Panel, nominal size and distance at +90 degrees.\n";
363 outfile << "#\n";
364 outfile << "# Lengths are in centimeters.\n";
365 outfile << "# Base and up give directions of unit vectors for a local\n";
366 outfile << "# x,y coordinate system on the face of the detector.\n";
367 outfile << "#\n";
368 outfile << "# " << DateAndTime::getCurrentTime().toFormattedString("%c") << "\n";
369 outfile << "#\n";
370 outfile << "6 L1 T0_SHIFT\n";
371 IComponent_const_sptr source = inst->getSource();
372 IComponent_const_sptr sample = inst->getSample();
373 outfile << "7 " << source->getDistance(*sample) * 100 << " 0\n";
374 outfile << "4 DETNUM NROWS NCOLS WIDTH HEIGHT DEPTH DETD "
375 "CenterX CenterY CenterZ BaseX BaseY BaseZ "
376 "UpX UpY UpZ\n";
377 }
378
379 Progress prog(this, 0.0, 1.0, detList.size());
380 for (int det = 0; det < static_cast<int>(detList.size()); det++) {
381 std::string par[6];
382 par[0] = detList[det]->getName();
383 par[1] = inname;
384 par[2] = outname;
385 std::ostringstream strpeakOpt;
386 strpeakOpt << peakOpt;
387 par[3] = strpeakOpt.str();
388 par[4] = rb_params;
389
390 // --- Create a GroupingWorkspace for this detector name ------
391 CPUTimer tim;
392 auto alg2 = AlgorithmFactory::Instance().create("CreateGroupingWorkspace", 1);
393 alg2->initialize();
394 alg2->setProperty("InputWorkspace", inputW);
395 alg2->setPropertyValue("GroupNames", detList[det]->getName());
396 std::string groupWSName = "group_" + detList[det]->getName();
397 alg2->setPropertyValue("OutputWorkspace", groupWSName);
398 alg2->executeAsChildAlg();
399 par[5] = groupWSName;
400 std::cout << tim << " to CreateGroupingWorkspace\n";
401
402 const gsl_multimin_fminimizer_type *T = gsl_multimin_fminimizer_nmsimplex;
403 gsl_vector *ss, *x;
404 gsl_multimin_function minex_func;
405
406 // finally do the fitting
407
408 int nopt = 6;
409 int iter = 0;
410 int status = 0;
411
412 /* Starting point */
413 x = gsl_vector_alloc(nopt);
414 gsl_vector_set(x, 0, 0.0);
415 gsl_vector_set(x, 1, 0.0);
416 gsl_vector_set(x, 2, 0.0);
417 gsl_vector_set(x, 3, 0.0);
418 gsl_vector_set(x, 4, 0.0);
419 gsl_vector_set(x, 5, 0.0);
420
421 /* Set initial step sizes to 0.1 */
422 ss = gsl_vector_alloc(nopt);
423 gsl_vector_set_all(ss, 0.1);
424
425 /* Initialize method and iterate */
426 minex_func.n = nopt;
428 minex_func.params = &par;
429
430 gsl_multimin_fminimizer *s = gsl_multimin_fminimizer_alloc(T, nopt);
431 gsl_multimin_fminimizer_set(s, &minex_func, x, ss);
432
433 do {
434 iter++;
435 status = gsl_multimin_fminimizer_iterate(s);
436
437 if (status)
438 break;
439
440 double size = gsl_multimin_fminimizer_size(s);
441 status = gsl_multimin_test_size(size, 1e-2);
442
443 } while (status == GSL_CONTINUE && iter < maxIterations && s->fval != -0.000);
444
445 // Output summary to log file
446 if (s->fval != -0.000)
447 movedetector(gsl_vector_get(s->x, 0), gsl_vector_get(s->x, 1), gsl_vector_get(s->x, 2), gsl_vector_get(s->x, 3),
448 gsl_vector_get(s->x, 4), gsl_vector_get(s->x, 5), par[0], getProperty("InputWorkspace"));
449 else {
450 gsl_vector_set(s->x, 0, 0.0);
451 gsl_vector_set(s->x, 1, 0.0);
452 gsl_vector_set(s->x, 2, 0.0);
453 gsl_vector_set(s->x, 3, 0.0);
454 gsl_vector_set(s->x, 4, 0.0);
455 gsl_vector_set(s->x, 5, 0.0);
456 }
457
458 std::string reportOfDiffractionEventCalibrateDetectors = gsl_strerror(status);
459 if (s->fval == -0.000)
460 reportOfDiffractionEventCalibrateDetectors = "No events";
461
462 g_log.information() << "Detector = " << det << "\n"
463 << "Method used = "
464 << "Simplex"
465 << "\n"
466 << "Iteration = " << iter << "\n"
467 << "Status = " << reportOfDiffractionEventCalibrateDetectors << "\n"
468 << "Minimize PeakLoc-" << peakOpt << " = " << s->fval << "\n";
469 // Move in cm for small shifts
470 g_log.information() << "Move (X) = " << gsl_vector_get(s->x, 0) * 0.01 << " \n";
471 g_log.information() << "Move (Y) = " << gsl_vector_get(s->x, 1) * 0.01 << " \n";
472 g_log.information() << "Move (Z) = " << gsl_vector_get(s->x, 2) * 0.01 << " \n";
473 g_log.information() << "Rotate (X) = " << gsl_vector_get(s->x, 3) << " \n";
474 g_log.information() << "Rotate (Y) = " << gsl_vector_get(s->x, 4) << " \n";
475 g_log.information() << "Rotate (Z) = " << gsl_vector_get(s->x, 5) << " \n";
476
477 Kernel::V3D CalCenter =
478 V3D(gsl_vector_get(s->x, 0) * 0.01, gsl_vector_get(s->x, 1) * 0.01, gsl_vector_get(s->x, 2) * 0.01);
479 Kernel::V3D Center = detList[det]->getPos() + CalCenter;
480 int pixmax = detList[det]->xpixels() - 1;
481 int pixmid = (detList[det]->ypixels() - 1) / 2;
482 BoundingBox box;
483 detList[det]->getAtXY(pixmax, pixmid)->getBoundingBox(box);
484 double baseX = box.xMax();
485 double baseY = box.yMax();
486 double baseZ = box.zMax();
487 Kernel::V3D Base = V3D(baseX, baseY, baseZ) + CalCenter;
488 pixmid = (detList[det]->xpixels() - 1) / 2;
489 pixmax = detList[det]->ypixels() - 1;
490 detList[det]->getAtXY(pixmid, pixmax)->getBoundingBox(box);
491 double upX = box.xMax();
492 double upY = box.yMax();
493 double upZ = box.zMax();
494 Kernel::V3D Up = V3D(upX, upY, upZ) + CalCenter;
495 Base -= Center;
496 Up -= Center;
497 // Rotate around x
498 baseX = Base[0];
499 baseY = Base[1];
500 baseZ = Base[2];
501 double deg2rad = M_PI / 180.0;
502 double angle = gsl_vector_get(s->x, 3) * deg2rad;
503 Base = V3D(baseX, baseY * cos(angle) - baseZ * sin(angle), baseY * sin(angle) + baseZ * cos(angle));
504 upX = Up[0];
505 upY = Up[1];
506 upZ = Up[2];
507 Up = V3D(upX, upY * cos(angle) - upZ * sin(angle), upY * sin(angle) + upZ * cos(angle));
508 // Rotate around y
509 baseX = Base[0];
510 baseY = Base[1];
511 baseZ = Base[2];
512 angle = gsl_vector_get(s->x, 4) * deg2rad;
513 Base = V3D(baseZ * sin(angle) + baseX * cos(angle), baseY, baseZ * cos(angle) - baseX * sin(angle));
514 upX = Up[0];
515 upY = Up[1];
516 upZ = Up[2];
517 Up = V3D(upZ * cos(angle) - upX * sin(angle), upY, upZ * sin(angle) + upX * cos(angle));
518 // Rotate around z
519 baseX = Base[0];
520 baseY = Base[1];
521 baseZ = Base[2];
522 angle = gsl_vector_get(s->x, 5) * deg2rad;
523 Base = V3D(baseX * cos(angle) - baseY * sin(angle), baseX * sin(angle) + baseY * cos(angle), baseZ);
524 upX = Up[0];
525 upY = Up[1];
526 upZ = Up[2];
527 Up = V3D(upX * cos(angle) - upY * sin(angle), upX * sin(angle) + upY * cos(angle), upZ);
528 Base.normalize();
529 Up.normalize();
530 Center *= 100.0;
531 // << det+1 << " "
532 outfile << "5 " << detList[det]->getName().substr(4) << " " << detList[det]->xpixels() << " "
533 << detList[det]->ypixels() << " " << 100.0 * detList[det]->xsize() << " " << 100.0 * detList[det]->ysize()
534 << " "
535 << "0.2000"
536 << " " << Center.norm() << " ";
537 Center.write(outfile);
538 outfile << " ";
539 Base.write(outfile);
540 outfile << " ";
541 Up.write(outfile);
542 outfile << "\n";
543
544 // clean up dynamically allocated gsl stuff
545 gsl_vector_free(x);
546 gsl_vector_free(ss);
547 gsl_multimin_fminimizer_free(s);
548
549 // Remove the now-unneeded grouping workspace
550 AnalysisDataService::Instance().remove(groupWSName);
551 prog.report(detList[det]->getName());
552 }
553
554 // Closing
555 outfile.close();
556}
557
558} // namespace Mantid::Algorithms
#define DECLARE_ALGORITHM(classname)
Definition: Algorithm.h:576
std::string getName(const IMDDimension &self)
void declareProperty(std::unique_ptr< Kernel::Property > p, const std::string &doc="") override
Add a property to the list of managed properties.
Definition: Algorithm.cpp:1913
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
Definition: Algorithm.cpp:2076
virtual std::shared_ptr< Algorithm > createChildAlgorithm(const std::string &name, const double startProgress=-1., const double endProgress=-1., const bool enableLogging=true, const int &version=-1)
Create a Child Algorithm.
Definition: Algorithm.cpp:842
Kernel::Logger & g_log
Definition: Algorithm.h:451
@ Save
to specify a file to write to, the file may or may not exist
Definition: FileProperty.h:49
Helper class for reporting progress from algorithms.
Definition: Progress.h:25
A property class for workspaces.
void movedetector(double x, double y, double z, double rotx, double roty, double rotz, const std::string &detname, const Mantid::DataObjects::EventWorkspace_sptr &inputW)
The movedetector function changes detector position and angles.
double intensity(double x, double y, double z, double rotx, double roty, double rotz, const std::string &detname, const std::string &inname, const std::string &outname, const std::string &peakOpt, const std::string &rb_param, const std::string &groupWSName)
Function to optimize.
A simple structure that defines an axis-aligned cuboid shaped bounding box for a geometrical object.
Definition: BoundingBox.h:34
double xMax() const
Return the maximum value of X.
Definition: BoundingBox.h:80
double zMax() const
Return the maximum value of Z.
Definition: BoundingBox.h:88
double yMax() const
Return the maximum value of Y.
Definition: BoundingBox.h:84
CPUTimer : Timer that uses the CPU time, rather than wall-clock time to measure execution time.
Definition: CPUTimer.h:24
Exception for when an item is not found in a collection.
Definition: Exception.h:145
void debug(const std::string &msg)
Logs at debug level.
Definition: Logger.cpp:114
void error(const std::string &msg)
Logs at error level.
Definition: Logger.cpp:77
void information(const std::string &msg)
Logs at information level.
Definition: Logger.cpp:105
void report()
Increments the loop counter by 1, then sends the progress notification on behalf of its algorithm.
Definition: ProgressBase.h:51
The concrete, templated class for properties.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
Class for 3D vectors.
Definition: V3D.h:34
double normalize()
Make a normalized vector (return norm value)
Definition: V3D.cpp:130
double norm() const noexcept
Definition: V3D.h:263
void write(std::ostream &) const
Write out the point values.
Definition: V3D.cpp:330
std::shared_ptr< IAlgorithm > IAlgorithm_sptr
shared pointer to Mantid::API::IAlgorithm
std::shared_ptr< IFunction > IFunction_sptr
shared pointer to the function base class
Definition: IFunction.h:732
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
static double gsl_costFunction(const gsl_vector *v, void *params)
The gsl_costFunction is optimized by GSL simplex.
std::shared_ptr< const EventWorkspace > EventWorkspace_const_sptr
shared pointer to a const Workspace2D
std::shared_ptr< EventWorkspace > EventWorkspace_sptr
shared pointer to the EventWorkspace class
constexpr double deg2rad
Defines units/enum for Crystal work.
Definition: AngleUnits.h:20
std::shared_ptr< const IComponent > IComponent_const_sptr
Typdef of a shared pointer to a const IComponent.
Definition: IComponent.h:161
std::shared_ptr< const Instrument > Instrument_const_sptr
Shared pointer to an const instrument object.
std::vector< double > MantidVec
typedef for the data storage used in Mantid matrix workspaces
Definition: cow_ptr.h:172
@ Input
An input workspace.
Definition: Property.h:53