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

Robustness of switch defaults

Allows a non standard install directory for cbmroot.

Updates the geometry repository tags.
parent 7e110f6f
No related branches found
No related tags found
1 merge request!646Updates geometry tags, shifted geometries
...@@ -5,17 +5,22 @@ ...@@ -5,17 +5,22 @@
echo "programme starts" echo "programme starts"
if false; then # Detecting the GEOMETRY and PARAMETER GIT DIRECTORIES
if [ -z ${VMWORKDIR} ]; if [ -d ${PWD}/../../geometry/.git -a -d ${PWD}/../../parameters/.git ]; then
then GEO_SRC_DIR="$PWD/../../geometry"
cat << EOT PAR_SRC_DIR="$PWD/../../parameters"
BUILT AND CONFIGURATION CBMROOT ENIVORNMENT NOT DETECTED\n cd $PWD/../run
HAVE YOU RUN_SRC_DIR=$PWD
. build/config.sh -a cd -
SCRIPTS REQUIRES A RUNNING SYSTEM. else
EOT if [ -z ${VMWORKDIR} -a -d ${VMCWORKDIR}/geometry/.git -a -d ${VMCWORKDIR}/parameters/.git ]; then
exit PAR_SRC_DIR="${VMCWORKDIR}/parameters"
fi GEO_SRC_DIR="${VMCWORKDIR}/geometry"
RUN_SRC_DIR="${VMCWORKDIR}/macro/run"
else
echo "Geometry or Parameter Git Source Directory not detected"
exit
fi
fi fi
# TAG FOR THE OFFICIAL APR 2019 CBMROOT SW Release # TAG FOR THE OFFICIAL APR 2019 CBMROOT SW Release
...@@ -34,9 +39,6 @@ TEST_PARATAG="21bed5c5e746efdb63b696f4053b9e5f65f940a8" ...@@ -34,9 +39,6 @@ TEST_PARATAG="21bed5c5e746efdb63b696f4053b9e5f65f940a8"
GIT_GEOREPO="https://git.cbm.gsi.de/e.clerkin/cbmroot_geometry.git" GIT_GEOREPO="https://git.cbm.gsi.de/e.clerkin/cbmroot_geometry.git"
GIT_PARAREPO="https://git.cbm.gsi.de/e.clerkin/cbmroot_parameter.git" GIT_PARAREPO="https://git.cbm.gsi.de/e.clerkin/cbmroot_parameter.git"
##########1234567890##########1234567890##########1234567890##########1234567890########## ##########1234567890##########1234567890##########1234567890##########1234567890##########
cat << EOT cat << EOT
******************************************************************************************* *******************************************************************************************
...@@ -57,12 +59,16 @@ EOT ...@@ -57,12 +59,16 @@ EOT
read RELEASE read RELEASE
case "${RELEASE}" in case "${RELEASE}" in
APR20) echo "You specified APR20"; GEOMETRY_TAG=${APR20_GEOTAG}; PARAMETER_TAG=${APR20_PARATAG} ;; APR20) echo "You specified APR20"; GEOMETRY_TAG=${APR20_GEOTAG}; PARAMETER_TAG=${APR20_PARATAG}; TARGET_Z_POS=0 ;;
APR21) echo "You specified APR21"; GEOMETRY_TAG=${APR21_GEOTAG}; PARAMETER_TAG=${APR21_PARATAG} ;; APR21) echo "You specified APR21"; GEOMETRY_TAG=${APR21_GEOTAG}; PARAMETER_TAG=${APR21_PARATAG}; TARGET_Z_POS=0 ;;
TEST) echo "You specified TEST "; GEOMETRY_TAG=${TEST_GEOTAG}; PARAMETER_TAG=${TEST_PARATAG} ;; TEST) echo "You specified ORIGIN_SHIFT "; GEOMETRY_TAG=${TEST_GEOTAG}; PARAMETER_TAG=${TEST_PARATAG}; TARGET_Z_POS=-40 ;;
*) echo "$ANSWER is an unknown option"; exit 1 ;; *) echo "$ANSWER is an unknown option"; exit 1 ;;
esac esac
cat << EOT cat << EOT
Have you read above, and understand that you will need to rerun the script to revert the changes? Have you read above, and understand that you will need to rerun the script to revert the changes?
TYPE Yes for confirmation ???? TYPE Yes for confirmation ????
...@@ -74,10 +80,10 @@ if (echo "${CONFIRMATION}" | sed -n '/^Yes$/!{q10}') ...@@ -74,10 +80,10 @@ if (echo "${CONFIRMATION}" | sed -n '/^Yes$/!{q10}')
then then
echo "Yes typed!" echo "Yes typed!"
sed -i 's/Double_t[[:space:]]targetZpos.*$/Double_t targetZpos = '${TARGET_Z_POS}'/' ${RUN_SRC_DIR}/run_tra_file.C;
# Geometry Repostiory # Geometry Repostiory
cd ${VMCWORKDIR}/geometry cd ${GEO_SRC_DIR}
git checkout ${GEOMETRY_TAG} git checkout ${GEOMETRY_TAG}
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
git fetch ${GIT_GEOREPO} ${GEOMETRY_TAG} git fetch ${GIT_GEOREPO} ${GEOMETRY_TAG}
...@@ -90,7 +96,7 @@ then ...@@ -90,7 +96,7 @@ then
cd $OLDPWD cd $OLDPWD
# Parameter Repository # Parameter Repository
cd ${VMCWORKDIR}/parameters cd ${PAR_SRC_DIR}
git checkout ${PARAMETER_TAG} git checkout ${PARAMETER_TAG}
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
git fetch ${GIT_PARAREPO} ${PARAMETER_TAG} git fetch ${GIT_PARAREPO} ${PARAMETER_TAG}
...@@ -108,17 +114,16 @@ else ...@@ -108,17 +114,16 @@ else
echo "No changed to geometry and parameter repositoroes made" echo "No changed to geometry and parameter repositoroes made"
fi fi
cat << EOT cat << EOT
The position of the target is at ${TARGET_Z_POS} cm from the origin.
You may now run the standard CBMROOT macros, e.g. You may now run the standard CBMROOT macros, e.g.
root -l run_tra_file.C root -l -q ${RUN_SRC_DIR}/run_tra_file.C
root -l run_digi.C root -l -q ${RUN_SRC_DIR}/run_digi.C
root -l run_reco.C root -l -q ${RUN_SRC_DIR}/run_reco.C
and the specified default geometries will be used. To revert these changes, you may re-run this script or rebuild the CBMROOT framework. and the specified default geometries will be used. To revert these changes, you may re-run this script or rebuild the CBMROOT framework.
EOT EOT
echo "Program Ended" echo "Program Ended"
...@@ -103,12 +103,14 @@ void run_tra_file(const char* input = "", Int_t nEvents = 1, const char* output ...@@ -103,12 +103,14 @@ void run_tra_file(const char* input = "", Int_t nEvents = 1, const char* output
// For flexibility, the target volume is not part of the predefined // For flexibility, the target volume is not part of the predefined
// geometry setup. It thus has to be specified in this macro. By default, // geometry setup. It thus has to be specified in this macro. By default,
// a Gold target of 250 micrometer thickness and 2.5 cm diameter is used. // a Gold target of 250 micrometer thickness and 2.5 cm diameter is used.
// The target shifts by 4 cm upstream by decision of the technical board
// in Apr 2020 which is 40 cm from center of magnet.
const char* targetMedium = "Gold"; const char* targetMedium = "Gold";
Double_t targetThickness = 0.025; // in cm Double_t targetThickness = 0.025; // in cm
Double_t targetDiameter = 2.5; // in cm Double_t targetDiameter = 2.5; // in cm
Double_t targetZpos = -40
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
// ----- Beam properties ---------------------------------------------- // ----- Beam properties ----------------------------------------------
// The beam particles themselves are not subject to the transport, // The beam particles themselves are not subject to the transport,
// but the properties of the beam determine where the main collision // but the properties of the beam determine where the main collision
...@@ -149,7 +151,8 @@ void run_tra_file(const char* input = "", Int_t nEvents = 1, const char* output ...@@ -149,7 +151,8 @@ void run_tra_file(const char* input = "", Int_t nEvents = 1, const char* output
run.SetParFileName(parFile); run.SetParFileName(parFile);
run.SetGeoFileName(geoFile); run.SetGeoFileName(geoFile);
run.LoadSetup(setup); run.LoadSetup(setup);
run.SetTarget(targetMedium, targetThickness, targetDiameter); // run.SetTarget(targetMedium, targetThickness, targetDiameter);
run.SetTarget(targetMedium, targetThickness, targetDiameter, 0, 0, targetZpos);
run.SetBeamPosition(beamPosX, beamPosY, beamSigmaX, beamSigmaY); run.SetBeamPosition(beamPosX, beamPosY, beamSigmaX, beamSigmaY);
if (rotateEvents) run.SetRandomEventPlane(); if (rotateEvents) run.SetRandomEventPlane();
run.SetRandomSeed(randomSeed); run.SetRandomSeed(randomSeed);
......
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