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

Utility for position to cellID and cellID to position conversions. More...

#include <CellIDPositionConverter.h>

Public Member Functions

 CellIDPositionConverter (Detector &description)
 The constructor - takes the main description object. More...
 
virtual ~CellIDPositionConverter ()
 Destructor. More...
 
Position positionNominal (const CellID &cellID) const
 Return the nominal global position for a given cellID of a sensitive volume. More...
 
Position position (const CellID &cellID) const
 Return the global position for a given cellID of a sensitive volume. More...
 
CellID cellID (const Position &global) const
 Return the global cellID for the given global position. More...
 
const VolumeManagerContext * findContext (const CellID &cellID) const
 Find the context with DetElement, placements etc for a given cellID of a sensitive volume. More...
 
DetElement findDetElement (const Position &global, const DetElement &det=DetElement()) const
 Find the DetElement that contains the given point - if no DetElement is found, an invalid DetElement is returned. More...
 
PlacedVolume findPlacement (const Position &point, const PlacedVolume &mother, double locPos[3], PlacedVolume::VolIDs &volIDs) const
 Find the lowest daughter Placement in the given Placement that contains the point (in the coordinate system of the mother placement). More...
 
Readout findReadout (const DetElement &det) const
 Find the readout object for the given DetElement. More...
 
Readout findReadout (const PlacedVolume &pv) const
 Return this PlacedVolume's Readout or, if the volume is not sensitive, recursively search for a Readout object in the daughter nodes (volumes). More...
 
std::vector< double > cellDimensions (const CellID &cell) const
 Returns the segmentation.cellDimensions. More...
 

Protected Attributes

VolumeManager _volumeManager {}
 
const Detector * _description
 

Private Member Functions

 CellIDPositionConverter ()=delete
 
 CellIDPositionConverter (const CellIDPositionConverter &)=delete
 
void operator= (const CellIDPositionConverter &)=delete
 

Detailed Description

Utility for position to cellID and cellID to position conversions.

(Correctly re-implements some of the functionality of the deprecated IDDecoder).

Author
F.Gaede, DESY
Date
May 2017

Definition at line 39 of file CellIDPositionConverter.h.

Constructor & Destructor Documentation

dd4hep::rec::CellIDPositionConverter::CellIDPositionConverter ( )
privatedelete
dd4hep::rec::CellIDPositionConverter::CellIDPositionConverter ( const CellIDPositionConverter )
privatedelete
dd4hep::rec::CellIDPositionConverter::CellIDPositionConverter ( Detector &  description)
inline

The constructor - takes the main description object.

Definition at line 51 of file CellIDPositionConverter.h.

References _volumeManager.

virtual dd4hep::rec::CellIDPositionConverter::~CellIDPositionConverter ( )
inlinevirtual

Destructor.

Definition at line 56 of file CellIDPositionConverter.h.

Member Function Documentation

std::vector< double > dd4hep::rec::CellIDPositionConverter::cellDimensions ( const CellID cell) const

Returns the segmentation.cellDimensions.

Definition at line 342 of file CellIDPositionConverter.cpp.

References findContext(), and findReadout().

CellID dd4hep::rec::CellIDPositionConverter::cellID ( const Position &  global) const

Return the global cellID for the given global position.

Note: this call is rather slow - only use it when really needed !

Definition at line 87 of file CellIDPositionConverter.cpp.

References _description, std::begin(), and std::end().

const VolumeManagerContext * dd4hep::rec::CellIDPositionConverter::findContext ( const CellID cellID) const

Find the context with DetElement, placements etc for a given cellID of a sensitive volume.

Returns NULL if not found (e.g. if the cellID does not correspond to a sensitive volume).

Definition at line 27 of file CellIDPositionConverter.cpp.

References _volumeManager.

Referenced by cellDimensions(), and positionNominal().

DetElement dd4hep::rec::CellIDPositionConverter::findDetElement ( const Position &  global,
const DetElement det = DetElement() 
) const

Find the DetElement that contains the given point - if no DetElement is found, an invalid DetElement is returned.

Uses the optionally given DetElement as start for the search.

Definition at line 209 of file CellIDPositionConverter.cpp.

References _description.

PlacedVolume dd4hep::rec::CellIDPositionConverter::findPlacement ( const Position &  point,
const PlacedVolume &  mother,
double  locPos[3],
PlacedVolume::VolIDs &  volIDs 
) const

Find the lowest daughter Placement in the given Placement that contains the point (in the coordinate system of the mother placement).

Return the local coordinates in this daughter Placement and collect all volIDs on the way.

Definition at line 248 of file CellIDPositionConverter.cpp.

References std::begin(), and std::end().

Readout dd4hep::rec::CellIDPositionConverter::findReadout ( const DetElement det) const

Find the readout object for the given DetElement.

If the DetElement is sensitive the corresondig Readout is returned, else a recursive search in the daughter volumes (nodes) of this DetElement's volume is performed and the first Readout object is returned.

Definition at line 302 of file CellIDPositionConverter.cpp.

Referenced by cellDimensions(), findReadout(), and positionNominal().

Readout dd4hep::rec::CellIDPositionConverter::findReadout ( const PlacedVolume &  pv) const

Return this PlacedVolume's Readout or, if the volume is not sensitive, recursively search for a Readout object in the daughter nodes (volumes).

Definition at line 321 of file CellIDPositionConverter.cpp.

References findReadout().

void dd4hep::rec::CellIDPositionConverter::operator= ( const CellIDPositionConverter )
privatedelete
Position dd4hep::rec::CellIDPositionConverter::position ( const CellID cellID) const

Return the global position for a given cellID of a sensitive volume.

Alignment corrections are applied (TO BE DONE). If no sensitive volume is found, (0,0,0) is returned.

Definition at line 32 of file CellIDPositionConverter.cpp.

References positionNominal().

Position dd4hep::rec::CellIDPositionConverter::positionNominal ( const CellID cellID) const

Return the nominal global position for a given cellID of a sensitive volume.

No Alignment corrections are applied. If no sensitive volume is found, (0,0,0) is returned.

Definition at line 39 of file CellIDPositionConverter.cpp.

References dumpDetectorData::det, findContext(), and findReadout().

Referenced by position().

Member Data Documentation

const Detector* dd4hep::rec::CellIDPositionConverter::_description
protected

Definition at line 121 of file CellIDPositionConverter.h.

Referenced by cellID(), and findDetElement().

VolumeManager dd4hep::rec::CellIDPositionConverter::_volumeManager {}
protected

Definition at line 120 of file CellIDPositionConverter.h.

Referenced by CellIDPositionConverter(), and findContext().


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