Skip to content
Snippets Groups Projects
Commit 5e4c54e2 authored by Marshall Scott's avatar Marshall Scott Committed by Maria Zurek
Browse files

Resolve "Pion rejection YR benchmark"

parent b02c17f1
No related branches found
No related tags found
1 merge request!49Resolve "Pion rejection YR benchmark"
......@@ -32,6 +32,13 @@ sim:emcal_barrel_pions_electrons:
- bash benchmarks/barrel_ecal/run_emcal_barrel_electrons.sh
- bash benchmarks/barrel_ecal/run_emcal_barrel_particles.sh piminus
sim:emcal_barrel_pion_rejection:
extends: .det_benchmark
stage: simulate
script:
- bash benchmarks/barrel_ecal/run_emcal_barrel_pion_rejection.sh electron
- bash benchmarks/barrel_ecal/run_emcal_barrel_pion_rejection.sh piminus
calib:emcal_barrel_electrons:
extends: .det_benchmark
stage: calibrate
......@@ -92,6 +99,17 @@ bench:emcal_barrel_pions_electrons:
- rootls -t sim_output/sim_emcal_barrel_uniform_electrons.root
- root -b -q benchmarks/barrel_ecal/scripts/emcal_barrel_pions_electrons_analysis.cxx+
bench:emcal_barrel_pion_rejection:
extends: .det_benchmark
stage: benchmarks
needs:
- ["sim:emcal_barrel_pion_rejection"]
script:
- ls -lhtR sim_output/
- rootls -t sim_output/sim_emcal_barrel_piRej_piminus.root
- rootls -t sim_output/sim_emcal_barrel_piRej_electron.root
- root -b -q benchmarks/barrel_ecal/scripts/emcal_barrel_pion_rejection_analysis.cxx+
collect_results:barrel_ecal:
extends: .det_benchmark
stage: collect
......@@ -102,6 +120,7 @@ collect_results:barrel_ecal:
- "bench:emcal_barrel_pions"
- "bench:emcal_barrel_pi0"
- "bench:emcal_barrel_pions_electrons"
- "bench:emcal_barrel_pion_rejection"
script:
- ls -lrht
- echo " FIX ME"
......
#!/bin/bash
if [[ ! -n "${JUGGLER_DETECTOR}" ]] ; then
export JUGGLER_DETECTOR="athena"
fi
if [[ ! -n "${JUGGLER_N_EVENTS}" ]] ; then
export JUGGLER_N_EVENTS=100
fi
if [[ ! -n "${E_START}" ]] ; then
export E_START=1.0
fi
if [[ ! -n "${E_END}" ]] ; then
export E_END=18.0
fi
export PARTICLE=$1
if [[ ! -n "${PARTICLE}" ]] ; then
export PARTICLE="electron"
fi
export JUGGLER_FILE_NAME_TAG="emcal_barrel_piRej_${PARTICLE}"
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}"
# Generate the input events
root -b -q "benchmarks/barrel_ecal/scripts/emcal_barrel_particles_gen.cxx+(${JUGGLER_N_EVENTS}, ${E_START}, ${E_END}, \"${PARTICLE}\")"
if [[ "$?" -ne "0" ]] ; then
echo "ERROR running script: generating input events"
exit 1
fi
# Plot the input events
root -b -q "benchmarks/barrel_ecal/scripts/emcal_barrel_particles_reader.cxx+(\"${PARTICLE}\")"
if [[ "$?" -ne "0" ]] ; then
echo "ERROR running script: plotting input events"
exit 1
fi
ls -ltRhL
npsim --runType batch \
-v WARNING \
--part.minimalKineticEnergy 0.5*GeV \
--numberOfEvents ${JUGGLER_N_EVENTS} \
--compactFile ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml \
--inputFiles data/${JUGGLER_FILE_NAME_TAG}.hepmc \
--outputFile sim_output/${JUGGLER_SIM_FILE}
if [[ "$?" -ne "0" ]] ; then
echo "ERROR running npdet"
exit 1
fi
# Directory for plots
mkdir -p results
# Move ROOT output file
#mv ${JUGGLER_REC_FILE} sim_output/
......@@ -23,7 +23,7 @@
using namespace HepMC3;
void emcal_barrel_particles_gen(int n_events = 1e6, double e_start = 0.0, double e_end = 20.0, std::string particle_name = "electron") {
std::string out_fname = fmt::format("./data/emcal_barrel_{}.hepmc", particle_name);
std::string out_fname = fmt::format("./data/{}", std::getenv("JUGGLER_GEN_FILE"));
WriterAscii hepmc_output(out_fname);
int events_parsed = 0;
GenEvent evt(Units::GEV, Units::MM);
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment