Skip to content
Snippets Groups Projects
Commit b1bdd6cf authored by Whitney Armstrong's avatar Whitney Armstrong
Browse files

modified: ../../gatsby-config.js

	modified:   part1/overview.md
parent 2f77be65
No related branches found
No related tags found
No related merge requests found
module.exports = { module.exports = {
siteMetadata: { siteMetadata: {
siteTitle: `@rocketseat/gatsby-theme-docs`, siteTitle: `EIC Software`,
defaultTitle: `@rocketseat/gatsby-theme-docs`, defaultTitle: `EIC Software`,
siteTitleShort: `gatsby-theme-docs`, siteTitleShort: `EIC software`,
siteDescription: `Out of the box Gatsby Theme for creating documentation websites easily and quickly`, siteDescription: `Electron ion collider simulation software tutorial`,
siteUrl: `https://rocketdocs.netlify.com`, siteUrl: `https://argonne_eic.gitlab.io`,
siteAuthor: `@rocketseat`, siteAuthor: `@rocketseat`,
siteImage: `/banner.png`, siteImage:`/banner.png`,
siteLanguage: `en`, siteLanguage: `en`,
themeColor: `#e1a809`, themeColor: `#e1a809`,
basePath: `/`, basePath: `/tutorial/eic_tutorial/`,
footer: `Theme by Rocketseat`, footer: `Theme by Rocketseat`,
}, },
plugins: [ plugins: [
......
...@@ -56,7 +56,7 @@ To compile this detector into the GenericDetectors library the detector needs ...@@ -56,7 +56,7 @@ To compile this detector into the GenericDetectors library the detector needs
to be added to the list of sources in the cmake file to be added to the list of sources in the cmake file
`src/GenericDetectors/CMakeLists.txt`. `src/GenericDetectors/CMakeLists.txt`.
``` ```bash
dd4hep_add_plugin(${a_lib_name} SOURCES dd4hep_add_plugin(${a_lib_name} SOURCES
src/BeamPipe_geo.cpp src/BeamPipe_geo.cpp
... ...
...@@ -70,7 +70,7 @@ The work of defining the detector is done in a function (here called ...@@ -70,7 +70,7 @@ The work of defining the detector is done in a function (here called
`build_detector`) that is registered using the DD4hep plugin macro `build_detector`) that is registered using the DD4hep plugin macro
`DECLARE_DETELEMENT`. `DECLARE_DETELEMENT`.
``` ```cpp
static Ref_t build_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; xml_det_t x_det = e;
...@@ -97,7 +97,7 @@ stamps out the necessary boiler plate code to register a new detector called ...@@ -97,7 +97,7 @@ stamps out the necessary boiler plate code to register a new detector called
The `<detector>` tag defines a new instance of a detector and requires the The `<detector>` tag defines a new instance of a detector and requires the
attributes "id", "name", and "type". For example: attributes "id", "name", and "type". For example:
``` ```xml
<detector id="1" name="MyRomanPot" type="SimpleRomanPot" <detector id="1" name="MyRomanPot" type="SimpleRomanPot"
vis="RedVis" readout="RomanPotHits" zoffset="1.0*m"> vis="RedVis" readout="RomanPotHits" zoffset="1.0*m">
</detector> </detector>
...@@ -135,7 +135,7 @@ If you have a detector parameter which we later will tweak (while optimizing ...@@ -135,7 +135,7 @@ If you have a detector parameter which we later will tweak (while optimizing
the design) try to get the value from the xml element but provide a good the design) try to get the value from the xml element but provide a good
default value. For example: default value. For example:
``` ```cpp
double radius = ( x_det.hasAttr(_Unicode(radius)) ) ? x_det.attr<double>(_Unicode(radius)) : 5.0*dd4hep::cm; double radius = ( x_det.hasAttr(_Unicode(radius)) ) ? x_det.attr<double>(_Unicode(radius)) : 5.0*dd4hep::cm;
``` ```
...@@ -147,7 +147,7 @@ attribute defined. We will return to this later. ...@@ -147,7 +147,7 @@ attribute defined. We will return to this later.
We will now look at parts of the source file `src/GenericDetectors/src/SimpleRomanPot_geo.cpp`. We will now look at parts of the source file `src/GenericDetectors/src/SimpleRomanPot_geo.cpp`.
``` ```cpp
static Ref_t build_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; xml_det_t x_det = e;
...@@ -173,7 +173,7 @@ It is a means of providing the detector hierarchy/tree, but doesn't necessarily ...@@ -173,7 +173,7 @@ It is a means of providing the detector hierarchy/tree, but doesn't necessarily
have to map exactly to detector geometry. However, it typically will typically have to map exactly to detector geometry. However, it typically will typically
parallel the geometry (and probably should). parallel the geometry (and probably should).
``` ```cpp
string module_name = "RomanPot"; string module_name = "RomanPot";
Assembly assembly(det_name + "_assembly"); Assembly assembly(det_name + "_assembly");
DetElement sdet( det_name, det_id); DetElement sdet( det_name, det_id);
...@@ -184,7 +184,7 @@ The last line sets the `SensitiveDetector sens` argument to be the tracker type ...@@ -184,7 +184,7 @@ The last line sets the `SensitiveDetector sens` argument to be the tracker type
`sdet` is associated with the mother detector element by the constructor which `sdet` is associated with the mother detector element by the constructor which
looks up the detector name (here "MyRomanPot"). 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 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 thickness = (x_det.hasAttr(_Unicode(thickness))) ? x_det.attr<double>(_Unicode(thickness)) : 0.01*dd4hep::cm;
``` ```
...@@ -193,7 +193,7 @@ values that could also be define through attributes, however, we will want to ...@@ -193,7 +193,7 @@ values that could also be define through attributes, however, we will want to
add child elements of the detector tag (so the attributes does not grow too add child elements of the detector tag (so the attributes does not grow too
long). long).
``` ```cpp
double rp_chamber_thickness = 5.0*dd4hep::mm; double rp_chamber_thickness = 5.0*dd4hep::mm;
double rp_chamber_radius = 5.0*dd4hep::cm; double rp_chamber_radius = 5.0*dd4hep::cm;
double rp_chamber_length = 50.0*dd4hep::cm; double rp_chamber_length = 50.0*dd4hep::cm;
...@@ -230,7 +230,7 @@ BitFieldValue in the readout's BitField64 readout string. In this case the ...@@ -230,7 +230,7 @@ BitFieldValue in the readout's BitField64 readout string. In this case the
"layer" BitFieldValue. The BitField64 is used to construct unique VolumeIDs and "layer" BitFieldValue. The BitField64 is used to construct unique VolumeIDs and
CellIDs for PlacedVolumes and Segmentations respectively. CellIDs for PlacedVolumes and Segmentations respectively.
``` ```cpp
PlacedVolume pv; PlacedVolume pv;
pv = assembly.placeVolume( rp_chamber_vol ); pv = assembly.placeVolume( rp_chamber_vol );
pv = assembly.placeVolume( rp_vacuum_vol ); pv = assembly.placeVolume( rp_vacuum_vol );
...@@ -239,7 +239,7 @@ CellIDs for PlacedVolumes and Segmentations respectively. ...@@ -239,7 +239,7 @@ CellIDs for PlacedVolumes and Segmentations respectively.
Set the PlacedVolume BitFieldValue ID. "2" in this case. Set the PlacedVolume BitFieldValue ID. "2" in this case.
``` ```cpp
double supp_x_half = 1.0*dd4hep::cm; double supp_x_half = 1.0*dd4hep::cm;
double supp_y_half = 1.0*dd4hep::cm; double supp_y_half = 1.0*dd4hep::cm;
double supp_thickness = 1.0*dd4hep::mm; double supp_thickness = 1.0*dd4hep::mm;
...@@ -254,7 +254,7 @@ Set the PlacedVolume BitFieldValue ID. "2" in this case. ...@@ -254,7 +254,7 @@ Set the PlacedVolume BitFieldValue ID. "2" in this case.
Next we define vectors which are used to define a "surface" (which will later Next we define vectors which are used to define a "surface" (which will later
generate simulation tracker hits). generate simulation tracker hits).
``` ```cpp
// create a measurement plane for the tracking surface attched to the sensitive volume // create a measurement plane for the tracking surface attched to the sensitive volume
Vector3D u( 1. , 0. , 0. ) ; Vector3D u( 1. , 0. , 0. ) ;
Vector3D v( 0. , 1. , 0. ) ; Vector3D v( 0. , 1. , 0. ) ;
...@@ -276,7 +276,7 @@ generate simulation tracker hits). ...@@ -276,7 +276,7 @@ generate simulation tracker hits).
We now define a simple rectangular pixel sensor. This will be the first of We now define a simple rectangular pixel sensor. This will be the first of
four: two will come in along the x axis and two along the y axis. four: two will come in along the x axis and two along the y axis.
``` ```cpp
// ------------- x1 // ------------- x1
Volume support1_vol( "xsenseor_supp", supp_box, supp_mat ); Volume support1_vol( "xsenseor_supp", supp_box, supp_mat );
Volume sensor1_vol( "xsenseor_sens", sens_box, sens_mat ); Volume sensor1_vol( "xsenseor_sens", sens_box, sens_mat );
...@@ -286,7 +286,7 @@ four: two will come in along the x axis and two along the y axis. ...@@ -286,7 +286,7 @@ four: two will come in along the x axis and two along the y axis.
The code above builds two volumes one which will contain the sensitive volume. The code above builds two volumes one which will contain the sensitive volume.
The sensitive volume is assigned to be a sensitive detector. The sensitive volume is assigned to be a sensitive detector.
``` ```cpp
DetElement layer1_DE( sdet, "layer1_DE", 1 ); DetElement layer1_DE( sdet, "layer1_DE", 1 );
pv = rp_vacuum_vol.placeVolume( support1_vol, Position(xy_shift,0, -z_shift) ); pv = rp_vacuum_vol.placeVolume( support1_vol, Position(xy_shift,0, -z_shift) );
pv.addPhysVolID("layer", 1 ); pv.addPhysVolID("layer", 1 );
...@@ -298,7 +298,7 @@ the DetElement. Note the DetElement is constructed with the parent element ...@@ -298,7 +298,7 @@ the DetElement. Note the DetElement is constructed with the parent element
(sdet) being the first argument. In this way it is clear we are building, (sdet) being the first argument. In this way it is clear we are building,
(semi-)parallel to the geometry, a detector element hierarchy. (semi-)parallel to the geometry, a detector element hierarchy.
``` ```cpp
DetElement mod1( layer1_DE , "module_1", 1 ); DetElement mod1( layer1_DE , "module_1", 1 );
pv = support1_vol.placeVolume(sensor1_vol, Position(0,0,0)); pv = support1_vol.placeVolume(sensor1_vol, Position(0,0,0));
pv.addPhysVolID("module", 1 ); pv.addPhysVolID("module", 1 );
...@@ -314,7 +314,7 @@ Finally we get the top level volume to place the assemble volume. Note we are ...@@ -314,7 +314,7 @@ Finally we get the top level volume to place the assemble volume. Note we are
using the zoffset. This PV is then associated with the top level "system" using the zoffset. This PV is then associated with the top level "system"
bitfieldvalue. bitfieldvalue.
``` ```cpp
pv = dtor.pickMotherVolume(sdet).placeVolume(assembly, Position(0,0,z_offset)); pv = dtor.pickMotherVolume(sdet).placeVolume(assembly, Position(0,0,z_offset));
pv.addPhysVolID("system", det_id); // Set the subdetector system ID. pv.addPhysVolID("system", det_id); // Set the subdetector system ID.
sdet.setPlacement(pv); sdet.setPlacement(pv);
...@@ -363,7 +363,7 @@ There are some library dependencies: ...@@ -363,7 +363,7 @@ There are some library dependencies:
### Running the scripts ### Running the scripts
``` ```bash
./run_example ./run_example
root scripts/example_digi.cxx++ root scripts/example_digi.cxx++
root scripts/example_hit_position.cxx++ # no output root scripts/example_hit_position.cxx++ # no output
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment