89 const bool mscatOn =
getProperty(
"MultipleScattering");
95 auto instrument = inputWS->getInstrument();
96 const auto frame = instrument->getReferenceFrame();
99 const auto &sampleShape = inputWS->sample().getShape();
102 const double big(100.);
103 double minX(-big), maxX(big), minY(-big), maxY(big), minZ(-big), maxZ(big);
104 sampleShape.getBoundingBox(maxX, maxY, maxZ, minX, minY, minZ);
105 V3D boxWidth(maxX - minX, maxY - minY, maxZ - minZ);
106 const double radius(0.5 * boxWidth[frame->pointingHorizontal()]),
height(boxWidth[frame->pointingUp()]);
107 const auto &sampleMaterial = sampleShape.material();
109 const size_t nhist(inputWS->getNumberHistograms());
110 Progress prog(
this, 0.0, 1.0, nhist);
113 const auto &spectrumInfo = inputWS->spectrumInfo();
116 for (int64_t i = 0; i < static_cast<int64_t>(nhist); ++i) {
119 if (!spectrumInfo.hasDetectors(i) || spectrumInfo.isMonitor(i) || spectrumInfo.isMasked(i) ||
120 spectrumInfo.l2(i) == 0) {
125 params.
mscat = mscatOn;
126 params.
l1 = spectrumInfo.l1();
127 params.
l2 = spectrumInfo.l2(i);
128 params.
twoTheta = spectrumInfo.twoTheta(i);
131 const auto pos = spectrumInfo.position(i);
134 double _(0.0), theta(0.0), phi(0.0);
135 pos.getSpherical(_, theta, phi);
136 params.
azimuth = asin(sin(theta) * sin(phi));
137 params.
rho = sampleMaterial.numberDensityEffective();
138 params.
sigmaAbs = sampleMaterial.absorbXSection();
139 params.
sigmaSc = sampleMaterial.totalScatterXSection();
142 params.
msNEvents =
static_cast<size_t>(msEvents);
143 params.
msNRuns =
static_cast<size_t>(msRuns);