From 1205c1b54eb3d2f4ee3110d6579a95be2f3c9419 Mon Sep 17 00:00:00 2001
From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Date: Fri, 27 Sep 2024 00:47:57 -0400
Subject: [PATCH] remove single benchmark, it doesn't belong in physics

---
 .gitlab-ci.yml                               |  4 --
 benchmarks/single/analysis/analyze.cxx       | 42 ----------------
 benchmarks/single/analyze.sh                 | 18 -------
 benchmarks/single/common.sh                  | 21 --------
 benchmarks/single/config.yml                 | 50 --------------------
 benchmarks/single/e-_1GeV_135to177deg.steer  | 11 -----
 benchmarks/single/e-_1GeV_3to45deg.steer     | 11 -----
 benchmarks/single/e-_1GeV_45to135deg.steer   | 11 -----
 benchmarks/single/pi-_1GeV_135to177deg.steer | 11 -----
 benchmarks/single/pi-_1GeV_3to45deg.steer    | 11 -----
 benchmarks/single/pi-_1GeV_45to135deg.steer  | 11 -----
 benchmarks/single/reconstruct.sh             | 25 ----------
 benchmarks/single/simulate.sh                | 20 --------
 13 files changed, 246 deletions(-)
 delete mode 100644 benchmarks/single/analysis/analyze.cxx
 delete mode 100644 benchmarks/single/analyze.sh
 delete mode 100644 benchmarks/single/common.sh
 delete mode 100644 benchmarks/single/config.yml
 delete mode 100644 benchmarks/single/e-_1GeV_135to177deg.steer
 delete mode 100644 benchmarks/single/e-_1GeV_3to45deg.steer
 delete mode 100644 benchmarks/single/e-_1GeV_45to135deg.steer
 delete mode 100644 benchmarks/single/pi-_1GeV_135to177deg.steer
 delete mode 100644 benchmarks/single/pi-_1GeV_3to45deg.steer
 delete mode 100644 benchmarks/single/pi-_1GeV_45to135deg.steer
 delete mode 100644 benchmarks/single/reconstruct.sh
 delete mode 100644 benchmarks/single/simulate.sh

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 49ecec33..fbe2c907 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -38,8 +38,6 @@ stages:
   - compile
   - generate
   - simulate
-  - reconstruct
-  - analyze
   - collect
   - finish
   - status-report
@@ -122,7 +120,6 @@ include:
   - local: 'benchmarks/dvcs/config.yml'
   - local: 'benchmarks/tcs/config.yml'
   - local: 'benchmarks/u_omega/config.yml'
-  - local: 'benchmarks/single/config.yml'
   - local: 'benchmarks/backgrounds/config.yml'
 
 summary:
@@ -134,7 +131,6 @@ summary:
     - "dvcs:results"
     - "tcs:results"
     - "u_omega:results"
-    - "single:results"
     - "backgrounds:results"
   script:
     - collect_benchmarks.py
