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.cpp
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 
14 // Framework include files
16 #include "DD4hep/InstanceCount.h"
17 
18 // C/C++ include files
19 
20 using namespace std;
21 using namespace DD4hep;
22 using namespace DD4hep::Geometry;
25 //using DD4hep::DDSegmentation::SegmentationParameter;
26 
28 SegmentationObject::SegmentationObject(BaseSegmentation* s)
29  : magic(magic_word()), useForHitPosition(0),
30  detector(0), sensitive(0), segmentation(s)
31 {
33 }
34 
38  if (segmentation) {
39  delete segmentation;
40  }
41 }
42 
46 }
47 
49 const string& SegmentationObject::name() const {
50  return segmentation->name();
51 }
53 void SegmentationObject::setName(const string& value) {
54  segmentation->setName(value);
55 }
56 
58 const string& SegmentationObject::type() const {
59  return segmentation->type();
60 }
61 
63 const string& SegmentationObject::description() const {
64  return segmentation->description();
65 }
66 
68 BitField64* SegmentationObject::decoder() const {
69  return segmentation->decoder();
70 }
71 
73 void SegmentationObject::setDecoder(BitField64* ptr_decoder) const {
74  segmentation->setDecoder(ptr_decoder);
75 }
76 
78 Parameter SegmentationObject::parameter(const string& parameterName) const {
79  return segmentation->parameter(parameterName);
80 }
81 
84  return segmentation->parameters();
85 }
86 
89  segmentation->setParameters(params);
90 }
91 
94  return Position(segmentation->position(cell));
95 }
96 
99  const Position& global,
100  const VolumeID& volID) const {
101  return segmentation->cellID(local, global, volID);
102 }
103 
106  return segmentation->volumeID(cell);
107 }
long long int CellID
Useful typedefs to differentiate cell IDs and volume IDs.
Definition: Primitives.h:32
virtual VolumeID volumeID(const CellID &cellID) const
Determine the volume ID from the full cell ID by removing all local fields.
const std::string & description() const
Access the description of the segmentation.
virtual BitField64 * decoder() const
Access the underlying decoder.
Definition: Segmentation.h:105
Parameter parameter(const std::string &parameterName) const
Access to parameter by name.
const std::string & type() const
Access the segmentation type.
static void decrement(T *)
Decrement count according to type information.
virtual Parameters parameters() const
Access to all parameters.
virtual const std::string & name() const
Access the segmentation name.
Definition: Segmentation.h:89
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 Vector3D position(const CellID &cellID) const =0
Determine the local position based on the cell ID.
virtual void setParameters(const Parameters &parameters)
Set all parameters from an existing set of parameters.
virtual ~SegmentationObject()
Default destructor.
Position position(const CellID &cellID) const
Determine the local position based on the cell ID.
ROOT::Math::XYZVector Position
Definition: Objects.h:75
Base class for all segmentations.
Definition: Segmentation.h:68
virtual CellID cellID(const Vector3D &localPosition, const Vector3D &globalPosition, const VolumeID &volumeID) const =0
Determine the cell ID based on the position.
static void increment(T *)
Increment count according to type information.
Definition: InstanceCount.h:98
DDSegmentation::Parameters Parameters
virtual Parameter parameter(const std::string &parameterName) const
Access to parameter by name.
VolumeID volumeID(const CellID &cellID) const
Determine the volume ID from the full cell ID by removing all local fields.
long long int VolumeID
Definition: Primitives.h:35
virtual void setDecoder(BitField64 *decoder)
Set the underlying decoder.
virtual void setName(const std::string &value)
Set the segmentation name.
Definition: Segmentation.h:93
void setParameters(const Parameters &parameters)
Set all parameters from an existing set of parameters.
virtual const std::string & type() const
Access the segmentation type.
Definition: Segmentation.h:97
Class to hold a segmentation parameter with its description.
const std::string & name() const
Access the segmentation name.
SegmentationParameter * Parameter
Definition: Segmentation.h:24
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.
BitField64 * decoder() const
Access the underlying decoder.
virtual const std::string & description() const
Access the description of the segmentation.
Definition: Segmentation.h:101
virtual std::string fieldDescription() const
Access the encoding string.
Definition: Segmentation.h:85
Parameters parameters() const
Access to all parameters.
unsigned long long int magic_word()
Access to the magic word, which is protecting some objects against memory corruptions.
Definition: Handle.h:55