diff --git a/benchmarks/single/config.yml b/benchmarks/single/config.yml new file mode 100644 index 0000000000000000000000000000000000000000..35ed2a0d046972fd4ccf7a18b60d9a334c79d155 --- /dev/null +++ b/benchmarks/single/config.yml @@ -0,0 +1,6 @@ +single:process: + extends: .phy_benchmark + timeout: 24 hours + stage: process + script: + - bash benchmarks/single/single.sh e-_1GeV_45to135deg diff --git a/benchmarks/single/e-_1GeV_45to135deg.steer b/benchmarks/single/e-_1GeV_45to135deg.steer new file mode 100644 index 0000000000000000000000000000000000000000..dff3f9515242b432ad37e648f222c7d6f3f7a243 --- /dev/null +++ b/benchmarks/single/e-_1GeV_45to135deg.steer @@ -0,0 +1,11 @@ +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/single.sh b/benchmarks/single/single.sh new file mode 100644 index 0000000000000000000000000000000000000000..852c59273453a5650d7898c78cf7d54e82e4acf4 --- /dev/null +++ b/benchmarks/single/single.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +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_${JUGGLER_FILE_NAME_TAG}.root" +export JUGGLER_REC_FILE="rec_${JUGGLER_FILE_NAME_TAG}.root" + +# Simulate +npsim --runType run \ + --printLevel WARNING \ + --enableGun \ + --steeringFile ${JUGGLER_GEN_FILE} \ + --numberOfEvents ${JUGGLER_N_EVENTS} \ + --part.minimalKineticEnergy 1*TeV \ + --compactFile ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml \ + --outputFile ${JUGGLER_SIM_FILE} +if [[ "$?" -ne "0" ]] ; then + echo "ERROR running npsim" + exit 1 +fi + +# Reconstruct +gaudirun.py options/reconstruction.py +if [[ "$?" -ne "0" ]] ; then + echo "ERROR running juggler" + exit 1 +fi + +# Analysis +root -l -b -q ${JUGGLER_REC_FILE} -e 'events->Scan("@ReconstructedParticles.size()","","",10)' +if [[ "$?" -ne "0" ]] ; then + echo "ERROR analysis failed" + exit 1 +fi