ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TrackingGeometryGeoIDTests.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TrackingGeometryGeoIDTests.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 
12 #include "Acts/Utilities/Units.hpp"
13 
15 
16 using namespace Acts::UnitLiterals;
17 
18 namespace Acts {
19 namespace Test {
20 
21 // Create a test context
23 
27 double iVsurfaceR = 25_mm;
30 double iVlayerEnvelope = 0.5_mm;
31 double iVvolumeEnvelope = 10_mm;
32 double iVvolumeR =
34 
37 double oVsurfaceR = 100_mm;
40 double oVlayerEnvelope = 0.5_mm;
41 double oVvolumeEnvelope = 10_mm;
42 double oVvolumeR =
44 
49  "InnerVolume");
50 
51 BOOST_AUTO_TEST_CASE(GeometryID_innervolume_test) {
52  BOOST_CHECK_EQUAL(0ul, iVolume->geoID().value());
53  // check the boundary surfaces
54  for (auto bSf : iVolume->boundarySurfaces()) {
55  BOOST_CHECK_EQUAL(0ul, bSf->surfaceRepresentation().geoID().value());
56  for (auto lay : iVolume->confinedLayers()->arrayObjects()) {
57  BOOST_CHECK_EQUAL(0ul, lay->geoID().value());
58  // check the approach surfaces
59  for (auto asf : lay->approachDescriptor()->containedSurfaces()) {
60  BOOST_CHECK_EQUAL(0ul, asf->geoID().value());
61  }
62  // check the layer surface array
63  for (auto ssf : lay->surfaceArray()->surfaces()) {
64  BOOST_CHECK_EQUAL(0ul, ssf->geoID().value());
65  }
66  }
67  }
68 }
69 
74  "OuterVolume");
75 
76 BOOST_AUTO_TEST_CASE(GeometryID_outervolume_test) {
77  BOOST_CHECK_EQUAL(0ul, oVolume->geoID().value());
78  // check the boundary surfaces
79  for (auto bSf : iVolume->boundarySurfaces()) {
80  BOOST_CHECK_EQUAL(0ul, bSf->surfaceRepresentation().geoID().value());
81  for (auto lay : oVolume->confinedLayers()->arrayObjects()) {
82  BOOST_CHECK_EQUAL(0ul, lay->geoID().value());
83  // check the approach surfaces
84  for (auto asf : lay->approachDescriptor()->containedSurfaces()) {
85  BOOST_CHECK_EQUAL(0ul, asf->geoID().value());
86  }
87  // check the layer surface array
88  for (auto ssf : lay->surfaceArray()->surfaces()) {
89  BOOST_CHECK_EQUAL(0ul, ssf->geoID().value());
90  }
91  }
92  }
93 }
94 //
95 double oVvolumeHalfZ =
97 // now create the container volume
99  oVvolumeHalfZ, "Container");
100 
102 BOOST_AUTO_TEST_CASE(GeometryID_containervolume_test) {
104  BOOST_CHECK_EQUAL(0ul, hVolume->geoID().value());
106  for (auto hbsf : hVolume->boundarySurfaces()) {
107  BOOST_CHECK_EQUAL(0ul, hbsf->surfaceRepresentation().geoID().value());
108  }
109  for (auto cVol : hVolume->confinedVolumes()->arrayObjects()) {
111  BOOST_CHECK_EQUAL(0ul, cVol->geoID().value());
112  // check the boundary surfaces
113  for (auto bSf : cVol->boundarySurfaces()) {
114  BOOST_CHECK_EQUAL(0ul, bSf->surfaceRepresentation().geoID().value());
115  }
116  for (auto lay : cVol->confinedLayers()->arrayObjects()) {
117  BOOST_CHECK_EQUAL(0ul, lay->geoID().value());
118  // check the approach surfaces
119  for (auto asf : lay->approachDescriptor()->containedSurfaces()) {
120  BOOST_CHECK_EQUAL(0ul, asf->geoID().value());
121  }
122  // check the layer surface array
123  for (auto ssf : lay->surfaceArray()->surfaces()) {
124  BOOST_CHECK_EQUAL(0ul, ssf->geoID().value());
125  }
126  }
127  }
128 }
129 
130 } // end of namespace Test
131 } // end of namespace Acts