Skip to content
Snippets Groups Projects
Commit b5478000 authored by Wouter Deconinck's avatar Wouter Deconinck
Browse files

feat: DIS: replace gaudirun with eicrecon

parent 95e2e86d
Branches
No related tags found
1 merge request!185feat: DIS: replace gaudirun with eicrecon
Showing
with 115 additions and 885 deletions
image: eicweb.phy.anl.gov:4567/eic/juggler/juggler:$JUGGLER_TAG image: eicweb.phy.anl.gov:4567/eic/juggler/juggler:$JUGGLER_TAG
variables:
RECO: "eicrecon"
default: default:
before_script: before_script:
- source .local/bin/env.sh - source .local/bin/env.sh
......
#!/bin/bash #!/bin/bash
source strict-mode.sh
function print_the_help { function print_the_help {
echo "USAGE: ${0} [--rec] [--sim] [--ana] [--all] " echo "USAGE: ${0} [--rec] [--sim] [--ana] [--all] "
...@@ -114,18 +115,23 @@ if [[ -n "${DO_SIM}" || -n "${DO_ALL}" ]] ; then ...@@ -114,18 +115,23 @@ if [[ -n "${DO_SIM}" || -n "${DO_ALL}" ]] ; then
fi fi
fi fi
### Step 3. Run the reconstruction (juggler) ### Step 3. Run the reconstruction (eicrecon)
if [[ -n "${DO_REC}" || -n "${DO_ALL}" ]] ; then if [[ -n "${DO_REC}" || -n "${DO_ALL}" ]] ; then
for rec in options/*.py ; do if [ ${RECO} == "eicrecon" ] ; then
unset tag eicrecon ${JUGGLER_SIM_FILE} -Ppodio:output_file=${JUGGLER_REC_FILE}
[[ $(basename ${rec} .py) =~ (.*)\.(.*) ]] && tag=".${BASH_REMATCH[2]}"
JUGGLER_REC_FILE=${JUGGLER_REC_FILE/.root/${tag:-}.root} \
gaudirun.py ${rec}
if [[ "$?" -ne "0" ]] ; then if [[ "$?" -ne "0" ]] ; then
echo "ERROR running eicrecon"
exit 1
fi
fi
if [[ ${RECO} == "juggler" ]] ; then
gaudirun.py options/reconstruction.py
if [ "$?" -ne "0" ] ; then
echo "ERROR running juggler" echo "ERROR running juggler"
exit 1 exit 1
fi fi
done fi
root_filesize=$(stat --format=%s "${JUGGLER_REC_FILE}") root_filesize=$(stat --format=%s "${JUGGLER_REC_FILE}")
if [[ "${JUGGLER_N_EVENTS}" -lt "500" ]] ; then if [[ "${JUGGLER_N_EVENTS}" -lt "500" ]] ; then
...@@ -145,13 +151,13 @@ if [[ -n "${DO_ANA}" || -n "${DO_ALL}" ]] ; then ...@@ -145,13 +151,13 @@ if [[ -n "${DO_ANA}" || -n "${DO_ALL}" ]] ; then
mkdir -p results/synchrotron mkdir -p results/synchrotron
# here you can add as many scripts as you want. # here you can add as many scripts as you want.
root -b -q "benchmarks/synchrotron/analysis/synchrotron_sim.cxx+(\"${JUGGLER_SIM_FILE}\")" root -b -q "benchmarks/backgrounds/analysis/synchrotron_sim.cxx+(\"${JUGGLER_SIM_FILE}\")"
if [[ "$?" -ne "0" ]] ; then if [[ "$?" -ne "0" ]] ; then
echo "ERROR running root script" echo "ERROR running root script"
exit 1 exit 1
fi fi
root -b -q "benchmarks/synchrotron/analysis/synchrotron_raw.cxx+(\"${JUGGLER_REC_FILE/.root/.raw.root}\")" root -b -q "benchmarks/backgrounds/analysis/synchrotron_raw.cxx+(\"${JUGGLER_REC_FILE/.root/.raw.root}\")"
if [[ "$?" -ne "0" ]] ; then if [[ "$?" -ne "0" ]] ; then
echo "ERROR running root script" echo "ERROR running root script"
exit 1 exit 1
......
#!/bin/bash #!/bin/bash
source strict-mode.sh
## ============================================================================= ## =============================================================================
## Run the DIS benchmarks in 5 steps: ## Run the DIS benchmarks in 5 steps:
......
#include "common_bench/benchmark.h"
#include "common_bench/mt.h"
#include "common_bench/util.h"
#include "common_bench/plot.h"
#include <cmath>
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include "ROOT/RDataFrame.hxx"
#include <TH1D.h>
#include <TFitResult.h>
#include <TRandom3.h>
#include <TCanvas.h>
#include "fmt/color.h"
#include "fmt/core.h"
#include "nlohmann/json.hpp"
#include "edm4eic/CalorimeterHitData.h"
#include "edm4eic/ClusterData.h"
int rec_analysis_ecal(const std::string& config_name)
{
// read our configuration
std::ifstream config_file{config_name};
nlohmann::json config;
config_file >> config;
const std::string rec_file = config["rec_file"];
const std::string detector = config["detector"];
const std::string output_prefix = config["output_prefix"];
const std::string test_tag = config["test_tag"];
const int ebeam = config["ebeam"];
const int pbeam = config["pbeam"];
fmt::print(fmt::emphasis::bold | fg(fmt::color::forest_green),
"Running DIS electron analysis...\n");
fmt::print(" - Detector package: {}\n", detector);
fmt::print(" - input file: {}\n", rec_file);
fmt::print(" - output prefix: {}\n", output_prefix);
fmt::print(" - test tag: {}\n", test_tag);
fmt::print(" - ebeam: {}\n", ebeam);
fmt::print(" - pbeam: {}\n", pbeam);
// create our test definition
// test_tag
common_bench::Test dis_Q2_resolution{
{{"name", fmt::format("{}_Q2_resolution", test_tag)},
{"title", "DIS Q2 resolution"},
{"description",
fmt::format("DIS Q2 resolution with {}, estimated using a Gaussian fit.", detector)},
{"quantity", "resolution (in %)"},
{"target", "0.1"}}};
// Run this in multi-threaded mode if desired
ROOT::EnableImplicitMT(kNumThreads);
ROOT::RDataFrame d("events", rec_file);
return 0;
}
#include "common_bench/benchmark.h"
#include "common_bench/mt.h"
#include "common_bench/util.h"
#include "common_bench/plot.h"
#include <cmath>
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include "ROOT/RDataFrame.hxx"
#include <TH1D.h>
#include <TFitResult.h>
#include <TRandom3.h>
#include <TCanvas.h>
#include "fmt/color.h"
#include "fmt/core.h"
#include "nlohmann/json.hpp"
#include "edm4eic/CalorimeterHitData.h"
#include "edm4eic/ClusterData.h"
int rec_analysis_hcal(const std::string& config_name)
{
// read our configuration
std::ifstream config_file{config_name};
nlohmann::json config;
config_file >> config;
const std::string rec_file = config["rec_file"];
const std::string detector = config["detector"];
const std::string output_prefix = config["output_prefix"];
const std::string test_tag = config["test_tag"];
const int ebeam = config["ebeam"];
const int pbeam = config["pbeam"];
fmt::print(fmt::emphasis::bold | fg(fmt::color::forest_green),
"Running DIS electron analysis...\n");
fmt::print(" - Detector package: {}\n", detector);
fmt::print(" - input file: {}\n", rec_file);
fmt::print(" - output prefix: {}\n", output_prefix);
fmt::print(" - test tag: {}\n", test_tag);
fmt::print(" - ebeam: {}\n", ebeam);
fmt::print(" - pbeam: {}\n", pbeam);
// create our test definition
// test_tag
common_bench::Test dis_Q2_resolution{
{{"name", fmt::format("{}_Q2_resolution", test_tag)},
{"title", "DIS Q2 resolution"},
{"description",
fmt::format("DIS Q2 resolution with {}, estimated using a Gaussian fit.", detector)},
{"quantity", "resolution (in %)"},
{"target", "0.1"}}};
// Run this in multi-threaded mode if desired
ROOT::EnableImplicitMT(kNumThreads);
ROOT::RDataFrame d("events", rec_file);
return 0;
}
This diff is collapsed.
...@@ -89,25 +89,26 @@ else: ...@@ -89,25 +89,26 @@ else:
particle = config.split('-')[0].strip() particle = config.split('-')[0].strip()
particle_dict = {'e':[boolean_electron,'Electrons'],'pi':[boolean_pion,'Pions']} particle_dict = {'e':[boolean_electron,'Electrons'],'pi':[boolean_pion,'Pions']}
#################################################################################################### ####################################################################################################
#Ratio #Ratio
#################################################################################################### ####################################################################################################
for i in range(len(MC_list)): #Repeat the following steps for each variable (momentum,theta,phi,eta) for i in range(len(MC_list)): #Repeat the following steps for each variable (momentum,theta,phi,eta)
X1 = MC_list[i] #MCParticles events to be plotted on x-axis MCparts = MC_list[i] #MCParticles events to be plotted on x-axis
Y1 = RC_list[i] #ReconstructedParticles events RCparts = RC_list[i] #ReconstructedParticles events
X_list = [ak.Array(X1), X_list = [ak.Array(MCparts),
ak.Array(X1[boolean_pion]), ak.Array(MCparts[boolean_pion]),
ak.Array(X1[boolean_proton]), ak.Array(MCparts[boolean_proton]),
ak.Array(X1[boolean_electron]), ak.Array(MCparts[boolean_electron]),
ak.Array(X1[boolean_neutron]), ak.Array(MCparts[boolean_neutron]),
ak.Array(X1[boolean_photon])] ak.Array(MCparts[boolean_photon])]
Y_list = [ak.Array(Y1), Y_list = [ak.Array(RCparts),
ak.Array(Y1[boolean_pion]), ak.Array(RCparts[boolean_pion]),
ak.Array(Y1[boolean_proton]), ak.Array(RCparts[boolean_proton]),
ak.Array(Y1[boolean_electron]), ak.Array(RCparts[boolean_electron]),
ak.Array(Y1[boolean_neutron]), ak.Array(RCparts[boolean_neutron]),
ak.Array(Y1[boolean_photon])] ak.Array(RCparts[boolean_photon])]
X_plot = list(np.zeros(len(X_list))) X_plot = list(np.zeros(len(X_list)))
Y_plot = list(np.zeros(len(X_list))) Y_plot = list(np.zeros(len(X_list)))
...@@ -177,6 +178,7 @@ for i in range(len(MC_list)): #Repeat the following steps for each variable (mom ...@@ -177,6 +178,7 @@ for i in range(len(MC_list)): #Repeat the following steps for each variable (mom
plt.savefig(os.path.join(r_path, '%s_%s_%s.png' % (title_list[i],title,config))) plt.savefig(os.path.join(r_path, '%s_%s_%s.png' % (title_list[i],title,config)))
plt.close() plt.close()
################################################################################################### ###################################################################################################
#Ratio vs momentum #Ratio vs momentum
################################################################################################### ###################################################################################################
...@@ -219,19 +221,20 @@ for i in range(len(MC_list)): #Repeat the following steps for each variable (mom ...@@ -219,19 +221,20 @@ for i in range(len(MC_list)): #Repeat the following steps for each variable (mom
ax1.set_title('%s Difference Vs Momentum %s %s events\n DETECTOR_CONFIG: %s'%(title_list[i],config,Nevents,Dconfig)) ax1.set_title('%s Difference Vs Momentum %s %s events\n DETECTOR_CONFIG: %s'%(title_list[i],config,Nevents,Dconfig))
plt.savefig(os.path.join(r_path, '%s_difference_vs_momentum_%s.png' % (title_list[i],config))) plt.savefig(os.path.join(r_path, '%s_difference_vs_momentum_%s.png' % (title_list[i],config)))
################################################################################################### ###################################################################################################
#Correlation #Correlation
################################################################################################### ###################################################################################################
#Repeat the following steps for each variable (momentum,theta,phi,eta) #Repeat the following steps for each variable (momentum,theta,phi,eta)
X_len = ak.count(X1,axis=None) X_len = ak.count(MCparts,axis=None)
Y_len = ak.count(Y1,axis=None) Y_len = ak.count(RCparts,axis=None)
if X_len > Y_len: if X_len > Y_len:
F_boolean = np.ones_like(Y1) == 1 F_boolean = np.ones_like(RCparts) == 1
else: else:
F_boolean = np.ones_like(X1) == 1 F_boolean = np.ones_like(MCparts) == 1
X_s = np.array(ak.flatten(X1[F_boolean])) X_s = np.array(ak.flatten(MCparts[F_boolean]))
Y_s = np.array(ak.flatten(Y1[F_boolean])) Y_s = np.array(ak.flatten(RCparts[F_boolean]))
#Histogram #Histogram
if i == 0 and particle in particle_dict.keys(): #Momentum in Single events if i == 0 and particle in particle_dict.keys(): #Momentum in Single events
...@@ -268,6 +271,7 @@ for i in range(len(MC_list)): #Repeat the following steps for each variable (mom ...@@ -268,6 +271,7 @@ for i in range(len(MC_list)): #Repeat the following steps for each variable (mom
fig.suptitle('%s %s events\n DETECTOR_CONFIG: %s'%(config,Nevents,Dconfig)) fig.suptitle('%s %s events\n DETECTOR_CONFIG: %s'%(config,Nevents,Dconfig))
plt.savefig(os.path.join(r_path, '%s_correlation_%s.png' % (title_list[i],config))) plt.savefig(os.path.join(r_path, '%s_correlation_%s.png' % (title_list[i],config)))
################################################################################################### ###################################################################################################
#Phi vs Theta plots #Phi vs Theta plots
################################################################################################### ###################################################################################################
......
...@@ -38,7 +38,7 @@ dis:simulate: ...@@ -38,7 +38,7 @@ dis:simulate:
- EBEAM: 18 - EBEAM: 18
PBEAM: 275 PBEAM: 275
MINQ2: [1, 10, 100, 1000] MINQ2: [1, 10, 100, 1000]
timeout: 2 hour timeout: 96 hour
script: script:
- bash benchmarks/dis/dis.sh --config dis_${EBEAM}x${PBEAM}_minQ2=${MINQ2} --ebeam ${EBEAM} --pbeam ${PBEAM} --minq2 ${MINQ2} - bash benchmarks/dis/dis.sh --config dis_${EBEAM}x${PBEAM}_minQ2=${MINQ2} --ebeam ${EBEAM} --pbeam ${PBEAM} --minq2 ${MINQ2}
retry: retry:
......
#!/bin/bash #!/bin/bash
source strict-mode.sh
## ============================================================================= ## =============================================================================
## Run the DIS benchmarks in 5 steps: ## Run the DIS benchmarks in 5 steps:
...@@ -52,7 +53,7 @@ GEN_FILE=${INPUT_PATH}/gen-${CONFIG}_${JUGGLER_N_EVENTS}.hepmc ...@@ -52,7 +53,7 @@ GEN_FILE=${INPUT_PATH}/gen-${CONFIG}_${JUGGLER_N_EVENTS}.hepmc
SIM_FILE=${TMP_PATH}/sim-${CONFIG}.edm4hep.root SIM_FILE=${TMP_PATH}/sim-${CONFIG}.edm4hep.root
SIM_LOG=${TMP_PATH}/sim-${CONFIG}.log SIM_LOG=${TMP_PATH}/sim-${CONFIG}.log
# JUGGLER_REC_FILE_BASE= ${TMP_PATH}/rec-${CONFIG}
REC_FILE=${TMP_PATH}/rec-${CONFIG}.root REC_FILE=${TMP_PATH}/rec-${CONFIG}.root
REC_LOG=${TMP_PATH}/sim-${CONFIG}.log REC_LOG=${TMP_PATH}/sim-${CONFIG}.log
...@@ -65,7 +66,7 @@ if [ ! -f ${SIM_FILE} ] ; then ...@@ -65,7 +66,7 @@ if [ ! -f ${SIM_FILE} ] ; then
ddsim --runType batch \ ddsim --runType batch \
--part.minimalKineticEnergy 1000*GeV \ --part.minimalKineticEnergy 1000*GeV \
--filter.tracker edep0 \ --filter.tracker edep0 \
-v INFO \ -v WARNING \
--numberOfEvents ${JUGGLER_N_EVENTS} \ --numberOfEvents ${JUGGLER_N_EVENTS} \
--compactFile ${DETECTOR_PATH}/${DETECTOR_CONFIG}.xml \ --compactFile ${DETECTOR_PATH}/${DETECTOR_CONFIG}.xml \
--inputFiles ${GEN_FILE} \ --inputFiles ${GEN_FILE} \
...@@ -79,25 +80,24 @@ fi ...@@ -79,25 +80,24 @@ fi
## ============================================================================= ## =============================================================================
## Step 3: Run digitization & reconstruction ## Step 3: Run digitization & reconstruction
echo "Running the digitization and reconstruction" echo "Running the digitization and reconstruction"
## FIXME Need to figure out how to pass file name to juggler from the commandline if [ ${RECO} == "eicrecon" ] ; then
## the tracker_reconstruction.py options file uses the following environment /usr/bin/time -v eicrecon ${SIM_FILE} -Ppodio:output_file=${REC_FILE}
## variables: if [ "$?" -ne "0" ] ; then
## - JUGGLER_SIM_FILE: input detector simulation echo "ERROR running eicrecon"
## - JUGGLER_REC_FILE: output reconstructed data exit 1
## - JUGGLER_N_EVENTS: number of events to process (part of global environment) fi
## - DETECTOR: detector package (part of global environment) fi
if [[ ${RECO} == "juggler" ]] ; then
export JUGGLER_SIM_FILE=${SIM_FILE} export JUGGLER_SIM_FILE=${SIM_FILE}
export JUGGLER_REC_FILE=${REC_FILE} export JUGGLER_REC_FILE=${REC_FILE}
for rec in options/*.py options/extra/*.py ; do gaudirun.py options/reconstruction.py
unset tag
[[ $(basename ${rec} .py) =~ (.*)\.(.*) ]] && tag=".${BASH_REMATCH[2]}"
JUGGLER_REC_FILE=${JUGGLER_REC_FILE/.root/${tag:-}.root} \
gaudirun.py ${rec}
if [ "$?" -ne "0" ] ; then if [ "$?" -ne "0" ] ; then
echo "ERROR running juggler" echo "ERROR running juggler"
exit 1 exit 1
fi fi
done fi
## ============================================================================= ## =============================================================================
## Step 4: Analysis ## Step 4: Analysis
...@@ -134,59 +134,6 @@ if [[ "$?" -ne "0" ]] ; then ...@@ -134,59 +134,6 @@ if [[ "$?" -ne "0" ]] ; then
exit 1 exit 1
fi fi
CONFIG="${TMP_PATH}/${PLOT_TAG}.raw.json"
cat << EOF > ${CONFIG}
{
"rec_file": "${REC_FILE/.root/.raw.root}",
"detector": "${DETECTOR}",
"output_prefix": "${RESULTS_PATH}/${PLOT_TAG}",
"ebeam": ${EBEAM},
"pbeam": ${PBEAM},
"minq2": ${MINQ2},
"test_tag": "${BEAM_TAG}"
}
EOF
root -b -q "benchmarks/dis/analysis/rec_analysis_raw.cxx+(\"${CONFIG}\")"
if [[ "$?" -ne "0" ]] ; then
echo "ERROR running rec_analysis_raw script"
exit 1
fi
CONFIG="${TMP_PATH}/${PLOT_TAG}.ecal.json"
cat << EOF > ${CONFIG}
{
"rec_file": "${REC_FILE/.root/.ecal.root}",
"detector": "${DETECTOR}",
"output_prefix": "${RESULTS_PATH}/${PLOT_TAG}",
"ebeam": ${EBEAM},
"pbeam": ${PBEAM},
"minq2": ${MINQ2},
"test_tag": "${BEAM_TAG}"
}
EOF
root -b -q "benchmarks/dis/analysis/rec_analysis_ecal.cxx+(\"${CONFIG}\")"
if [[ "$?" -ne "0" ]] ; then
echo "ERROR running rec_analysis_ecal script"
exit 1
fi
CONFIG="${TMP_PATH}/${PLOT_TAG}.hcal.json"
cat << EOF > ${CONFIG}
{
"rec_file": "${REC_FILE/.root/.hcal.root}",
"detector": "${DETECTOR}",
"output_prefix": "${RESULTS_PATH}/${PLOT_TAG}",
"ebeam": ${EBEAM},
"pbeam": ${PBEAM},
"minq2": ${MINQ2},
"test_tag": "${BEAM_TAG}"
}
EOF
root -b -q "benchmarks/dis/analysis/rec_analysis_hcal.cxx+(\"${CONFIG}\")"
if [[ "$?" -ne "0" ]] ; then
echo "ERROR running rec_analysis_hcal script"
exit 1
fi
## ============================================================================= ## =============================================================================
## Step 5: finalize ## Step 5: finalize
...@@ -198,9 +145,6 @@ if [ "${JUGGLER_N_EVENTS}" -lt "500" ] ; then ...@@ -198,9 +145,6 @@ if [ "${JUGGLER_N_EVENTS}" -lt "500" ] ; then
cp ${REC_FILE} ${RESULTS_PATH} cp ${REC_FILE} ${RESULTS_PATH}
fi fi
## Always move over log files to the results path
cp ${REC_LOG} ${RESULTS_PATH}
## ============================================================================= ## =============================================================================
## All done! ## All done!
echo "DIS benchmarks complete" echo "DIS benchmarks complete"
#!/bin/bash #!/bin/bash
source strict-mode.sh
## ============================================================================= ## =============================================================================
## Local configuration variables for this particular benchmark ## Local configuration variables for this particular benchmark
......
#!/bin/bash #!/bin/bash
source strict-mode.sh
## ============================================================================= ## =============================================================================
## Standin for a proper pythia generation process, similar to how we ## Standin for a proper pythia generation process, similar to how we
......
#!/bin/bash #!/bin/bash
source strict-mode.sh
## ============================================================================= ## =============================================================================
## Standin for a proper pythia generation process, similar to how we ## Standin for a proper pythia generation process, similar to how we
......
#!/bin/bash #!/bin/bash
source strict-mode.sh
function print_the_help { function print_the_help {
echo "USAGE: ${0} [--rec] [--sim] [--analysis] [--all] " echo "USAGE: ${0} [--rec] [--sim] [--analysis] [--all] "
...@@ -114,19 +115,23 @@ if [[ -n "${DO_SIM}" || -n "${DO_ALL}" ]] ; then ...@@ -114,19 +115,23 @@ if [[ -n "${DO_SIM}" || -n "${DO_ALL}" ]] ; then
fi fi
fi fi
### Step 3. Run the reconstruction (juggler) ### Step 3. Run the reconstruction (eicrecon)
if [[ -n "${DO_REC}" || -n "${DO_ALL}" ]] ; then if [[ -n "${DO_REC}" || -n "${DO_ALL}" ]] ; then
for rec in options/*.py ; do if [ ${RECO} == "eicrecon" ] ; then
unset tag eicrecon ${JUGGLER_SIM_FILE} -Ppodio:output_file=${JUGGLER_REC_FILE}
[[ $(basename ${rec} .py) =~ (.*)\.(.*) ]] && tag=".${BASH_REMATCH[2]}"
JUGGLER_REC_FILE=${JUGGLER_REC_FILE/.root/${tag:-}.root} \
gaudirun.py ${rec}
if [[ "$?" -ne "0" ]] ; then if [[ "$?" -ne "0" ]] ; then
echo "ERROR running juggler" echo "ERROR running eicrecon"
exit 1 exit 1
fi fi
done fi
if [[ ${RECO} == "juggler" ]] ; then
gaudirun.py options/reconstruction.py
if [ "$?" -ne "0" ] ; then
echo "ERROR running juggler"
exit 1
fi
fi
root_filesize=$(stat --format=%s "${JUGGLER_REC_FILE}") root_filesize=$(stat --format=%s "${JUGGLER_REC_FILE}")
if [[ "${JUGGLER_N_EVENTS}" -lt "500" ]] ; then if [[ "${JUGGLER_N_EVENTS}" -lt "500" ]] ; then
# file must be less than 10 MB to upload # file must be less than 10 MB to upload
......
#!/bin/bash #!/bin/bash
source strict-mode.sh
## ============================================================================= ## =============================================================================
## Run the DVMP benchmarks in 5 steps: ## Run the DVMP benchmarks in 5 steps:
...@@ -85,17 +86,21 @@ echo "Running the digitization and reconstruction" ...@@ -85,17 +86,21 @@ echo "Running the digitization and reconstruction"
## - DETECTOR: detector package (part of global environment) ## - DETECTOR: detector package (part of global environment)
export JUGGLER_SIM_FILE=${SIM_FILE} export JUGGLER_SIM_FILE=${SIM_FILE}
export JUGGLER_REC_FILE=${REC_FILE} export JUGGLER_REC_FILE=${REC_FILE}
for rec in options/*.py ; do if [ ${RECO} == "eicrecon" ] ; then
unset tag eicrecon ${JUGGLER_SIM_FILE} -Ppodio:output_file=${JUGGLER_REC_FILE}
[[ $(basename ${rec} .py) =~ (.*)\.(.*) ]] && tag=".${BASH_REMATCH[2]}" if [[ "$?" -ne "0" ]] ; then
JUGGLER_REC_FILE=${JUGGLER_REC_FILE/.root/${tag:-}.root} \ echo "ERROR running eicrecon"
gaudirun.py ${rec}
if [ "$?" -ne "0" ] ; then
echo "ERROR running juggler, both attempts failed"
exit 1 exit 1
fi fi
done fi
if [[ ${RECO} == "juggler" ]] ; then
gaudirun.py options/reconstruction.py
if [ "$?" -ne "0" ] ; then
echo "ERROR running juggler"
exit 1
fi
fi
## ============================================================================= ## =============================================================================
## Step 4: Analysis ## Step 4: Analysis
......
#!/bin/bash #!/bin/bash
source strict-mode.sh
## ============================================================================= ## =============================================================================
## Local configuration variables for this particular benchmark ## Local configuration variables for this particular benchmark
......
#!/bin/bash #!/bin/bash
source strict-mode.sh
## ============================================================================= ## =============================================================================
## Run a single instance of the DVMP generator (lAger) ## Run a single instance of the DVMP generator (lAger)
......
#!/bin/bash #!/bin/bash
source strict-mode.sh
source $(dirname $0)/common.sh $* source $(dirname $0)/common.sh $*
......
#!/bin/bash
source strict-mode.sh
if [[ ! -n "${JUGGLER_N_EVENTS}" ]] ; then if [[ ! -n "${JUGGLER_N_EVENTS}" ]] ; then
export JUGGLER_N_EVENTS=100 export JUGGLER_N_EVENTS=100
fi fi
...@@ -5,7 +8,8 @@ fi ...@@ -5,7 +8,8 @@ fi
export JUGGLER_FILE_NAME_TAG="${1:-e-_1GeV_45to135deg}" export JUGGLER_FILE_NAME_TAG="${1:-e-_1GeV_45to135deg}"
export JUGGLER_GEN_FILE="benchmarks/single/${JUGGLER_FILE_NAME_TAG}.steer" 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_SIM_FILE="sim_output/sim_${JUGGLER_FILE_NAME_TAG}.edm4hep.root"
export JUGGLER_REC_FILE="sim_output/rec_${JUGGLER_FILE_NAME_TAG}.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" export BENCHMARK_TAG="single"
echo "Setting up the local environment for the ${BENCHMARK_TAG^^} benchmarks" echo "Setting up the local environment for the ${BENCHMARK_TAG^^} benchmarks"
......
#!/bin/bash #!/bin/bash
source strict-mode.sh
source $(dirname $0)/common.sh $* source $(dirname $0)/common.sh $*
# Reconstruct # Reconstruct
for rec in options/*.py ; do if [ ${RECO} == "eicrecon" ] ; then
unset tag eicrecon ${JUGGLER_SIM_FILE} -Ppodio:output_file=${JUGGLER_REC_FILE}
[[ $(basename ${rec} .py) =~ (.*)\.(.*) ]] && tag=".${BASH_REMATCH[2]}"
JUGGLER_REC_FILE=${JUGGLER_REC_FILE/.root/${tag:-}.root} \
/usr/bin/time -v \
gaudirun.py ${JUGGLER_GAUDI_OPTIONS:-} ${rec}
if [[ "$?" -ne "0" ]] ; then if [[ "$?" -ne "0" ]] ; then
echo "ERROR running eicrecon"
exit 1
fi
fi
if [[ ${RECO} == "juggler" ]] ; then
gaudirun.py options/reconstruction.py
if [ "$?" -ne "0" ] ; then
echo "ERROR running juggler" echo "ERROR running juggler"
exit 1 exit 1
fi fi
done fi
if [ -f jana.dot ] ; then cp jana.dot ${JUGGLER_REC_FILE_BASE}.dot ; fi
rootls -t ${JUGGLER_REC_FILE_BASE}.tree.edm4eic.root
#!/bin/bash #!/bin/bash
source strict-mode.sh
source $(dirname $0)/common.sh $* source $(dirname $0)/common.sh $*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment