Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TrackingGeometryGeometryIdTests.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TrackingGeometryGeometryIdTests.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 
16 #include "Acts/Geometry/Layer.hpp"
21 
22 #include <memory>
23 #include <vector>
24 
26 
27 using namespace Acts::UnitLiterals;
28 
29 namespace Acts {
30 namespace Test {
31 
32 // Create a test context
34 
37 double iVsurfaceHalfLengthZ = 50_mm;
38 double iVsurfaceR = 25_mm;
39 double iVsurfaceRstagger = 5_mm;
40 double iVsurfaceZoverlap = 10_mm;
41 double iVlayerEnvelope = 0.5_mm;
42 double iVvolumeEnvelope = 10_mm;
43 double iVvolumeR =
45 
47 double oVsurfaceHalfLengthZ = 50_mm;
48 double oVsurfaceR = 100_mm;
49 double oVsurfaceRstagger = 5_mm;
50 double oVsurfaceZoverlap = 10_mm;
51 double oVlayerEnvelope = 0.5_mm;
52 double oVvolumeEnvelope = 10_mm;
53 double oVvolumeR =
55 
60  "InnerVolume");
61 
62 BOOST_AUTO_TEST_CASE(GeometryIdentifier_innervolume_test) {
63  BOOST_CHECK_EQUAL(0ul, iVolume->geometryId().value());
64  // check the boundary surfaces
65  for (const auto& bSf : iVolume->boundarySurfaces()) {
66  BOOST_CHECK_EQUAL(0ul, bSf->surfaceRepresentation().geometryId().value());
67  for (const auto& lay : iVolume->confinedLayers()->arrayObjects()) {
68  BOOST_CHECK_EQUAL(0ul, lay->geometryId().value());
69  // check the approach surfaces
70  for (const auto& asf : lay->approachDescriptor()->containedSurfaces()) {
71  BOOST_CHECK_EQUAL(0ul, asf->geometryId().value());
72  }
73  // check the layer surface array
74  for (const auto& ssf : lay->surfaceArray()->surfaces()) {
75  BOOST_CHECK_EQUAL(0ul, ssf->geometryId().value());
76  }
77  }
78  }
79 }
80 
85  "OuterVolume");
86 
87 BOOST_AUTO_TEST_CASE(GeometryIdentifier_outervolume_test) {
88  BOOST_CHECK_EQUAL(0ul, oVolume->geometryId().value());
89  // check the boundary surfaces
90  for (const auto& bSf : iVolume->boundarySurfaces()) {
91  BOOST_CHECK_EQUAL(0ul, bSf->surfaceRepresentation().geometryId().value());
92  for (const auto& lay : oVolume->confinedLayers()->arrayObjects()) {
93  BOOST_CHECK_EQUAL(0ul, lay->geometryId().value());
94  // check the approach surfaces
95  for (const auto& asf : lay->approachDescriptor()->containedSurfaces()) {
96  BOOST_CHECK_EQUAL(0ul, asf->geometryId().value());
97  }
98  // check the layer surface array
99  for (const auto& ssf : lay->surfaceArray()->surfaces()) {
100  BOOST_CHECK_EQUAL(0ul, ssf->geometryId().value());
101  }
102  }
103  }
104 }
105 //
108 // now create the container volume
110  oVvolumeHalfZ, "Container");
111 
113 BOOST_AUTO_TEST_CASE(GeometryIdentifier_containervolume_test) {
115  BOOST_CHECK_EQUAL(0ul, hVolume->geometryId().value());
117  for (const auto& hbsf : hVolume->boundarySurfaces()) {
118  BOOST_CHECK_EQUAL(0ul, hbsf->surfaceRepresentation().geometryId().value());
119  }
120  for (const auto& cVol : hVolume->confinedVolumes()->arrayObjects()) {
122  BOOST_CHECK_EQUAL(0ul, cVol->geometryId().value());
123  // check the boundary surfaces
124  for (const auto& bSf : cVol->boundarySurfaces()) {
125  BOOST_CHECK_EQUAL(0ul, bSf->surfaceRepresentation().geometryId().value());
126  }
127  for (const auto& lay : cVol->confinedLayers()->arrayObjects()) {
128  BOOST_CHECK_EQUAL(0ul, lay->geometryId().value());
129  // check the approach surfaces
130  for (const auto& asf : lay->approachDescriptor()->containedSurfaces()) {
131  BOOST_CHECK_EQUAL(0ul, asf->geometryId().value());
132  }
133  // check the layer surface array
134  for (auto ssf : lay->surfaceArray()->surfaces()) {
135  BOOST_CHECK_EQUAL(0ul, ssf->geometryId().value());
136  }
137  }
138  }
139 }
140 
141 } // end of namespace Test
142 } // end of namespace Acts