|
DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
Go to the documentation of this file.
19 #include <TGeoManager.h>
26 const VolumeManagerContext*
41 double l[3], e[3], g[3];
51 #if 0 // this uses the deprecated VolumeManagerContext::placement
72 local.GetCoordinates(l);
74 const TGeoMatrix& volToElement = context->
toElement();
75 volToElement.LocalToMaster(l, e);
77 const TGeoMatrix& elementToGlobal =
det.nominal().worldTransformation();
78 elementToGlobal.LocalToMaster(e, g);
93 PlacedVolume pv = geoManager->FindNode( global.x() , global.y() , global.z() ) ;
97 TGeoHMatrix* m = geoManager->GetCurrentMatrix() ;
100 global.GetCoordinates( g ) ;
101 m->MasterToLocal( g, l );
110 TGeoPhysicalNode pN( geoManager->GetPath() ) ;
112 unsigned motherCount = 0 ;
114 while( pN.GetMother( motherCount ) != NULL ){
118 if( mPv.
isValid() && pN.GetMother( motherCount ) != NULL )
194 if(
det.volume().isValid() and
det.volume().solid().isValid() ) {
197 global.GetCoordinates( g ) ;
199 det.nominal().worldTransformation().MasterToLocal( g, l );
201 return det.volume().solid()->Contains( l ) ;
216 if( containsPoint(
det, global ) ) {
218 if(
det.children().empty() )
224 for(
const auto& it :
det.children() ){
229 if( containsPoint( it.second , global ) ){
252 pos.GetCoordinates( l ) ;
261 int ndau = pv->GetNdaughters() ;
269 for (
int i = 0 ; i < ndau; ++i) {
272 pvDau->MasterToLocal( l , locPos ) ;
283 volIDs.
insert( std::end(volIDs), std::begin(pvDau.
volIDs()), std::end(pvDau.
volIDs()) );
290 if( result->GetNdaughters() == 0 ){
305 if (
det.volume().isValid() and
det.volume().isSensitive()) {
331 for (Int_t idau = 0, ndau = pv->GetNdaughters(); idau < ndau; ++idau) {
344 if( context ==
nullptr )
return { };
const Children & children() const
Access to the list of children.
const VolumeManagerContext * findContext(const CellID &cellID) const
virtual DetElement world() const =0
Return reference to the top-most (world) detector element.
Position position(const CellID &cellID) const
determine the local position based on the cell ID
std::vector< double > cellDimensions(const CellID &cell) const
VolumeManagerContext * lookupContext(VolumeID volume_id) const
Lookup the context, which belongs to a registered physical volume.
Handle class to hold the information of a sensitive detector.
Handle class holding a placed volume (also called physical volume)
VolumeManager _volumeManager
DetElement element
Handle to the closest Detector element.
Readout findReadout(const DetElement &det) const
Position positionNominal(const CellID &cellID) const
Solid solid() const
Access to Solid (Shape)
bool isValid() const
Check the validity of the object held by the handle.
CellID cellID(const Position &global) const
bool isSensitive() const
Accessor if volume is sensitive (ie. is attached to a sensitive detector)
PlacedVolume findPlacement(const Position &point, const PlacedVolume &mother, double locPos[3], PlacedVolume::VolIDs &volIDs) const
Handle class describing a detector element.
std::vector< double > cellDimensions(const CellID &cellID) const
Returns a vector<double> of the cellDimensions of the given cell ID in natural order of dimensions,...
Volume volume() const
Access to the logical volume of the detector element's placement.
static VolumeID encode(const Field *fld, VolumeID value)
Encode partial volume identifiers to a volumeID.
DetElement findDetElement(const Position &global, const DetElement &det=DetElement()) const
Segmentation segmentation() const
Access segmentation structure.
CellID cellID(const Position &localPosition, const Position &globalPosition, const VolumeID &volumeID) const
determine the cell ID based on the local position
const TGeoHMatrix & toElement() const
Access the transformation to the closest detector element.
ROOT::Math::XYZVector Position
Namespace for the AIDA detector description toolkit.
Readout readout() const
Access readout structure of the sensitive detector.
Volume volume() const
Logical volume of this placement.
std::pair< std::vector< VolID >::iterator, bool > insert(const std::string &name, int value)
Insert new entry.
This structure describes the cached data for one placement held by the volume manager.
Handle to the implementation of the readout structure of a subdetector.
Handle class supporting generic Segmentations of sensitive detectors.
IDDescriptor idSpec() const
Access IDDescription structure.
const Detector * _description
const PlacedVolumeExtension::VolIDs & volIDs() const
Access to the volume IDs.
DDSegmentation::CellID CellID
Position position(const CellID &cellID) const
DDSegmentation::VolumeID VolumeID
Handle< NamedObject > sensitiveDetector() const
Access to the handle to the sensitive detector.