Mantid
Loading...
Searching...
No Matches
LoadIsawPeaks.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 +
11#include "MantidAPI/Run.h"
12#include "MantidAPI/Sample.h"
22#include "MantidKernel/Unit.h"
23
24#include <boost/algorithm/string/trim.hpp>
25#include <map>
26#include <utility>
27
31
32namespace Mantid::Crystal {
33
35
36using namespace Mantid::Kernel;
37using namespace Mantid::API;
38using namespace Mantid::DataObjects;
39using namespace Mantid::Geometry;
40
48 const std::string &extn = descriptor.extension();
49 // If the extension is peaks or integrate then give it a go
50 if (extn != ".peaks" && extn != ".integrate")
51 return 0;
52
53 int confidence(0);
54 try {
55 auto &in = descriptor.data();
56 // Read the header, load the instrument
57 std::string tag;
58 std::string r = getWord(in, false);
59
60 if (r.length() < 1)
61 throw std::logic_error(std::string("No first line of Peaks file"));
62
63 if (r != "Version:")
64 throw std::logic_error(std::string("No Version: on first line of Peaks file"));
65
66 std::string C_version = getWord(in, false);
67 if (C_version.length() < 1)
68 throw std::logic_error(std::string("No Version for Peaks file"));
69
70 getWord(in, false); // tag
71 getWord(in, false); // C_Facility
72
73 getWord(in, false); // tag
74 std::string C_Instrument = getWord(in, false);
75
76 if (C_Instrument.length() < 1)
77 throw std::logic_error(std::string("No Instrument for Peaks file"));
78
79 // Date: use the current date/time if not found
80 Types::Core::DateAndTime C_experimentDate;
81 tag = getWord(in, false);
82 if (tag == "Date:")
83 getWord(in, false);
84 readToEndOfLine(in, true);
85 confidence = 95;
86 } catch (std::exception &) {
87 }
88
89 return confidence;
90}
91
92//----------------------------------------------------------------------------------------------
96 const std::vector<std::string> exts{".peaks", ".integrate"};
97 declareProperty(std::make_unique<FileProperty>("Filename", "", FileProperty::Load, exts),
98 "Path to an ISAW-style .peaks filename.");
99 declareProperty(std::make_unique<WorkspaceProperty<Workspace>>("OutputWorkspace", "", Direction::Output),
100 "Name of the output workspace.");
101}
102
103//----------------------------------------------------------------------------------------------
107 // the workspace
109
110 // This loads (appends) the peaks
111 this->appendFile(ws, getPropertyValue("Filename"));
112
113 // Save it in the output
114 setProperty("OutputWorkspace", std::dynamic_pointer_cast<Workspace>(ws));
115
116 this->checkNumberPeaks(ws, getPropertyValue("Filename"));
117}
118
119//-----------------------------------------------------------------------------------------------
126std::string LoadIsawPeaks::readHeader(const PeaksWorkspace_sptr &outWS, std::ifstream &in, double &T0) {
127 std::string tag;
128 std::string r = getWord(in, false);
129
130 if (r.length() < 1)
131 throw std::logic_error(std::string("No first line of Peaks file"));
132
133 if (r != "Version:")
134 throw std::logic_error(std::string("No Version: on first line of Peaks file"));
135
136 std::string C_version = getWord(in, false);
137 if (C_version.length() < 1)
138 throw std::logic_error(std::string("No Version for Peaks file"));
139
140 getWord(in, false); // tag
141 getWord(in, false); // C_Facility
142
143 getWord(in, false); // tag
144 std::string C_Instrument = getWord(in, false);
145
146 if (C_Instrument.length() < 1)
147 throw std::logic_error(std::string("No Instrument for Peaks file"));
148
149 // Date: use the current date/time if not found
150 Types::Core::DateAndTime C_experimentDate;
151 std::string date;
152 tag = getWord(in, false);
153 if (tag.empty())
154 date = Types::Core::DateAndTime::getCurrentTime().toISO8601String();
155 else if (tag == "Date:")
156 date = getWord(in, false);
157 tag = getWord(in, false);
158 m_isModulatedStructure = tag == "MOD";
159 readToEndOfLine(in, true);
160
161 // Now we load the instrument using the name and date
162 MatrixWorkspace_sptr tempWS = WorkspaceFactory::Instance().create("Workspace2D", 1, 1, 1);
163 tempWS->mutableRun().addProperty<std::string>("run_start", date);
164
165 auto loadInst = createChildAlgorithm("LoadInstrument");
166 loadInst->setPropertyValue("InstrumentName", C_Instrument);
167 loadInst->setProperty("RewriteSpectraMap", Mantid::Kernel::OptionalBool(true));
168 loadInst->setProperty<MatrixWorkspace_sptr>("Workspace", tempWS);
169 loadInst->executeAsChildAlg();
170
171 // Populate the instrument parameters in this workspace - this works around a
172 // bug
173 tempWS->populateInstrumentParameters();
174 Geometry::Instrument_const_sptr instr = tempWS->getInstrument();
175 outWS->setInstrument(instr);
176
177 auto applyCal = createChildAlgorithm("LoadIsawDetCal");
178 applyCal->initialize();
179 applyCal->setProperty("InputWorkspace", outWS);
180 applyCal->setProperty("Filename", getPropertyValue("Filename"));
181 applyCal->executeAsChildAlg();
182 T0 = applyCal->getProperty("TimeOffset");
183
184 // Now skip all lines on L1, detector banks, etc. until we get to a block of
185 // peaks. They start with 0.
186 std::string s;
187 std::vector<int> det;
188 while (s != "0" && in.good()) {
189 readToEndOfLine(in, true);
190 s = getWord(in, false);
191 int bank = 0;
192 // Save all bank numbers in header lines
193 Strings::convert(getWord(in, false), bank);
194 if (s == "5")
195 det.emplace_back(bank);
196 }
197 // Find bank numbers in instument that are not in header lines
198 std::string maskBanks;
199 if (!instr)
200 throw std::runtime_error("No instrument in the Workspace. Cannot save DetCal file.");
201 // We cannot assume the peaks have bank type detector modules, so we have a
202 // string to check this
203 std::string bankPart = "bank";
204 if (instr->getName() == "WISH")
205 bankPart = "WISHpanel";
206 // Get all children
207 std::vector<IComponent_const_sptr> comps;
208 instr->getChildren(comps, true);
209 for (auto &comp : comps) {
210 std::string bankName = comp->getName();
211 boost::trim(bankName);
212 boost::erase_all(bankName, bankPart);
213 int bank = 0;
214 Strings::convert(bankName, bank);
215 for (int j : det) {
216 if (bank == j) {
217 bank = 0;
218 continue;
219 }
220 }
221 if (bank == 0)
222 continue;
223 // Track unique bank numbers
224 maskBanks += bankName + ",";
225 }
226
227 if (!maskBanks.empty()) {
228 // remove last comma
229 maskBanks.resize(maskBanks.size() - 1);
230 // Mask banks that are not in header lines
231 try {
232 Algorithm_sptr alg = createChildAlgorithm("MaskBTP");
233 alg->setProperty<Workspace_sptr>("Workspace", outWS);
234 alg->setProperty("Bank", maskBanks);
235 alg->setProperty("Instrument", instr->getName());
236 if (!alg->execute())
237 throw std::runtime_error("MaskDetectors Child Algorithm has not executed successfully");
238 } catch (...) {
239 g_log.error("Can't execute MaskBTP algorithm");
240 }
241 }
242 return s;
243}
244
245//-----------------------------------------------------------------------------------------------
256DataObjects::Peak LoadIsawPeaks::readPeak(const PeaksWorkspace_sptr &outWS, std::string &lastStr, std::ifstream &in,
257 int &seqNum, const std::string &bankName, double qSign) {
258 double h;
259 double k;
260 double l;
261 double col;
262 double row;
263 double wl;
264 double IPK;
265 double Inti;
266 double SigI;
267
268 std::string s = lastStr;
269
270 if (s.length() < 1 && in.good()) // blank line
271 {
272 readToEndOfLine(in, true);
273 s = getWord(in, false);
274 }
275
276 if (s.length() < 1)
277 throw std::runtime_error("Empty peak line encountered.");
278
279 if (s == "2") {
280 readToEndOfLine(in, true);
281 for (s = getWord(in, false); s.length() < 1 && in.good(); s = getWord(in, true)) {
282 s = getWord(in, false);
283 }
284 }
285
286 if (s.length() < 1)
287 throw std::runtime_error("Empty peak line encountered.");
288
292 if (s != "3" && s != "9")
293 throw std::runtime_error("Empty peak line encountered.");
294
295 seqNum = std::stoi(getWord(in, false));
296
297 h = qSign * std::stod(getWord(in, false), nullptr);
298 k = qSign * std::stod(getWord(in, false), nullptr);
299 l = qSign * std::stod(getWord(in, false), nullptr);
300 V3D mod = V3D(0, 0, 0);
301 V3D intHKL = V3D(h, k, l);
303 mod[0] = qSign * std::stoi(getWord(in, false), nullptr);
304 mod[1] = qSign * std::stoi(getWord(in, false), nullptr);
305 mod[2] = qSign * std::stoi(getWord(in, false), nullptr);
306 }
307
308 col = std::stod(getWord(in, false), nullptr);
309 row = std::stod(getWord(in, false), nullptr);
310 UNUSED_ARG(std::stod(getWord(in, false), nullptr)); // chan
311 UNUSED_ARG(std::stod(getWord(in, false), nullptr)); // L2
312 UNUSED_ARG(std::stod(getWord(in, false), nullptr)); // ScatAng
313
314 UNUSED_ARG(std::stod(getWord(in, false), nullptr)); // Az
315 wl = std::stod(getWord(in, false), nullptr);
316 UNUSED_ARG(std::stod(getWord(in, false), nullptr)); // D
317 IPK = std::stod(getWord(in, false), nullptr);
318
319 Inti = std::stod(getWord(in, false), nullptr);
320 SigI = std::stod(getWord(in, false), nullptr);
321 UNUSED_ARG(std::stoi(getWord(in, false))); // iReflag
322
323 // Finish the line and get the first word of next line
324 readToEndOfLine(in, true);
325 lastStr = getWord(in, false);
326
327 // Find the detector ID from row/col
328 Instrument_const_sptr inst = outWS->getInstrument();
329 if (!inst)
330 throw std::runtime_error("No instrument in PeaksWorkspace!");
331
332 int pixelID = findPixelID(inst, bankName, static_cast<int>(col), static_cast<int>(row));
333
334 // Create the peak object
335 Peak peak(outWS->getInstrument(), pixelID, wl);
336 peak.setHKL(h, k, l);
337 peak.setIntHKL(intHKL);
338 peak.setIntMNP(mod);
339 peak.setIntensity(Inti);
340 peak.setSigmaIntensity(SigI);
341 peak.setBinCount(IPK);
342 peak.setPeakNumber(seqNum);
343 // Return the peak
344 return peak;
345}
346
347//----------------------------------------------------------------------------------------------
348int LoadIsawPeaks::findPixelID(const Instrument_const_sptr &inst, const std::string &bankName, int col, int row) {
349 std::shared_ptr<const IComponent> parent = getCachedBankByName(bankName, inst);
350
351 if (!parent)
352 return -1; // peak not in any detector.
353
354 if (parent->type() == "RectangularDetector") {
355 std::shared_ptr<const RectangularDetector> RDet = std::dynamic_pointer_cast<const RectangularDetector>(parent);
356
357 std::shared_ptr<Detector> pixel = RDet->getAtXY(col, row);
358 return pixel->getID();
359 } else {
360 std::vector<Geometry::IComponent_const_sptr> children;
361 std::shared_ptr<const Geometry::ICompAssembly> asmb =
362 std::dynamic_pointer_cast<const Geometry::ICompAssembly>(parent);
363 asmb->getChildren(children, false);
364 if (children[0]->getName() == "sixteenpack") {
365 asmb = std::dynamic_pointer_cast<const Geometry::ICompAssembly>(children[0]);
366 children.clear();
367 asmb->getChildren(children, false);
368 }
369 int col0 = col - 1;
370 // WISH detectors are in bank in this order in instrument
371 if (inst->getName() == "WISH")
372 col0 = (col % 2 == 0 ? col / 2 + 75 : (col - 1) / 2);
373 std::shared_ptr<const Geometry::ICompAssembly> asmb2 =
374 std::dynamic_pointer_cast<const Geometry::ICompAssembly>(children[col0]);
375 std::vector<Geometry::IComponent_const_sptr> grandchildren;
376 asmb2->getChildren(grandchildren, false);
377 Geometry::IComponent_const_sptr first = grandchildren[row - 1];
378 Geometry::IDetector_const_sptr det = std::dynamic_pointer_cast<const Geometry::IDetector>(first);
379 return det->getID();
380 }
381}
382
383//-----------------------------------------------------------------------------------------------
385std::string LoadIsawPeaks::readPeakBlockHeader(std::string lastStr, std::ifstream &in, int &run, int &detName,
386 double &chi, double &phi, double &omega, double &monCount) {
387 std::string s = std::move(lastStr);
388
389 if (s.length() < 1 && in.good()) // blank line
390 {
391 readToEndOfLine(in, true);
392 s = getWord(in, false);
393 }
394
395 if (s.length() < 1)
396 return std::string();
397
398 if (s == "0") {
399 readToEndOfLine(in, true);
400 s = getWord(in, false);
401 while (s.length() < 1) {
402 readToEndOfLine(in, true);
403 s = getWord(in, false);
404 }
405 }
406
407 if (s != "1")
408 return s;
409
410 run = std::stoi(getWord(in, false));
411 detName = std::stoi(getWord(in, false));
412 chi = std::stod(getWord(in, false), nullptr);
413 phi = std::stod(getWord(in, false), nullptr);
414
415 omega = std::stod(getWord(in, false), nullptr);
416 monCount = std::stod(getWord(in, false), nullptr);
417 readToEndOfLine(in, true);
418
419 return getWord(in, false);
420}
421// special formatted file Use clear peaks to no append
422
423//-----------------------------------------------------------------------------------------------
428void LoadIsawPeaks::appendFile(const PeaksWorkspace_sptr &outWS, const std::string &filename) {
429 // HKL's are flipped by -1 because of the internal Q convention
430 // unless Crystallography convention
431 double qSign = -1.0;
432 std::string convention = ConfigService::Instance().getString("Q.convention");
433 if (convention == "Crystallography")
434 qSign = 1.0;
435 // Open the file
436 std::ifstream in(filename.c_str());
437
438 // Calculate filesize
439 in.seekg(0, in.end);
440 auto filelen = in.tellg();
441 in.seekg(0, in.beg);
442
443 // Read the header, load the instrument
444 double T0;
445 auto s = readHeader(outWS, in, T0);
446 // set T0 in the run parameters
447 API::Run &m_run = outWS->mutableRun();
448 m_run.addProperty<double>("T0", T0, true);
449
450 if (!in.good() || s.length() < 1)
451 throw std::runtime_error("End of Peaks file before peaks");
452
453 if (s != "0")
454 throw std::logic_error("No header for Peak segments");
455
456 readToEndOfLine(in, true);
457 s = getWord(in, false);
458
459 int run, bankNum;
460 double chi, phi, omega, monCount;
461
462 // Build the universal goniometer that will build the rotation matrix.
464 uniGonio.makeUniversalGoniometer();
465
466 // Progress is reported based on how much of the file we've read
467 Progress prog(this, 0.0, 1.0, filelen);
468
469 while (in.good()) {
470 // Read the header if necessary
471 s = readPeakBlockHeader(s, in, run, bankNum, chi, phi, omega, monCount);
472 // Build the Rotation matrix using phi,chi,omega
473 uniGonio.setRotationAngle("phi", phi);
474 uniGonio.setRotationAngle("chi", chi);
475 uniGonio.setRotationAngle("omega", omega);
476 // Put goniometer into peaks workspace
477 outWS->mutableRun().setGoniometer(uniGonio, false);
478
479 std::ostringstream oss;
480 std::string bankString = "bank";
481 if (outWS->getInstrument()->getName() == "WISH") {
482 if (bankNum < 10)
483 bankString = "WISHpanel0";
484 else
485 bankString = "WISHpanel";
486 }
487 oss << bankString << bankNum;
488 std::string bankName = oss.str();
489
490 int seqNum;
491
492 try {
493 // Read the peak
494 Peak peak = readPeak(outWS, s, in, seqNum, bankName, qSign);
495
496 // Get the calculated goniometer matrix
497 const Matrix<double> &gonMat = uniGonio.getR();
498
499 peak.setGoniometerMatrix(gonMat);
500 peak.setRunNumber(run);
501 peak.setMonitorCount(monCount);
502
503 double tof = peak.getTOF();
505
506 wl.initialize(peak.getL1(), 0, {{UnitParams::l2, peak.getL2()}, {UnitParams::twoTheta, peak.getScattering()}});
507
508 peak.setWavelength(wl.singleFromTOF(tof));
509 // Add the peak to workspace
510 outWS->addPeak(peak);
511 } catch (std::runtime_error &e) {
512 g_log.error() << "Error reading peak SEQN " << seqNum << " : " << e.what() << '\n';
513 throw std::runtime_error("Corrupted input file. ");
514 }
515
516 prog.report(in.tellg());
517 }
518 try {
519 if (m_isModulatedStructure) {
520 auto findUB = createChildAlgorithm("FindUBUsingIndexedPeaks");
521 findUB->setPropertyValue("ToleranceForSatellite", "0.05");
522 findUB->setProperty<PeaksWorkspace_sptr>("PeaksWorkspace", outWS);
523 findUB->executeAsChildAlg();
524
525 if (outWS->mutableSample().hasOrientedLattice()) {
526 OrientedLattice o_lattice = outWS->mutableSample().getOrientedLattice();
527 auto &peaks = outWS->getPeaks();
528 for (auto &peak : peaks) {
529
530 V3D hkl = peak.getHKL();
531 V3D mnp = peak.getIntMNP();
532 for (int i = 0; i <= 2; i++)
533 hkl += o_lattice.getModVec(i) * mnp[i];
534 peak.setHKL(hkl);
535 }
536 }
537 }
538 } catch (std::runtime_error &e) {
539 g_log.warning() << "Could not recalculate modulated UB\n";
540 g_log.warning() << "Load a modulated UB workspace on this workspace to recover the modulation vectors\n";
541 g_log.warning() << "Error calculating UB : " << e.what() << '\n';
542 }
543}
544
545//-----------------------------------------------------------------------------------------------
550void LoadIsawPeaks::checkNumberPeaks(const PeaksWorkspace_sptr &outWS, const std::string &filename) {
551
552 // Open the file
553 std::ifstream in(filename.c_str());
554 std::string first;
555 int NumberPeaks = 0;
556 while (getline(in, first)) {
557 if (first[0] == '3' || first[0] == '9')
558 NumberPeaks++;
559 }
560 if (NumberPeaks != outWS->getNumberPeaks()) {
561 g_log.error() << "Number of peaks in file is " << NumberPeaks << " but only read " << outWS->getNumberPeaks()
562 << '\n';
563 throw std::length_error("Wrong number of peaks read");
564 }
565}
566
567//----------------------------------------------------------------------------------------------
585std::shared_ptr<const IComponent>
586LoadIsawPeaks::getCachedBankByName(const std::string &bankname,
587 const std::shared_ptr<const Geometry::Instrument> &inst) {
588 m_banks.try_emplace(bankname, inst->getComponentByName(bankname));
589 return m_banks[bankname];
590}
591
592} // namespace Mantid::Crystal
std::string getName(const IMDDimension &self)
#define DECLARE_FILELOADER_ALGORITHM(classname)
DECLARE_FILELOADER_ALGORITHM should be used in place of the standard DECLARE_ALGORITHM macro when wri...
#define UNUSED_ARG(x)
Function arguments are sometimes unused in certain implmentations but are required for documentation ...
Definition: System.h:64
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
std::string getPropertyValue(const std::string &name) const override
Get the value of a property as a string.
Definition: Algorithm.cpp:2026
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
@ Load
allowed here which will be passed to the algorithm
Definition: FileProperty.h:52
void addProperty(Kernel::Property *prop, bool overwrite=false)
Add data to the object in the form of a property.
Definition: LogManager.h:79
Helper class for reporting progress from algorithms.
Definition: Progress.h:25
This class stores information regarding an experimental run as a series of log entries.
Definition: Run.h:38
A property class for workspaces.
void checkNumberPeaks(const Mantid::DataObjects::PeaksWorkspace_sptr &outWS, const std::string &filename)
Compare number of peaks in given file to given workspace Throws std::length_error on mismatch.
int findPixelID(const Geometry::Instrument_const_sptr &inst, const std::string &bankName, int col, int row)
void exec() override
Run the algorithm.
std::shared_ptr< const Geometry::IComponent > getCachedBankByName(const std::string &bankname, const std::shared_ptr< const Geometry::Instrument > &inst)
Retrieve cached bank (or load and cache for next time)
std::string readHeader(const Mantid::DataObjects::PeaksWorkspace_sptr &outWS, std::ifstream &in, double &T0)
Reads first line of peaks file and returns first word of next line.
void appendFile(const Mantid::DataObjects::PeaksWorkspace_sptr &outWS, const std::string &filename)
Append peaks from given file to given workspace.
void init() override
Initialise the properties.
DataObjects::Peak readPeak(const DataObjects::PeaksWorkspace_sptr &outWS, std::string &lastStr, std::ifstream &in, int &seqNum, const std::string &bankName, double qSign)
Read a single peak from peaks file.
std::string readPeakBlockHeader(std::string lastStr, std::ifstream &in, int &run, int &detName, double &chi, double &phi, double &omega, double &monCount)
Read the header of a peak block section, returns first word of next line.
bool m_isModulatedStructure
Flag for reading modulated structures.
Definition: LoadIsawPeaks.h:45
int confidence(Kernel::FileDescriptor &descriptor) const override
Returns a confidence value that this algorithm can load a file.
void setSigmaIntensity(double m_sigmaIntensity) override
Set the error on the integrated peak intensity.
Definition: BasePeak.cpp:206
void setIntMNP(const Mantid::Kernel::V3D &MNP) override
Sets the modulated peak structure number.
Definition: BasePeak.cpp:153
void setRunNumber(int m_runNumber) override
Set the run number that measured this peak.
Definition: BasePeak.cpp:82
void setPeakNumber(int m_peakNumber) override
Sets the unique peak number.
Definition: BasePeak.cpp:239
void setMonitorCount(double m_monitorCount) override
Set the monitor count for this peak.
Definition: BasePeak.cpp:90
void setIntensity(double m_intensity) override
Set the integrated peak intensity.
Definition: BasePeak.cpp:198
void setHKL(double H, double K, double L) override
Set all three H,K,L indices of the peak.
Definition: BasePeak.cpp:132
void setIntHKL(const Kernel::V3D &HKL) override
Set int HKL.
Definition: BasePeak.cpp:148
void setGoniometerMatrix(const Mantid::Kernel::Matrix< double > &goniometerMatrix) override
Set the goniometer rotation matrix at which this peak was measured.
Definition: BasePeak.cpp:220
void setBinCount(double m_binCount) override
Set the # of counts in the bin at its peak.
Definition: BasePeak.cpp:202
Structure describing a single-crystal peak.
Definition: Peak.h:34
double getL1() const override
Return the L1 flight path length (source to sample), in meters.
Definition: Peak.cpp:714
double getTOF() const override
Calculate the time of flight (in microseconds) of the neutrons for this peak, using the geometry of t...
Definition: Peak.cpp:379
The class PeaksWorkspace stores information about a set of SCD peaks.
Class to represent a particular goniometer setting, which is described by the rotation matrix.
Definition: Goniometer.h:55
void setRotationAngle(const std::string &name, double value)
Set rotation angle for an axis using motor name.
Definition: Goniometer.cpp:161
void makeUniversalGoniometer()
Make a default universal goniometer with phi,chi,omega angles according to SNS convention.
Definition: Goniometer.cpp:271
const Kernel::DblMatrix & getR() const
Return global rotation matrix.
Definition: Goniometer.cpp:80
Class to implement UB matrix.
const Kernel::V3D getModVec(int j) const
Get modulation vectors for satellites.
Definition: UnitCell.cpp:535
Defines a wrapper around an open file.
std::istream & data()
Access the open file stream.
const std::string & extension() const
Access the file extension.
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
void error(const std::string &msg)
Logs at error level.
Definition: Logger.cpp:77
void warning(const std::string &msg)
Logs at warning level.
Definition: Logger.cpp:86
Numerical Matrix class.
Definition: Matrix.h:42
OptionalBool : Tri-state bool.
Definition: OptionalBool.h:25
void report()
Increments the loop counter by 1, then sends the progress notification on behalf of its algorithm.
Definition: ProgressBase.h:51
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
void initialize(const double &_l1, const int &_emode, const UnitParametersMap &params)
Initialize the unit to perform conversion using singleToTof() and singleFromTof()
Definition: Unit.cpp:132
Wavelength in Angstrom.
Definition: Unit.h:302
Class for 3D vectors.
Definition: V3D.h:34
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
Definition: Workspace_fwd.h:20
Kernel::Logger g_log("ExperimentInfo")
static logger object
std::shared_ptr< Algorithm > Algorithm_sptr
Typedef for a shared pointer to an Algorithm.
Definition: Algorithm.h:61
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::shared_ptr< PeaksWorkspace > PeaksWorkspace_sptr
Typedef for a shared pointer to a peaks workspace.
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 Mantid::Geometry::IDetector > IDetector_const_sptr
Shared pointer to IDetector (const version)
Definition: IDetector.h:102
std::shared_ptr< const Instrument > Instrument_const_sptr
Shared pointer to an const instrument object.
MANTID_KERNEL_DLL void readToEndOfLine(std::istream &in, bool ConsumeEOL)
Eat everything from the stream until the next EOL.
Definition: Strings.cpp:951
int convert(const std::string &A, T &out)
Convert a string into a number.
Definition: Strings.cpp:665
MANTID_KERNEL_DLL std::string getWord(std::istream &in, bool consumeEOL)
Returns the next word in the stream.
Definition: Strings.cpp:900
static constexpr double h
Planck constant in J*s.
@ Output
An output workspace.
Definition: Property.h:54