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
38446f42
Commit
38446f42
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
1f8f7fdc
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/docs/part1/simple_detector.md
+41
-2
41 additions, 2 deletions
src/docs/part1/simple_detector.md
src/docs/part2/adding_detectors.md
+8
-0
8 additions, 0 deletions
src/docs/part2/adding_detectors.md
with
49 additions
and
2 deletions
src/docs/part1/simple_detector.md
+
41
−
2
View file @
38446f42
...
@@ -79,8 +79,7 @@ https://eic.phy.anl.gov/eicd/
...
@@ -79,8 +79,7 @@ https://eic.phy.anl.gov/eicd/
## Hit position
## Hit position
```
bash
```
bash
root
-b
-q
scripts/tutorial1_hit_position.cxx
root
-b
-q
scripts/tutorial2_cell_size.cxx+
# note if this fails because of ACLiC, run it again. This is a root bug.
```
```
Look at the generated file in results:
Look at the generated file in results:


...
@@ -89,6 +88,7 @@ This is the local position in the segmentation (i.e. pixel, strip, readout pad,
...
@@ -89,6 +88,7 @@ This is the local position in the segmentation (i.e. pixel, strip, readout pad,
### Cell ID (channel) to Position
### Cell ID (channel) to Position
At the top of the script you can see these lines:
At the top of the script you can see these lines:
```
cpp
```
cpp
dd4hep
::
Detector
&
detector
=
dd4hep
::
Detector
::
getInstance
();
dd4hep
::
Detector
&
detector
=
dd4hep
::
Detector
::
getInstance
();
...
@@ -115,4 +115,43 @@ Segmentation-Cell Position : 39,102,-100
...
@@ -115,4 +115,43 @@ Segmentation-Cell Position : 39,102,-100
```
```
### Id Specification
```
bash
root
-b
-q
scripts/tutorial3_id_spec.cxx+
```
```
cpp
fmt
::
print
(
"--------------------------
\n
"
);
fmt
::
print
(
"ID specification:
\n
"
);
auto
decoder
=
detector
.
readout
(
"GEMTrackerHits"
).
idSpec
().
decoder
();
fmt
::
print
(
"{}
\n
"
,
decoder
->
fieldDescription
());
auto
layer_index
=
decoder
->
index
(
"layer"
);
fmt
::
print
(
"
\"
layer
\"
index is {}.
\n
"
,
layer_index
);
```
Later in the loop over event hits.
```
cpp
auto
detector_layer
=
decoder
->
get
(
h
.
cellID
,
layer_index
);
if
((
detector_layer
!=
4
)
&&
(
detector_layer
!=
5
))
{
continue
;
}
```
Note the
`layer_index`
is computed once in the beginning when the decoder is also initialized.
This means it will be fast because it only parses the ID specification string once.
```
bash
ID specification:
system:0:5,barrel:5:3,layer:8:4,module:12:5,r:32:-16,phi:48:-16
"layer"
index is 2.
```
or
```
bash
ID specification:
system:0:8,barrel:8:2,layer:10:4,module:14:12,sensor:26:2,x:32:-16,y:48:-16
"layer"
index is 2.
```
For more information, see the
[
BitFieldCoder documentation
](
https://dd4hep.web.cern.ch/dd4hep/reference/classdd4hep_1_1DDSegmentation_1_1BitFieldCoder.html
)
.
This diff is collapsed.
Click to expand it.
src/docs/part2/adding_detectors.md
+
8
−
0
View file @
38446f42
...
@@ -160,6 +160,14 @@ static Ref_t build_detector(Detector& dtor, xml_h e, SensitiveDetector sens)
...
@@ -160,6 +160,14 @@ static Ref_t build_detector(Detector& dtor, xml_h e, SensitiveDetector sens)
string det_name = x_det.nameStr(); // "MyRomanPot"
string det_name = x_det.nameStr(); // "MyRomanPot"
```
```
### What materials exist
To browse the list of materials and elements (other than looking in the compact files), go to
[geo viewer](https://eic.phy.anl.gov/geoviewer/index.htm?file=https://eicweb.phy.anl.gov/api/v4/projects/473/jobs/artifacts/master/raw/geo/detector_geo_full.root?job=report)
and scroll through the materials.

Here we are grabbing the materials that are assumed to be already defined. Also
Here we are grabbing the materials that are assumed to be already defined. Also
we are getting the detector id and name defined in the `
detector
` tag.
we are getting the detector id and name defined in the `
detector
` tag.
...
...
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