Skip to content
Snippets Groups Projects
Commit 54e2ed6e authored by Sylvester Joosten's avatar Sylvester Joosten
Browse files

Resolve "Magnet settings in compact file should be beam energy dependent"

parent 6cc1bfab
No related branches found
No related tags found
No related merge requests found
......@@ -131,7 +131,8 @@ dump_geometry:
- sed -i '/forward_ion_beamline/d' ${DETECTOR_PATH}/athena.xml
- sed -i '/beampipe_hadron_B0/d' ${DETECTOR_PATH}/athena.xml
- sed -i '/B0_/d' ${DETECTOR_PATH}/athena.xml
- sed -i '/far_forward/d' ${DETECTOR_PATH}/athena.xml
- sed -i '/far_forward_offM/d' ${DETECTOR_PATH}/athena.xml
- sed -i '/far_forward_detectors/d' ${DETECTOR_PATH}/athena.xml
- sed -i '/roman_pots/d' ${DETECTOR_PATH}/athena.xml
- sed -i '/inner_vacuum_FF_magnets/d' ${DETECTOR_PATH}/athena.xml
- dd_web_display --output geo/detector_geo.root ${DETECTOR_PATH}/athena.xml
......
......@@ -34,6 +34,7 @@
These files have only a define tags.
</documentation>
<include ref="ip6/ip6_defs.xml" />
<include ref="ip6/far_forward_fields_275.xml" />
<include ref="compact/definitions.xml" />
</define>
......
#!/bin/bash
function print_the_help {
echo "USAGE: --ebeam E --pbeam E -c compact.xml"
echo "REQUIRED ARGUMENTS:"
echo " -h|--help Print this message"
echo " --ebeam Electron beam energy (5, 10 or 18)"
echo " --pbeam Ion beam energy (41, 100 or 275)"
echo " -c|--compact Compact file to set beam energy for"
exit
}
EBEAM=
PBEAM=
COMPACT=
while [ $# -gt 0 ]
do
key="$1"
case $key in
-h|--help)
print_the_help
;;
--ebeam)
EBEAM=$2
shift
shift
;;
--pbeam)
PBEAM=$2
shift
shift
;;
-c|--compact)
COMPACT=$2
shift
shift
;;
*) # unknown option
echo "unknown option"
exit 1
;;
esac
done
echo "Setting beam energies to $EBEAM on $PBEAM for $COMPACT"
if [ -z $COMPACT ]; then
echo "Error: no compact file given, use -h for help"
exit 1
fi
if [ -z $EBEAM ]; then
echo "Error: --ebeam argument missing, use -h for help"
exit 1
fi
if [ -z $PBEAM ]; then
echo "Error: --pbeam argument missing, use -h for help"
exit 1
fi
if [[ $PBEAM != "41" && $PBEAM != "100" && $PBEAM != "275" ]]; then
echo "Error: Ion beam energy should be 41, 100, or 275 GeV"
exit 1
fi
if [[ $EBEAM != 5 && $EBEAM != 10 && $EBEAM != 18 ]]; then
echo "Error: Electron beam energy should be 5, 10, or 18 GeV"
exit 1
fi
if [ ! -f ${COMPACT} ]; then
echo "Error: Compact file ${COMPACT} does not exist"
exit 1
fi
sed -i "s?far_forward_fields_.\{2,3\}.xml?far_forward_fields_${PBEAM}.xml?" athena.xml
sed -i "s?far_backward_fields_.\{1,2\}.xml?far_backward_fields_${EBEAM}.xml?" athena.xml
......@@ -34,6 +34,7 @@
These files have only a define tags.
</documentation>
<include ref="ip6/ip6_defs.xml" />
<include ref="ip6/far_forward_fields_275.xml" />
<include ref="compact/definitions.xml" />
</define>
......
......@@ -34,6 +34,7 @@
These files have only a define tags.
</documentation>
<include ref="ip6/ip6_defs.xml" />
<include ref="ip6/far_forward_fields_275.xml" />
<include ref="compact/definitions.xml" />
</define>
......
......@@ -34,6 +34,7 @@
These files have only a define tags.
</documentation>
<include ref="ip6/ip6_defs.xml" />
<include ref="ip6/far_forward_fields_275.xml" />
<include ref="compact/definitions.xml" />
</define>
......
......@@ -34,6 +34,7 @@
These files have only a define tags.
</documentation>
<include ref="ip6/ip6_defs.xml" />
<include ref="ip6/far_forward_fields_275.xml" />
<include ref="compact/definitions.xml" />
</define>
......
......@@ -34,6 +34,7 @@
These files have only a define tags.
</documentation>
<include ref="ip6/ip6_defs.xml" />
<include ref="ip6/far_forward_fields_275.xml" />
<include ref="compact/definitions.xml" />
</define>
......
......@@ -34,6 +34,7 @@
These files have only a define tags.
</documentation>
<include ref="ip6/ip6_defs.xml" />
<include ref="ip6/far_forward_fields_275.xml" />
<include ref="compact/definitions.xml" />
</define>
......
......@@ -34,6 +34,7 @@
These files have only a define tags.
</documentation>
<include ref="ip6/ip6_defs.xml" />
<include ref="ip6/far_forward_fields_275.xml" />
<include ref="compact/definitions.xml" />
</define>
......
......@@ -34,6 +34,7 @@
These files have only a define tags.
</documentation>
<include ref="ip6/ip6_defs.xml" />
<include ref="ip6/far_forward_fields_275.xml" />
<include ref="compact/definitions.xml" />
</define>
......
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