ECCE @ EIC Software
 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 <climits>
12 
17 
18 namespace Acts {
19 
20 namespace Test {
21 
23 BOOST_AUTO_TEST_CASE(BinnedSurfaceMaterial_construction_test) {
24  BinUtility xyBinning(2, -1., 1., open, binX);
25  xyBinning += BinUtility(3, -3., 3., open, binY);
26 
27  // Constructor a few material properties
28  MaterialProperties a00(1., 2., 3., 4., 5., 6.);
29  MaterialProperties a01(2., 3., 4., 5., 6., 7.);
30  MaterialProperties a02(3., 4., 5., 6., 7., 8.);
31  MaterialProperties a10(4., 5., 6., 7., 8., 9.);
32  MaterialProperties a11(5., 6., 7., 8., 9., 10.);
33  MaterialProperties a12(6., 7., 8., 9., 10., 11.);
34 
35  // Prepare the matrix
36  std::vector<MaterialProperties> l0 = {std::move(a00), std::move(a10)};
37  std::vector<MaterialProperties> l1 = {std::move(a01), std::move(a11)};
38  std::vector<MaterialProperties> l2 = {std::move(a02), std::move(a12)};
39 
40  // Build the matrix
41  std::vector<std::vector<MaterialProperties>> m = {
42  std::move(l0), std::move(l1), std::move(l2)};
43 
44  // Create the material
45  BinnedSurfaceMaterial bsm(xyBinning, std::move(m));
46 
47  // Copy the material
48  BinnedSurfaceMaterial bsmCopy(bsm);
49 
50  // Assignment operation
51  BinnedSurfaceMaterial bsmAssigned = bsm;
52 
53  // Move constructor
54  BinnedSurfaceMaterial bsmMoved(std::move(bsmCopy));
55 
56  // Move assigned
57  BinnedSurfaceMaterial bsmMoveAssigned(std::move(bsmAssigned));
58 }
59 
60 } // namespace Test
61 } // namespace Acts