diff --git a/src/docs/part1/simple_detector.md b/src/docs/part1/simple_detector.md index d8127ff0aa50ad4ebc4d8de990087fd2bde2aac6..d8ed2a85f0ee676f8fa912fe9fac1de43c25188c 100644 --- a/src/docs/part1/simple_detector.md +++ b/src/docs/part1/simple_detector.md @@ -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, +``` diff --git a/src/docs/part2/adding_detectors.md b/src/docs/part2/adding_detectors.md index b13e1d8242c94f897e79b328d6d28d06ce876a08..11692dcfd2fc0d761c117e6b8b3c2a90adbe6307 100644 --- a/src/docs/part2/adding_detectors.md +++ b/src/docs/part2/adding_detectors.md @@ -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/GenericDetectors/src/SimpleRomanPot_geo.cpp`. +`src/MyDetector.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="RomanPotHits" zoffset="1.0*m"> +<detector id="1" name="aNeatDetector" type="MyDetector" + vis="RedVis" readout="MyDetectorHits" 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