Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DD4hep
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cepc
externals
mirroring
DD4hep
Commits
301eae5f
Commit
301eae5f
authored
8 years ago
by
Markus Frank
Browse files
Options
Downloads
Patches
Plain Diff
Convert segmentations to DD4hep handles
parent
552432f0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
DDCore/include/DD4hep/Segmentations.h
+11
-3
11 additions, 3 deletions
DDCore/include/DD4hep/Segmentations.h
DDCore/src/Segmentations.cpp
+5
-5
5 additions, 5 deletions
DDCore/src/Segmentations.cpp
with
16 additions
and
8 deletions
DDCore/include/DD4hep/Segmentations.h
+
11
−
3
View file @
301eae5f
...
@@ -110,16 +110,24 @@ namespace DD4hep {
...
@@ -110,16 +110,24 @@ namespace DD4hep {
/// Standard constructor
/// Standard constructor
SegmentationImplementation
(
DDSegmentation
::
BitField64
*
decoder
);
SegmentationImplementation
(
DDSegmentation
::
BitField64
*
decoder
);
/// Default destructor
/// Default destructor
virtual
~
SegmentationImplementation
()
{}
virtual
~
SegmentationImplementation
()
;
};
};
/// Standard constructor
template
<
typename
IMP
>
inline
template
<
typename
IMP
>
inline
SegmentationImplementation
<
IMP
>::
SegmentationImplementation
(
DDSegmentation
::
BitField64
*
decode
r
)
SegmentationImplementation
<
IMP
>::
SegmentationImplementation
(
DDSegmentation
::
BitField64
*
decode
)
:
SegmentationObject
(
0
),
implementation
(
decode
r
)
:
SegmentationObject
(
0
),
implementation
(
decode
)
{
{
this
->
segmentation
=
&
implementation
;
this
->
segmentation
=
&
implementation
;
}
}
/// Default destructor
template
<
typename
IMP
>
inline
SegmentationImplementation
<
IMP
>::~
SegmentationImplementation
()
{
this
->
segmentation
=
0
;
// Prevent deletion! We have the object aggregated!
}
/// Handle class supporting generic Segmentation of sensitive detectors
/// Handle class supporting generic Segmentation of sensitive detectors
/**
/**
*
*
...
...
This diff is collapsed.
Click to expand it.
DDCore/src/Segmentations.cpp
+
5
−
5
View file @
301eae5f
...
@@ -122,24 +122,24 @@ void SegmentationObject::neighbours(const CellID& cell, std::set<CellID>& nb) co
...
@@ -122,24 +122,24 @@ void SegmentationObject::neighbours(const CellID& cell, std::set<CellID>& nb) co
}
}
/// Constructor to used when creating a new object
/// Constructor to used when creating a new object
Segmentation
::
Segmentation
(
const
string
&
typ
,
const
string
&
nam
,
BitField64
*
dec
oder
)
:
Handle
<
Implementation
>
()
Segmentation
::
Segmentation
(
const
string
&
typ
,
const
string
&
nam
,
BitField64
*
dec
)
:
Handle
<
Implementation
>
()
{
{
string
type
=
"segmentation_constructor__"
+
typ
;
string
type
=
"segmentation_constructor__"
+
typ
;
SegmentationObject
*
obj
=
PluginService
::
Create
<
SegmentationObject
*>
(
type
,
dec
oder
);
SegmentationObject
*
obj
=
PluginService
::
Create
<
SegmentationObject
*>
(
type
,
dec
);
if
(
obj
!=
0
)
{
if
(
obj
!=
0
)
{
assign
(
obj
,
nam
,
typ
);
assign
(
obj
,
nam
,
typ
);
if
(
!
nam
.
empty
()
)
obj
->
setName
(
nam
);
if
(
!
nam
.
empty
()
)
obj
->
setName
(
nam
);
return
;
}
}
#if 0
#if 0
BaseSegmentation* s = DDSegmentation::SegmentationFactory::instance()->create(typ);
BaseSegmentation* s = DDSegmentation::SegmentationFactory::instance()->create(typ);
if (s != 0) {
if (s != 0) {
assign(new Object(s), nam, "");
assign(new Object(s), nam, "");
if ( !nam.empty() ) s->setName(nam);
if ( !nam.empty() ) s->setName(nam);
return;
}
}
#endif
#endif
else
{
except
(
"Segmentation"
,
"FAILED to create segmentation: %s. [Missing factory]"
,
typ
.
c_str
());
throw
runtime_error
(
"FAILED to create segmentation: "
+
typ
+
". Missing factory method for: "
+
typ
+
"!"
);
}
}
}
/// Accessor: Segmentation type
/// Accessor: Segmentation type
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment