Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
cf55d9f2
Commit
cf55d9f2
authored
Nov 29, 2017
by
Roman Tolchenov
Browse files
Apply clang format patch. Re #12827
parent
81c5b9af
Changes
44
Hide whitespace changes
Inline
Side-by-side
Framework/API/src/Sample.cpp
View file @
cf55d9f2
...
...
@@ -353,7 +353,7 @@ int Sample::loadNexus(::NeXus::File *file, const std::string &group) {
if
(
!
shape_xml
.
empty
())
{
ShapeFactory
shapeMaker
;
m_shape
=
shapeMaker
.
createShape
(
shape_xml
,
false
/*Don't wrap with <type> tag*/
);
false
/*Don't wrap with <type> tag*/
);
}
Kernel
::
Material
material
;
material
.
loadNexus
(
file
,
"material"
);
...
...
Framework/Algorithms/inc/MantidAlgorithms/AbsorptionCorrection.h
View file @
cf55d9f2
...
...
@@ -114,11 +114,11 @@ protected:
*/
virtual
void
initialiseCachedDistances
()
=
0
;
API
::
MatrixWorkspace_sptr
m_inputWS
;
///< A pointer to the input workspace
API
::
MatrixWorkspace_sptr
m_inputWS
;
///< A pointer to the input workspace
const
Geometry
::
IObject
*
m_sampleObject
;
///< Local cache of sample object.
Kernel
::
V3D
m_beamDirection
;
///< The direction of the beam.
std
::
vector
<
double
>
m_L1s
,
///< Cached L1 distances
m_elementVolumes
;
///< Cached element volumes
Kernel
::
V3D
m_beamDirection
;
///< The direction of the beam.
std
::
vector
<
double
>
m_L1s
,
///< Cached L1 distances
m_elementVolumes
;
///< Cached element volumes
std
::
vector
<
Kernel
::
V3D
>
m_elementPositions
;
///< Cached element positions
size_t
m_numVolumeElements
;
///< The number of volume elements
double
m_sampleVolume
;
///< The total volume of the sample
...
...
Framework/Algorithms/inc/MantidAlgorithms/CreateSampleWorkspace.h
View file @
cf55d9f2
...
...
@@ -71,11 +71,11 @@ private:
double
pixelSpacing
,
const
double
bankDistanceFromSample
,
const
double
sourceSampleDistance
);
Geometry
::
IObject_sptr
createCappedCylinder
(
double
radius
,
double
height
,
const
Kernel
::
V3D
&
baseCentre
,
const
Kernel
::
V3D
&
axis
,
const
std
::
string
&
id
);
const
Kernel
::
V3D
&
baseCentre
,
const
Kernel
::
V3D
&
axis
,
const
std
::
string
&
id
);
Geometry
::
IObject_sptr
createSphere
(
double
radius
,
const
Kernel
::
V3D
&
centre
,
const
std
::
string
&
id
);
const
std
::
string
&
id
);
std
::
vector
<
double
>
evalFunction
(
const
std
::
string
&
functionString
,
const
std
::
vector
<
double
>
&
xVal
,
double
noiseScale
);
...
...
Framework/Algorithms/src/AbsorptionCorrection.cpp
View file @
cf55d9f2
...
...
@@ -244,7 +244,8 @@ void AbsorptionCorrection::retrieveBaseProperties() {
static_cast
<
uint16_t
>
(
0
),
0.0
,
0.0
,
sigma_s
,
0.0
,
sigma_s
,
sigma_atten
);
auto
shape
=
boost
::
shared_ptr
<
IObject
>
(
m_inputWS
->
sample
().
getShape
().
clone
());
auto
shape
=
boost
::
shared_ptr
<
IObject
>
(
m_inputWS
->
sample
().
getShape
().
clone
());
shape
->
setMaterial
(
Material
(
"SetInAbsorptionCorrection"
,
neutron
,
rho
));
m_inputWS
->
mutableSample
().
setShape
(
shape
);
}
...
...
Framework/Algorithms/src/AnyShapeAbsorption.cpp
View file @
cf55d9f2
...
...
@@ -43,7 +43,8 @@ std::string AnyShapeAbsorption::sampleXML() {
void
AnyShapeAbsorption
::
initialiseCachedDistances
()
{
// First, check if a 'gauge volume' has been defined. If not, it's the same as
// the sample.
auto
integrationVolume
=
boost
::
shared_ptr
<
const
IObject
>
(
m_sampleObject
->
clone
());
auto
integrationVolume
=
boost
::
shared_ptr
<
const
IObject
>
(
m_sampleObject
->
clone
());
if
(
m_inputWS
->
run
().
hasProperty
(
"GaugeVolume"
))
{
integrationVolume
=
constructGaugeVolume
();
}
...
...
@@ -120,7 +121,8 @@ void AnyShapeAbsorption::initialiseCachedDistances() {
YSliceThickness
*
ZSliceThickness
;
}
boost
::
shared_ptr
<
const
Geometry
::
IObject
>
AnyShapeAbsorption
::
constructGaugeVolume
()
{
boost
::
shared_ptr
<
const
Geometry
::
IObject
>
AnyShapeAbsorption
::
constructGaugeVolume
()
{
g_log
.
information
(
"Calculating scattering within the gauge volume defined on "
"the input workspace"
);
...
...
Framework/Algorithms/src/CreateSampleWorkspace.cpp
View file @
cf55d9f2
...
...
@@ -504,9 +504,9 @@ Instrument_sptr CreateSampleWorkspace::createTestInstrumentRectangular(
const
double
cylRadius
(
pixelSpacing
/
2
);
const
double
cylHeight
(
0.0002
);
// One object
auto
pixelShape
=
createCappedCylinder
(
cylRadius
,
cylHeight
,
V3D
(
0.0
,
-
cylHeight
/
2.0
,
0.0
),
V3D
(
0.
,
1.0
,
0.
),
"pixel-shape"
);
auto
pixelShape
=
createCappedCylinder
(
cylRadius
,
cylHeight
,
V3D
(
0.0
,
-
cylHeight
/
2.0
,
0.0
),
V3D
(
0.
,
1.0
,
0.
),
"pixel-shape"
);
for
(
int
banknum
=
1
;
banknum
<=
numBanks
;
banknum
++
)
{
// Make a new bank
...
...
@@ -577,8 +577,7 @@ Instrument_sptr CreateSampleWorkspace::createTestInstrumentRectangular(
testInst
->
add
(
chopper
);
// Define a sample as a simple sphere
auto
sampleSphere
=
createSphere
(
0.001
,
V3D
(
0.0
,
0.0
,
0.0
),
"sample-shape"
);
auto
sampleSphere
=
createSphere
(
0.001
,
V3D
(
0.0
,
0.0
,
0.0
),
"sample-shape"
);
ObjComponent
*
sample
=
new
ObjComponent
(
"sample"
,
sampleSphere
,
testInst
.
get
());
testInst
->
setPos
(
0.0
,
0.0
,
0.0
);
...
...
@@ -592,11 +591,9 @@ Instrument_sptr CreateSampleWorkspace::createTestInstrumentRectangular(
/**
* Create a capped cylinder object
*/
IObject_sptr
CreateSampleWorkspace
::
createCappedCylinder
(
double
radius
,
double
height
,
const
V3D
&
baseCentre
,
const
V3D
&
axis
,
const
std
::
string
&
id
)
{
IObject_sptr
CreateSampleWorkspace
::
createCappedCylinder
(
double
radius
,
double
height
,
const
V3D
&
baseCentre
,
const
V3D
&
axis
,
const
std
::
string
&
id
)
{
std
::
ostringstream
xml
;
xml
<<
"<cylinder id=
\"
"
<<
id
<<
"
\"
>"
<<
"<centre-of-bottom-base x=
\"
"
<<
baseCentre
.
X
()
<<
"
\"
y=
\"
"
...
...
@@ -617,8 +614,8 @@ IObject_sptr CreateSampleWorkspace::createCappedCylinder(double radius,
* Create a sphere object
*/
IObject_sptr
CreateSampleWorkspace
::
createSphere
(
double
radius
,
const
V3D
&
centre
,
const
std
::
string
&
id
)
{
const
V3D
&
centre
,
const
std
::
string
&
id
)
{
ShapeFactory
shapeMaker
;
std
::
ostringstream
xml
;
xml
<<
"<sphere id=
\"
"
<<
id
<<
"
\"
>"
...
...
Framework/Algorithms/src/HRPDSlabCanAbsorption.cpp
View file @
cf55d9f2
...
...
@@ -167,7 +167,8 @@ API::MatrixWorkspace_sptr HRPDSlabCanAbsorption::runFlatPlateAbsorption() {
NeutronAtom
neutron
(
static_cast
<
uint16_t
>
(
EMPTY_DBL
()),
static_cast
<
uint16_t
>
(
0
),
0.0
,
0.0
,
sigma_s
,
0.0
,
sigma_s
,
sigma_atten
);
auto
shape
=
boost
::
shared_ptr
<
IObject
>
(
m_inputWS
->
sample
().
getShape
().
clone
());
auto
shape
=
boost
::
shared_ptr
<
IObject
>
(
m_inputWS
->
sample
().
getShape
().
clone
());
shape
->
setMaterial
(
Material
(
"SetInSphericalAbsorption"
,
neutron
,
rho
));
m_inputWS
->
mutableSample
().
setShape
(
shape
);
}
...
...
Framework/Algorithms/src/MultipleScatteringCylinderAbsorption.cpp
View file @
cf55d9f2
...
...
@@ -140,7 +140,7 @@ void MultipleScatteringCylinderAbsorption::exec() {
NeutronAtom
neutron
(
static_cast
<
uint16_t
>
(
EMPTY_DBL
()),
static_cast
<
uint16_t
>
(
0
),
0.0
,
0.0
,
coeff3
,
0.0
,
coeff3
,
coeff1
);
auto
shape
=
boost
::
shared_ptr
<
IObject
>
(
in_WS
->
sample
().
getShape
().
clone
());
auto
shape
=
boost
::
shared_ptr
<
IObject
>
(
in_WS
->
sample
().
getShape
().
clone
());
shape
->
setMaterial
(
Material
(
"SetInMultipleScattering"
,
neutron
,
coeff2
));
in_WS
->
mutableSample
().
setShape
(
shape
);
}
...
...
Framework/Algorithms/src/SampleCorrections/MCInteractionVolume.cpp
View file @
cf55d9f2
...
...
@@ -40,8 +40,8 @@ double attenuation(double rho, double sigma, double length) {
MCInteractionVolume
::
MCInteractionVolume
(
const
API
::
Sample
&
sample
,
const
Geometry
::
BoundingBox
&
activeRegion
,
const
size_t
maxScatterAttempts
)
:
m_sample
(
sample
.
getShape
().
clone
()),
m_env
(
nullptr
),
m_activeRegion
(
activeRegion
),
m_maxScatterAttempts
(
maxScatterAttempts
)
{
:
m_sample
(
sample
.
getShape
().
clone
()),
m_env
(
nullptr
),
m_activeRegion
(
activeRegion
),
m_maxScatterAttempts
(
maxScatterAttempts
)
{
if
(
!
m_sample
->
hasValidShape
())
{
throw
std
::
invalid_argument
(
"MCInteractionVolume() - Sample shape does not have a valid shape."
);
...
...
@@ -93,7 +93,7 @@ double MCInteractionVolume::calculateAbsorption(
m_env
->
generatePoint
(
rng
,
m_activeRegion
,
m_maxScatterAttempts
);
}
else
{
scatterPos
=
m_sample
->
generatePointInObject
(
rng
,
m_activeRegion
,
m_maxScatterAttempts
);
m_maxScatterAttempts
);
}
auto
toStart
=
startPos
-
scatterPos
;
toStart
.
normalize
();
...
...
Framework/Algorithms/src/SphericalAbsorption.cpp
View file @
cf55d9f2
...
...
@@ -124,7 +124,8 @@ void SphericalAbsorption::retrieveBaseProperties() {
NeutronAtom
neutron
(
static_cast
<
uint16_t
>
(
EMPTY_DBL
()),
static_cast
<
uint16_t
>
(
0
),
0.0
,
0.0
,
sigma_s
,
0.0
,
sigma_s
,
sigma_atten
);
auto
shape
=
boost
::
shared_ptr
<
IObject
>
(
m_inputWS
->
sample
().
getShape
().
clone
());
auto
shape
=
boost
::
shared_ptr
<
IObject
>
(
m_inputWS
->
sample
().
getShape
().
clone
());
shape
->
setMaterial
(
Material
(
"SetInSphericalAbsorption"
,
neutron
,
rho
));
m_inputWS
->
mutableSample
().
setShape
(
shape
);
}
...
...
Framework/Algorithms/test/CalculateFlatBackgroundTest.h
View file @
cf55d9f2
...
...
@@ -682,9 +682,8 @@ private:
// Geometry::ReferenceFrame(Geometry::PointingAlong::Y,Geometry::X,Geometry::Left,"")));
const
double
pixelRadius
(
0.05
);
auto
pixelShape
=
ComponentCreationHelper
::
createCappedCylinder
(
pixelRadius
,
0.02
,
V3D
(
0.0
,
0.0
,
0.0
),
V3D
(
0.
,
1.0
,
0.
),
"tube"
);
auto
pixelShape
=
ComponentCreationHelper
::
createCappedCylinder
(
pixelRadius
,
0.02
,
V3D
(
0.0
,
0.0
,
0.0
),
V3D
(
0.
,
1.0
,
0.
),
"tube"
);
const
double
detXPos
(
5.0
);
for
(
int
i
=
0
;
i
<
ndets
;
++
i
)
{
...
...
Framework/Algorithms/test/CopySampleTest.h
View file @
cf55d9f2
...
...
@@ -43,7 +43,8 @@ public:
auto
canShape
=
ComponentCreationHelper
::
cappedCylinderXML
(
0.5
,
1.5
,
V3D
(
0.0
,
0.0
,
0.0
),
V3D
(
0.
,
1.0
,
0.
),
"tube"
);
SampleEnvironment
*
kit
=
new
SampleEnvironment
(
envName
,
boost
::
make_shared
<
Container
>
(
ShapeFactory
().
createShape
(
canShape
)));
envName
,
boost
::
make_shared
<
Container
>
(
ShapeFactory
().
createShape
(
canShape
)));
sample
.
setEnvironment
(
kit
);
OrientedLattice
*
latt
=
new
OrientedLattice
(
1.0
,
2.0
,
3.0
,
90
,
90
,
90
);
sample
.
setOrientedLattice
(
latt
);
...
...
Framework/Algorithms/test/CuboidGaugeVolumeAbsorptionTest.h
View file @
cf55d9f2
...
...
@@ -96,8 +96,7 @@ public:
testWS
->
getAxis
(
0
)
->
unit
()
=
Mantid
::
Kernel
::
UnitFactory
::
Instance
().
create
(
"Wavelength"
);
// Define a sample shape
auto
sampleShape
=
ComponentCreationHelper
::
createCuboid
(
0.025
,
0.03
,
0.02
);
auto
sampleShape
=
ComponentCreationHelper
::
createCuboid
(
0.025
,
0.03
,
0.02
);
testWS
->
mutableSample
().
setShape
(
sampleShape
);
TS_ASSERT_THROWS_NOTHING
(
...
...
Framework/Algorithms/test/DetectorEfficiencyCorTest.h
View file @
cf55d9f2
...
...
@@ -121,8 +121,7 @@ private:
// convert into a Geometry object
bool
addTypeTag
=
true
;
auto
shape
=
ShapeFactory
().
createShape
(
xmlShape
,
addTypeTag
);
auto
shape
=
ShapeFactory
().
createShape
(
xmlShape
,
addTypeTag
);
boost
::
shared_ptr
<
Instrument
>
instrument
=
boost
::
make_shared
<
Instrument
>
();
const
int
ndets
(
2
);
...
...
Framework/Algorithms/test/MonteCarloAbsorptionTest.h
View file @
cf55d9f2
...
...
@@ -52,9 +52,9 @@ void addSample(Mantid::API::MatrixWorkspace_sptr ws,
const
V3D
axis
(
0.0
,
1.0
,
0.0
);
ShapeFactory
shapeMaker
;
auto
can
=
boost
::
make_shared
<
Container
>
(
shapeMaker
.
createShape
(
ComponentCreationHelper
::
cappedCylinderXML
(
radius
,
height
,
baseCentre
,
axis
,
id
)));
auto
can
=
boost
::
make_shared
<
Container
>
(
shapeMaker
.
createShape
(
ComponentCreationHelper
::
cappedCylinderXML
(
radius
,
height
,
baseCentre
,
axis
,
id
)));
can
->
setMaterial
(
Material
(
"CanMaterial"
,
PhysicalConstants
::
getNeutronAtom
(
26
,
0
),
0.01
));
SampleEnvironment
*
env
=
new
SampleEnvironment
(
"can"
,
can
);
...
...
Framework/Crystal/src/AnvredCorrection.cpp
View file @
cf55d9f2
...
...
@@ -359,7 +359,8 @@ void AnvredCorrection::retrieveBaseProperties() {
NeutronAtom
neutron
(
static_cast
<
uint16_t
>
(
EMPTY_DBL
()),
static_cast
<
uint16_t
>
(
0
),
0.0
,
0.0
,
m_smu
,
0.0
,
m_smu
,
m_amu
);
auto
shape
=
boost
::
shared_ptr
<
IObject
>
(
m_inputWS
->
sample
().
getShape
().
clone
());
auto
shape
=
boost
::
shared_ptr
<
IObject
>
(
m_inputWS
->
sample
().
getShape
().
clone
());
shape
->
setMaterial
(
Material
(
"SetInAnvredCorrection"
,
neutron
,
1.0
));
m_inputWS
->
mutableSample
().
setShape
(
shape
);
}
...
...
Framework/Crystal/src/LoadHKL.cpp
View file @
cf55d9f2
...
...
@@ -168,7 +168,7 @@ void LoadHKL::exec() {
mrun
.
addProperty
<
double
>
(
"Radius"
,
radius
,
true
);
NeutronAtom
neutron
(
static_cast
<
uint16_t
>
(
EMPTY_DBL
()),
static_cast
<
uint16_t
>
(
0
),
0.0
,
0.0
,
smu
,
0.0
,
smu
,
amu
);
auto
shape
=
boost
::
shared_ptr
<
IObject
>
(
ws
->
sample
().
getShape
().
clone
());
auto
shape
=
boost
::
shared_ptr
<
IObject
>
(
ws
->
sample
().
getShape
().
clone
());
shape
->
setMaterial
(
Material
(
"SetInLoadHKL"
,
neutron
,
1.0
));
ws
->
mutableSample
().
setShape
(
shape
);
...
...
Framework/Crystal/src/SaveHKL.cpp
View file @
cf55d9f2
...
...
@@ -258,7 +258,8 @@ void SaveHKL::exec() {
NeutronAtom
neutron
(
static_cast
<
uint16_t
>
(
EMPTY_DBL
()),
static_cast
<
uint16_t
>
(
0
),
0.0
,
0.0
,
m_smu
,
0.0
,
m_smu
,
m_amu
);
auto
shape
=
boost
::
shared_ptr
<
IObject
>
(
peaksW
->
sample
().
getShape
().
clone
());
auto
shape
=
boost
::
shared_ptr
<
IObject
>
(
peaksW
->
sample
().
getShape
().
clone
());
shape
->
setMaterial
(
Material
(
"SetInSaveHKL"
,
neutron
,
1.0
));
peaksW
->
mutableSample
().
setShape
(
shape
);
}
...
...
Framework/Crystal/test/SaveHKLTest.h
View file @
cf55d9f2
...
...
@@ -40,7 +40,7 @@ public:
double
amu
=
0.011
;
NeutronAtom
neutron
(
static_cast
<
uint16_t
>
(
EMPTY_DBL
()),
static_cast
<
uint16_t
>
(
0
),
0.0
,
0.0
,
smu
,
0.0
,
smu
,
amu
);
auto
sampleShape
=
boost
::
make_shared
<
CSGObject
>
();
sampleShape
->
setMaterial
(
Material
(
"SetInSaveHKLTest"
,
neutron
,
1.0
));
ws
->
mutableSample
().
setShape
(
sampleShape
);
...
...
Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/VesuvioCalculateMS.h
View file @
cf55d9f2
...
...
@@ -139,7 +139,7 @@ private:
double
m_srcR2
;
// beam penumbra radius (m)
double
m_halfSampleHeight
,
m_halfSampleWidth
,
m_halfSampleThick
;
// (m)
Geometry
::
IObject
const
*
m_sampleShape
;
// sample shape
SampleComptonProperties
*
m_sampleProps
;
// description of sample properties
SampleComptonProperties
*
m_sampleProps
;
// description of sample properties
double
m_detHeight
,
m_detWidth
,
m_detThick
;
// (m)
double
m_tmin
,
m_tmax
,
m_delt
;
// min, max & dt TOF value
double
m_foilRes
;
// resolution in energy of foil
...
...
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment