ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GlueVolumesDescriptor.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file GlueVolumesDescriptor.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2016-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 
10 // GlueVolumesDescriptor.cpp, Acts project
12 
13 #include <utility>
14 
17 
19  const std::map<BoundarySurfaceFace,
20  std::shared_ptr<const TrackingVolumeArray>>& gvs)
21  : m_glueVolumes(gvs) {
22  // fill the available faces
23  for (auto& gvIter : m_glueVolumes) {
24  m_glueFaces.push_back(gvIter.first);
25  }
26 }
27 
30  std::shared_ptr<const TrackingVolumeArray> gvs) {
31  // register the face
32  auto searchIter = m_glueVolumes.find(bsf);
33  if (searchIter == m_glueVolumes.end()) {
34  m_glueFaces.push_back(bsf);
35  }
36  // simple assignment overwrites already existing entries
37  m_glueVolumes[bsf] =
38  std::move(gvs);
39 }
40 
41 std::shared_ptr<const Acts::TrackingVolumeArray>
43  // searching for the glue volumes according
44  auto searchIter = m_glueVolumes.find(bsf);
45  if (searchIter != m_glueVolumes.end()) {
46  return searchIter->second;
47  }
48  return nullptr;
49 }
50 
52  std::stringstream sl;
53  sl << "Acts::GlueVolumesDescriptor: " << std::endl;
54  const std::vector<Acts::BoundarySurfaceFace>& glueFaceVector = glueFaces();
55  sl << " has Tracking Volumes registered for : " << glueFaceVector.size()
56  << " Volume faces." << std::endl;
57  // loop over the faces
58  for (auto& gFace : glueFaceVector) {
59  const std::vector<TrackingVolumePtr>& glueVolumesVector =
60  glueVolumes(gFace)->arrayObjects();
61  // loop over the TrackingVolumes
62  sl << " -----> Processing Face: " << int(gFace) << " - has ";
63  sl << glueVolumesVector.size()
64  << " TrackingVolumes marked as 'GlueVolumes' " << std::endl;
65  for (auto& glueVolume : glueVolumesVector) {
66  sl << " - TrackingVolume: " << glueVolume->volumeName()
67  << std::endl;
68  }
69  }
70  return sl.str();
71 }
72 
73 std::ostream& Acts::operator<<(std::ostream& sl,
74  const GlueVolumesDescriptor& gvd) {
75  sl << gvd.screenOutput();
76  return sl;
77 }