forked from Expander/FlexibleSUSY
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alexander Voigt
authored and
Alexander Voigt
committed
Jul 18, 2015
1 parent
306fdb4
commit 139b649
Showing
2 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
#!/bin/bash | ||
|
||
# spectrums are the same. | ||
|
||
BASEDIR=$(dirname $0) | ||
FSCONFIG="$BASEDIR/../flexiblesusy-config" | ||
|
||
sm_input="$BASEDIR/../model_files/SM/LesHouches.in.SM" | ||
|
||
sm_two_scale_input="$BASEDIR/SM_two_scale.in.spc" | ||
sm_two_scale_output="$BASEDIR/SM_two_scale.out.spc" | ||
|
||
sm_root_input="$BASEDIR/SM_root.in.spc" | ||
sm_root_output="$BASEDIR/SM_root.out.spc" | ||
|
||
rel_error="0.00001" | ||
|
||
sm_exe="$BASEDIR/../models/SM/run_SM.x" | ||
|
||
[ $("$FSCONFIG" --with-SM) = yes ] || exit 1 | ||
|
||
if test ! -x "$sm_exe"; then | ||
echo "Error: SM spectrum generator not found: $sm_exe" | ||
exit 1 | ||
fi | ||
|
||
create_input() { | ||
local inp="$1" | ||
local out="$2" | ||
local flag="$3" | ||
|
||
cp "$inp" "$out" | ||
cat <<EOF >> "$out" | ||
Block FlexibleSUSY | ||
2 $flag # algorithm (0 = two_scale, 1 = root) | ||
EOF | ||
} | ||
|
||
run() { | ||
local inp="$1" | ||
local out="$2" | ||
|
||
echo "running SM point ... " | ||
echo "SM SLHA input file: $inp" | ||
echo "SM SLHA output file: $out" | ||
$sm_exe --slha-input-file="$inp" --slha-output-file="$out" > /dev/null 2>&1 | ||
if test "$?" -ne 0; then | ||
echo "Error: SM failed" | ||
echo "Test status: FAIL" | ||
exit 1 | ||
fi | ||
echo "done" | ||
} | ||
|
||
compare() { | ||
local a="$1" | ||
local b="$2" | ||
local max_diff="$3" | ||
local diff | ||
|
||
a_bc="`echo ${a} | sed -e 's/[eE]+*/\\*10\\^/'`" | ||
b_bc="`echo ${b} | sed -e 's/[eE]+*/\\*10\\^/'`" | ||
|
||
diff=$(cat <<EOF | bc $BASEDIR/abs.bc | ||
scale=10 | ||
abs($a_bc - $b_bc) / ($a_bc) < $max_diff | ||
EOF | ||
) | ||
return $diff | ||
} | ||
|
||
create_input "${sm_input}" "${sm_two_scale_input}" 0 | ||
create_input "${sm_input}" "${sm_root_input}" 1 | ||
|
||
run "$sm_two_scale_input" "$sm_two_scale_output" | ||
run "$sm_root_input" "$sm_root_output" | ||
|
||
mh_ts="`grep hh $sm_two_scale_output | awk '{ print $2 }'`" | ||
mh_ro="`grep hh $sm_root_output | awk '{ print $2 }'`" | ||
|
||
if compare "$mh_ts" "$mh_ro" "$rel_error" ; then | ||
echo "Error: relative difference between" | ||
echo " $mh_ts and $mh_ro is larger than $rel_error" | ||
echo "Test status: FAIL" | ||
exit 1 | ||
else | ||
echo "Test status: OK" | ||
fi | ||
|
||
exit 0 |