DD4hep  01.18
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
Public Member Functions | Protected Attributes | List of all members
dd4hep::rec::MaterialManager Class Reference

Material manager provides access to the material properties of the detector. More...

#include <MaterialManager.h>

Public Member Functions

 MaterialManager (Volume world)
 Instantiate the MaterialManager for this (world) volume. More...
 
 MaterialManager ()=delete
 
 ~MaterialManager ()
 
const MaterialVecmaterialsBetween (const Vector3D &p0, const Vector3D &p1, double epsilon=1e-4)
 Get a vector with all the materials between the two points p0 and p1 with the corresponding thicknesses - element type is std::pair< Material, double >. More...
 
const PlacementVecplacementsBetween (const Vector3D &p0, const Vector3D &p1, double epsilon=1e-4)
 Get a vector with all the placements between the two points p0 and p1. More...
 
const Material & materialAt (const Vector3D &pos)
 Get the material at the given position. More...
 
PlacedVolume placementAt (const Vector3D &pos)
 Get the placed volume at the given position. More...
 
MaterialData createAveragedMaterial (const MaterialVec &materials)
 Create a material with averaged properties from all materials in the list. More...
 

Protected Attributes

MaterialVec _mV
 Cached materials. More...
 
Material _m
 
PlacedVolume _pv
 Cached nodes. More...
 
PlacementVec _placeV
 
Vector3D _p0
 cached last points More...
 
Vector3D _p1
 
Vector3D _pos
 
TGeoManager * _tgeoMgr
 Reference to the TGeoManager. More...
 

Detailed Description

Material manager provides access to the material properties of the detector.

Material can be accessed either for a given point or as a list of materials along a straight line between two points.

Author
F.Gaede, DESY
Date
May, 19 2014
Version
$Id:$

Definition at line 41 of file MaterialManager.h.

Constructor & Destructor Documentation

dd4hep::rec::MaterialManager::MaterialManager ( Volume  world)

Instantiate the MaterialManager for this (world) volume.

Definition at line 27 of file MaterialManager.cpp.

References _tgeoMgr.

dd4hep::rec::MaterialManager::MaterialManager ( )
delete
dd4hep::rec::MaterialManager::~MaterialManager ( )

Definition at line 31 of file MaterialManager.cpp.

Member Function Documentation

MaterialData dd4hep::rec::MaterialManager::createAveragedMaterial ( const MaterialVec materials)

Create a material with averaged properties from all materials in the list.

A and Z are averaged by relative number of atoms(molecules), rho is averaged by relative volume and the inverse radiation and interaction lengths are averaged by relative weight.

Definition at line 196 of file MaterialManager.cpp.

References std::vector< T >::size(), and std::stringstream::str().

Referenced by dd4hep::rec::createGearForILD().

const Material & dd4hep::rec::MaterialManager::materialAt ( const Vector3D pos)

Get the material at the given position.

Definition at line 166 of file MaterialManager.cpp.

References _m, _pos, _pv, _tgeoMgr, and std::stringstream::str().

const MaterialVec & dd4hep::rec::MaterialManager::materialsBetween ( const Vector3D p0,
const Vector3D p1,
double  epsilon = 1e-4 
)

Get a vector with all the materials between the two points p0 and p1 with the corresponding thicknesses - element type is std::pair< Material, double >.

Materials with a thickness smaller than epsilon (default 1e-4=1mu) are ignored. Avoid calling this method in inner loops as the computation is not cheap. Ideally the result should be cached, for example as an averaged material

See Also
createAveragedMaterial().

Definition at line 40 of file MaterialManager.cpp.

References _mV, _p0, _p1, _placeV, _tgeoMgr, std::vector< T >::clear(), std::vector< T >::emplace_back(), std::vector< T >::empty(), and MINSTEP.

Referenced by dd4hep::rec::createGearForILD(), and placementsBetween().

PlacedVolume dd4hep::rec::MaterialManager::placementAt ( const Vector3D pos)

Get the placed volume at the given position.

Definition at line 181 of file MaterialManager.cpp.

References _m, _pos, _pv, _tgeoMgr, and std::stringstream::str().

const PlacementVec & dd4hep::rec::MaterialManager::placementsBetween ( const Vector3D p0,
const Vector3D p1,
double  epsilon = 1e-4 
)

Get a vector with all the placements between the two points p0 and p1.

Definition at line 35 of file MaterialManager.cpp.

References _placeV, and materialsBetween().

Member Data Documentation

Material dd4hep::rec::MaterialManager::_m
protected

Definition at line 84 of file MaterialManager.h.

Referenced by materialAt(), and placementAt().

MaterialVec dd4hep::rec::MaterialManager::_mV
protected

Cached materials.

Definition at line 83 of file MaterialManager.h.

Referenced by materialsBetween().

Vector3D dd4hep::rec::MaterialManager::_p0
protected

cached last points

Definition at line 89 of file MaterialManager.h.

Referenced by materialsBetween().

Vector3D dd4hep::rec::MaterialManager::_p1
protected

Definition at line 89 of file MaterialManager.h.

Referenced by materialsBetween().

PlacementVec dd4hep::rec::MaterialManager::_placeV
protected

Definition at line 87 of file MaterialManager.h.

Referenced by materialsBetween(), and placementsBetween().

Vector3D dd4hep::rec::MaterialManager::_pos
protected

Definition at line 89 of file MaterialManager.h.

Referenced by materialAt(), and placementAt().

PlacedVolume dd4hep::rec::MaterialManager::_pv
protected

Cached nodes.

Definition at line 86 of file MaterialManager.h.

Referenced by materialAt(), and placementAt().

TGeoManager* dd4hep::rec::MaterialManager::_tgeoMgr
protected

Reference to the TGeoManager.

Definition at line 91 of file MaterialManager.h.

Referenced by materialAt(), MaterialManager(), materialsBetween(), and placementAt().


The documentation for this class was generated from the following files: