Improve sampling of scatter pts in absorption correction simulation
The sampling is now performed according to the volume of each part of the sample\environment that intersects the beam profile Following changes have been made: a) the function IObject::generatePointInObject has been modified so that it returns false rather than raising an exception if it fails to generate a point inside the object that is also in the active region. This is more efficient when it is being called with a maxAttempts value of 1 in an attempt to fairly sample the scatter points among the sample + environment components. This involved a change in IObject and various child classes (MeshObject, CSGObject, MeshObject2D, Container) b) the code that calls IObject::generatePointInObject and cycles through the various parts of the environment\sample has been moved from SampleEnvironment into MCInteractionVolume so that the sample can be included. There is a new function MCInteractionVolume::generatePoint that randomly generates a scatter point across the sample and environment components. Possible the SampleEnvironment class could be retired entirely and just replaced by a vector of IObject items attached to the sample. c) change CSGObject::generatePointInObject to stop calling the fallback method when the maxAttempts parameter equals 1. The fallback method always returns a point if the object's bounding box is inside the active area which doesn't produce the required sampling across the env components. This change has modified the random number sequences used in various tests - including the "sample only" tests d) added some logging to the simulation to show where the scatter points occurred. These show that for Pearl around 6% of the scatter points are in the sample which is less than the 50% assumption previously in the code e) Several changes to the unit tests (MCInteractionVolumeTest.h, MonteCarloAbsorptionTest.h, DirectILLSelfShieldingTest.py). The updated sampling means that the absorption corrections are slightly different than before for cases with a sample + environment. For DirectILLSelfShieldingTest, an extra parameter has been added to underlying algorithm (DirectILLSelfShielding) so that this test can continue to use 300 events per point while the ILLDirectGeometryReductionTest can use 5000 events per point f) some changes to system tests (ILLDirectGeometryReductionTest, complexShapeAbsorptions) The calculation used in ILLDirectGeometryReductionTest wasn't converged (changing the seed gave a ~25% change in the output) so have increased the number of events per point from 300 to 5000. I didn't increase the number of events further because I didn't want to make the runtime of the system test (esp in debug mode) too large
Showing
- Framework/Algorithms/inc/MantidAlgorithms/SampleCorrections/MCAbsorptionStrategy.h 2 additions, 2 deletions...MantidAlgorithms/SampleCorrections/MCAbsorptionStrategy.h
- Framework/Algorithms/inc/MantidAlgorithms/SampleCorrections/MCInteractionVolume.h 4 additions, 0 deletions.../MantidAlgorithms/SampleCorrections/MCInteractionVolume.h
- Framework/Algorithms/src/MonteCarloAbsorption.cpp 3 additions, 1 deletionFramework/Algorithms/src/MonteCarloAbsorption.cpp
- Framework/Algorithms/src/SampleCorrections/MCAbsorptionStrategy.cpp 7 additions, 4 deletions...Algorithms/src/SampleCorrections/MCAbsorptionStrategy.cpp
- Framework/Algorithms/src/SampleCorrections/MCInteractionVolume.cpp 85 additions, 8 deletions.../Algorithms/src/SampleCorrections/MCInteractionVolume.cpp
- Framework/Algorithms/test/MCAbsorptionStrategyTest.h 6 additions, 3 deletionsFramework/Algorithms/test/MCAbsorptionStrategyTest.h
- Framework/Algorithms/test/MCInteractionVolumeTest.h 105 additions, 11 deletionsFramework/Algorithms/test/MCInteractionVolumeTest.h
- Framework/Algorithms/test/MonteCarloAbsorptionTest.h 54 additions, 55 deletionsFramework/Algorithms/test/MonteCarloAbsorptionTest.h
- Framework/Algorithms/test/MonteCarloTesting.h 18 additions, 0 deletionsFramework/Algorithms/test/MonteCarloTesting.h
- Framework/Geometry/inc/MantidGeometry/Instrument/Container.h 9 additions, 8 deletionsFramework/Geometry/inc/MantidGeometry/Instrument/Container.h
- Framework/Geometry/inc/MantidGeometry/Instrument/SampleEnvironment.h 1 addition, 8 deletions...eometry/inc/MantidGeometry/Instrument/SampleEnvironment.h
- Framework/Geometry/inc/MantidGeometry/Objects/CSGObject.h 5 additions, 5 deletionsFramework/Geometry/inc/MantidGeometry/Objects/CSGObject.h
- Framework/Geometry/inc/MantidGeometry/Objects/IObject.h 8 additions, 7 deletionsFramework/Geometry/inc/MantidGeometry/Objects/IObject.h
- Framework/Geometry/inc/MantidGeometry/Objects/MeshObject.h 5 additions, 5 deletionsFramework/Geometry/inc/MantidGeometry/Objects/MeshObject.h
- Framework/Geometry/inc/MantidGeometry/Objects/MeshObject2D.h 6 additions, 5 deletionsFramework/Geometry/inc/MantidGeometry/Objects/MeshObject2D.h
- Framework/Geometry/src/Instrument/SampleEnvironment.cpp 0 additions, 35 deletionsFramework/Geometry/src/Instrument/SampleEnvironment.cpp
- Framework/Geometry/src/Objects/CSGObject.cpp 40 additions, 31 deletionsFramework/Geometry/src/Objects/CSGObject.cpp
- Framework/Geometry/src/Objects/MeshObject.cpp 19 additions, 16 deletionsFramework/Geometry/src/Objects/MeshObject.cpp
- Framework/Geometry/src/Objects/MeshObject2D.cpp 6 additions, 5 deletionsFramework/Geometry/src/Objects/MeshObject2D.cpp
- Framework/Geometry/test/CSGObjectTest.h 31 additions, 21 deletionsFramework/Geometry/test/CSGObjectTest.h
Loading
Please register or sign in to comment