27 using namespace DD4hep;
28 using namespace DD4hep::Geometry;
33 Segmentation::Segmentation(
const string& typ,
const string& nam, BitField64* dec) :
Handle<
Object>()
35 string seg_type =
"segmentation_constructor__"+typ;
39 if ( !nam.empty() ) obj->
setName(nam);
43 except(
"Segmentation",
"FAILED to create segmentation: %s. [Missing factory]",typ.c_str());
48 return data<Object>()->
type();
62 return data<Object>()->
parameter(parameterName);
120 #define IMPLEMENT_SEGMENTATION_HANDLE(X) \
121 DD4HEP_INSTANTIATE_HANDLE_UNNAMED(SegmentationWrapper<DDSegmentation::X>);
126 #include "DDSegmentation/CartesianGridXY.h"
129 #include "DDSegmentation/CartesianGridXZ.h"
132 #include "DDSegmentation/CartesianGridYZ.h"
135 #include "DDSegmentation/CartesianGridXYZ.h"
138 #include "DDSegmentation/TiledLayerGridXY.h"
141 #include "DDSegmentation/MegatileLayerGridXY.h"
144 #include "DDSegmentation/WaferGridXY.h"
147 #include "DDSegmentation/PolarGridRPhi.h"
150 #include "DDSegmentation/PolarGridRPhi2.h"
153 #include "DDSegmentation/ProjectiveCylinder.h"
156 #include "DDSegmentation/MultiSegmentation.h"
long long int CellID
Useful typedefs to differentiate cell IDs and volume IDs.
virtual VolumeID volumeID(const CellID &cellID) const
Determine the volume ID from the full cell ID by removing all local fields.
Implementation class supporting generic Segmentation of sensitive detectors.
void setDecoder(BitField64 *decoder) const
Set the underlying decoder.
bool useForHitPosition() const
Access flag for hit positioning.
virtual void neighbours(const CellID &cellID, std::set< CellID > &neighbours) const
Calculates the neighbours of the given cell ID and adds them to the list of neighbours.
Implementation class for the grid XZ segmentation.
virtual BitField64 * decoder() const
Access the underlying decoder.
void neighbours(const CellID &cellID, std::set< CellID > &neighbours) const
Calculates the neighbours of the given cell ID and adds them to the list of neighbours.
Position position(const long64 &cellID) const
determine the local position based on the cell ID
void setName(const std::string &value)
Set the segmentation name.
int except(const std::string &src, const std::string &fmt,...)
Calls the display action with ERROR and throws an std::runtime_error exception.
BitField64 * decoder() const
Access the underlying decoder.
virtual Vector3D position(const CellID &cellID) const =0
Determine the local position based on the cell ID.
Parameters parameters() const
Access to the parameters.
Handle< DetElementObject > detector() const
Access the main detector element using this segmetnation object.
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...
Implementation class for the grid XYZ segmentation.
virtual 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...
void assign(Implementation *n, const std::string &nam, const std::string &title)
Assign a new named object. Note: object references must be managed by the user.
Implementation class for the grid XZ segmentation.
Parameter parameter(const std::string ¶meterName) const
Access to parameter by name.
Implementation class for the grid XZ segmentation.
BaseSegmentation * segmentation() const
Access to the base DDSegmentation object. WARNING: Deprecated call!
ROOT::Math::XYZVector Position
DDSegmentation::Parameters Parameters
#define IMPLEMENT_SEGMENTATION_HANDLE(X)
Base class for all segmentations.
virtual CellID cellID(const Vector3D &localPosition, const Vector3D &globalPosition, const VolumeID &volumeID) const =0
Determine the cell ID based on the position.
VolumeID volumeID(const CellID &cellID) const
Determine the volume ID from the full cell ID by removing all local fields.
DD4HEP_INSTANTIATE_HANDLE_UNNAMED(SegmentationObject)
Implementation class for the grid XY segmentation.
Implementation class for the grid XZ segmentation.
Handle: a templated class like a shared pointer, which allows specialized access to tgeometry objects...
Handle< SensitiveDetectorObject > sensitive() const
Access the sensitive detector using this segmetnation object.
virtual void setDecoder(BitField64 *decoder)
Set the underlying decoder.
Class to hold a segmentation parameter with its description.
long64 cellID(const Position &localPosition, const Position &globalPosition, const long64 &volumeID) const
determine the cell ID based on the local position
std::string type() const
Accessor: Segmentation type.
Implementation class for the grid XZ segmentation.
Implementation class for the grid YZ segmentation.