Skip to content
Snippets Groups Projects
Commit d312187f authored by Eoin Clerkin's avatar Eoin Clerkin
Browse files

Bin to Text as artifact

Rename checkradlen file. Add copyright header. Change rad len check to output
text of binary as compressed artifact for debugging of geometry.
parent d9cc424d
No related branches found
No related tags found
1 merge request!298Output binary as text
Pipeline #33526 passed
...@@ -118,7 +118,7 @@ FileMediaCheck: ...@@ -118,7 +118,7 @@ FileMediaCheck:
- git fetch upstream - git fetch upstream
- gawk -f ci_scripts/static_check.awk media.geo - gawk -f ci_scripts/static_check.awk media.geo
CheckRadLen: Bin2Txt_CheckRadLen:
stage: checkGeometries stage: checkGeometries
image: rootproject/root image: rootproject/root
tags: tags:
...@@ -137,8 +137,11 @@ CheckRadLen: ...@@ -137,8 +137,11 @@ CheckRadLen:
- git diff upstream/master --name-only - git diff upstream/master --name-only
- touch LIST_GEO_FILES - touch LIST_GEO_FILES
- FAIL=0 - FAIL=0
- for file in `git diff upstream/master 2>/dev/null --name-only | sed -ne '/\.geo\.root$/p'`; do if [ -f $file ]; then echo $file; sh ci_scripts/check_radlen.sh $file; if [ $? -ne 0 ]; then let FAIL++; fi; fi; done - for file in `git diff upstream/master 2>/dev/null --name-only | sed -ne '/\.geo\.root$/p'`; do if [ -f $file ]; then echo $file; sh ci_scripts/bin2txt_checkradlen.sh $file; if [ $? -ne 0 ]; then let FAIL++; fi; fi; done
- exit $FAIL - exit $FAIL
artifacts:
paths:
- "*.geo.txt.gz"
InformCodeOwners: InformCodeOwners:
stage: finalise stage: finalise
...@@ -168,6 +171,3 @@ Md5Sums: ...@@ -168,6 +171,3 @@ Md5Sums:
script: script:
- find . -iname '*.geo.root' | xargs md5sum - find . -iname '*.geo.root' | xargs md5sum
#/bin/bash #/bin/bash
# check_radlen.sh - checks radiation length of materials in user supplied geometry # Copyright (C) 2022-2025 Facility for AntiProton and Ion Research in Europe, Darmstadt
# SPDX-License-Identifier: GPL-3.0-only
# First commited by Eoin Clerkin
# bin2txt_checkradlen.sh
# renamed from check_radlen.sh - checks radiation length of materials in user supplied geometry
# Author: Eoin Clerkin (FAIR) 2022-01-31 # Author: Eoin Clerkin (FAIR) 2022-01-31
# 2025-03-20 Modified to also output the to-text version of binaries as artifact
echo "Scanning the geometry" $1 echo "Scanning the geometry" $1
root -l -b -q 'ci_scripts/scan_geometry.C("'$1'")' 1>tmp ARTIFACT=`echo $1 | sed 's_^[a-zA-Z]*\/__' | sed 's_\.root$_\.txt_'`
echo "ARTIFACT name is $ARTIFACT"
root -l -b -q 'ci_scripts/scan_geometry.C("'$1'")' 2>&1 1>$ARTIFACT
ROOT_EXIT=$?; ROOT_EXIT=$?;
if [ 0 -ne $ROOT_EXIT ]; then if [ 0 -ne $ROOT_EXIT ]; then
...@@ -12,7 +22,7 @@ if [ 0 -ne $ROOT_EXIT ]; then ...@@ -12,7 +22,7 @@ if [ 0 -ne $ROOT_EXIT ]; then
exit ${ROOT_EXIT}; exit ${ROOT_EXIT};
fi; fi;
grep '^M\(at\|ix\)' tmp | \ grep '^M\(at\|ix\)' $ARTIFACT | \
sort | \ sort | \
uniq -c | \ uniq -c | \
sort -g -k 1 1>MATERIALS sort -g -k 1 1>MATERIALS
...@@ -22,7 +32,6 @@ FAIL=0; ...@@ -22,7 +32,6 @@ FAIL=0;
SKIP=0; SKIP=0;
OKAY=0; OKAY=0;
while IFS= read -r line; while IFS= read -r line;
do do
...@@ -57,8 +66,8 @@ variables=`echo "$line" | sed -e 's/eff//g' | sed -e 's/index/jndex/g' | sed -e ...@@ -57,8 +66,8 @@ variables=`echo "$line" | sed -e 's/eff//g' | sed -e 's/index/jndex/g' | sed -e
done < MATERIALS done < MATERIALS
rm tmp MATERIALS rm MATERIALS
gzip $ARTIFACT
echo ${FAIL}" failures in " $COUNT " materials" echo ${FAIL}" failures in " $COUNT " materials"
......
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