ATLAS Offline Software
Loading...
Searching...
No Matches
VolumeConverter.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6// VolumeConverter.h, (c) ATLAS Detector software
8
9#ifndef TRKDETDESCRGEOMODELCNV_VOLUMECONVERTER_H
10#define TRKDETDESCRGEOMODELCNV_VOLUMECONVERTER_H
11
12#include <cmath> //for M_PI
13#include <utility> //for std::pair
14#include <vector>
15
20#include "TrkGeometry/Material.h" //used in typedef
21
22class GeoVPhysVol;
23
24namespace Trk {
25class TrackingVolume;
26class VolumeBounds;
27} // namespace Trk
28
29namespace Trk {
30
31using MaterialComponent = std::pair<Material, double>;
32
33struct VolumeSpan {
34 double phiMin{0.};
35 double phiMax{2 * M_PI};
36 double rMin{0.};
37 double rMax{1.e5};
38 double xMin{-1.e5};
39 double xMax{1.e5};
40 double yMin{-1.e5};
41 double yMax{1.e5};
42 double zMin{-1.e5};
43 double zMax{1.e5};
44};
45
46struct VolumePart {
47 std::vector<std::shared_ptr<Volume>> parts{};
48 double sign{1.};
49};
50using VolumePartVec = std::vector<VolumePart>;
51
59
61
62 public:
65 std::unique_ptr<TrackingVolume> translate(const GeoVPhysVol* gv,
66 bool simplify, bool blend,
67 double blendMassLimit) const;
68
69 using VolumePair =
70 std::pair<std::shared_ptr<Volume>, std::shared_ptr<Volume>>;
71 using VolumePairVec = std::vector<VolumePair>;
74 static VolumePairVec splitComposedVolume(const Volume& trVol) ;
75
76 double resolveBooleanVolume(const Volume& trVol, double tolerance) const;
77
79 std::unique_ptr<VolumeSpan> findVolumeSpan(
80 const VolumeBounds& volBounds, const Amg::Transform3D& transform,
81 double zTol, double phiTol) const;
82
84 double calculateVolume(const Volume& vol, bool nonBooleanOnly = false,
85 double precision = 1.e-3) const;
86
88 double estimateFraction(const VolumePair& sub, double precision) const;
89
91 void collectMaterial(const GeoVPhysVol* pv, Trk::MaterialProperties& layMat,
92 double sf) const;
93
96 const GeoVPhysVol* gv,
97 std::vector<Trk::MaterialComponent>& materialContent) const;
98
99 private:
100 double leadingVolume(const GeoShape* sh) const;
101
103
104 static constexpr double s_precisionInX0 =
105 1.e-3; // tentative required precision of the material thickness
106 // estimate
107};
108
109} // end of namespace Trk
110
111#endif
#define M_PI
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
A Simple Helper Class that convertes the GeoShape object used in GeoModel full detector description t...
Material with information about thickness of material.
Full Volume description used in Tracking, it inherits from Volume to get the geometrical structure,...
Pure Absract Base Class for Volume bounds.
static VolumePairVec splitComposedVolume(const Volume &trVol)
Decomposition of volume into set of non-overlapping subtractions from analytically calculable volume.
void collectMaterialContent(const GeoVPhysVol *gv, std::vector< Trk::MaterialComponent > &materialContent) const
material collection for volumes
std::pair< std::shared_ptr< Volume >, std::shared_ptr< Volume > > VolumePair
Trk::GeoShapeConverter m_geoShapeConverter
shape converter
std::vector< VolumePair > VolumePairVec
static constexpr double s_precisionInX0
double resolveBooleanVolume(const Volume &trVol, double tolerance) const
double calculateVolume(const Volume &vol, bool nonBooleanOnly=false, double precision=1.e-3) const
Volume calculation : by default return analytical solution only.
double estimateFraction(const VolumePair &sub, double precision) const
the tricky part of volume calculation
void collectMaterial(const GeoVPhysVol *pv, Trk::MaterialProperties &layMat, double sf) const
material collection for layers
std::unique_ptr< TrackingVolume > translate(const GeoVPhysVol *gv, bool simplify, bool blend, double blendMassLimit) const
translation of GeoVPhysVol to Trk::TrackingVolume
std::unique_ptr< VolumeSpan > findVolumeSpan(const VolumeBounds &volBounds, const Amg::Transform3D &transform, double zTol, double phiTol) const
Estimation of the geometrical volume span.
double leadingVolume(const GeoShape *sh) const
Base class for all volumes inside the tracking realm, it defines the interface for inherited Volume c...
Definition Volume.h:36
Eigen::Affine3d Transform3D
Ensure that the ATLAS eigen extensions are properly loaded.
std::pair< Material, double > MaterialComponent
std::vector< VolumePart > VolumePartVec
std::vector< std::shared_ptr< Volume > > parts