From 353750906d3875f666a0f4c75afb6f5ed40cf53b Mon Sep 17 00:00:00 2001
From: Whitney Armstrong <warmstrong@anl.gov>
Date: Thu, 20 May 2021 22:44:53 -0500
Subject: [PATCH] 	modified:   part1/simple_detector.md

---
 src/docs/part1/simple_detector.md | 68 ++++++++++++++++++++++++++-----
 1 file changed, 58 insertions(+), 10 deletions(-)

diff --git a/src/docs/part1/simple_detector.md b/src/docs/part1/simple_detector.md
index 3a57eaf..dc6fa19 100644
--- a/src/docs/part1/simple_detector.md
+++ b/src/docs/part1/simple_detector.md
@@ -11,7 +11,7 @@ git clone https://eicweb.phy.anl.gov/EIC/tutorials/ip6_tutorial_1.git part1
 cd part1
 ```
 
-## Inspect files 
+### Inspect files 
 
 Look around see what's what.
 The files 
@@ -23,7 +23,7 @@ are the compact detector description files. The first two files are included in
 the main `gem_tracker.xml` file. Note these files are often found in 
 directories named compact (but not always).
 
-## Compile the detector library
+### Compile the detector library
 
 ```bash
 mkdir build
@@ -31,8 +31,9 @@ cmake ../. -DCMAKE_INSTALL_PREFIX=../../local
 make -j4 install
 ```
 
-## Look at geometry
+## Visualize and Check Geometry
 
+### Look at disk tracker
 
 ```bash
 dd_web_display --export gem_tracker.xml
@@ -57,6 +58,51 @@ Examine the compact description, specifically this part:
 </detector>
 ```
 
+### Check for overlaps
+
+```bash
+checkOverlaps -t 0.0001 -c gem_tracker.xml
+```
+
+```
+...
+Info in <TGeoNodeMatrix::CheckOverlaps>: Checking overlaps for world_volume and daughters within 0.0001
+Check overlaps:      [==========]   11 [100.00 %]           00:00           
+Info in <TGeoNodeMatrix::CheckOverlaps>: Number of illegal overlaps/extrusions : 0
+```
+
+### Look at all the constants
+
+Look at the constants as defined in the compact description (xml files).
+
+```bash
+npdet_info dump gem_tracker.xml
+```
+
+This should output something like this:
+
+```bash
+CrossingAngle                  =        0.020 = 0.020*rad
+ForwardTrackerPlane_z0         =      400.000 = 400*cm
+Place_Center                   =        0.000 = 0*cm
+compact_checksum               = 1924675351.000 = 1924675351
+tracker_region_rmax            =      200.000 = 2.0*m
+tracker_region_zmax            =      400.000 = 4.0*m
+world_side                     =     1000.000 = 10*m
+world_x                        =     1000.000 = world_side
+world_y                        =     1000.000 = world_side
+world_z                        =    10000.000 = 10*world_side
+```
+
+Or if there are too many constants to dump, try searching:
+
+```bash
+npdet_info search world --all gem_tracker.xml
+```
+
+This is very useful with a good subsystem naming convention.
+
+
 ## Run the geant4 simulation
 
 ```bash
@@ -71,16 +117,14 @@ The output will be a root file containing the generated events and GEM tracker h
 
 See the [GPS Documentation](http://www.fe.infn.it/u/paterno/Geant4_tutorial/slides_further/GPS/GPS.pdf) for more information.
 
-## Looking at the data 
+## Using detector description in analysis
+
+### Preface: data model
 
-First, the data model used by npsim is described here
+First, the data model used by `npsim is described here
 https://eic.phy.anl.gov/eicd/
 
-## Hit position
 
-```bash
-root -b -q scripts/tutorial2_cell_size.cxx+
-```
 Look at the generated file in results:
 ![local hit position](../hit_position.png)
 
@@ -107,7 +151,11 @@ Later on you can see its use:
 
 ### Cell size
 
-You will see this:
+```bash
+root -b -q scripts/tutorial2_cell_size.cxx+
+```
+
+[You](You) will see this:
 ```bash
 ...
 Segmentation-Cell Position : 39,102,-100
-- 
GitLab