Skip to content
Snippets Groups Projects

Output binary as text

Merged Eoin Clerkin requested to merge e.clerkin/cbmroot_geometry:output_text into master
2 files
+ 20
11
Compare changes
  • Side-by-side
  • Inline
Files
2
#/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
# 2025-03-20 Modified to also output the to-text version of binaries as artifact
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=$?;
if [ 0 -ne $ROOT_EXIT ]; then
@@ -12,7 +22,7 @@ if [ 0 -ne $ROOT_EXIT ]; then
exit ${ROOT_EXIT};
fi;
grep '^M\(at\|ix\)' tmp | \
grep '^M\(at\|ix\)' $ARTIFACT | \
sort | \
uniq -c | \
sort -g -k 1 1>MATERIALS
@@ -22,7 +32,6 @@ FAIL=0;
SKIP=0;
OKAY=0;
while IFS= read -r line;
do
@@ -57,8 +66,8 @@ variables=`echo "$line" | sed -e 's/eff//g' | sed -e 's/index/jndex/g' | sed -e
done < MATERIALS
rm tmp MATERIALS
rm MATERIALS
gzip $ARTIFACT
echo ${FAIL}" failures in " $COUNT " materials"
Loading