19 using Geometry::PlacedVolume;
20 using Geometry::Readout;
22 using Geometry::VolumeManager;
23 using Geometry::Volume;
48 local.GetCoordinates(l);
53 localToGlobal.LocalToMaster(l, g);
65 global.GetCoordinates(g);
70 localToGlobal.MasterToLocal(g, l);
83 local.GetCoordinates(l);
87 localToGlobal.LocalToMaster(l, g);
159 std::cout << det.
name() << std::endl;
187 set<CellID> neighbour_cells;
190 return neighbour_cells.count(otherCellID) != 0;
224 DetElement::Children::const_iterator it = children.begin();
225 while (it != children.end()) {
243 double globalPosition[3] = { position.x(), position.y(), position.z() };
246 if (det.
volume().
solid()->Contains(localPosition)) {
255 DetElement::Children::const_iterator it = children.begin();
256 while (it != children.end()) {
259 result = daughterDet;
Handle class to hold the information of a sensitive detector.
IDDecoder()
Default constructor.
Ref_t sensitiveDetector() const
Access to the handle to the sensitive detector.
static Geometry::DetElement getClosestDaughter(const Geometry::DetElement &det, const Geometry::Position &position)
Helper method to get the closest daughter DetElement to the position starting from the given DetEleme...
Handle class holding a placed volume (also called physical volume)
Solid solid() const
Access to Solid (Shape)
virtual DetElement world() const =0
Return reference to the top-most (world) detector element.
static std::string systemIdentifier()
Volume volume() const
Access to the logical volume of the detector element's placement.
Geometry::Position position(const CellID &cellID) const
Returns the global position from a given cell ID.
const char * name() const
Access the object name (or "" if not supported by the object)
bool isValid() const
Check the validity of the object held by the handle.
DDSegmentation::CellID CellID
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.
PlacedVolume lookupPlacement(VolumeID volume_id) const
Lookup a physical (placed) volume identified by its 64 bit hit ID.
Geometry::DetElement detectorElement(const CellID &cellID) const
Returns the closest detector element in the hierarchy for a given cell ID.
VolumeID volumeID(const CellID &cellID) const
Returns the volume ID of a given cell ID.
BarrelEndcapFlag barrelEndcapFlag(const CellID &cellID) const
Access to the barrel-endcap flag.
Geometry::Readout findReadout(const Geometry::DetElement &det) const
Helper method to find the corresponding Readout object to a DetElement.
Geometry::Position localPosition(const CellID &cellID) const
Returns the local position from a given cell ID.
Position position(const long64 &cellID) const
determine the local position based on the cell ID
const Children & children() const
Access to the list of children.
static LCDD & getInstance(void)
—Factory method----—
Handle to the implementation of the readout structure of a subdetector.
DD4hep::Geometry::DetElement DetElement
Geometry::PlacedVolume placement(const CellID &cellID) const
Returns the placement for a given cell ID.
VolumeID volumeID() const
The cached VolumeID of this subdetector element.
CellID cellIDFromLocal(const Geometry::Position &local, const VolumeID volumeID) const
Returns the cell ID from the local position in the given volume ID.
Geometry::Readout readout(const CellID &cellID) const
Access to the Readout object for a given cell ID.
static std::string barrelIdentifier()
Field field(const std::string &field_name) const
Get the field descriptor of one field by name.
static std::string layerIdentifier()
long int systemIndex(const CellID &cellID) const
Access to the system index.
IDDescriptor idSpec() const
Access IDDescription structure.
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.
long int layerIndex(const CellID &cellID) const
Access to the layer index.
ROOT::Math::XYZVector Position
Solid_type< TGeoShape > Solid
Segmentation segmentation() const
Access segmentation structure.
Geometry::DetElement subDetector(const CellID &cellID) const
Returns the subdetector for a given cell ID.
DDSegmentation::VolumeID VolumeID
VolumeID volumeID(const CellID &cellID) const
Determine the volume ID from the full cell ID by removing all local fields.
DetElement lookupDetElement(VolumeID volume_id) const
Lookup the closest subdetector detector element in the hierarchy according to a contained 64 bit hit ...
DetElement lookupDetector(VolumeID volume_id) const
Lookup a top level subdetector detector element according to a contained 64 bit hit ID...
Handle class describing a detector element.
Class to support the retrieval of detector elements and volumes given a valid identifier.
Geometry::VolumeManager _volumeManager
Readout readout() const
Access readout structure of the sensitive detector.
bool areNeighbours(const CellID &cellID, const CellID &otherCellID) const
Checks if the given cell IDs are neighbours.
The main interface to the DD4hep detector description package.
std::map< std::string, DetElement > Children
virtual VolumeManager volumeManager() const =0
Return handle to the VolumeManager.
long64 cellID(const Position &localPosition, const Position &globalPosition, const long64 &volumeID) const
determine the cell ID based on the local position
const TGeoHMatrix & worldTransformation() const
Set detector element for reference transformations. Will delete existing reference trafo...
bool isSensitive() const
Accessor if volume is sensitive (ie. is attached to a sensitive detector)
static IDDecoder & getInstance()
Access to the global IDDecoder instance.
CellID cellID(const Geometry::Position &global) const
Returns the global cell ID from a given global position.