Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
BinnedSurfaceMaterialTests.cpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file BinnedSurfaceMaterialTests.cpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2017-2018 CERN for the benefit of the Acts project
4
//
5
// This Source Code Form is subject to the terms of the Mozilla Public
6
// License, v. 2.0. If a copy of the MPL was not distributed with this
7
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
9
#include <boost/test/unit_test.hpp>
10
11
#include "
Acts/Material/BinnedSurfaceMaterial.hpp
"
12
#include "
Acts/Material/Material.hpp
"
13
#include "
Acts/Material/MaterialSlab.hpp
"
14
#include "
Acts/Utilities/BinUtility.hpp
"
15
#include "
Acts/Utilities/BinningType.hpp
"
16
17
#include <utility>
18
#include <vector>
19
20
namespace
Acts {
21
22
namespace
Test {
23
25
BOOST_AUTO_TEST_CASE
(BinnedSurfaceMaterial_construction_test) {
26
BinUtility
xyBinning(2, -1., 1.,
open
,
binX
);
27
xyBinning +=
BinUtility
(3, -3., 3.,
open
,
binY
);
28
29
// Constructor a few material properties
30
MaterialSlab
a00(
Material::fromMolarDensity
(1., 2., 3., 4., 5.), 6.);
31
MaterialSlab
a01(
Material::fromMolarDensity
(2., 3., 4., 5., 6.), 7.);
32
MaterialSlab
a02(
Material::fromMolarDensity
(3., 4., 5., 6., 7.), 8.);
33
MaterialSlab
a10(
Material::fromMolarDensity
(4., 5., 6., 7., 8.), 9.);
34
MaterialSlab
a11(
Material::fromMolarDensity
(5., 6., 7., 8., 9.), 10.);
35
MaterialSlab
a12(
Material::fromMolarDensity
(6., 7., 8., 9., 10.), 11.);
36
37
// Prepare the matrix
38
std::vector<MaterialSlab> l0 = {a00, a10};
39
std::vector<MaterialSlab>
l1
= {a01, a11};
40
std::vector<MaterialSlab>
l2
= {a02, a12};
41
42
// Build the matrix
43
std::vector<std::vector<MaterialSlab>>
m
= {
std::move
(l0),
std::move
(l1),
44
std::move
(l2)};
45
46
// Create the material
47
BinnedSurfaceMaterial
bsm(xyBinning,
std::move
(m));
48
49
// Copy the material
50
BinnedSurfaceMaterial
bsmCopy(bsm);
51
52
// Assignment operation
53
BinnedSurfaceMaterial
bsmAssigned = bsm;
54
55
// Move constructor
56
BinnedSurfaceMaterial
bsmMoved(
std::move
(bsmCopy));
57
58
// Move assigned
59
BinnedSurfaceMaterial
bsmMoveAssigned(
std::move
(bsmAssigned));
60
}
61
62
}
// namespace Test
63
}
// namespace Acts
acts
blob
sPHENIX
Tests
UnitTests
Core
Material
BinnedSurfaceMaterialTests.cpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:43
using
1.8.2 with
sPHENIX GitHub integration