diff --git a/DDRec/include/DDRec/CellIDPositionConverter.h b/DDRec/include/DDRec/CellIDPositionConverter.h index 6ceab09cdb537666ec8c88b43cb589b29eb5b9a7..6f4ea8e9e36d79c642c6c31331648690889c422a 100644 --- a/DDRec/include/DDRec/CellIDPositionConverter.h +++ b/DDRec/include/DDRec/CellIDPositionConverter.h @@ -96,6 +96,10 @@ namespace dd4hep { */ Readout findReadout(const PlacedVolume& pv) const ; + /** Returns the segmentation.cellDimensions. + * + */ + std::vector<double> cellDimensions(const CellID& cell) const ; protected: VolumeManager _volumeManager{} ; diff --git a/DDRec/src/CellIDPositionConverter.cpp b/DDRec/src/CellIDPositionConverter.cpp index f55dc06c3dc36642e06a7703c98828a0d1e03616..77c650b33736670d40be91e31c10e5fded603e7c 100644 --- a/DDRec/src/CellIDPositionConverter.cpp +++ b/DDRec/src/CellIDPositionConverter.cpp @@ -327,6 +327,14 @@ namespace dd4hep { return Readout() ; } + std::vector<double> CellIDPositionConverter::cellDimensions(const CellID& cell) const { + auto context = findContext( cell ) ; + if( context == nullptr ) return { }; + dd4hep::Readout r = findReadout( context->element ) ; + dd4hep::Segmentation seg = r.segmentation() ; + return seg.cellDimensions( cell ); + } +