From 8e39696b34b9892b23e4887c61f9d311ab8cdad2 Mon Sep 17 00:00:00 2001
From: Whitney Armstrong <warmstrong@anl.gov>
Date: Mon, 15 Mar 2021 13:03:56 -0500
Subject: [PATCH] 	modified:   .gitlab-ci.yml 	modified:  
 bin/make_dawn_views 	renamed:    scripts/run_topside.py ->
 scripts/run_detector_simulation.py 	deleted:    scripts/run_simulation.sh

---
 .gitlab-ci.yml                                  |  8 ++++----
 bin/make_dawn_views                             | 17 +++++++++++------
 ...un_topside.py => run_detector_simulation.py} |  6 +++---
 scripts/run_simulation.sh                       |  6 ------
 4 files changed, 18 insertions(+), 19 deletions(-)
 rename scripts/{run_topside.py => run_detector_simulation.py} (98%)
 delete mode 100755 scripts/run_simulation.sh

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b481a2ff..04d89c5f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -31,7 +31,7 @@ stages:
 env:
   stage: config 
   script:
-    - export JUGGLER_DETECTOR="topside"
+    - export JUGGLER_DETECTOR="detector_template"
     - |
       if [[ "x${CI_PIPELINE_SOURCE}" == "xmerge_request_event"  || "$CI_COMMIT_BRANCH" == "master" ]]; then
         export JUGGLER_DETECTOR_VERSION="${CI_COMMIT_REF_NAME}"
@@ -89,16 +89,16 @@ overlap_check:
   needs: 
     - ["compile"]
   script:
-    - checkOverlaps -c topside.xml  | tee doc/overlap_check.out 
+    - checkOverlaps -c detector_template.xml  | tee doc/overlap_check.out 
     - echo "$(cat doc/overlap_check.out | grep ovlp | wc -l) overlaps..."
     - if [[ "$(cat doc/overlap_check.out | grep ovlp | wc -l)" -gt "1" ]] ; then echo "Overlaps exist!" && false ; fi
 
-topside:config_testing:
+detector:config_testing:
   stage: test
   needs: 
     - ["compile"]
   script:
-    - checkOverlaps -c topside.xml  | tee doc/overlap_check.out | wc -l
+    - checkOverlaps -c detector_template.xml  | tee doc/overlap_check.out | wc -l
     - cat doc/overlap_check.out
   allow_failure: true
 
diff --git a/bin/make_dawn_views b/bin/make_dawn_views
index bc70a7e4..c6736a06 100755
--- a/bin/make_dawn_views
+++ b/bin/make_dawn_views
@@ -35,7 +35,7 @@ SKIP_EVENTS=0
 DETECTOR_ONLY=0
 FILE_TAG="view"
 DAWN_RUN_DIR="scripts/view1"
-
+DETECTOR_FILE="detector_template.xml"
 
 POSITIONAL=()
 while [[ $# -gt 0 ]]
@@ -47,6 +47,11 @@ do
       shift # past argument
       print_the_help
       ;;
+    -c|--compact-file)
+      DETECTOR_FILE="$2"
+      shift # past argument
+      shift # past value
+      ;;
     -s|--skip)
       SKIP_EVENTS="$2"
       shift # past argument
@@ -92,7 +97,7 @@ rm -f *.prim
 
 if [  "${DETECTOR_ONLY}" -eq "1" ] ; then
 
-  ./scripts/run_topside.py -i scripts/input_data/few_events.hepmc \
+  ./scripts/run_detector_simulation.py -i scripts/input_data/few_events.hepmc \
   -o derp.root -n 1 \
   --ui csh --vis -b -m macro/dawn_picture.mac & 
 
@@ -108,7 +113,7 @@ kill %1
 else 
 
   echo " Running simulation for tracks"
-./scripts/run_topside.py -i scripts/input_data/few_events.hepmc \
+./scripts/run_detector_simulation.py -i scripts/input_data/few_events.hepmc \
   -o derp.root -s ${SKIP_EVENTS} -n 1 \
   --ui csh --vis -b -m macro/dawn_picture2.mac & 
 
@@ -117,21 +122,21 @@ kill %1
 
 fi
 
-#./scripts/run_topside.py -i scripts/input_data/few_events.hepmc \
+#./scripts/run_detector_simulation.py -i scripts/input_data/few_events.hepmc \
 #  -o derp.root -s 2 -n 1 \
 #  --ui csh --vis -b -m macro/dawn_picture2.mac & 
 #
 #sleep 20 
 #kill %1
 
-#./scripts/run_topside.py -i scripts/input_data/few_events.hepmc \
+#./scripts/run_detector_simulation.py -i scripts/input_data/few_events.hepmc \
 #  -o derp.root -s 5 -n 1 \
 #  --ui csh --vis -b -m macro/dawn_picture2.mac & 
 #
 #sleep 20 
 #kill %1
 #
-#./scripts/run_topside.py -i scripts/input_data/few_events.hepmc \
+#./scripts/run_detector_simulation.py -i scripts/input_data/few_events.hepmc \
 #  -o derp.root -s 6 -n 1 \
 #  --ui csh --vis -b -m macro/dawn_picture2.mac & 
 #
diff --git a/scripts/run_topside.py b/scripts/run_detector_simulation.py
similarity index 98%
rename from scripts/run_topside.py
rename to scripts/run_detector_simulation.py
index 08d6ace7..41dc6f10 100755
--- a/scripts/run_topside.py
+++ b/scripts/run_detector_simulation.py
@@ -6,13 +6,13 @@ import logging
 
 import argparse
 parser = argparse.ArgumentParser(
-     prog='run_topside',
+     prog='run_detector_simulation',
      description='''This runs the simulation  the but that is okay''',
      epilog='''
      This program should be run in the "compact" directory.
          ''')
 parser.add_argument("-v","--verbose", help="increase output verbosity", type=int, default=0)
-parser.add_argument("--compact", help="compact detector file",default="topside.xml")
+parser.add_argument("--compact", help="compact detector file",default="detector_template.xml")
 parser.add_argument("--vis", help="vis true/false", action="store_true",default=False)
 parser.add_argument("--ui", help="ui setting tcsh or qt; default=qt", type=str,default="qt",dest="ui")
 parser.add_argument("-b","--batch", help="batch turns off vis/ui", action="store_true",default=False, dest="batch")
@@ -86,7 +86,7 @@ def run():
 
     outputfile = args.output
     if outputfile is None:
-        outputfile = 'data/topside_' + time.strftime('%Y-%m-%d_%H-%M')
+        outputfile = 'data/detector_template_' + time.strftime('%Y-%m-%d_%H-%M')
     #rootoutput = geant4.setupROOTOutput('RootOutput', outputfile)
     #rootoutput.HandleMCTruth = True
 
diff --git a/scripts/run_simulation.sh b/scripts/run_simulation.sh
deleted file mode 100755
index 3d9c5183..00000000
--- a/scripts/run_simulation.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-
-npsim --runType batch --numberOfEvents 100000 \
-      --compactFile ./topside.xml \
-      --inputFiles  ../datasets/data/emcal_electron_0GeVto30GeV_100kEvt.hepmc \
-      --outputFile  ./sim_electron_0GeVto30GeV_100k_input.root
-- 
GitLab