DD4hep  1.28.0
Detector Description Toolkit for High Energy Physics
Segmentations.h
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 // Author : M.Frank
11 //
12 //==========================================================================
13 #ifndef DD4HEP_SEGMENTATIONS_H
14 #define DD4HEP_SEGMENTATIONS_H
15 
16 // Framework include files
17 #include <DD4hep/Handle.h>
18 #include <DD4hep/Objects.h>
19 #include <DD4hep/BitFieldCoder.h>
21 
23 namespace dd4hep {
24 
26  class DetElementObject;
27  class SegmentationObject;
28  class SensitiveDetectorObject;
29  template <typename T> class SegmentationWrapper;
30 
32 
41  class Segmentation : public Handle<SegmentationObject> {
42  public:
44  Segmentation(const std::string& type, const std::string& name, const BitFieldCoder* decoder);
46  Segmentation() = default;
48  Segmentation(Segmentation&& e) = default;
50  Segmentation(const Segmentation& e) = default;
51 #ifndef __CINT__
56 #endif
57  template <typename Q> Segmentation(const Handle<Q>& e) : Handle<Object>(e) { }
60  Segmentation& operator=(Segmentation&& seg) = default;
62  Segmentation& operator=(const Segmentation& seg) = default;
64  bool useForHitPosition() const;
66  const char* name() const;
68  std::string type() const;
72  DDSegmentation::Parameter parameter(const std::string& parameterName) const;
78  const BitFieldCoder* decoder() const;
80  void setDecoder(const BitFieldCoder* decoder) const;
82  Position position(const CellID& cellID) const;
84  CellID cellID(const Position& localPosition, const Position& globalPosition, const VolumeID& volumeID) const;
86  VolumeID volumeID(const CellID& cellID) const;
88  void neighbours(const CellID& cellID, std::set<CellID>& neighbours) const;
95  std::vector<double> cellDimensions(const CellID& cellID) const;
96 
99  };
100 } /* End namespace dd4hep */
101 #endif // DD4HEP_SEGMENTATIONS_H
dd4hep::Segmentation::position
Position position(const CellID &cellID) const
determine the local position based on the cell ID
Definition: Segmentations.cpp:69
Objects.h
dd4hep::Handle< SegmentationObject >::Object
SegmentationObject Object
Extern accessible definition of the contained element type.
Definition: Handle.h:88
dd4hep::Segmentation::useForHitPosition
bool useForHitPosition() const
Access flag for hit positioning.
Definition: Segmentations.cpp:54
dd4hep::Segmentation::sensitive
Handle< SensitiveDetectorObject > sensitive() const
Access the sensitive detector using this segmentation object.
Definition: Segmentations.cpp:119
Handle.h
dd4hep::Handle
Handle: a templated class like a shared pointer, which allows specialized access to tgeometry objects...
Definition: Handle.h:84
dd4hep::Segmentation::detector
Handle< DetElementObject > detector() const
Access the main detector element using this segmentation object.
Definition: Segmentations.cpp:114
dd4hep::SegmentationObject
Implementation class supporting generic Segmentation of sensitive detectors.
Definition: SegmentationsInterna.h:46
dd4hep::DDSegmentation::SegmentationParameter
Class to hold a segmentation parameter with its description.
Definition: SegmentationParameter.h:108
dd4hep::Segmentation::cellDimensions
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,...
Definition: Segmentations.cpp:94
dd4hep::Segmentation::setDecoder
void setDecoder(const BitFieldCoder *decoder) const
Set the underlying decoder.
Definition: Segmentations.cpp:109
dd4hep::DDSegmentation::Parameters
std::vector< Parameter > Parameters
Definition: SegmentationsInterna.h:35
dd4hep::Segmentation::neighbours
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.
Definition: Segmentations.cpp:84
dd4hep::Segmentation::Segmentation
Segmentation(const Handle< Object > &e)
Copy Constructor from handle.
Definition: Segmentations.h:55
dd4hep::Segmentation::cellID
CellID cellID(const Position &localPosition, const Position &globalPosition, const VolumeID &volumeID) const
determine the cell ID based on the local position
Definition: Segmentations.cpp:74
dd4hep::Segmentation::volumeID
VolumeID volumeID(const CellID &cellID) const
Determine the volume ID from the full cell ID by removing all local fields.
Definition: Segmentations.cpp:79
dd4hep::Segmentation::Segmentation
Segmentation(const Segmentation &e)=default
Copy Constructor.
dd4hep::Segmentation::Segmentation
Segmentation(Segmentation &&e)=default
Move Constructor.
dd4hep::Segmentation::name
const char * name() const
Accessor: Segmentation type.
Definition: Segmentations.cpp:45
dd4hep::Position
ROOT::Math::XYZVector Position
Definition: Objects.h:81
dd4hep::Segmentation::type
std::string type() const
Accessor: Segmentation type.
Definition: Segmentations.cpp:50
VolumeID
dd4hep::DDSegmentation::VolumeID VolumeID
Definition: SegmentationDictionary.h:48
dd4hep::Segmentation::segmentation
DDSegmentation::Segmentation * segmentation() const
Access to the base DDSegmentation object. WARNING: Deprecated call!
Definition: Segmentations.cpp:99
dd4hep::Segmentation::operator=
Segmentation & operator=(const Segmentation &seg)=default
Copy Assignment operator.
dd4hep::Segmentation::decoder
const BitFieldCoder * decoder() const
Access the underlying decoder.
Definition: Segmentations.cpp:104
dd4hep::Segmentation::parameters
DDSegmentation::Parameters parameters() const
Access to the parameters.
Definition: Segmentations.cpp:59
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::Segmentation::operator=
Segmentation & operator=(Segmentation &&seg)=default
Move Assignment operator.
dd4hep::Segmentation::Segmentation
Segmentation()=default
Default constructor.
dd4hep::Segmentation
Handle class supporting generic Segmentations of sensitive detectors.
Definition: Segmentations.h:41
dd4hep::Segmentation::parameter
DDSegmentation::Parameter parameter(const std::string &parameterName) const
Access to parameter by name.
Definition: Segmentations.cpp:64
Segmentation.h
dd4hep::DDSegmentation::Segmentation
Base class for all segmentations.
Definition: Segmentation.h:75
BitFieldCoder.h
CellID
dd4hep::DDSegmentation::CellID CellID
Definition: SegmentationDictionary.h:49