Skip to content

Commit eb407a8

Browse files
authored
feat: update geometry viewer and constants wrappers (#48)
1 parent aed420d commit eb407a8

File tree

5 files changed

+60
-15
lines changed

5 files changed

+60
-15
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ git clone [email protected]:EIC/benchmarks/reconstruction_benchmarks.git
241241
- see comments within the code for documentation
242242
243243
## Viewing the Geometry and Parameter Values
244-
- run `./run_dd_web_display.sh` to produce the `TGeo` geometry ROOT file
244+
- run `./geometry.sh` to produce the `TGeo` geometry ROOT file
245245
- follow the usage guide to specify whether to draw the full EPIC
246246
detector, or just the dRICH
247247
- output ROOT file will be in `geo/`, by default

doc/jsroot.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ if yours is different)
2424

2525
Various settings can be set via the URL. For example, the following URL
2626
automatically opens the `detector_geometry.root` file (produced by
27-
`run_dd_web_display.sh`) using `file=...`, and enables dark mode:
27+
`geometry.sh`) using `file=...`, and enables dark mode:
2828

2929
<http://localhost:8000/?file=geo/detector_geometry.root&dark>

run_dd_web_display.sh renamed to geometry.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ USAGE:
1919
$0 [MODE] [OPTIONS]...
2020
2121
MODES: (one required)
22-
-e full EPIC detector
2322
-d dRICH only
2423
-p pfRICH only
24+
-m mRICH only
25+
-e full EPIC detector
26+
-a full EPIC detector, arches configuration
27+
-b full EPIC detector, brycecanyon configuration
2528
-c <compact_file>
2629
custom compact file
2730
@@ -40,12 +43,15 @@ USAGE:
4043
if [ $# -eq 0 ]; then usage; fi
4144

4245
# parse options
43-
while getopts "hedpc:o:" opt; do
46+
while getopts "hdpmeabc:o:" opt; do
4447
case $opt in
4548
h|\?) usage ;;
46-
e) compactFile="${DETECTOR_PATH}/${DETECTOR}.xml" ;;
4749
d) compactFile="${DETECTOR_PATH}/${DETECTOR}_drich_only.xml" ;;
4850
p) compactFile="${DETECTOR_PATH}/${DETECTOR}_pfrich_only.xml" ;;
51+
m) compactFile="${DETECTOR_PATH}/${DETECTOR}_mrich_only.xml" ;;
52+
e) compactFile="${DETECTOR_PATH}/${DETECTOR}.xml" ;;
53+
a) compactFile="${DETECTOR_PATH}/${DETECTOR}_arches.xml" ;;
54+
b) compactFile="${DETECTOR_PATH}/${DETECTOR}_brycecanyon.xml" ;;
4955
c) compactFile=$OPTARG ;;
5056
o) outputFile=$OPTARG ;;
5157
esac
@@ -61,7 +67,7 @@ if [ -z "$compactFile" ]; then
6167
fi
6268

6369
# produce geometry root file
64-
dd_web_display --export -o $outputFile $compactFile
70+
geoConverter -compact2tgeo -input $compactFile -output $outputFile
6571
echo ""
6672
echo "produced $outputFile"
6773
echo " -> open it with jsroot to view the geometry"

ruby/variator/variator_base.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class VariatorBase
3737
]],
3838
### draw geometry
3939
[[
40-
'./run_dd_web_display.sh',
40+
'./geometry.sh',
4141
"-c #{settings[:compact_detector]}",
4242
"-o #{settings[:output].sub(/root$/,'geometry.root')}",
4343
]],

search_compact_params.sh

Lines changed: 47 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,55 @@
11
#!/bin/bash
22
# return parameter value(s) from compact files, given search term
3+
set -e
34

4-
if [ $# -ne 1 ]; then
5-
echo "USAGE: $0 [search term (case sensitive)]"
6-
exit 2
7-
fi
8-
5+
# check environment
96
if [ -z "$DETECTOR_PATH" ]; then
107
echo "ERROR: source environ.sh first"
118
exit 1
129
fi
1310

14-
compact_file=$DETECTOR_PATH/$DETECTOR.xml
15-
echo "Searching compact file $compact_file"
16-
npdet_info search $1 --value $compact_file
11+
# usage
12+
function usage {
13+
echo """
14+
USAGE:
15+
$0 [CONFIGURATION]
16+
17+
CONFIGURATIONS: (one required)
18+
-e default EPIC detector
19+
-a arches (mRICH)
20+
-b brycecanyon (pfRICH)
21+
-c <compact_file>
22+
custom compact file
23+
24+
For -e,-a,-b, compact files are assumed to be at
25+
\$DETECTOR_PATH = $DETECTOR_PATH
26+
(rendered by build.sh epic)
27+
28+
Use grep to search the output
29+
30+
"""
31+
exit 2
32+
}
33+
if [ $# -eq 0 ]; then usage; fi
34+
35+
# parse options
36+
while getopts "heabc:" opt; do
37+
case $opt in
38+
h|\?) usage ;;
39+
e) compactFile="${DETECTOR_PATH}/${DETECTOR}.xml" ;;
40+
a) compactFile="${DETECTOR_PATH}/${DETECTOR}_arches.xml" ;;
41+
b) compactFile="${DETECTOR_PATH}/${DETECTOR}_brycecanyon.xml" ;;
42+
c) compactFile=$OPTARG ;;
43+
esac
44+
done
45+
echo """
46+
compactFile = $compactFile
47+
"""
48+
if [ -z "$compactFile" ]; then
49+
echo "ERROR: specify CONFIGURATION"
50+
usage
51+
exit 1
52+
fi
53+
54+
# dump table
55+
npdet_info dump $compactFile

0 commit comments

Comments
 (0)