36 std::string load_grp =
"Load Options";
38 "If true, the edges of the TOF distribution will be cut "
39 "according to the configuration file");
41 "TOF value below which events will not be "
42 "loaded into the workspace at load-time");
44 "TOF value above which events will not be "
45 "loaded into the workspace at load-time");
47 "Wavelength steps to be used when "
48 "rebinning the data before performing "
51 "If true, the masking information "
52 "found in the configuration file "
54 declareProperty(
"UseConfig",
true,
"If true, the best configuration file found will be used");
56 "If true, the TOF will be modified for the true flight path "
57 "from the sample to the detector pixel");
59 declareProperty(
"SkipTOFCorrection",
false,
"If true, the EQSANS TOF correction will be skipped");
60 declareProperty(
"PreserveEvents",
false,
"If true, the output workspace will be an event workspace");
63 "Sample to detector distance to use (overrides meta data), in mm");
66 "Offset to the sample to detector distance (use only when "
67 "using the detector distance found in the meta data), in mm");
69 "Offset applies to the sample position (use only when "
70 "using the detector distance found in the meta data), in mm");
72 "Offset applies to the detector position (use only when "
73 "using the distance found in the meta data), in mm");
75 declareProperty(
"SolidAngleCorrection",
true,
"If true, the solid angle correction will be applied to the data");
76 declareProperty(
"DetectorTubes",
false,
"If true, the solid angle correction for tube detectors will be applied");
79 "Reads the embedded Instrument XML from the NeXus file "
80 "(optional, default True). ");
105 std::string center_grp =
"Beam Center";
106 std::vector<std::string> centerOptions{
"None",
"Value",
"DirectBeam",
"Scattering"};
108 declareProperty(
"BeamCenterMethod",
"None", std::make_shared<StringListValidator>(centerOptions),
109 "Method for determining the data beam center");
113 declareProperty(
"UseConfigBeam",
false,
"If True, the beam center will be taken from the config file");
124 "The name of the input event Nexus file to load");
126 std::make_unique<VisibleWhenProperty>(
"BeamCenterMethod",
IS_NOT_EQUAL_TO,
"None"));
130 auto positiveDouble = std::make_shared<BoundedValidator<double>>();
131 positiveDouble->setLower(0);
135 "Radius of the beam area used the exclude the beam when calculating "
136 "the center of mass of the scattering pattern [pixels]. Default=3.0");
138 std::make_unique<VisibleWhenProperty>(
"BeamCenterMethod",
IS_EQUAL_TO,
"Scattering"));
151 std::string norm_grp =
"Normalisation";
152 std::vector<std::string> incidentBeamNormOptions;
153 incidentBeamNormOptions.emplace_back(
"None");
155 incidentBeamNormOptions.emplace_back(
"Monitor");
158 incidentBeamNormOptions.emplace_back(
"BeamProfileAndCharge");
160 incidentBeamNormOptions.emplace_back(
"Charge");
162 std::make_shared<StringListValidator>(incidentBeamNormOptions),
163 "Options for data normalisation");
165 declareProperty(
"LoadMonitors",
false,
"If true, the monitor workspace will be loaded");
172 "The name of the beam monitor reference file used for normalisation");
181 "The name of the input event Nexus file to load as dark current.");
184 std::string eff_grp =
"Sensitivity";
187 "Flood field or sensitivity file.");
189 "Minimum efficiency for a pixel to be considered (default: no minimum).");
191 "Maximum efficiency for a pixel to be considered (default: no maximum).");
193 "If true, the dark current subtracted "
194 "from the sample data will also be "
195 "subtracted from the flood field.");
198 "The name of the input file to load as dark current.");
200 declareProperty(
"SensitivityBeamCenterMethod",
"None", std::make_shared<StringListValidator>(centerOptions),
201 "Method for determining the sensitivity data beam center");
206 std::make_unique<VisibleWhenProperty>(
"SensitivityBeamCenterMethod",
IS_EQUAL_TO,
"Value"));
210 std::make_unique<VisibleWhenProperty>(
"SensitivityBeamCenterMethod",
IS_EQUAL_TO,
"Value"));
215 "The name of the input data file to load");
217 std::make_unique<VisibleWhenProperty>(
"SensitivityBeamCenterMethod",
IS_NOT_EQUAL_TO,
"None"));
220 "Radius of the beam area used the exclude the beam when calculating "
221 "the center of mass of the scattering pattern [pixels]. Default=3.0");
223 std::make_unique<VisibleWhenProperty>(
"BeamCenterMethod",
IS_EQUAL_TO,
"Scattering"));
225 declareProperty(
"OutputSensitivityWorkspace",
"",
"Name to give the sensitivity workspace");
241 std::string trans_grp =
"Transmission";
242 std::vector<std::string> transOptions{
"Value",
"DirectBeam"};
243 declareProperty(
"TransmissionMethod",
"Value", std::make_shared<StringListValidator>(transOptions),
244 "Transmission determination method");
249 std::make_unique<VisibleWhenProperty>(
"TransmissionMethod",
IS_EQUAL_TO,
"Value"));
252 std::make_unique<VisibleWhenProperty>(
"TransmissionMethod",
IS_EQUAL_TO,
"Value"));
255 declareProperty(
"TransmissionBeamRadius", 3.0,
"Radius of the beam area used to compute the transmission [pixels]");
257 std::make_unique<VisibleWhenProperty>(
"TransmissionMethod",
IS_EQUAL_TO,
"DirectBeam"));
260 "Sample data file for transmission calculation");
262 std::make_unique<VisibleWhenProperty>(
"TransmissionMethod",
IS_EQUAL_TO,
"DirectBeam"));
265 "Empty data file for transmission calculation");
267 std::make_unique<VisibleWhenProperty>(
"TransmissionMethod",
IS_EQUAL_TO,
"DirectBeam"));
268 declareProperty(
"FitFramesTogether",
false,
"If true, the two frames will be fit together");
270 std::make_unique<VisibleWhenProperty>(
"TransmissionMethod",
IS_EQUAL_TO,
"DirectBeam"));
273 declareProperty(
"TransmissionBeamCenterMethod",
"None", std::make_shared<StringListValidator>(centerOptions),
274 "Method for determining the transmission data beam center");
276 std::make_unique<VisibleWhenProperty>(
"TransmissionMethod",
IS_EQUAL_TO,
"DirectBeam"));
281 std::make_unique<VisibleWhenProperty>(
"TransmissionMethod",
IS_EQUAL_TO,
"DirectBeam"));
284 std::make_unique<VisibleWhenProperty>(
"TransmissionMethod",
IS_EQUAL_TO,
"DirectBeam"));
289 "The name of the input data file to load");
291 std::make_unique<VisibleWhenProperty>(
"TransmissionMethod",
IS_EQUAL_TO,
"DirectBeam"));
295 "The name of the input data file to load as transmission dark current.");
297 std::make_unique<VisibleWhenProperty>(
"TransmissionMethod",
IS_NOT_EQUAL_TO,
"Value"));
300 "If true, the sample dark current will be used IF a dark current file is"
303 std::make_unique<VisibleWhenProperty>(
"TransmissionMethod",
IS_NOT_EQUAL_TO,
"Value"));
306 "If true, a theta-dependent transmission correction will be applied.");
326 std::string bck_grp =
"Background";
328 declareProperty(
"BckTransmissionMethod",
"Value", std::make_shared<StringListValidator>(transOptions),
329 "Transmission determination method");
334 std::make_unique<VisibleWhenProperty>(
"BckTransmissionMethod",
IS_EQUAL_TO,
"Value"));
338 std::make_unique<VisibleWhenProperty>(
"BckTransmissionMethod",
IS_EQUAL_TO,
"Value"));
342 "Radius of the beam area used to compute the transmission [pixels]");
344 std::make_unique<VisibleWhenProperty>(
"BckTransmissionMethod",
IS_EQUAL_TO,
"DirectBeam"));
347 "Sample data file for transmission calculation");
349 std::make_unique<VisibleWhenProperty>(
"BckTransmissionMethod",
IS_EQUAL_TO,
"DirectBeam"));
352 "Empty data file for transmission calculation");
354 std::make_unique<VisibleWhenProperty>(
"BckTransmissionMethod",
IS_EQUAL_TO,
"DirectBeam"));
355 declareProperty(
"BckFitFramesTogether",
false,
"If true, the two frames will be fit together");
357 std::make_unique<VisibleWhenProperty>(
"BckTransmissionMethod",
IS_EQUAL_TO,
"DirectBeam"));
360 declareProperty(
"BckTransmissionBeamCenterMethod",
"None", std::make_shared<StringListValidator>(centerOptions),
361 "Method for determining the transmission data beam center");
363 std::make_unique<VisibleWhenProperty>(
"BckTransmissionMethod",
IS_EQUAL_TO,
"DirectBeam"));
367 std::make_unique<VisibleWhenProperty>(
"BckTransmissionMethod",
IS_EQUAL_TO,
"DirectBeam"));
371 std::make_unique<VisibleWhenProperty>(
"BckTransmissionMethod",
IS_EQUAL_TO,
"DirectBeam"));
374 "The name of the input data file to load");
376 std::make_unique<VisibleWhenProperty>(
"BckTransmissionMethod",
IS_EQUAL_TO,
"DirectBeam"));
378 declareProperty(std::make_unique<API::FileProperty>(
"BckTransmissionDarkCurrentFile",
"",
380 "The name of the input data file to load as background "
381 "transmission dark current.");
383 std::make_unique<VisibleWhenProperty>(
"BckTransmissionMethod",
IS_EQUAL_TO,
"BeamSpreader"));
386 "If true, a theta-dependent transmission correction will be applied.");
406 std::string mask_grp =
"Mask";
409 "Number of pixels to mask on the edges: X-low, X-high, Y-low, Y-high");
410 std::vector<std::string> maskOptions{
"None",
"Front",
"Back"};
411 declareProperty(
"MaskedSide",
"None", std::make_shared<StringListValidator>(maskOptions),
412 "Mask one side of the detector");
419 std::string abs_scale_grp =
"Absolute Scale";
420 std::vector<std::string> scaleOptions;
421 scaleOptions.emplace_back(
"None");
422 scaleOptions.emplace_back(
"Value");
423 scaleOptions.emplace_back(
"ReferenceData");
424 declareProperty(
"AbsoluteScaleMethod",
"None", std::make_shared<StringListValidator>(scaleOptions),
425 "Absolute scale correction method");
426 declareProperty(
"AbsoluteScalingFactor", 1.0,
"Absolute scaling factor");
428 std::make_unique<VisibleWhenProperty>(
"AbsoluteScaleMethod",
IS_EQUAL_TO,
"Value"));
430 declareProperty(std::make_unique<API::FileProperty>(
"AbsoluteScalingReferenceFilename",
"",
433 std::make_unique<VisibleWhenProperty>(
"AbsoluteScaleMethod",
IS_EQUAL_TO,
"ReferenceData"));
435 "Beamstop diameter for computing the absolute scale factor [mm]. "
436 "Read from file if not supplied.");
438 std::make_unique<VisibleWhenProperty>(
"AbsoluteScaleMethod",
IS_EQUAL_TO,
"ReferenceData"));
440 "Attenuator transmission value for computing the absolute scale factor");
442 std::make_unique<VisibleWhenProperty>(
"AbsoluteScaleMethod",
IS_EQUAL_TO,
"ReferenceData"));
444 "Apply sensitivity correction to the reference data "
445 "when computing the absolute scale factor");
447 std::make_unique<VisibleWhenProperty>(
"AbsoluteScaleMethod",
IS_EQUAL_TO,
"ReferenceData"));
457 std::string iq1d_grp =
"I(q) Calculation";
459 auto positiveInt = std::make_shared<BoundedValidator<int>>();
460 positiveInt->setLower(0);
461 declareProperty(
"IQNumberOfBins", 100, positiveInt,
"Number of I(q) bins when binning is not specified");
462 declareProperty(
"IQLogBinning",
false,
"I(q) log binning when binning is not specified");
464 "If true and frame skipping is "
465 "used, each frame will have "
467 declareProperty(
"IQScaleResults",
true,
"If true and frame skipping is used, frame 1 will be scaled to frame 2");
468 declareProperty(
"ComputeResolution",
false,
"If true the Q resolution will be computed");
469 declareProperty(
"SampleApertureDiameter", 10.0,
"Sample aperture diameter [mm]");
472 declareProperty(
"IQ2DNumberOfBins", 100, positiveInt,
"Number of I(qx,qy) bins.");
487 declareProperty(
"OutputDirectory",
"",
"Directory to put the output files in");
494 const std::string reductionManagerName =
getProperty(
"ReductionProperties");
495 if (reductionManagerName.empty()) {
496 g_log.
error() <<
"ERROR: Reduction Property Manager name is empty\n";
499 std::shared_ptr<PropertyManager> reductionManager = std::make_shared<PropertyManager>();
500 PropertyManagerDataService::Instance().addOrReplace(reductionManagerName, reductionManager);
506 const std::string processInfo =
getProperty(
"ProcessInfo");
510 const std::string outputDirectory =
getProperty(
"OutputDirectory");
511 reductionManager->declareProperty(
515 const std::string normalization =
getProperty(
"Normalisation");
517 const std::string monitorRefFile =
getPropertyValue(
"MonitorReferenceFile");
521 if (boost::contains(normalization,
"BeamProfileAndCharge")) {
522 normAlg->setProperty(
"NormaliseToBeam",
true);
523 normAlg->setProperty(
"BeamSpectrumFile", monitorRefFile);
524 }
else if (boost::contains(normalization,
"Charge")) {
525 normAlg->setProperty(
"NormaliseToBeam",
false);
526 }
else if (boost::contains(normalization,
"Monitor")) {
527 if (monitorRefFile.empty()) {
528 g_log.
error() <<
"ERROR: normalize-to-monitor was turned ON but no "
529 "reference data was selected\n";
533 normAlg->setProperty(
"NormaliseToMonitor",
true);
534 normAlg->setProperty(
"BeamSpectrumFile", monitorRefFile);
536 normAlg->setPropertyValue(
"ReductionProperties", reductionManagerName);
537 auto normAlgProp = std::make_unique<AlgorithmProperty>(
"NormaliseAlgorithm");
538 normAlgProp->setValue(normAlg->toString());
539 reductionManager->declareProperty(std::move(normAlgProp));
543 const bool useConfigBeam =
getProperty(
"UseConfigBeam");
544 loadAlg->setProperty(
"UseConfigBeam", useConfigBeam);
545 const bool useConfigTOFCuts =
getProperty(
"UseConfigTOFCuts");
546 loadAlg->setProperty(
"UseConfigTOFCuts", useConfigTOFCuts);
547 if (!useConfigTOFCuts) {
549 const double highTOFCut =
getProperty(
"HighTOFCut");
550 loadAlg->setProperty(
"LowTOFCut", lowTOFCut);
551 loadAlg->setProperty(
"HighTOFCut", highTOFCut);
554 const bool skipTOFCorrection =
getProperty(
"SkipTOFCorrection");
555 loadAlg->setProperty(
"SkipTOFCorrection", skipTOFCorrection);
557 const bool correctForFlightPath =
getProperty(
"CorrectForFlightPath");
558 loadAlg->setProperty(
"CorrectForFlightPath", correctForFlightPath);
560 const bool preserveEvents =
getProperty(
"PreserveEvents");
561 loadAlg->setProperty(
"PreserveEvents", preserveEvents);
563 loadAlg->setProperty(
"LoadMonitors", (loadMonitors && monitorRefFile.empty()));
565 const double sdd =
getProperty(
"SampleDetectorDistance");
566 loadAlg->setProperty(
"SampleDetectorDistance", sdd);
567 const double sddOffset =
getProperty(
"SampleDetectorDistanceOffset");
568 loadAlg->setProperty(
"SampleDetectorDistanceOffset", sddOffset);
569 const double dOffset =
getProperty(
"DetectorOffset");
570 loadAlg->setProperty(
"DetectorOffset", dOffset);
571 const double sOffset =
getProperty(
"SampleOffset");
572 loadAlg->setProperty(
"SampleOffset", sOffset);
573 const double wlStep =
getProperty(
"WavelengthStep");
574 loadAlg->setProperty(
"WavelengthStep", wlStep);
577 loadAlg->setProperty(
"UseConfig", useConfig);
578 const bool useConfigMask =
getProperty(
"UseConfigMask");
579 loadAlg->setProperty(
"UseConfigMask", useConfigMask);
580 const bool loadNexusInstrumentXML =
getProperty(
"LoadNexusInstrumentXML");
581 loadAlg->setProperty(
"LoadNexusInstrumentXML", loadNexusInstrumentXML);
582 auto loadAlgProp = std::make_unique<AlgorithmProperty>(
"LoadAlgorithm");
583 loadAlgProp->setValue(loadAlg->toString());
584 reductionManager->declareProperty(std::move(loadAlgProp));
588 if (!darkCurrentFile.empty()) {
590 darkAlg->setProperty(
"Filename", darkCurrentFile);
591 darkAlg->setProperty(
"OutputDarkCurrentWorkspace",
"");
592 darkAlg->setPropertyValue(
"ReductionProperties", reductionManagerName);
593 auto dcAlgProp = std::make_unique<AlgorithmProperty>(
"DarkCurrentAlgorithm");
594 dcAlgProp->setValue(darkAlg->toString());
595 reductionManager->declareProperty(std::move(dcAlgProp));
600 darkDefaultAlg->setProperty(
"OutputDarkCurrentWorkspace",
"");
601 darkDefaultAlg->setPropertyValue(
"ReductionProperties", reductionManagerName);
602 auto ddcAlgProp = std::make_unique<AlgorithmProperty>(
"DefaultDarkCurrentAlgorithm");
603 ddcAlgProp->setValue(darkDefaultAlg->toString());
604 reductionManager->declareProperty(std::move(ddcAlgProp));
607 const bool solidAngleCorrection =
getProperty(
"SolidAngleCorrection");
608 if (solidAngleCorrection) {
609 const bool detectorTubes =
getProperty(
"DetectorTubes");
611 solidAlg->setProperty(
"DetectorTubes", detectorTubes);
612 auto ssaAlgProp = std::make_unique<AlgorithmProperty>(
"SANSSolidAngleCorrection");
613 ssaAlgProp->setValue(solidAlg->toString());
614 reductionManager->declareProperty(std::move(ssaAlgProp));
618 const double beamCenterX =
getProperty(
"BeamCenterX");
619 const double beamCenterY =
getProperty(
"BeamCenterY");
623 if (boost::iequals(centerMethod,
"Value")) {
628 }
else if (!boost::iequals(centerMethod,
"None")) {
629 bool useDirectBeamMethod =
true;
630 if (!boost::iequals(centerMethod,
"DirectBeam"))
631 useDirectBeamMethod =
false;
632 const std::string beamCenterFile =
getProperty(
"BeamCenterFile");
633 if (!beamCenterFile.empty()) {
634 const double beamRadius =
getProperty(
"BeamRadius");
637 ctrAlg->setProperty(
"Filename", beamCenterFile);
638 ctrAlg->setProperty(
"UseDirectBeamMethod", useDirectBeamMethod);
640 ctrAlg->setProperty(
"BeamRadius", beamRadius);
641 ctrAlg->setPropertyValue(
"ReductionProperties", reductionManagerName);
643 auto ctrAlgProp = std::make_unique<AlgorithmProperty>(
"SANSBeamFinderAlgorithm");
644 ctrAlgProp->setValue(ctrAlg->toString());
645 reductionManager->declareProperty(std::move(ctrAlgProp));
647 g_log.
error() <<
"ERROR: Beam center determination was required"
648 " but no file was provided\n";
658 const double thickness =
getProperty(
"SampleThickness");
661 thickAlg->setProperty(
"SampleThickness", thickness);
663 auto geomAlgProp = std::make_unique<AlgorithmProperty>(
"GeometryAlgorithm");
664 geomAlgProp->setValue(thickAlg->toString());
665 reductionManager->declareProperty(std::move(geomAlgProp));
671 const std::string maskSide =
getProperty(
"MaskedSide");
675 maskAlg->setPropertyValue(
"Facility",
"SNS");
676 maskAlg->setPropertyValue(
"MaskedDetectorList", maskDetList);
677 maskAlg->setPropertyValue(
"MaskedEdges", maskEdges);
678 maskAlg->setProperty(
"MaskedSide", maskSide);
679 auto maskAlgProp = std::make_unique<AlgorithmProperty>(
"MaskAlgorithm");
680 maskAlgProp->setValue(maskAlg->toString());
681 reductionManager->declareProperty(std::move(maskAlgProp));
684 const std::string absScaleMethod =
getProperty(
"AbsoluteScaleMethod");
685 if (boost::iequals(absScaleMethod,
"Value")) {
686 const double absScaleFactor =
getProperty(
"AbsoluteScalingFactor");
689 absAlg->setProperty(
"Method", absScaleMethod);
690 absAlg->setProperty(
"ScalingFactor", absScaleFactor);
691 absAlg->setPropertyValue(
"ReductionProperties", reductionManagerName);
692 auto absAlgProp = std::make_unique<AlgorithmProperty>(
"AbsoluteScaleAlgorithm");
693 absAlgProp->setValue(absAlg->toString());
694 reductionManager->declareProperty(std::move(absAlgProp));
695 }
else if (boost::iequals(absScaleMethod,
"ReferenceData")) {
696 const std::string absRefFile =
getPropertyValue(
"AbsoluteScalingReferenceFilename");
697 const double beamDiam =
getProperty(
"AbsoluteScalingBeamDiameter");
698 const double attTrans =
getProperty(
"AbsoluteScalingAttenuatorTrans");
699 const bool applySensitivity =
getProperty(
"AbsoluteScalingApplySensitivity");
702 absAlg->setProperty(
"Method", absScaleMethod);
703 absAlg->setProperty(
"ReferenceDataFilename", absRefFile);
704 absAlg->setProperty(
"BeamstopDiameter", beamDiam);
705 absAlg->setProperty(
"AttenuatorTransmission", attTrans);
706 absAlg->setProperty(
"ApplySensitivity", applySensitivity);
707 absAlg->setPropertyValue(
"ReductionProperties", reductionManagerName);
708 auto scaleAlgProp = std::make_unique<AlgorithmProperty>(
"AbsoluteScaleAlgorithm");
709 scaleAlgProp->setValue(absAlg->toString());
710 reductionManager->declareProperty(std::move(scaleAlgProp));
714 const bool doAveraging =
getProperty(
"DoAzimuthalAverage");
717 const bool logBinning =
getProperty(
"IQLogBinning");
718 const double sampleApert =
getProperty(
"SampleApertureDiameter");
719 const bool computeResolution =
getProperty(
"ComputeResolution");
720 const bool indepBinning =
getProperty(
"IQIndependentBinning");
721 const bool scaleResults =
getProperty(
"IQScaleResults");
724 iqAlg->setPropertyValue(
"NumberOfBins", nBins);
725 iqAlg->setProperty(
"LogBinning", logBinning);
726 iqAlg->setProperty(
"ScaleResults", scaleResults);
727 iqAlg->setProperty(
"ComputeResolution", computeResolution);
728 iqAlg->setProperty(
"IndependentBinning", indepBinning);
729 iqAlg->setProperty(
"SampleApertureDiameter", sampleApert);
730 iqAlg->setPropertyValue(
"ReductionProperties", reductionManagerName);
732 auto iqalgProp = std::make_unique<AlgorithmProperty>(
"IQAlgorithm");
733 iqalgProp->setValue(iqAlg->toString());
734 reductionManager->declareProperty(std::move(iqalgProp));
738 const bool do2DReduction =
getProperty(
"Do2DReduction");
742 iqAlg->setPropertyValue(
"NumberOfBins", n_bins);
743 auto xyalgProp = std::make_unique<AlgorithmProperty>(
"IQXYAlgorithm");
744 xyalgProp->setValue(iqAlg->toString());
745 reductionManager->declareProperty(std::move(xyalgProp));
750 auto setupAlgProp = std::make_unique<AlgorithmProperty>(
"SetupAlgorithm");
752 reductionManager->declareProperty(std::move(setupAlgProp));
756 const std::string reductionManagerName =
getProperty(
"ReductionProperties");
759 if (!sensitivityFile.empty()) {
760 const bool useSampleDC =
getProperty(
"UseDefaultDC");
761 const std::string sensitivityDarkCurrentFile =
getPropertyValue(
"SensitivityDarkCurrentFile");
762 const std::string outputSensitivityWS =
getPropertyValue(
"OutputSensitivityWorkspace");
763 const double minEff =
getProperty(
"MinEfficiency");
764 const double maxEff =
getProperty(
"MaxEfficiency");
765 const double sensitivityBeamCenterX =
getProperty(
"SensitivityBeamCenterX");
766 const double sensitivityBeamCenterY =
getProperty(
"SensitivityBeamCenterY");
769 effAlg->setProperty(
"Filename", sensitivityFile);
770 effAlg->setProperty(
"UseSampleDC", useSampleDC);
771 effAlg->setProperty(
"DarkCurrentFile", sensitivityDarkCurrentFile);
772 effAlg->setProperty(
"MinEfficiency", minEff);
773 effAlg->setProperty(
"MaxEfficiency", maxEff);
776 const std::string centerMethod =
getPropertyValue(
"SensitivityBeamCenterMethod");
777 if (boost::iequals(centerMethod,
"Value")) {
778 if (!
isEmpty(sensitivityBeamCenterX) && !
isEmpty(sensitivityBeamCenterY)) {
779 effAlg->setProperty(
"BeamCenterX", sensitivityBeamCenterX);
780 effAlg->setProperty(
"BeamCenterY", sensitivityBeamCenterY);
782 }
else if (boost::iequals(centerMethod,
"DirectBeam") || boost::iequals(centerMethod,
"Scattering")) {
783 const std::string beamCenterFile =
getProperty(
"SensitivityBeamCenterFile");
784 const double sensitivityBeamRadius =
getProperty(
"SensitivityBeamCenterRadius");
785 bool useDirectBeam = boost::iequals(centerMethod,
"DirectBeam");
786 if (!beamCenterFile.empty()) {
788 ctrAlg->setProperty(
"Filename", beamCenterFile);
789 ctrAlg->setProperty(
"UseDirectBeamMethod", useDirectBeam);
790 ctrAlg->setProperty(
"PersistentCorrection",
false);
791 if (!
isEmpty(sensitivityBeamRadius))
792 ctrAlg->setProperty(
"BeamRadius", sensitivityBeamRadius);
793 ctrAlg->setPropertyValue(
"ReductionProperties", reductionManagerName);
795 auto sensAlgProp = std::make_unique<AlgorithmProperty>(
"SensitivityBeamCenterAlgorithm");
796 sensAlgProp->setValue(ctrAlg->toString());
797 reductionManager->declareProperty(std::move(sensAlgProp));
799 g_log.
error() <<
"ERROR: Sensitivity beam center determination was required"
800 " but no file was provided\n";
804 effAlg->setPropertyValue(
"OutputSensitivityWorkspace", outputSensitivityWS);
805 effAlg->setPropertyValue(
"ReductionProperties", reductionManagerName);
807 auto algProp = std::make_unique<AlgorithmProperty>(
"SensitivityAlgorithm");
808 algProp->setValue(effAlg->toString());
809 reductionManager->declareProperty(std::move(algProp));
813 const std::string reductionManagerName =
getProperty(
"ReductionProperties");
815 const bool thetaDependentTrans =
getProperty(
"ThetaDependentTransmission");
816 const std::string transMethod =
getProperty(
"TransmissionMethod");
817 const std::string darkCurrent =
getPropertyValue(
"TransmissionDarkCurrentFile");
818 const bool useSampleDC =
getProperty(
"TransmissionUseSampleDC");
821 if (boost::iequals(transMethod,
"Value")) {
822 const double transValue =
getProperty(
"TransmissionValue");
823 const double transError =
getProperty(
"TransmissionError");
826 transAlg->setProperty(
"TransmissionValue", transValue);
827 transAlg->setProperty(
"TransmissionError", transError);
828 transAlg->setProperty(
"ThetaDependent", thetaDependentTrans);
830 auto algProp = std::make_unique<AlgorithmProperty>(
"TransmissionAlgorithm");
831 algProp->setValue(transAlg->toString());
832 reductionManager->declareProperty(std::move(algProp));
835 "expected transmission/error values and got empty values");
839 else if (boost::iequals(transMethod,
"DirectBeam")) {
840 const std::string sampleFilename =
getPropertyValue(
"TransmissionSampleDataFile");
841 const std::string emptyFilename =
getPropertyValue(
"TransmissionEmptyDataFile");
842 const double beamRadius =
getProperty(
"TransmissionBeamRadius");
843 const bool fitFramesTogether =
getProperty(
"FitFramesTogether");
844 const double beamX =
getProperty(
"TransmissionBeamCenterX");
845 const double beamY =
getProperty(
"TransmissionBeamCenterY");
846 const std::string centerMethod =
getPropertyValue(
"TransmissionBeamCenterMethod");
849 transAlg->setProperty(
"FitFramesTogether", fitFramesTogether);
850 transAlg->setProperty(
"SampleDataFilename", sampleFilename);
851 transAlg->setProperty(
"EmptyDataFilename", emptyFilename);
852 transAlg->setProperty(
"BeamRadius", beamRadius);
853 transAlg->setProperty(
"DarkCurrentFilename", darkCurrent);
854 transAlg->setProperty(
"UseSampleDarkCurrent", useSampleDC);
857 if (boost::iequals(centerMethod,
"Value") && !
isEmpty(beamX) && !
isEmpty(beamY)) {
858 transAlg->setProperty(
"BeamCenterX", beamX);
859 transAlg->setProperty(
"BeamCenterY", beamY);
860 }
else if (boost::iequals(centerMethod,
"DirectBeam")) {
861 const std::string beamCenterFile =
getProperty(
"TransmissionBeamCenterFile");
862 if (!beamCenterFile.empty()) {
864 ctrAlg->setProperty(
"Filename", beamCenterFile);
865 ctrAlg->setProperty(
"UseDirectBeamMethod",
true);
866 ctrAlg->setProperty(
"PersistentCorrection",
false);
867 ctrAlg->setPropertyValue(
"ReductionProperties", reductionManagerName);
869 auto algProp = std::make_unique<AlgorithmProperty>(
"TransmissionBeamCenterAlgorithm");
870 algProp->setValue(ctrAlg->toString());
871 reductionManager->declareProperty(std::move(algProp));
873 g_log.
error() <<
"ERROR: Transmission beam center determination was required"
874 " but no file was provided\n";
877 transAlg->setProperty(
"ThetaDependent", thetaDependentTrans);
878 auto algProp = std::make_unique<AlgorithmProperty>(
"TransmissionAlgorithm");
879 algProp->setValue(transAlg->toString());
880 reductionManager->declareProperty(std::move(algProp));
885 const std::string reductionManagerName =
getProperty(
"ReductionProperties");
888 if (!backgroundFile.empty())
889 reductionManager->declareProperty(
894 const std::string darkCurrent =
getPropertyValue(
"BckTransmissionDarkCurrentFile");
895 const bool bckThetaDependentTrans =
getProperty(
"BckThetaDependentTransmission");
896 const std::string bckTransMethod =
getProperty(
"BckTransmissionMethod");
897 if (boost::iequals(bckTransMethod,
"Value")) {
898 const double transValue =
getProperty(
"BckTransmissionValue");
899 const double transError =
getProperty(
"BckTransmissionError");
902 transAlg->setProperty(
"TransmissionValue", transValue);
903 transAlg->setProperty(
"TransmissionError", transError);
904 transAlg->setProperty(
"ThetaDependent", bckThetaDependentTrans);
906 auto algProp = std::make_unique<AlgorithmProperty>(
"BckTransmissionAlgorithm");
907 algProp->setValue(transAlg->toString());
908 reductionManager->declareProperty(std::move(algProp));
911 "expected transmission/error values and got empty values");
913 }
else if (boost::iequals(bckTransMethod,
"DirectBeam")) {
914 const std::string sampleFilename =
getPropertyValue(
"BckTransmissionSampleDataFile");
915 const std::string emptyFilename =
getPropertyValue(
"BckTransmissionEmptyDataFile");
916 const double beamRadius =
getProperty(
"BckTransmissionBeamRadius");
917 const double beamX =
getProperty(
"BckTransmissionBeamCenterX");
918 const double beamY =
getProperty(
"BckTransmissionBeamCenterY");
919 const bool thetaDependentTrans =
getProperty(
"BckThetaDependentTransmission");
920 const bool useSampleDC =
getProperty(
"TransmissionUseSampleDC");
921 const bool fitFramesTogether =
getProperty(
"BckFitFramesTogether");
924 transAlg->setProperty(
"FitFramesTogether", fitFramesTogether);
925 transAlg->setProperty(
"SampleDataFilename", sampleFilename);
926 transAlg->setProperty(
"EmptyDataFilename", emptyFilename);
927 transAlg->setProperty(
"BeamRadius", beamRadius);
928 transAlg->setProperty(
"DarkCurrentFilename", darkCurrent);
929 transAlg->setProperty(
"UseSampleDarkCurrent", useSampleDC);
932 const std::string centerMethod =
getPropertyValue(
"BckTransmissionBeamCenterMethod");
933 if (boost::iequals(centerMethod,
"Value") && !
isEmpty(beamX) && !
isEmpty(beamY)) {
934 transAlg->setProperty(
"BeamCenterX", beamX);
935 transAlg->setProperty(
"BeamCenterY", beamY);
936 }
else if (boost::iequals(centerMethod,
"DirectBeam")) {
937 const std::string beamCenterFile =
getProperty(
"BckTransmissionBeamCenterFile");
938 if (!beamCenterFile.empty()) {
940 ctrAlg->setProperty(
"Filename", beamCenterFile);
941 ctrAlg->setProperty(
"UseDirectBeamMethod",
true);
942 ctrAlg->setProperty(
"PersistentCorrection",
false);
943 ctrAlg->setPropertyValue(
"ReductionProperties", reductionManagerName);
945 auto algProp = std::make_unique<AlgorithmProperty>(
"BckTransmissionBeamCenterAlgorithm");
946 algProp->setValue(ctrAlg->toString());
947 reductionManager->declareProperty(std::move(algProp));
949 g_log.
error() <<
"ERROR: Beam center determination was required"
950 " but no file was provided\n";
953 transAlg->setProperty(
"DarkCurrentFilename", darkCurrent);
954 transAlg->setProperty(
"ThetaDependent", thetaDependentTrans);
955 auto algProp = std::make_unique<AlgorithmProperty>(
"BckTransmissionAlgorithm");
956 algProp->setValue(transAlg->toString());
957 reductionManager->declareProperty(std::move(algProp));