ATLAS Offline Software
TrackingGeometry.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // TrackingGeometry.h, (c) ATLAS Detector software
8 
9 #ifndef TRKGEOMETRY_TRACKINGGEOMETRY_H
10 #define TRKGEOMETRY_TRACKINGGEOMETRY_H
11 
12 // Amg
14 // Trk
17 // CLASS DEF
18 #include "AthenaKernel/CLASS_DEF.h"
19 // STL
20 #include <map>
21 // ATH_MSG macros
23 //boost
24 #include <boost/iterator/transform_iterator.hpp>
25 #include <boost/range.hpp>
26 
28 
29 class MsgStream;
30 
31 // must be known to declare friend class
32 namespace Muon {
33 class MuonTrackingGeometryBuilderCond;
34 }
35 
36 namespace Trk {
37 
43 {
46  association = 2
47 };
48 
49 class TrackingVolume;
50 class Layer;
51 class MaterialProperties;
52 
67 {
68 
70  friend class GeometryBuilder;
71 
72  friend class GeometryBuilderCond;
73 
74 
76  {
77  public:
78  std::pair<const Trk::Layer*, int> operator()(
79  const std::pair<Trk::Layer*, int>& in) const
80  {
81  return std::pair<const Trk::Layer*, int>{ in.first, in.second };
82  }
83  };
84 
86  boost::transform_iterator<constTransformLayerMap,
87  std::map<Trk::Layer*, int>::const_iterator>;
88 
89 public:
90 
91  using constMapRange_t = boost::iterator_range<iterator_convert_const_t>;
93  TrackingGeometry(TrackingVolume* highestVolume,
94  NavigationLevel navlevel = globalSearch);
96  virtual ~TrackingGeometry();
97 
101 
102 
104  const TrackingVolume* lowestTrackingVolume(const Amg::Vector3D& gp) const;
105 
107  std::vector<const Trk::DetachedTrackingVolume*>
109 
112  const Amg::Vector3D& gp) const;
113 
115  const TrackingVolume* trackingVolume(const std::string& name) const;
116 
118  const Layer* associatedLayer(const Amg::Vector3D& gp) const;
119 
121  const Layer* nextLayer(const Amg::Vector3D& gp,
122  const Amg::Vector3D& mom,
123  bool skipNavLayer = false) const;
124 
126  template<class T>
128  const T& pars,
130  const BoundaryCheck& bchk = true) const;
132  static bool atVolumeBoundary(const Amg::Vector3D& gp,
133  const TrackingVolume* vol,
134  double tol);
135 
137  static bool atVolumeBoundary(const Amg::Vector3D& gp,
138  const Amg::Vector3D& mom,
139  const TrackingVolume* vol,
140  const TrackingVolume*& nextVol,
142  double tol);
143 
145  const std::map<Layer*, int>& boundaryLayers() ;
147 
148  size_t numBoundaryLayers() const;
152 
154  void printVolumeHierarchy(MsgStream& msgstream) const;
155 
158  void indexStaticLayers(GeometrySignature geosit, int offset = 0);
159 
160  void dump(MsgStream& out, const std::string& head) const;
161 
162  // get ownership of Muon Tracking Geometry Elements
163  void addToGarbage(std::vector<std::unique_ptr<Trk::DetachedTrackingVolume>>&& garbageVec);
164  void addToGarbage(std::vector<std::unique_ptr<Trk::TrackingVolume>>&& garbageVec);
165 
166 
167  private:
170  void sign(GeometrySignature geosit, GeometryType geotype = Static);
171 
176  void compactify(MsgStream& msgstream, TrackingVolume* vol = nullptr);
177 
180  void synchronizeLayers(MsgStream& msgstream, TrackingVolume* vol = nullptr);
181 
184 
187  TrackingVolume* mvol = nullptr,
188  int lvl = 0);
189 
193 
195  void printVolumeInformation(MsgStream& msgstream,
196  const TrackingVolume& tvol,
197  int lvl) const;
198 
199  static void dumpLayer(MsgStream& out,
200  const std::string& head,
201  const Layer* layer);
202 
205 
207  std::map<Layer*, int> m_boundaryLayers;
208 
210  std::map<const std::string, const TrackingVolume*> m_trackingVolumes;
211 
214 
216  // muon chambers
217  std::vector<std::shared_ptr<DetachedTrackingVolume>> m_detachedVolGarbage{};
218  std::vector<std::shared_ptr<TrackingVolume>> m_trkVolumeGarbage{};
219 
220 };
221 
222 } // end of namespace
224 CLASS_DEF(Trk::TrackingGeometry, 167645219, 1)
225 #include "AthenaKernel/CondCont.h"
227 
228 #endif // TRKGEOMETRY_TRACKINGGEOMETRY_H
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
Trk::TrackingGeometry::m_world
TrackingVolume * m_world
The known world - and the beam.
Definition: TrackingGeometry.h:204
Trk::TrackingGeometry::atVolumeBoundary
static bool atVolumeBoundary(const Amg::Vector3D &gp, const TrackingVolume *vol, double tol)
check position at volume boundary
Definition: TrackingGeometry.cxx:250
Trk::Static
@ Static
Definition: GeometrySignature.h:38
Trk::TrackingGeometry::m_boundaryLayers
std::map< Layer *, int > m_boundaryLayers
The unique boundary Layers.
Definition: TrackingGeometry.h:207
GeometrySignature.h
AthMsgStreamMacros.h
Trk::TrackingGeometry::numBoundaryLayers
size_t numBoundaryLayers() const
GeometrySignature
Trk::TrackingGeometry::dump
void dump(MsgStream &out, const std::string &head) const
Definition: TrackingGeometry.cxx:294
Trk::globalSearch
@ globalSearch
Definition: TrackingGeometry.h:45
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
Trk::TrackingGeometry::registerTrackingVolumes
void registerTrackingVolumes(TrackingVolume &tvol, TrackingVolume *mvol=nullptr, int lvl=0)
private method to register recursively the tracking volumes
Definition: TrackingGeometry.cxx:90
Trk::TrackingGeometry::boundaryLayers
constMapRange_t boundaryLayers() const
Trk::alongMomentum
@ alongMomentum
Definition: PropDirection.h:20
Trk::TrackingGeometry::~TrackingGeometry
virtual ~TrackingGeometry()
Destructor.
Definition: TrackingGeometry.cxx:32
Trk::TrackingGeometry::nextLayer
const Layer * nextLayer(const Amg::Vector3D &gp, const Amg::Vector3D &mom, bool skipNavLayer=false) const
Forward the next Layer information.
Trk::TrackingGeometry::constTransformLayerMap::operator()
std::pair< const Trk::Layer *, int > operator()(const std::pair< Trk::Layer *, int > &in) const
Definition: TrackingGeometry.h:78
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:49
python.RingerConstants.Layer
Layer
Definition: RingerConstants.py:42
Trk::TrackingGeometry::synchronizeLayers
void synchronizeLayers(MsgStream &msgstream, TrackingVolume *vol=nullptr)
Geometry Builder business: synchronize all layers to enclosed volume dimensions.
Definition: TrackingGeometry.cxx:162
Trk::noNavigation
@ noNavigation
Definition: TrackingGeometry.h:44
Trk::TrackingGeometry::dumpLayer
static void dumpLayer(MsgStream &out, const std::string &head, const Layer *layer)
Definition: TrackingGeometry.cxx:330
GeoPrimitives.h
Trk::NavigationLevel
NavigationLevel
Definition: TrackingGeometry.h:43
Trk::PropDirection
PropDirection
Definition: PropDirection.h:19
Trk::TrackingGeometry::highestTrackingVolume
const TrackingVolume * highestTrackingVolume() const
return the world
ParticleGun_EoverP_Config.mom
mom
Definition: ParticleGun_EoverP_Config.py:63
Trk::TrackingGeometry::constTransformLayerMap
Definition: TrackingGeometry.h:76
Trk::TrackingGeometry::closestMaterialLayer
LayerIntersection< Amg::Vector3D > closestMaterialLayer(const T &pars, PropDirection pDir=Trk::alongMomentum, const BoundaryCheck &bchk=true) const
Closest Material Layer - used for the mapping option.
TrackingGeometry.icc
Trk::TrackingGeometry
Definition: TrackingGeometry.h:67
Trk::GeometryBuilderCond
Definition: GeometryBuilderCond.h:50
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
Trk::TrackingGeometry::lowestStaticTrackingVolume
const TrackingVolume * lowestStaticTrackingVolume(const Amg::Vector3D &gp) const
return the lowest static tracking Volume
Definition: TrackingGeometry.cxx:77
Trk::association
@ association
Definition: TrackingGeometry.h:46
Trk::TrackingGeometry::addToGarbage
void addToGarbage(std::vector< std::unique_ptr< Trk::DetachedTrackingVolume >> &&garbageVec)
Definition: TrackingGeometry.cxx:35
Trk::TrackingGeometry::compactify
void compactify(MsgStream &msgstream, TrackingVolume *vol=nullptr)
Geometry Builder busineess: set all contained surfaces TG owned - this should save memory and avoid s...
Definition: TrackingGeometry.cxx:141
Trk::TrackingGeometry::sign
void sign(GeometrySignature geosit, GeometryType geotype=Static)
Geometry Builder busineess: the geometry builder has to sign.
beamspotman.dir
string dir
Definition: beamspotman.py:623
Trk::TrackingGeometry::indexStaticLayers
void indexStaticLayers(GeometrySignature geosit, int offset=0)
indexLayers : method to re-set the index of the layers, depending on geometrySignature
Definition: TrackingGeometry.cxx:241
Trk::TrackingGeometry::constMapRange_t
boost::iterator_range< iterator_convert_const_t > constMapRange_t
Definition: TrackingGeometry.h:91
head
std::string head(std::string s, const std::string &pattern)
head of a string
Definition: computils.cxx:310
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
Trk::TrackingGeometry::TrackingGeometry
TrackingGeometry(TrackingVolume *highestVolume, NavigationLevel navlevel=globalSearch)
Constructor.
Definition: TrackingGeometry.cxx:23
Trk::TrackingGeometry::registerNavigationLevel
void registerNavigationLevel(NavigationLevel navlevel)
private method the Navigation Level
Trk::TrackingGeometry::printVolumeHierarchy
void printVolumeHierarchy(MsgStream &msgstream) const
Print the summary of volume Hierarchy of the TrackingGeometry.
Definition: TrackingGeometry.cxx:178
Trk::TrackingGeometry::m_navigationLevel
NavigationLevel m_navigationLevel
The Navigation level for identification.
Definition: TrackingGeometry.h:213
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::TrackingGeometry::boundaryLayers
const std::map< Layer *, int > & boundaryLayers()
Return the unique BoundarySurfaces with MaterialInformation.
Trk::TrackingGeometry::iterator_convert_const_t
boost::transform_iterator< constTransformLayerMap, std::map< Trk::Layer *, int >::const_iterator > iterator_convert_const_t
Definition: TrackingGeometry.h:87
TrackingVolume.h
Trk::TrackingGeometry::m_detachedVolGarbage
std::vector< std::shared_ptr< DetachedTrackingVolume > > m_detachedVolGarbage
keep ownership of MuonTrackingGeometry elements in here
Definition: TrackingGeometry.h:217
Trk::TrackingGeometry::highestTrackingVolume
TrackingVolume * highestTrackingVolume()
Trk::TrackingGeometry::lowestDetachedTrackingVolumes
std::vector< const Trk::DetachedTrackingVolume * > lowestDetachedTrackingVolumes(const Amg::Vector3D &gp) const
return the vector of lowest detached tracking Volume(->overlaps)
Definition: TrackingGeometry.cxx:65
Trk::BoundaryCheck
Definition: BoundaryCheck.h:51
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
Trk::TrackingGeometry::checkoutHighestTrackingVolume
TrackingVolume * checkoutHighestTrackingVolume()
private method to be called from GeometryBuilder: return the world with ownership
Definition: TrackingGeometry.cxx:169
Trk::TrackingGeometry::m_trkVolumeGarbage
std::vector< std::shared_ptr< TrackingVolume > > m_trkVolumeGarbage
Definition: TrackingGeometry.h:218
Trk::TrackingGeometry::trackingVolume
const TrackingVolume * trackingVolume(const std::string &name) const
return the tracking Volume by name, 0 if it doesn't exist
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
Trk::TrackingGeometry::lowestTrackingVolume
const TrackingVolume * lowestTrackingVolume(const Amg::Vector3D &gp) const
return the lowest tracking Volume
Definition: TrackingGeometry.cxx:53
Trk::TrackingGeometry::printVolumeInformation
void printVolumeInformation(MsgStream &msgstream, const TrackingVolume &tvol, int lvl) const
print VolumeInformation with Level
Definition: TrackingGeometry.cxx:189
Trk::GeometryType
GeometryType
Definition: GeometrySignature.h:37
Trk::FullIntersection
Class extension to return the object, a represenation & the result.
Definition: Intersection.h:64
CONDCONT_MIXED_DEF
CONDCONT_MIXED_DEF(Trk::TrackingGeometry, 119021535)
Trk::GeometryBuilder
Definition: GeometryBuilder.h:50
Trk::TrackingGeometry::associatedLayer
const Layer * associatedLayer(const Amg::Vector3D &gp) const
Forward the associated Layer information.
checker_macros.h
Define macros for attributes used to control the static checker.
Trk::TrackingVolume
Definition: TrackingVolume.h:121
CLASS_DEF.h
macros to associate a CLID to a type
Trk::TrackingGeometry::navigationLevel
NavigationLevel navigationLevel() const
Return the Navigation Level - only one TrackingGeometry can have full association to GeoModel.
Trk::TrackingGeometry::m_trackingVolumes
std::map< const std::string, const TrackingVolume * > m_trackingVolumes
The Volumes in a map for later finding.
Definition: TrackingGeometry.h:210
Trk::Layer
Definition: Layer.h:73