DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
MultiSegmentation.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 DDSEGMENTATION_MULTISEGMENTATION_H
14 #define DDSEGMENTATION_MULTISEGMENTATION_H
15 
17 
19 namespace dd4hep {
20 
21  namespace DDSegmentation {
22 
24 
30  public:
32  struct Entry {
35  };
36  typedef std::vector<Entry> Segmentations;
37 
38  protected:
41 
43  std::string m_discriminatorId;
44 
47 
49  int m_debug;
50 
51  public:
53  MultiSegmentation(const std::string& cellEncoding = "");
54 
57 
59  virtual ~MultiSegmentation();
60 
62  virtual void addSubsegmentation(long key_min, long key_max, Segmentation* entry);
63 
65  const Segmentation& subsegmentation(const CellID& cellID) const;
66 
68  virtual Vector3D position(const CellID& cellID) const;
69 
71  virtual CellID cellID(const Vector3D& localPosition, const Vector3D& globalPosition, const VolumeID& volumeID) const;
72 
79  virtual std::vector<double> cellDimensions(const CellID& cellID) const;
80 
82  const std::string& discriminatorName() const { return m_discriminatorId; }
83 
85  const BitFieldElement* discriminator() const { return m_discriminator; }
86 
88  virtual void setDecoder(const BitFieldCoder* decoder);
89 
91  const Segmentations& subSegmentations() const { return m_segmentations; }
92 
93  };
94 
95  } /* namespace DDSegmentation */
96 } /* namespace dd4hep */
97 
98 #endif // DDSEGMENTATION_MULTISEGMENTATION_H
dd4hep::DDSegmentation::VolumeID
uint64_t VolumeID
Definition: BitFieldCoder.h:27
dd4hep::DDSegmentation::MultiSegmentation::position
virtual Vector3D position(const CellID &cellID) const
determine the position based on the cell ID
Definition: MultiSegmentation.cpp:98
dd4hep::DDSegmentation::BitFieldElement
Helper class for BitFieldCoder that corresponds to one field value.
Definition: BitFieldCoder.h:32
dd4hep::DDSegmentation::Vector3D
Simple container for a physics vector.
Definition: Segmentation.h:48
dd4hep::DDSegmentation::BitFieldCoder
Helper class for decoding and encoding a bit field of 64bits for convenient declaration.
Definition: BitFieldCoder.h:114
dd4hep::DDSegmentation::MultiSegmentation::Entry
Helper structure to describe a sub-segmentation entry.
Definition: MultiSegmentation.h:32
dd4hep::DDSegmentation::MultiSegmentation::discriminatorName
const std::string & discriminatorName() const
access the field name used to discriminate sub-segmentations
Definition: MultiSegmentation.h:82
dd4hep::DDSegmentation::MultiSegmentation::addSubsegmentation
virtual void addSubsegmentation(long key_min, long key_max, Segmentation *entry)
Add subsegmentation.
Definition: MultiSegmentation.cpp:57
dd4hep::DDSegmentation::MultiSegmentation::cellDimensions
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,...
Definition: MultiSegmentation.cpp:107
dd4hep::DDSegmentation::MultiSegmentation
Wrapper to support multiple segmentations.
Definition: MultiSegmentation.h:29
dd4hep::DDSegmentation::MultiSegmentation::setDecoder
virtual void setDecoder(const BitFieldCoder *decoder)
Set the underlying decoder.
Definition: MultiSegmentation.cpp:66
dd4hep::DDSegmentation::MultiSegmentation::Entry::key_min
long key_min
Definition: MultiSegmentation.h:33
dd4hep::DDSegmentation::MultiSegmentation::subsegmentation
const Segmentation & subsegmentation(const CellID &cellID) const
Access subsegmentation by cell identifier.
Definition: MultiSegmentation.cpp:74
dd4hep::DDSegmentation::MultiSegmentation::Entry::segmentation
Segmentation * segmentation
Definition: MultiSegmentation.h:34
dd4hep::DDSegmentation::MultiSegmentation::cellID
virtual CellID cellID(const Vector3D &localPosition, const Vector3D &globalPosition, const VolumeID &volumeID) const
determine the cell ID based on the position
Definition: MultiSegmentation.cpp:103
dd4hep::DDSegmentation::MultiSegmentation::m_segmentations
Segmentations m_segmentations
Sub-segmentaion container.
Definition: MultiSegmentation.h:40
dd4hep::DDSegmentation::Segmentation::decoder
virtual const BitFieldCoder * decoder() const
Access the underlying decoder.
Definition: Segmentation.h:112
dd4hep::DDSegmentation::CellID
uint64_t CellID
Definition: BitFieldCoder.h:26
dd4hep::DDSegmentation::MultiSegmentation::Entry::key_max
long key_max
Definition: MultiSegmentation.h:33
dd4hep::DDSegmentation::MultiSegmentation::discriminator
const BitFieldElement * discriminator() const
Discriminating bitfield entry.
Definition: MultiSegmentation.h:85
dd4hep::DDSegmentation::MultiSegmentation::~MultiSegmentation
virtual ~MultiSegmentation()
Default destructor.
Definition: MultiSegmentation.cpp:50
dd4hep::DDSegmentation::MultiSegmentation::m_discriminatorId
std::string m_discriminatorId
the field name used to discriminate sub-segmentations
Definition: MultiSegmentation.h:43
dd4hep::DDSegmentation::Segmentation::volumeID
virtual VolumeID volumeID(const CellID &cellID) const
Determine the volume ID from the full cell ID by removing all local fields.
Definition: Segmentation.cpp:66
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::DDSegmentation::MultiSegmentation::MultiSegmentation
MultiSegmentation(const std::string &cellEncoding="")
Default constructor passing the encoding string.
Definition: MultiSegmentation.cpp:28
dd4hep::DDSegmentation::MultiSegmentation::Segmentations
std::vector< Entry > Segmentations
Definition: MultiSegmentation.h:36
dd4hep::DDSegmentation::MultiSegmentation::m_discriminator
const BitFieldElement * m_discriminator
Bitfield corresponding to dicriminator identifier.
Definition: MultiSegmentation.h:46
dd4hep::DDSegmentation::MultiSegmentation::m_debug
int m_debug
Debug flags.
Definition: MultiSegmentation.h:49
Segmentation.h
dd4hep::DDSegmentation::Segmentation
Base class for all segmentations.
Definition: Segmentation.h:75
dd4hep::DDSegmentation::MultiSegmentation::subSegmentations
const Segmentations & subSegmentations() const
The underlying sub-segementations.
Definition: MultiSegmentation.h:91