DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
SegmentationsInterna.cpp
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 
14 // Framework include files
16 #include <DD4hep/InstanceCount.h>
17 
19 
20 using namespace dd4hep;
21 
24  : magic(magic_word()), useForHitPosition(0),
25  detector(0), sensitive(0), segmentation(s)
26 {
28 }
29 
33  if (segmentation) {
34  delete segmentation;
35  }
36 }
37 
41 }
42 
44 const std::string& SegmentationObject::name() const {
45  return segmentation->name();
46 }
48 void SegmentationObject::setName(const std::string& value) {
49  segmentation->setName(value);
50 }
51 
53 const std::string& SegmentationObject::type() const {
54  return segmentation->type();
55 }
56 
58 const std::string& SegmentationObject::description() const {
59  return segmentation->description();
60 }
61 
63 const BitFieldCoder* SegmentationObject::decoder() const {
64  return segmentation->decoder();
65 }
66 
68 void SegmentationObject::setDecoder(const BitFieldCoder* ptr_decoder) const {
69  segmentation->setDecoder(ptr_decoder);
70 }
71 
73 DDSegmentation::Parameter SegmentationObject::parameter(const std::string& parameterName) const {
74  return segmentation->parameter(parameterName);
75 }
76 
79  return segmentation->parameters();
80 }
81 
84  segmentation->setParameters(params);
85 }
86 
89  return Position(segmentation->position(cell));
90 }
91 
94  const Position& global,
95  const VolumeID& volID) const {
96  return segmentation->cellID(local, global, volID);
97 }
98 
101  return segmentation->volumeID(cell);
102 }
dd4hep::SegmentationObject::volumeID
VolumeID volumeID(const CellID &cellID) const
Determine the volume ID from the full cell ID by removing all local fields.
Definition: SegmentationsInterna.cpp:100
dd4hep::SegmentationObject::parameters
DDSegmentation::Parameters parameters() const
Access to all parameters.
Definition: SegmentationsInterna.cpp:78
dd4hep::SegmentationObject::SegmentationObject
SegmentationObject(DDSegmentation::Segmentation *seg=0)
Standard constructor.
Definition: SegmentationsInterna.cpp:23
dd4hep::SegmentationObject::segmentation
DDSegmentation::Segmentation * segmentation
Reference to base segmentation.
Definition: SegmentationsInterna.h:96
dd4hep::SegmentationObject::~SegmentationObject
virtual ~SegmentationObject()
Default destructor.
Definition: SegmentationsInterna.cpp:31
dd4hep::InstanceCount::increment
static void increment(T *)
Increment count according to type information.
Definition: InstanceCount.h:98
dd4hep::magic_word
unsigned long long int magic_word()
Access to the magic word, which is protecting some objects against memory corruptions.
Definition: Handle.h:53
dd4hep::DDSegmentation::SegmentationParameter
Class to hold a segmentation parameter with its description.
Definition: SegmentationParameter.h:107
dd4hep::DDSegmentation::Segmentation::name
virtual const std::string & name() const
Access the segmentation name.
Definition: Segmentation.h:96
dd4hep::DDSegmentation::Segmentation::parameters
virtual Parameters parameters() const
Access to all parameters.
Definition: Segmentation.cpp:121
dd4hep::DDSegmentation::Segmentation::parameter
virtual Parameter parameter(const std::string &parameterName) const
Access to parameter by name.
Definition: Segmentation.cpp:110
dd4hep::DDSegmentation::Parameters
std::vector< Parameter > Parameters
Definition: SegmentationsInterna.h:35
dd4hep::InstanceCount::decrement
static void decrement(T *)
Decrement count according to type information.
Definition: InstanceCount.h:102
dd4hep::SegmentationObject::description
const std::string & description() const
Access the description of the segmentation.
Definition: SegmentationsInterna.cpp:58
dd4hep::DDSegmentation::Segmentation::decoder
virtual const BitFieldCoder * decoder() const
Access the underlying decoder.
Definition: Segmentation.h:112
dd4hep::SegmentationObject::type
const std::string & type() const
Access the segmentation type.
Definition: SegmentationsInterna.cpp:53
dd4hep::SegmentationObject::name
const std::string & name() const
Access the segmentation name.
Definition: SegmentationsInterna.cpp:44
dd4hep::DDSegmentation::Segmentation::setDecoder
virtual void setDecoder(const BitFieldCoder *decoder)
Set the underlying decoder.
Definition: Segmentation.cpp:100
dd4hep::Position
ROOT::Math::XYZVector Position
Definition: Objects.h:81
dd4hep::DDSegmentation::Segmentation::description
virtual const std::string & description() const
Access the description of the segmentation.
Definition: Segmentation.h:108
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
SegmentationsInterna.h
VolumeID
dd4hep::DDSegmentation::VolumeID VolumeID
Definition: SegmentationDictionary.h:50
dd4hep::DDSegmentation::Segmentation::cellID
virtual CellID cellID(const Vector3D &localPosition, const Vector3D &globalPosition, const VolumeID &volumeID) const =0
Determine the cell ID based on the position.
dd4hep::SegmentationObject::setParameters
void setParameters(const DDSegmentation::Parameters &parameters)
Set all parameters from an existing set of parameters.
Definition: SegmentationsInterna.cpp:83
dd4hep::SegmentationObject::cellID
CellID cellID(const Position &localPosition, const Position &globalPosition, const VolumeID &volumeID) const
Determine the cell ID based on the position.
Definition: SegmentationsInterna.cpp:93
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::SegmentationObject::position
Position position(const CellID &cellID) const
Determine the local position based on the cell ID.
Definition: SegmentationsInterna.cpp:88
dd4hep::SegmentationObject::decoder
const BitFieldCoder * decoder() const
Access the underlying decoder.
Definition: SegmentationsInterna.cpp:63
dd4hep::DDSegmentation::Segmentation::fieldDescription
virtual std::string fieldDescription() const
Access the encoding string.
Definition: Segmentation.h:92
dd4hep::DDSegmentation::Segmentation::setName
virtual void setName(const std::string &value)
Set the segmentation name.
Definition: Segmentation.h:100
InstanceCount.h
Segmentation.h
dd4hep::SegmentationObject::fieldDescription
std::string fieldDescription() const
Access the encoding string.
Definition: SegmentationsInterna.cpp:39
dd4hep::DDSegmentation::Segmentation::setParameters
virtual void setParameters(const Parameters &parameters)
Set all parameters from an existing set of parameters.
Definition: Segmentation.cpp:129
dd4hep::DDSegmentation::Segmentation
Base class for all segmentations.
Definition: Segmentation.h:75
dd4hep::SegmentationObject::parameter
DDSegmentation::Parameter parameter(const std::string &parameterName) const
Access to parameter by name.
Definition: SegmentationsInterna.cpp:73
dd4hep::SegmentationObject::setDecoder
void setDecoder(const BitFieldCoder *decoder) const
Set the underlying decoder.
Definition: SegmentationsInterna.cpp:68
dd4hep::DDSegmentation::Segmentation::position
virtual Vector3D position(const CellID &cellID) const =0
Determine the local position based on the cell ID.
dd4hep::SegmentationObject::setName
void setName(const std::string &value)
Set the segmentation name.
Definition: SegmentationsInterna.cpp:48
dd4hep::DDSegmentation::Segmentation::type
virtual const std::string & type() const
Access the segmentation type.
Definition: Segmentation.h:104
CellID
dd4hep::DDSegmentation::CellID CellID
Definition: SegmentationDictionary.h:51