diff --git a/benchmarks/single/analysis/analyze.cxx b/benchmarks/single/analysis/analyze.cxx
deleted file mode 100644
index bdff812f..00000000
--- a/benchmarks/single/analysis/analyze.cxx
+++ /dev/null
@@ -1,42 +0,0 @@
-#include <iostream>
-#include <string>
-
-#include <ROOT/RDataFrame.hxx>
-
-#include <edm4eic/ReconstructedParticleData.h>
-
-int analyze(std::string file)
-{
-  // open dataframe
-  ROOT::RDataFrame df("events", file, {"GeneratedParticles", "ReconstructedChargedParticles"});
-
-  // count total events
-  auto count = df.Count();
-  if (count == 0) {
-    std::cout << "Error: No events found" << std::endl;
-    return -1;
-  }
-
-  auto n_tracks = [](const std::vector<edm4eic::ReconstructedParticleData> &p) { return (int) p.size(); };
-
-  auto d = df
-  .Define("n_tracks_gen", n_tracks, {"GeneratedParticles"})
-  .Define("n_tracks_rec", n_tracks, {"ReconstructedChargedParticles"})
-  ;
-
-  auto stats_n_tracks_gen = d.Stats("n_tracks_gen");
-  auto stats_n_tracks_rec = d.Stats("n_tracks_rec");
-  double mean_num_track_thresh = 0.8;
-  if (file.find("135to177deg") != std::string::npos) {
-    mean_num_track_thresh = 0.6;
-  }
-  if (stats_n_tracks_rec->GetMean() < mean_num_track_thresh) {
-    std::cout << "Error: too few tracks per events (" << stats_n_tracks_rec->GetMean() << ")" << std::endl;
-    stats_n_tracks_gen->Print();
-    stats_n_tracks_rec->Print();
-    return -1;
-  }
-
-  // success
-  return 0;
-}
diff --git a/benchmarks/single/analyze.sh b/benchmarks/single/analyze.sh
deleted file mode 100644
index eebf96b6..00000000
--- a/benchmarks/single/analyze.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/bash
-source strict-mode.sh
-
-source $(dirname $0)/common.sh $*
-
-# Analyze
-/usr/bin/time -v \
-root -l -b -q "benchmarks/single/analysis/analyze.cxx+(\"${JUGGLER_REC_FILE}\")"
-if [[ "$?" -ne "0" ]] ; then
-  echo "ERROR analysis failed"
-  exit 1
-fi
-
-python benchmarks/dis/analysis/truth_reconstruction.py --rec_file ${JUGGLER_REC_FILE} --config ${JUGGLER_FILE_NAME_TAG}_${DETECTOR_CONFIG} --results_path ${RESULTS_PATH} --nevents ${JUGGLER_N_EVENTS}
-if [[ "$?" -ne "0" ]] ; then
-  echo "ERROR running truth_reconstruction script"
-  exit 1
-fi
diff --git a/benchmarks/single/common.sh b/benchmarks/single/common.sh
deleted file mode 100644
index 82d3648b..00000000
--- a/benchmarks/single/common.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-source strict-mode.sh
-
-if [[ ! -n  "${JUGGLER_N_EVENTS}" ]] ; then 
-  export JUGGLER_N_EVENTS=100
-fi
-
-export JUGGLER_FILE_NAME_TAG="${1:-e-_1GeV_45to135deg}"
-export JUGGLER_GEN_FILE="benchmarks/single/${JUGGLER_FILE_NAME_TAG}.steer"
-export JUGGLER_SIM_FILE="sim_output/sim_${JUGGLER_FILE_NAME_TAG}.edm4hep.root"
-export JUGGLER_REC_FILE_BASE="sim_output/rec_${JUGGLER_FILE_NAME_TAG}"
-export JUGGLER_REC_FILE="${JUGGLER_REC_FILE_BASE}.tree.edm4eic.root"
-
-export BENCHMARK_TAG="single"
-echo "Setting up the local environment for the ${BENCHMARK_TAG^^} benchmarks"
-
-RESULTS_PATH="results/${BENCHMARK_TAG}"
-mkdir -p ${RESULTS_PATH}
-mkdir -p "${RESULTS_PATH}/truth_reconstruction"
-export RESULTS_PATH=`realpath ${RESULTS_PATH}`
-echo "RESULTS_PATH:           ${RESULTS_PATH}"
diff --git a/benchmarks/single/config.yml b/benchmarks/single/config.yml
deleted file mode 100644
index 0e5167fb..00000000
--- a/benchmarks/single/config.yml
+++ /dev/null
@@ -1,50 +0,0 @@
-single:compile:
-  extends: .compile_benchmark
-  stage: compile
-  script:
-    - compile_analyses.py single
-
-single:simulate:
-  extends: .phy_benchmark
-  timeout: 2 hours
-  stage: simulate
-  needs: ["common:detector"]
-  parallel:
-    matrix:
-      - particle: ['e-', 'pi-']
-        energy: ['1GeV']
-        angle: ['3to45deg', '45to135deg', '135to177deg']
-  script:
-    - bash benchmarks/single/simulate.sh ${particle}_${energy}_${angle}
-
-single:reconstruct:
-  extends: .phy_benchmark
-  timeout: 2 hours
-  stage: reconstruct
-  needs: ["single:simulate"]
-  parallel:
-    matrix:
-      - particle: ['e-', 'pi-']
-        energy: ['1GeV']
-        angle: ['3to45deg', '45to135deg', '135to177deg']
-  script:
-    - bash benchmarks/single/reconstruct.sh ${particle}_${energy}_${angle}
-
-single:analyze:
-  extends: .phy_benchmark
-  timeout: 2 hours
-  stage: analyze
-  needs: ["single:reconstruct", "single:compile"]
-  parallel:
-    matrix:
-      - particle: ['e-', 'pi-']
-        energy: ['1GeV']
-        angle: ['3to45deg', '45to135deg', '135to177deg']
-  script:
-    - bash benchmarks/single/analyze.sh ${particle}_${energy}_${angle}
-
-single:results:
-  stage: collect
-  needs: ["single:analyze"]
-  script:
-    - ls -al
diff --git a/benchmarks/single/e-_1GeV_135to177deg.steer b/benchmarks/single/e-_1GeV_135to177deg.steer
deleted file mode 100644
index f5ddf317..00000000
--- a/benchmarks/single/e-_1GeV_135to177deg.steer
+++ /dev/null
@@ -1,11 +0,0 @@
-from DDSim.DD4hepSimulation import DD4hepSimulation
-from g4units import mm, GeV, MeV, degree
-SIM = DD4hepSimulation()
-
-SIM.gun.energy = 1*GeV
-SIM.gun.particle = "e-"
-SIM.gun.position = (0.0, 0.0, 0.0)
-SIM.gun.direction = (0.0, 0.0, 1.0)
-SIM.gun.distribution = "cos(theta)"
-SIM.gun.thetaMin = 135*degree
-SIM.gun.thetaMax = 177*degree
diff --git a/benchmarks/single/e-_1GeV_3to45deg.steer b/benchmarks/single/e-_1GeV_3to45deg.steer
deleted file mode 100644
index f547e2e1..00000000
--- a/benchmarks/single/e-_1GeV_3to45deg.steer
+++ /dev/null
@@ -1,11 +0,0 @@
-from DDSim.DD4hepSimulation import DD4hepSimulation
-from g4units import mm, GeV, MeV, degree
-SIM = DD4hepSimulation()
-
-SIM.gun.energy = 1*GeV
-SIM.gun.particle = "e-"
-SIM.gun.position = (0.0, 0.0, 0.0)
-SIM.gun.direction = (0.0, 0.0, 1.0)
-SIM.gun.distribution = "cos(theta)"
-SIM.gun.thetaMin = 3*degree
-SIM.gun.thetaMax = 45*degree
diff --git a/benchmarks/single/e-_1GeV_45to135deg.steer b/benchmarks/single/e-_1GeV_45to135deg.steer
deleted file mode 100644
index dff3f951..00000000
--- a/benchmarks/single/e-_1GeV_45to135deg.steer
+++ /dev/null
@@ -1,11 +0,0 @@
-from DDSim.DD4hepSimulation import DD4hepSimulation
-from g4units import mm, GeV, MeV, degree
-SIM = DD4hepSimulation()
-
-SIM.gun.energy = 1*GeV
-SIM.gun.particle = "e-"
-SIM.gun.position = (0.0, 0.0, 0.0)
-SIM.gun.direction = (0.0, 0.0, 1.0)
-SIM.gun.distribution = "cos(theta)"
-SIM.gun.thetaMin = 45*degree
-SIM.gun.thetaMax = 135*degree
\ No newline at end of file
diff --git a/benchmarks/single/pi-_1GeV_135to177deg.steer b/benchmarks/single/pi-_1GeV_135to177deg.steer
deleted file mode 100644
index 6cedafa2..00000000
--- a/benchmarks/single/pi-_1GeV_135to177deg.steer
+++ /dev/null
@@ -1,11 +0,0 @@
-from DDSim.DD4hepSimulation import DD4hepSimulation
-from g4units import mm, GeV, MeV, degree
-SIM = DD4hepSimulation()
-
-SIM.gun.energy = 1*GeV
-SIM.gun.particle = "pi-"
-SIM.gun.position = (0.0, 0.0, 0.0)
-SIM.gun.direction = (0.0, 0.0, 1.0)
-SIM.gun.distribution = "cos(theta)"
-SIM.gun.thetaMin = 135*degree
-SIM.gun.thetaMax = 177*degree
diff --git a/benchmarks/single/pi-_1GeV_3to45deg.steer b/benchmarks/single/pi-_1GeV_3to45deg.steer
deleted file mode 100644
index 40d767e5..00000000
--- a/benchmarks/single/pi-_1GeV_3to45deg.steer
+++ /dev/null
@@ -1,11 +0,0 @@
-from DDSim.DD4hepSimulation import DD4hepSimulation
-from g4units import mm, GeV, MeV, degree
-SIM = DD4hepSimulation()
-
-SIM.gun.energy = 1*GeV
-SIM.gun.particle = "pi-"
-SIM.gun.position = (0.0, 0.0, 0.0)
-SIM.gun.direction = (0.0, 0.0, 1.0)
-SIM.gun.distribution = "cos(theta)"
-SIM.gun.thetaMin = 3*degree
-SIM.gun.thetaMax = 45*degree
diff --git a/benchmarks/single/pi-_1GeV_45to135deg.steer b/benchmarks/single/pi-_1GeV_45to135deg.steer
deleted file mode 100644
index 3ec2dac7..00000000
--- a/benchmarks/single/pi-_1GeV_45to135deg.steer
+++ /dev/null
@@ -1,11 +0,0 @@
-from DDSim.DD4hepSimulation import DD4hepSimulation
-from g4units import mm, GeV, MeV, degree
-SIM = DD4hepSimulation()
-
-SIM.gun.energy = 1*GeV
-SIM.gun.particle = "pi-"
-SIM.gun.position = (0.0, 0.0, 0.0)
-SIM.gun.direction = (0.0, 0.0, 1.0)
-SIM.gun.distribution = "cos(theta)"
-SIM.gun.thetaMin = 45*degree
-SIM.gun.thetaMax = 135*degree
diff --git a/benchmarks/single/reconstruct.sh b/benchmarks/single/reconstruct.sh
deleted file mode 100644
index bfcbed6e..00000000
--- a/benchmarks/single/reconstruct.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash
-source strict-mode.sh
-
-source $(dirname $0)/common.sh $*
-
-# Reconstruct
-if [ ${RECO} == "eicrecon" ] ; then
-  eicrecon ${JUGGLER_SIM_FILE} -Ppodio:output_file=${JUGGLER_REC_FILE}
-  if [[ "$?" -ne "0" ]] ; then
-    echo "ERROR running eicrecon"
-    exit 1
-  fi
-fi
-
-if [[ ${RECO} == "juggler" ]] ; then
-  gaudirun.py options/reconstruction.py || [ $? -eq 4 ]
-  if [ "$?" -ne "0" ] ; then
-    echo "ERROR running juggler"
-    exit 1
-  fi
-fi
-
-if [ -f jana.dot ] ; then cp jana.dot ${JUGGLER_REC_FILE_BASE}.dot ; fi
-
-rootls -t ${JUGGLER_REC_FILE_BASE}.tree.edm4eic.root
diff --git a/benchmarks/single/simulate.sh b/benchmarks/single/simulate.sh
deleted file mode 100644
index 5ab79f6d..00000000
--- a/benchmarks/single/simulate.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-source strict-mode.sh
-
-source $(dirname $0)/common.sh $*
-
-# Simulate
-/usr/bin/time -v \
-ddsim --runType run \
-      --printLevel WARNING \
-      --enableGun \
-      --steeringFile ${JUGGLER_GEN_FILE} \
-      --numberOfEvents ${JUGGLER_N_EVENTS} \
-      --part.minimalKineticEnergy 1*TeV  \
-      --filter.tracker edep0 \
-      --compactFile ${DETECTOR_PATH}/${DETECTOR_CONFIG}.xml \
-      --outputFile  ${JUGGLER_SIM_FILE}
-if [[ "$?" -ne "0" ]] ; then
-  echo "ERROR running ddsim"
-  exit 1
-fi
-- 
GitLab