From e0b9d8bcfa33946e72195f43195d0c46997d7160 Mon Sep 17 00:00:00 2001
From: Whitney Armstrong <warmstrong@anl.gov>
Date: Thu, 22 Oct 2020 18:03:52 -0500
Subject: [PATCH] RICH template

- benchmark template files
- some are totally empty.
---
 .gitlab-ci.yml                       |  1 +
 rich/forward_hadrons.sh              | 58 ++++++++++++++++++++++++++++
 rich/options/rich_reconstruction.py  |  0
 rich/rich_config.yml                 | 14 +++++++
 rich/scripts/gen_forward_hadrons.cxx |  0
 5 files changed, 73 insertions(+)
 create mode 100644 rich/forward_hadrons.sh
 create mode 100644 rich/options/rich_reconstruction.py
 create mode 100644 rich/rich_config.yml
 create mode 100644 rich/scripts/gen_forward_hadrons.cxx

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d0396a27..2d268f8b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -28,6 +28,7 @@ include:
   - local: 'ecal/ecal_config.yml'
   - local: 'tracking/tracking_config.yml'
   - local: 'clustering/clustering_config.yml'
+    #  - local: 'rich/rich_config.yml'
 
 
 final_report:
diff --git a/rich/forward_hadrons.sh b/rich/forward_hadrons.sh
new file mode 100644
index 00000000..b78033f4
--- /dev/null
+++ b/rich/forward_hadrons.sh
@@ -0,0 +1,58 @@
+#!/bin/bash
+
+if [[ ! -n  "${JUGGLER_DETECTOR}" ]] ; then 
+  export JUGGLER_DETECTOR="topside"
+fi
+
+if [[ ! -n  "${JUGGLER_N_EVENTS}" ]] ; then 
+  export JUGGLER_N_EVENTS=100
+fi
+
+if [[ ! -n  "${JUGGLER_INSTALL_PREFIX}" ]] ; then 
+  export JUGGLER_INSTALL_PREFIX="/usr/local"
+fi
+
+export JUGGLER_FILE_NAME_TAG="forward_hadrons"
+export JUGGLER_GEN_FILE="${JUGGLER_FILE_NAME_TAG}.hepmc"
+
+export JUGGLER_SIM_FILE="sim_${JUGGLER_FILE_NAME_TAG}.root"
+export JUGGLER_REC_FILE="rec_${JUGGLER_FILE_NAME_TAG}.root"
+
+echo "JUGGLER_N_EVENTS = ${JUGGLER_N_EVENTS}"
+echo "JUGGLER_DETECTOR = ${JUGGLER_DETECTOR}"
+
+
+## Build the detector constructors.
+git clone https://eicweb.phy.anl.gov/EIC/detectors/${JUGGLER_DETECTOR}.git
+mkdir ${JUGGLER_DETECTOR}/build
+pushd ${JUGGLER_DETECTOR}/build
+cmake ../. -DCMAKE_INSTALL_PREFIX=/usr/local && make -j30 install
+popd
+#
+## generate the input events
+## note datasets is now only used to develop datasets.
+##git clone https://eicweb.phy.anl.gov/EIC/datasets.git datasets
+root -b -q "rich/scripts/gen_forward_hadrons.cxx(${JUGGLER_N_EVENTS}, \"${JUGGLER_FILE_NAME_TAG}.hepmc\")"
+#
+pushd ${JUGGLER_DETECTOR}
+#ls -l
+## run geant4 simulations
+npsim --runType batch \
+      --part.minimalKineticEnergy 1000*GeV  \
+      -v WARNING \
+      --numberOfEvents ${JUGGLER_N_EVENTS} \
+      --compactFile ${JUGGLER_DETECTOR}.xml \
+      --inputFiles ../${JUGGLER_FILE_NAME_TAG}.hepmc \
+      --outputFile  ${JUGGLER_SIM_FILE}
+
+# Need to figure out how to pass file name to juggler from the commandline
+xenv -x ${JUGGLER_INSTALL_PREFIX}/Juggler.xenv gaudirun.py ../rich/options/rich_reconstruction.py
+ls -l
+popd
+
+pwd
+mkdir -p results
+
+# run analysis scripts
+
+
diff --git a/rich/options/rich_reconstruction.py b/rich/options/rich_reconstruction.py
new file mode 100644
index 00000000..e69de29b
diff --git a/rich/rich_config.yml b/rich/rich_config.yml
new file mode 100644
index 00000000..71209569
--- /dev/null
+++ b/rich/rich_config.yml
@@ -0,0 +1,14 @@
+rich_job_x:
+  image: eicweb.phy.anl.gov:4567/eic/juggler/juggler:latest
+  tags:
+    - silicon
+  needs: ["get_data"]
+  timeout: 24 hours
+  artifacts:
+    expire_in: 20 weeks
+    paths:
+      - results/
+  stage: run
+  script:
+    - bash rich/rich_test.sh
+
diff --git a/rich/scripts/gen_forward_hadrons.cxx b/rich/scripts/gen_forward_hadrons.cxx
new file mode 100644
index 00000000..e69de29b
-- 
GitLab