diff --git a/src/config/sidebar.yml b/src/config/sidebar.yml index f011bd0e949f4e892fdb848f50e5844a6f6f048d..6988f6ca8e04dabe779025c7a6cdb83f4da70dc0 100644 --- a/src/config/sidebar.yml +++ b/src/config/sidebar.yml @@ -14,7 +14,7 @@ # link: '/getting-started/eic_container' # - label: 'Environment' # link: '/getting-started/environment' -- label: Tutorials +- label: Tutorial items: - label: 'Quick-start ' link: '/getting-started/quickstart' diff --git a/src/docs/part1/simple_detector.md b/src/docs/part1/simple_detector.md index d8a4e4adb7f88b2f86f9472a44f9ea1e6a82cb4f..d8127ff0aa50ad4ebc4d8de990087fd2bde2aac6 100644 --- a/src/docs/part1/simple_detector.md +++ b/src/docs/part1/simple_detector.md @@ -80,7 +80,29 @@ https://eic.phy.anl.gov/eicd/ root -b -q scripts/tutorial1_hit_position.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:  +This is the local position in the segmentation (i.e. pixel, strip, readout pad, etc.). + +### Cell ID (channel) to Position + +At the top of the script you can see these lines: +```cpp + dd4hep::Detector& detector = dd4hep::Detector::getInstance(); + detector.fromCompact("gem_tracker.xml"); + dd4hep::rec::CellIDPositionConverter cellid_converter(detector); +``` +This + - gets the DD4hep instance + - loads the compact detector file + - initializes the [position converter tool](https://dd4hep.web.cern.ch/dd4hep/reference/classdd4hep_1_1rec_1_1CellIDPositionConverter.html) (which provides thread safe access) + +Later on you can see its use: +```cpp + auto pos1 = cellid_converter.position(h.cellID); +``` + + + diff --git a/static/hit_position.png b/static/hit_position.png index 5d4006c721be9441c1f3e59439f8a8c8fef49627..33f1d557e086265c5c92b7438e2f26facc81824a 100644 Binary files a/static/hit_position.png and b/static/hit_position.png differ