Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eic_tutorial
Manage
Activity
Members
Labels
Plan
Issues
9
Issue boards
Milestones
Wiki
Code
Merge requests
1
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
d04e8feb
Commit
d04e8feb
authored
3 years ago
by
Whitney Armstrong
Browse files
Options
Downloads
Patches
Plain Diff
modified: part1/simple_detector.md
modified: part2/adding_detectors.md
parent
4a4e0697
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#10110
passed with stage
in 1 minute and 33 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/docs/part1/simple_detector.md
+9
-1
9 additions, 1 deletion
src/docs/part1/simple_detector.md
src/docs/part2/adding_detectors.md
+10
-13
10 additions, 13 deletions
src/docs/part2/adding_detectors.md
with
19 additions
and
14 deletions
src/docs/part1/simple_detector.md
+
9
−
1
View file @
d04e8feb
...
...
@@ -100,9 +100,17 @@ This
Later on you can see its use:
```
cpp
auto
pos1
=
cellid_converter
.
position
(
h
.
cellID
);
auto
pos1
=
cellid_converter
.
position
(
h
.
cellID
);
```
### Cell size
You will see this:
```
bash
...
Segmentation-Cell Position : 39,102,-100
dim 1, 3,
```
This diff is collapsed.
Click to expand it.
src/docs/part2/adding_detectors.md
+
10
−
13
View file @
d04e8feb
...
...
@@ -43,19 +43,17 @@ Building a new (generic) detector using dd4hep is rather straight forward if we
make the following assumptions.
1.
We will use the built-in sensitive detectors
2.
We will use the
built-in
data model (
hits) associated with these detectors
2.
We will use the
dd4pod
data model (
i.e. use
`npsim`
)
These items can be customized by using the DD4hep plugin mechanism. This will
be covered in another tutorial.
### Compiling a new detector
For this tutorial we will build a simplified Roman Pot detector.
We will discuss the detector built in the source file
`src/
Generic
Detector
s/src/SimpleRomanPot_geo
.cpp`
.
`src/
My
Detector.cpp`
.
To compile this detector into the GenericDetectors library the detector needs
to be added to the list of sources in the cmake file
`
src/GenericDetectors/
CMakeLists.txt`
.
`CMakeLists.txt`
.
```
bash
dd4hep_add_plugin
(
${
a_lib_name
}
SOURCES
...
...
@@ -89,7 +87,7 @@ The argument signature of the `build_detector` is:
-
`SensitiveDetector sens`
: The sensitive detector to be assigned to the
sensitive volumes/elements of the detector.
The DD4hep plugin macro
`DECLARE_DETELEMENT(
SimpleRomanPot
, build_detector)`
The DD4hep plugin macro
`DECLARE_DETELEMENT(
MyDetector
, build_detector)`
stamps out the necessary boiler plate code to register a new detector called
`SimpleRomanPot`
which is build by calling
`build_detector`
.
...
...
@@ -99,15 +97,15 @@ The `<detector>` tag defines a new instance of a detector and requires the
attributes "id", "name", and "type". For example:
```
xml
<detector
id=
"1"
name=
"
MyRomanPot"
type=
"SimpleRomanPot
"
vis=
"RedVis"
readout=
"
RomanPot
Hits"
zoffset=
"1.0*m"
>
<detector
id=
"1"
name=
"
aNeatDetector"
type=
"MyDetector
"
vis=
"RedVis"
readout=
"
MyDetector
Hits"
zoffset=
"1.0*m"
>
</detector>
```
`
This defines an instance of the detector named "
MyRomanPot
" of type
"
SimpleRomanPot
" (i.e. the type-name given in the first argument of the DD4hep
`
DECLARE_DETELEMENT
` macro) and with id=1.
The additional attributes (vis,
readout, zoffset)
will
are optional.
This defines an instance of the detector named "
aNeatDetector
" of type
"
MyDetector
" (i.e. the type-name given in the first argument of the DD4hep
`
DECLARE_DETELEMENT
` macro) and with id=1.
Each `
<detector>
` must have a unique id.
The additional attributes (vis,
readout, zoffset) are optional.
The detector tag is provided as the second argument in the `
build_detector
`
function. It can be parsed *how ever you want* in order to extract detector
...
...
@@ -115,7 +113,6 @@ information. The allowed attributes are listed in
[`
UnicodeValues.h
`](http://test-dd4hep.web.cern.ch/test-dd4hep/doxygen/html/_unicode_values_8h_source.html)
where it is clear how to add new attributes.
#### Geometry Construction
If you are familiar with Geant4 or TGeo geometry construction then this will be
...
...
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