Skip to content
Snippets Groups Projects
Commit 41f260b7 authored by Lynch, Vickie's avatar Lynch, Vickie
Browse files

Refs #19900 fix t0 from LoadIsawDetCal

parent 1f3a6880
No related branches found
No related tags found
No related merge requests found
......@@ -162,8 +162,7 @@ void SaveIsawPeaks::exec() {
const API::Run &run = ws->run();
double T0 = 0.0;
if (run.hasProperty("T0")) {
Kernel::Property *prop = run.getProperty("T0");
T0 = boost::lexical_cast<double, std::string>(prop->value());
T0 = run.getPropertyValueAsType<double>("T0");
if (T0 != 0) {
g_log.notice() << "T0 = " << T0 << '\n';
}
......
......@@ -39,12 +39,12 @@ using namespace DataObjects;
/** Initialisation method
*/
void LoadIsawDetCal::init() {
declareProperty(Kernel::make_unique<WorkspaceProperty<Workspace>>(
declareProperty(Kernel::make_unique<WorkspaceProperty<Workspace> >(
"InputWorkspace", "", Direction::InOut,
boost::make_shared<InstrumentValidator>()),
"The workspace containing the geometry to be calibrated.");
const auto exts = std::vector<std::string>({".DetCal"});
const auto exts = std::vector<std::string>({ ".DetCal" });
declareProperty(
Kernel::make_unique<API::MultipleFileProperty>("Filename", exts),
"The input filename of the ISAW DetCal file (Two files "
......@@ -133,7 +133,7 @@ void LoadIsawDetCal::exec() {
std::string line;
std::string detname;
// Build a list of Rectangular Detectors
std::vector<boost::shared_ptr<RectangularDetector>> detList;
std::vector<boost::shared_ptr<RectangularDetector> > detList;
for (int i = 0; i < inst->nelements(); i++) {
boost::shared_ptr<RectangularDetector> det;
boost::shared_ptr<ICompAssembly> assem;
......@@ -218,7 +218,8 @@ void LoadIsawDetCal::exec() {
alg1->setProperty<MatrixWorkspace_sptr>("OutputWorkspace", inputW);
if (run.hasProperty("T0")) {
double T0IDF = run.getPropertyValueAsType<double>("T0");
alg1->setProperty("Offset", mT0 - T0IDF);
mT0 += T0IDF;
alg1->setProperty("Offset", mT0);
} else {
alg1->setProperty("Offset", mT0);
}
......@@ -226,6 +227,14 @@ void LoadIsawDetCal::exec() {
inputW = alg1->getProperty("OutputWorkspace");
// set T0 in the run parameters
run.addProperty<double>("T0", mT0, true);
} else if (inputP) {
API::Run &run = inputP->mutableRun();
if (run.hasProperty("T0")) {
double T0IDF = run.getPropertyValueAsType<double>("T0");
mT0 += T0IDF;
}
// set T0 in the run parameters
run.addProperty<double>("T0", mT0, true);
}
}
......@@ -375,7 +384,7 @@ Instrument_sptr LoadIsawDetCal::getCheckInst(API::Workspace_sptr ws) {
std::vector<std::string> LoadIsawDetCal::getFilenames() {
std::vector<std::string> filenamesFromPropertyUnraveld;
std::vector<std::vector<std::string>> filenamesFromProperty =
std::vector<std::vector<std::string> > filenamesFromProperty =
this->getProperty("Filename");
for (const auto &outer : filenamesFromProperty) {
std::copy(outer.begin(), outer.end(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment