ATLAS Offline Software
GlueVolumesDescriptor.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // GlueVolumesDescriptor.cxx, (c) ATLAS Detector software
8 
9 // Trk
11 
13 
14 const std::vector<Trk::TrackingVolume*>
16 
18  const std::map<Trk::BoundarySurfaceFace,
19  std::vector<Trk::TrackingVolume*> >& glv)
20  : m_glueVolumes(glv) {
21  Trk::GlueVolumeIterator searchIter = m_glueVolumes.begin();
22  Trk::GlueVolumeIterator endIter = m_glueVolumes.end();
23  // fill the available faces
24  for (; searchIter != endIter; ++searchIter)
25  m_glueFaces.push_back(searchIter->first);
26 }
27 
30  std::vector<Trk::TrackingVolume*>& gvs) {
31  // register the face
32  Trk::GlueVolumeIterator searchIter = m_glueVolumes.begin();
33  searchIter = m_glueVolumes.find(bsf);
34  if (searchIter == m_glueVolumes.end()) m_glueFaces.push_back(bsf);
35  // simple assignment overwrites already existing entries
36  m_glueVolumes[bsf] = gvs;
37 }
38 
39 const std::vector<Trk::TrackingVolume*>&
41  Trk::GlueVolumeConstIterator searchIter = m_glueVolumes.begin();
42  Trk::GlueVolumeConstIterator endIter = m_glueVolumes.end();
43 
44  searchIter = m_glueVolumes.find(bsf);
45  if (searchIter != endIter) return searchIter->second;
46  return s_emptyVector;
47 }
48 
49 MsgStream& Trk::operator<<(MsgStream& sl,
51  sl << "Trk::GlueVolumesDescriptor: " << std::endl;
52  const std::vector<Trk::BoundarySurfaceFace>& glueFaceVector = gvd.glueFaces();
53  sl << " has Tracking Volumes registered for : " << glueFaceVector.size()
54  << " Volume faces." << std::endl;
55  std::vector<Trk::BoundarySurfaceFace>::const_iterator glueFaceIter =
56  glueFaceVector.begin();
57  std::vector<Trk::BoundarySurfaceFace>::const_iterator glueFaceIterEnd =
58  glueFaceVector.end();
59  // loop over the faces
60  for (; glueFaceIter != glueFaceIterEnd; ++glueFaceIter) {
61  const std::vector<Trk::TrackingVolume*>& glueVolumesVector =
62  gvd.glueVolumes(*glueFaceIter);
63  auto glueVolumeIter = glueVolumesVector.begin();
64  auto glueVolumeIterEnd = glueVolumesVector.end();
65  // loop over the TrackingVolumes
66  sl << " -----> Processing Face: " << int(*glueFaceIter) << " - has ";
67  sl << glueVolumesVector.size()
68  << " TrackingVolumes marked as 'GlueVolumes' " << std::endl;
69  for (; glueVolumeIter != glueVolumeIterEnd; ++glueVolumeIter)
70  sl << " - TrackingVolume: " << (*glueVolumeIter)->volumeName()
71  << std::endl;
72  }
73  return sl;
74 }
75 
76 std::ostream& Trk::operator<<(std::ostream& sl,
77  GlueVolumesDescriptor& gvd) {
78  sl << "Trk::GlueVolumesDescriptor: " << std::endl;
79  const std::vector<Trk::BoundarySurfaceFace>& glueFaceVector = gvd.glueFaces();
80  sl << " has Tracking Volumes registered for : " << glueFaceVector.size()
81  << " Volume faces." << std::endl;
82  std::vector<Trk::BoundarySurfaceFace>::const_iterator glueFaceIter =
83  glueFaceVector.begin();
84  std::vector<Trk::BoundarySurfaceFace>::const_iterator glueFaceIterEnd =
85  glueFaceVector.end();
86  // loop over the faces
87  for (; glueFaceIter != glueFaceIterEnd; ++glueFaceIter) {
88  const std::vector<Trk::TrackingVolume*>& glueVolumesVector =
89  gvd.glueVolumes(*glueFaceIter);
90  auto glueVolumeIter = glueVolumesVector.begin();
91  auto glueVolumeIterEnd = glueVolumesVector.end();
92  // loop over the TrackingVolumes
93  sl << " -----> Processing Face: " << int(*glueFaceIter) << " - has ";
94  sl << glueVolumesVector.size()
95  << " TrackingVolumes marked as 'GlueVolumes' " << std::endl;
96  for (; glueVolumeIter != glueVolumeIterEnd; ++glueVolumeIter)
97  sl << " - TrackingVolume: " << (*glueVolumeIter)->volumeName()
98  << std::endl;
99  }
100  return sl;
101 }
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
Trk::GlueVolumeIterator
std::map< BoundarySurfaceFace, std::vector< TrackingVolume * > >::iterator GlueVolumeIterator
Definition: GlueVolumesDescriptor.h:23
Trk::BoundarySurfaceFace
BoundarySurfaceFace
Definition: BoundarySurfaceFace.h:31
Trk::GlueVolumesDescriptor::glueFaces
const std::vector< BoundarySurfaceFace > & glueFaces() const
retrieve the available Glue Faces
Definition: GlueVolumesDescriptor.h:72
Trk::GlueVolumesDescriptor::registerGlueVolumes
void registerGlueVolumes(BoundarySurfaceFace, std::vector< TrackingVolume * > &)
register the volumes
Definition: GlueVolumesDescriptor.cxx:28
Trk::GlueVolumeConstIterator
std::map< BoundarySurfaceFace, std::vector< TrackingVolume * > >::const_iterator GlueVolumeConstIterator
Definition: GlueVolumesDescriptor.h:30
Trk::GlueVolumesDescriptor::m_glueFaces
std::vector< BoundarySurfaceFace > m_glueFaces
Definition: GlueVolumesDescriptor.h:67
GlueVolumesDescriptor.h
Trk::GlueVolumesDescriptor::glueVolumes
const std::vector< TrackingVolume * > & glueVolumes(BoundarySurfaceFace)
retrieve them again
Definition: GlueVolumesDescriptor.cxx:40
Trk::GlueVolumesDescriptor
Definition: GlueVolumesDescriptor.h:40
TrackingVolume.h
Trk::GlueVolumesDescriptor::m_glueVolumes
std::map< BoundarySurfaceFace, std::vector< TrackingVolume * > > m_glueVolumes
Definition: GlueVolumesDescriptor.h:66
Trk::operator<<
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output
Definition: AlignModule.cxx:204
Trk::GlueVolumesDescriptor::s_emptyVector
static const std::vector< TrackingVolume * > s_emptyVector
Definition: GlueVolumesDescriptor.h:68
Trk::GlueVolumesDescriptor::GlueVolumesDescriptor
GlueVolumesDescriptor()
Constructor.
Definition: GlueVolumesDescriptor.h:43