DD4hep - The AIDA detector description toolkit for high energy physics experiments
DD4hep  Rev:Unversioneddirectory
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Segmentations.h
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation for LCD
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_GEOMETRY_SEGMENTATIONS_H
14 #define DD4HEP_GEOMETRY_SEGMENTATIONS_H
15 
16 // Framework include files
17 #include "DD4hep/Handle.h"
18 #include "DD4hep/Objects.h"
19 #include "DD4hep/BitField64.h"
21 
22 // C/C++ include files
23 
24 
26 namespace DD4hep {
27 
29  namespace Geometry {
30 
32  class DetElementObject;
33  class SegmentationObject;
34  class SensitiveDetectorObject;
35 
37 
43  class Segmentation: public Handle<SegmentationObject> {
44  public:
49 
50  public:
52  Segmentation(const std::string& type, const std::string& name, BitField64* decoder);
54  Segmentation() = default;
57 #ifndef __CINT__
58  Segmentation(const Handle<Object>& e) : Handle<Object>(e) { }
60 #endif
61  template <typename Q>
63  Segmentation(const Handle<Q>& e) : Handle<Object>(e) { }
65  Segmentation& operator=(const Segmentation& seg) = default;
67  bool useForHitPosition() const;
69  std::string type() const;
71  Parameters parameters() const;
73  Parameter parameter(const std::string& parameterName) const;
79  BitField64* decoder() const;
81  void setDecoder(BitField64* decoder) const;
83  Position position(const long64& cellID) const;
85  long64 cellID(const Position& localPosition, const Position& globalPosition, const long64& volumeID) const;
87  VolumeID volumeID(const CellID& cellID) const;
89  void neighbours(const CellID& cellID, std::set<CellID>& neighbours) const;
96  std::vector<double> cellDimensions(const CellID& cellID) const;
97 
100  };
101 
102  } /* End namespace Geometry */
103 } /* End namespace DD4hep */
104 #endif /* DD4HEP_GEOMETRY_SEGMENTATIONS_H */
long long int CellID
Useful typedefs to differentiate cell IDs and volume IDs.
Definition: Primitives.h:32
Implementation class supporting generic Segmentation of sensitive detectors.
const char * name() const
Access the object name (or "" if not supported by the object)
Definition: Handle.inl:36
void setDecoder(BitField64 *decoder) const
Set the underlying decoder.
bool useForHitPosition() const
Access flag for hit positioning.
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
return e
Definition: Volumes.cpp:297
std::vector< Parameter > Parameters
Definition: Segmentation.h:25
DDSegmentation::Parameter Parameter
Definition: Segmentations.h:47
BitField64 * decoder() const
Access the underlying decoder.
Parameters parameters() const
Access to the parameters.
Segmentation(const Segmentation &e)
Copy Constructor from object.
Definition: Segmentations.h:56
Handle< DetElementObject > detector() const
Access the main detector element using this segmetnation object.
Segmentation(const Handle< Q > &e)
Constructor to be used when reading the already parsed object.
Definition: Segmentations.h:63
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...
Parameter parameter(const std::string &parameterName) const
Access to parameter by name.
BaseSegmentation * segmentation() const
Access to the base DDSegmentation object. WARNING: Deprecated call!
ROOT::Math::XYZVector Position
Definition: Objects.h:75
DDSegmentation::Parameters Parameters
Definition: Segmentations.h:48
Segmentation()=default
Default constructor.
Handle class supporting generic Segmentation of sensitive detectors.
Definition: Segmentations.h:43
Base class for all segmentations.
Definition: Segmentation.h:68
VolumeID volumeID(const CellID &cellID) const
Determine the volume ID from the full cell ID by removing all local fields.
DDSegmentation::Segmentation BaseSegmentation
Definition: Segmentations.h:46
Handle: a templated class like a shared pointer, which allows specialized access to tgeometry objects...
Definition: Handle.h:87
Handle< SensitiveDetectorObject > sensitive() const
Access the sensitive detector using this segmetnation object.
long long int VolumeID
Definition: Primitives.h:35
Segmentation & operator=(const Segmentation &seg)=default
Assignment operator.
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.
long long int long64
Definition: BitField64.h:15