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
SegmentationsInterna.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_SEGMENTATIONSINTERNA_H
14 #define DD4HEP_GEOMETRY_SEGMENTATIONSINTERNA_H
15 
16 // Framework include files
17 #include "DD4hep/Handle.h"
18 #include "DD4hep/Objects.h"
20 
21 // C/C++ include files
22 
24 namespace DD4hep {
25 
27  namespace Geometry {
28 
29  // Forward declarations
30  class DetElementObject;
31  class SegmentationObject;
32  class SensitiveDetectorObject;
33 
35 
43  public:
47 
48  public:
52  virtual ~SegmentationObject();
54  std::string fieldDescription() const;
56  const std::string& name() const;
58  void setName(const std::string& value);
59 
61  const std::string& type() const;
63  const std::string& description() const;
65  BitField64* decoder() const;
67  void setDecoder(BitField64* decoder) const;
69  Parameter parameter(const std::string& parameterName) const;
71  Parameters parameters() const;
73  void setParameters(const Parameters& parameters);
74 
76  Position position(const CellID& cellID) const;
79  CellID cellID(const Position& localPosition,
80  const Position& globalPosition,
81  const VolumeID& volumeID) const;
83  VolumeID volumeID(const CellID& cellID) const;
85  void neighbours(const CellID& cellID, std::set<CellID>& neighbours) const;
86 
88  unsigned long magic;
91  unsigned char useForHitPosition;
98  };
99 
101 
106  template <typename IMP> class SegmentationWrapper : public SegmentationObject {
107  public:
110  public:
114  virtual ~SegmentationWrapper();
115  };
116 
118  template <typename IMP> inline
120  : SegmentationObject(implementation=new IMP(decode))
121  {
122  }
123 
125  template <typename IMP> inline SegmentationWrapper<IMP>::~SegmentationWrapper() {
126  }
127  } /* End namespace Geometry */
128 } /* End namespace DD4hep */
129 #endif /* DD4HEP_GEOMETRY_SEGMENTATIONSINTERNA_H */
long long int CellID
Useful typedefs to differentiate cell IDs and volume IDs.
Definition: Primitives.h:32
SegmentationObject(BaseSegmentation *s=0)
Standard constructor.
Implementation class supporting generic Segmentation of sensitive detectors.
IMP * implementation
DDSegmentation aggregate.
const std::string & description() const
Access the description of the segmentation.
Handle< DetElementObject > detector
Reference to hosting top level DetElement structure.
Parameter parameter(const std::string &parameterName) const
Access to parameter by name.
const std::string & type() const
Access the segmentation type.
Handle< SensitiveDetectorObject > sensitive
Reference to hosting top level sensitve detector structure.
TGeoShape * s
Definition: Volumes.cpp:294
void setName(const std::string &value)
Set the segmentation name.
std::string fieldDescription() const
Access the encoding string.
std::vector< Parameter > Parameters
Definition: Segmentation.h:25
BaseSegmentation * segmentation
Reference to base segmentation.
virtual ~SegmentationWrapper()
Default destructor.
virtual ~SegmentationObject()
Default destructor.
Concrete wrapper class for segmentation implementation based on DDSegmentation objects.
Position position(const CellID &cellID) const
Determine the local position based on the cell ID.
DDSegmentation::Segmentation BaseSegmentation
ROOT::Math::XYZVector Position
Definition: Objects.h:75
Base class for all segmentations.
Definition: Segmentation.h:68
unsigned char useForHitPosition
Flag to use segmentation for hit positioning.
DDSegmentation::Parameters Parameters
VolumeID volumeID(const CellID &cellID) const
Determine the volume ID from the full cell ID by removing all local fields.
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 long int VolumeID
Definition: Primitives.h:35
void setParameters(const Parameters &parameters)
Set all parameters from an existing set of parameters.
Class to hold a segmentation parameter with its description.
const std::string & name() const
Access the segmentation name.
SegmentationWrapper(DDSegmentation::BitField64 *decoder)
Standard constructor.
CellID cellID(const Position &localPosition, const Position &globalPosition, const VolumeID &volumeID) const
Determine the cell ID based on the position.
void setDecoder(BitField64 *decoder) const
Set the underlying decoder.
unsigned long magic
Magic word to check object integrity.
BitField64 * decoder() const
Access the underlying decoder.
Parameters parameters() const
Access to all parameters.