Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-10-16 08:04:13

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #include <boost/test/unit_test.hpp>
0010 
0011 #include "Acts/Material/BinnedSurfaceMaterial.hpp"
0012 #include "Acts/Material/Material.hpp"
0013 #include "Acts/Material/MaterialSlab.hpp"
0014 #include "Acts/Utilities/BinUtility.hpp"
0015 #include "Acts/Utilities/BinningType.hpp"
0016 
0017 #include <utility>
0018 #include <vector>
0019 
0020 using namespace Acts;
0021 
0022 namespace ActsTests {
0023 
0024 BOOST_AUTO_TEST_SUITE(MaterialSuite)
0025 
0026 /// Test the constructors
0027 BOOST_AUTO_TEST_CASE(BinnedSurfaceMaterial_construction_test) {
0028   BinUtility xyBinning(2, -1., 1., open, AxisDirection::AxisX);
0029   xyBinning += BinUtility(3, -3., 3., open, AxisDirection::AxisY);
0030 
0031   // Constructor a few material properties
0032   MaterialSlab a00(Material::fromMolarDensity(1., 2., 3., 4., 5.), 6.);
0033   MaterialSlab a01(Material::fromMolarDensity(2., 3., 4., 5., 6.), 7.);
0034   MaterialSlab a02(Material::fromMolarDensity(3., 4., 5., 6., 7.), 8.);
0035   MaterialSlab a10(Material::fromMolarDensity(4., 5., 6., 7., 8.), 9.);
0036   MaterialSlab a11(Material::fromMolarDensity(5., 6., 7., 8., 9.), 10.);
0037   MaterialSlab a12(Material::fromMolarDensity(6., 7., 8., 9., 10.), 11.);
0038 
0039   // Prepare the matrix
0040   std::vector<MaterialSlab> l0 = {a00, a10};
0041   std::vector<MaterialSlab> l1 = {a01, a11};
0042   std::vector<MaterialSlab> l2 = {a02, a12};
0043 
0044   // Build the matrix
0045   std::vector<std::vector<MaterialSlab>> m = {std::move(l0), std::move(l1),
0046                                               std::move(l2)};
0047 
0048   // Create the material
0049   BinnedSurfaceMaterial bsm(xyBinning, std::move(m));
0050 
0051   // Copy the material
0052   BinnedSurfaceMaterial bsmCopy(bsm);
0053 
0054   // Assignment operation
0055   BinnedSurfaceMaterial bsmAssigned = bsm;
0056 
0057   // Move constructor
0058   BinnedSurfaceMaterial bsmMoved(std::move(bsmCopy));
0059 
0060   // Move assigned
0061   BinnedSurfaceMaterial bsmMoveAssigned(std::move(bsmAssigned));
0062 }
0063 
0064 BOOST_AUTO_TEST_SUITE_END()
0065 
0066 }  // namespace ActsTests