Skip to content

Commit e04be27

Browse files
authored
feat: add stand-alone IRT auxfile creator (#32)
1 parent 75a559e commit e04be27

File tree

13 files changed

+488
-1057
lines changed

13 files changed

+488
-1057
lines changed

Makefile

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,49 +5,36 @@ FLAGS = -g -Wno-deprecated -fPIC -m64 -fno-inline -Wno-write-strings
55
DEPS += $(shell root-config --cflags)
66
LIBS += $(shell root-config --glibs)
77

8-
# PODIO
9-
LIBS += -L/usr/local/lib -lDD4pod -lpodio -lpodioRootIO -ledm4hep
8+
# image libs
9+
LIBS += -L/usr/local/lib
10+
LIBS += -lDDCore
11+
LIBS += -lDD4pod -lpodio -lpodioRootIO -ledm4hep
12+
LIBS += -lfmt
13+
14+
# local libs
15+
LIBS += -L${EIC_SHELL_PREFIX}/lib
16+
LIBS += -lIRT
17+
DEPS += -I${EIC_SHELL_PREFIX}/include/IRT
1018

1119
#--------------------------------------------
1220

1321
INSTALL_PREFIX = bin
14-
SRC_MAIN := $(basename $(notdir $(wildcard src/*.cpp)))
15-
SRC_EXAMPLES := $(basename $(notdir $(wildcard src/examples/*.cpp)))
22+
EXECUTABLES := $(addprefix $(INSTALL_PREFIX)/, $(basename $(notdir $(wildcard src/*.cpp))))
1623

1724
#--------------------------------------------
1825

19-
all:
20-
@echo ""
21-
@echo "BUILDING SOURCES ==========================================="
22-
@echo "$(SRC_MAIN)"
23-
@echo "============================================================"
24-
make main
25-
@echo ""
26-
@echo "BUILDING EXAMPLES =========================================="
27-
@echo "$(SRC_EXAMPLES)"
28-
@echo "============================================================"
29-
make examples
30-
31-
main: $(SRC_MAIN)
32-
examples: $(SRC_EXAMPLES)
26+
all: $(EXECUTABLES)
3327

3428
clean:
3529
@echo "CLEAN ======================================================"
36-
$(RM) $(addprefix $(INSTALL_PREFIX)/, $(SRC_MAIN))
37-
$(RM) $(addprefix $(INSTALL_PREFIX)/, $(SRC_EXAMPLES))
30+
$(RM) $(EXECUTABLES)
3831

3932
#--------------------------------------------
4033

41-
%: %.o
42-
@echo "--- make executable $(INSTALL_PREFIX)/$@"
43-
$(CXX) -o $(INSTALL_PREFIX)/$@ $< $(LIBS)
44-
45-
%.o: src/%.cpp
46-
mkdir -p $(INSTALL_PREFIX)
47-
@echo "----- build $@ -----"
48-
$(CXX) -c $^ -o $@ $(FLAGS) $(DEPS)
49-
50-
%.o: src/examples/%.cpp
34+
$(INSTALL_PREFIX)/%: src/%.cpp
5135
mkdir -p $(INSTALL_PREFIX)
52-
@echo "----- build $@ -----"
53-
$(CXX) -c $^ -o $@ $(FLAGS) $(DEPS)
36+
@echo "----- build $@.o -----"
37+
$(CXX) -c $^ -o $@.o $(FLAGS) $(DEPS)
38+
@echo "--- make executable $@"
39+
$(CXX) -o $@ $@.o $(LIBS)
40+
$(RM) $@.o

README.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,6 @@ corresponding executables and install them to `bin/`
305305
- `src/draw_segmentation.cpp` (run with `bin/draw_segmentation`)
306306
- reads simulation output and draws the hits within sensor pixels, which is
307307
useful for checking mapping of sensor segmentation (pixels)
308-
- relies on `text/sensorLUT.dat`, which must be up-to-date
309-
- you can produce a new version of this file by uncommenting relevant lines
310-
in `epic/src/DRICH_geo.cpp` (search for `generate LUT`), and running
311-
something like `./rebuild_all.sh && ./run_dd_web_display.sh`
312308
- build with `make`, execute with `bin/draw_segmentation [simulation_output_file]`
313309
- specific for dRICH; for pfRICH version, see `deprecated/pfrich/`
314310

@@ -340,11 +336,10 @@ until it is time to migrate to the new reconstruction framework.
340336

341337
Procedure:
342338

343-
- Create the auxiliary IRT configuration file; this uses a temporary "backdoor"
344-
dependency on `irt` in `epic` to produce a ROOT file containing `libIRT`
339+
- Create the auxiliary IRT configuration file; this is a ROOT file containing `libIRT`
345340
objects, such as optical boundaries, based on the dRICH geometry description.
346341
```bash
347-
scripts/create_irt_auxfile.sh
342+
bin/create_irt_auxfile
348343
```
349344

350345
- Run the simulation, for example:

build.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ case $module in
6363
genOpt EVALUATION=OFF
6464
;;
6565
epic)
66-
genOpt IRT_AUXFILE=ON
6766
;;
6867
juggler)
6968
prefix=$JUGGLER_INSTALL_PREFIX

scripts/src/create_irt_auxfile.py renamed to deprecated/create_irt_auxfile_athena.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/usr/bin/env python
2-
# produce auxiliary ROOT file for the IRT algorithm
2+
# produce auxiliary ROOT file for the IRT algorithm; assumes the
3+
# production of `libIRT` objects is in the geometry `cpp` file
4+
#
5+
# DEPRECATED for usage in EPIC; this script is preserved for 2 reasons:
6+
# 1. usage for ATHENA support
7+
# 2. example how to edit compact files on-the-fly with Python
38

49
import shutil, os, sys, argparse
510
import xml.etree.ElementTree as et

doc/athena.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ build.sh athena clean
1919
build.sh juggler clean
2020
```
2121

22+
For reconstruction, you may need to create an IRT auxfile, using
23+
```bash
24+
deprecated/create_irt_auxfile_athena.py
25+
```
26+
2227
Revert to EPIC
2328
==============
2429
To switch your environment back to EPIC:

ruby/variator/optics2.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def initialize
5151
# sensor_sphere_radius = 100
5252
# sensor_sphere_centerz = -50
5353
#
54-
# corresponding mirror parameters (dumped from `scripts/create_irt_auxfile.sh`):
54+
# corresponding mirror parameters (dumped from `create_irt_auxfile`):
5555
# SECTOR 0 MIRROR:
5656
# mirror x = 113.888311 cm
5757
# mirror y = 0.000000 cm

scripts/create_irt_auxfile.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

scripts/momentum_scan.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
require 'pycall/import'
88

99
## settings
10-
NumEvents = 100 # number of events per fixed momentum
11-
NumPoints = 20 # number of momenta to sample
10+
NumEvents = 50 # number of events per fixed momentum
11+
NumPoints = 10 # number of momenta to sample
1212
PoolSize = 6 # number of parallel threads to run
1313
OutputDir = 'out/momentum_scan' # output directory ( ! will be overwritten ! )
1414
RunSimRec = true # if false, do not run simulation+reconstruction, only draw the result

0 commit comments

Comments
 (0)