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
c3e94f46
Commit
c3e94f46
authored
4 years ago
by
Whitney Armstrong
Browse files
Options
Downloads
Patches
Plain Diff
modified: adding_detectors.md
parent
1772b984
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/docs/part2/adding_detectors.md
+31
-31
31 additions, 31 deletions
src/docs/part2/adding_detectors.md
with
31 additions
and
31 deletions
src/docs/part2/adding_detectors.md
+
31
−
31
View file @
c3e94f46
...
...
@@ -175,10 +175,10 @@ have to map exactly to detector geometry. However, it typically will typically
parallel the geometry (and probably should).
```cpp
string module_name = "RomanPot";
Assembly assembly(det_name + "_assembly");
DetElement sdet( det_name, det_id);
sens.setType("tracker");
string module_name = "RomanPot";
Assembly assembly(det_name + "_assembly");
DetElement sdet( det_name, det_id);
sens.setType("tracker");
```
The last line sets the `
SensitiveDetector sens
` argument to be the tracker type
(which is a DD4hep built-in). We will soon assign this to sensitive volumes.
...
...
@@ -186,8 +186,8 @@ The last line sets the `SensitiveDetector sens` argument to be the tracker type
looks up the detector name (here "MyRomanPot").
```cpp
double z_offset = (x_det.hasAttr(_Unicode(zoffset))) ? x_det.attr<double>(_Unicode(zoffset)) : 0.0;
double thickness = (x_det.hasAttr(_Unicode(thickness))) ? x_det.attr<double>(_Unicode(thickness)) : 0.01*dd4hep::cm;
double z_offset = (x_det.hasAttr(_Unicode(zoffset))) ? x_det.attr<double>(_Unicode(zoffset)) : 0.0;
double thickness = (x_det.hasAttr(_Unicode(thickness))) ? x_det.attr<double>(_Unicode(thickness)) : 0.01*dd4hep::cm;
```
Here we grab attributes and provide default values. We continue with default
values that could also be define through attributes, however, we will want to
...
...
@@ -195,31 +195,31 @@ add child elements of the detector tag (so the attributes does not grow too
long).
```cpp
double rp_chamber_thickness = 5.0*dd4hep::mm;
double rp_chamber_radius = 5.0*dd4hep::cm;
double rp_chamber_length = 50.0*dd4hep::cm;
Tube rp_beam_pipe_tube(rp_chamber_radius, rp_chamber_radius+rp_chamber_thickness, rp_chamber_length/2.0);
Tube rp_beam_vacuum_tube(0.0, rp_chamber_radius+rp_chamber_thickness, rp_chamber_length/2.0);
Tube rp_beam_vacuum_tube2(0.0, rp_chamber_radius, rp_chamber_length/2.0);
double rp_detector_tube_radius = 2.5*dd4hep::cm;
double rp_detector_tube_length = 20.0*dd4hep::cm;
Tube rp_detector_tube(rp_detector_tube_radius, rp_detector_tube_radius+rp_chamber_thickness, rp_detector_tube_length/2.0);
Tube rp_detector_vacuum_tube(0.0, rp_detector_tube_radius+rp_chamber_thickness, rp_detector_tube_length/2.0);
Tube rp_detector_vacuum_tube2(0.0, rp_detector_tube_radius, rp_detector_tube_length/2.0);
ROOT::Math::Rotation3D rot_X( ROOT::Math::RotationX(M_PI/2.0) );
ROOT::Math::Rotation3D rot_Y( ROOT::Math::RotationY(M_PI/2.0) );
UnionSolid rp_chamber_tee1(rp_beam_vacuum_tube, rp_detector_vacuum_tube, rot_X);
UnionSolid rp_chamber_tee12(rp_chamber_tee1, rp_detector_vacuum_tube, rot_Y);
UnionSolid rp_chamber_tee2(rp_beam_vacuum_tube2, rp_detector_vacuum_tube2, rot_X);
UnionSolid rp_chamber_tee22(rp_chamber_tee2, rp_detector_vacuum_tube2, rot_Y);
SubtractionSolid sub1(rp_chamber_tee12,rp_chamber_tee22);
Volume rp_chamber_vol("rp_chamber_walls_vol", sub1, aluminum);
Volume rp_vacuum_vol("rp_chamber_vacuum_vol", rp_chamber_tee22, vacuum);
double rp_chamber_thickness = 5.0*dd4hep::mm;
double rp_chamber_radius = 5.0*dd4hep::cm;
double rp_chamber_length = 50.0*dd4hep::cm;
Tube rp_beam_pipe_tube(rp_chamber_radius, rp_chamber_radius+rp_chamber_thickness, rp_chamber_length/2.0);
Tube rp_beam_vacuum_tube(0.0, rp_chamber_radius+rp_chamber_thickness, rp_chamber_length/2.0);
Tube rp_beam_vacuum_tube2(0.0, rp_chamber_radius, rp_chamber_length/2.0);
double rp_detector_tube_radius = 2.5*dd4hep::cm;
double rp_detector_tube_length = 20.0*dd4hep::cm;
Tube rp_detector_tube(rp_detector_tube_radius, rp_detector_tube_radius+rp_chamber_thickness, rp_detector_tube_length/2.0);
Tube rp_detector_vacuum_tube(0.0, rp_detector_tube_radius+rp_chamber_thickness, rp_detector_tube_length/2.0);
Tube rp_detector_vacuum_tube2(0.0, rp_detector_tube_radius, rp_detector_tube_length/2.0);
ROOT::Math::Rotation3D rot_X( ROOT::Math::RotationX(M_PI/2.0) );
ROOT::Math::Rotation3D rot_Y( ROOT::Math::RotationY(M_PI/2.0) );
UnionSolid rp_chamber_tee1(rp_beam_vacuum_tube, rp_detector_vacuum_tube, rot_X);
UnionSolid rp_chamber_tee12(rp_chamber_tee1, rp_detector_vacuum_tube, rot_Y);
UnionSolid rp_chamber_tee2(rp_beam_vacuum_tube2, rp_detector_vacuum_tube2, rot_X);
UnionSolid rp_chamber_tee22(rp_chamber_tee2, rp_detector_vacuum_tube2, rot_Y);
SubtractionSolid sub1(rp_chamber_tee12,rp_chamber_tee22);
Volume rp_chamber_vol("rp_chamber_walls_vol", sub1, aluminum);
Volume rp_vacuum_vol("rp_chamber_vacuum_vol", rp_chamber_tee22, vacuum);
```
The above code builds the up the two solids associated with 3 tubes
intersecting. One volume is the aluminum vacuum chamber walls and the other is
...
...
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