Skip to content
Snippets Groups Projects
Commit 1205c1b5 authored by Dmitry Kalinkin's avatar Dmitry Kalinkin
Browse files

remove single benchmark, it doesn't belong in physics

parent f4e41076
No related branches found
No related tags found
No related merge requests found
Pipeline #103500 canceled
...@@ -38,8 +38,6 @@ stages: ...@@ -38,8 +38,6 @@ stages:
- compile - compile
- generate - generate
- simulate - simulate
- reconstruct
- analyze
- collect - collect
- finish - finish
- status-report - status-report
...@@ -122,7 +120,6 @@ include: ...@@ -122,7 +120,6 @@ include:
- local: 'benchmarks/dvcs/config.yml' - local: 'benchmarks/dvcs/config.yml'
- local: 'benchmarks/tcs/config.yml' - local: 'benchmarks/tcs/config.yml'
- local: 'benchmarks/u_omega/config.yml' - local: 'benchmarks/u_omega/config.yml'
- local: 'benchmarks/single/config.yml'
- local: 'benchmarks/backgrounds/config.yml' - local: 'benchmarks/backgrounds/config.yml'
summary: summary:
...@@ -134,7 +131,6 @@ summary: ...@@ -134,7 +131,6 @@ summary:
- "dvcs:results" - "dvcs:results"
- "tcs:results" - "tcs:results"
- "u_omega:results" - "u_omega:results"
- "single:results"
- "backgrounds:results" - "backgrounds:results"
script: script:
- collect_benchmarks.py - collect_benchmarks.py
......
#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;
}
#!/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
#!/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}"
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
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
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
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
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
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
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
#!/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
#!/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
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