Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:12:42

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 namespace Acts::Test {
0021 
0022 /// Test the constructors
0023 BOOST_AUTO_TEST_CASE(BinnedSurfaceMaterial_construction_test) {
0024   BinUtility xyBinning(2, -1., 1., open, AxisDirection::AxisX);
0025   xyBinning += BinUtility(3, -3., 3., open, AxisDirection::AxisY);
0026 
0027   // Constructor a few material properties
0028   MaterialSlab a00(Material::fromMolarDensity(1., 2., 3., 4., 5.), 6.);
0029   MaterialSlab a01(Material::fromMolarDensity(2., 3., 4., 5., 6.), 7.);
0030   MaterialSlab a02(Material::fromMolarDensity(3., 4., 5., 6., 7.), 8.);
0031   MaterialSlab a10(Material::fromMolarDensity(4., 5., 6., 7., 8.), 9.);
0032   MaterialSlab a11(Material::fromMolarDensity(5., 6., 7., 8., 9.), 10.);
0033   MaterialSlab a12(Material::fromMolarDensity(6., 7., 8., 9., 10.), 11.);
0034 
0035   // Prepare the matrix
0036   std::vector<MaterialSlab> l0 = {a00, a10};
0037   std::vector<MaterialSlab> l1 = {a01, a11};
0038   std::vector<MaterialSlab> l2 = {a02, a12};
0039 
0040   // Build the matrix
0041   std::vector<std::vector<MaterialSlab>> m = {std::move(l0), std::move(l1),
0042                                               std::move(l2)};
0043 
0044   // Create the material
0045   BinnedSurfaceMaterial bsm(xyBinning, std::move(m));
0046 
0047   // Copy the material
0048   BinnedSurfaceMaterial bsmCopy(bsm);
0049 
0050   // Assignment operation
0051   BinnedSurfaceMaterial bsmAssigned = bsm;
0052 
0053   // Move constructor
0054   BinnedSurfaceMaterial bsmMoved(std::move(bsmCopy));
0055 
0056   // Move assigned
0057   BinnedSurfaceMaterial bsmMoveAssigned(std::move(bsmAssigned));
0058 }
0059 
0060 }  // namespace Acts::Test