Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eic_tutorial
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIC
tutorials
eic_tutorial
Commits
0e173742
Commit
0e173742
authored
3 years ago
by
Sylvester Joosten
Browse files
Options
Downloads
Patches
Plain Diff
Function name consistency
parent
23fc7392
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#10161
passed
3 years ago
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/docs/part2/adding_detectors.md
+9
-9
9 additions, 9 deletions
src/docs/part2/adding_detectors.md
with
9 additions
and
9 deletions
src/docs/part2/adding_detectors.md
+
9
−
9
View file @
0e173742
...
...
@@ -48,11 +48,11 @@ dd4hep_add_plugin(${a_lib_name} SOURCES
### Building the geometry (cpp + xml)
The work of constructing the detector is done in a static function (here called
`
create
_detector`
) that is registered using the DD4hep plugin macro
`
build
_detector`
) that is registered using the DD4hep plugin macro
`DECLARE_DETELEMENT`
.
```
cpp
static
Ref_t
create
_detector
(
Detector
&
dtor
,
xml_h
e
,
SensitiveDetector
sens
)
static
Ref_t
build
_detector
(
Detector
&
dtor
,
xml_h
e
,
SensitiveDetector
sens
)
{
xml_det_t
x_det
=
e
;
Material
air
=
dtor
.
air
();
...
...
@@ -61,7 +61,7 @@ static Ref_t create_detector(Detector& dtor, xml_h e, SensitiveDetector sens)
DECLARE_DETELEMENT
(
MyGEMTrackerEndcap
,
build_detector
)
```
The argument signature of the
`
create
_detector`
is:
The argument signature of the
`
build
_detector`
is:
-
`Detector& dtor`
: This handle provides the main hook to the detector tree (
`dd4hep::Detector`
).
-
`xml_h e`
: Handle to the XML
`<detector>`
tag associated with the detector in
the "compact" detector description file (more on this later). This provides
...
...
@@ -71,7 +71,7 @@ The argument signature of the `create_detector` is:
The DD4hep plugin macro
`DECLARE_DETELEMENT(MyGEMTrackerEndcap, build_detector)`
stamps out the necessary boiler plate code to register a new detector called
`MyGEMTrackerEndcap`
which is build by calling
`
create
_detector`
.
`MyGEMTrackerEndcap`
which is build by calling
`
build
_detector`
.
#### Compact detector description entry element
...
...
@@ -138,7 +138,7 @@ We will now look at the function in `src/GEMTrackerDisc_geo.cpp`.
Note that **this is not a good example to copy**, rather it is a simple example to walk through.
```cpp
static Ref_t
create
_detector(Detector& lcdd, xml_h e, SensitiveDetector sens)
static Ref_t
build
_detector(Detector& lcdd, xml_h e, SensitiveDetector sens)
{
typedef vector<PlacedVolume> Placements;
...
...
@@ -191,7 +191,7 @@ static Ref_t create_detector(Detector& lcdd, xml_h e, SensitiveDetector sens)
assembly->GetShape()->ComputeBBox() ;
return sdet;
}
DECLARE_DETELEMENT(my_GEMTracker,
create
_detector)
DECLARE_DETELEMENT(my_GEMTracker,
build
_detector)
```
Here is the XML again:
```xml
...
...
@@ -302,7 +302,7 @@ Here you see a different strategy: build a module, then build layers constructed
The corresponding detector constructor function is in `src/TrapEndcapTracker_geo.cpp`
```cpp
static Ref_t
create
_detector(Detector& description, xml_h e, SensitiveDetector sens) {
static Ref_t
build
_detector(Detector& description, xml_h e, SensitiveDetector sens) {
typedef vector<PlacedVolume> Placements;
xml_det_t x_det = e;
Material vacuum = description.vacuum();
...
...
@@ -428,8 +428,8 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
}
// clang-format off
DECLARE_DETELEMENT(TrapEndcapTracker,
create
_detector)
DECLARE_DETELEMENT(MyGEMTrackerEndcap,
create
_detector)
DECLARE_DETELEMENT(TrapEndcapTracker,
build
_detector)
DECLARE_DETELEMENT(MyGEMTrackerEndcap,
build
_detector)
`
``

...
...
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