From 55df4126007720348a363b29fd4831d0e6ba5098 Mon Sep 17 00:00:00 2001 From: tbritton Date: Wed, 19 Apr 2017 09:18:42 -0400 Subject: [PATCH] small enhancement in robustness of jana config files --- MCwrapper/MakeMC.csh | 13 ++++++++++--- MCwrapper/MakeMC.sh | 14 ++++++++++---- MCwrapper/examples/MC.config | 0 3 files changed, 20 insertions(+), 7 deletions(-) mode change 100644 => 100755 MCwrapper/examples/MC.config diff --git a/MCwrapper/MakeMC.csh b/MCwrapper/MakeMC.csh index 03710dbd..b924b9e9 100755 --- a/MCwrapper/MakeMC.csh +++ b/MCwrapper/MakeMC.csh @@ -176,6 +176,14 @@ if ( "$BKGFOLDSTR" == "DEFAULT" ) then endif endif + +set recon_pre=`echo $CUSTOM_PLUGINS | cut -c1-4` +set jana_config_file=`echo $CUSTOM_PLUGINS | sed -r 's/^.{5}//'` + +if ( -f $jana_config_file ) then +cp $jana_config_file ./jana_config.cfg +endif + set gen_pre="" if ( "$GENR" != "0" ) then @@ -372,12 +380,11 @@ if ( "$GENR" != "0" ) then if ( "$RECON" != "0" ) then echo "RUNNING RECONSTRUCTION" - set recon_pre=`echo $CUSTOM_PLUGINS | cut -c1-4` + if ( "$recon_pre" == "file" ) then - set jana_config_file=`echo $CUSTOM_PLUGINS | sed -r 's/^.{5}//'` echo "using config file: "$jana_config_file - hd_root ./$STANDARD_NAME'_geant'$GEANTVER'_smeared.hddm' --config=$jana_config_file -PNTHREADS=$NUMTHREADS + hd_root ./$STANDARD_NAME'_geant'$GEANTVER'_smeared.hddm' --config=jana_config.cfg -PNTHREADS=$NUMTHREADS else set pluginlist=("danarest" "monitoring_hists") diff --git a/MCwrapper/MakeMC.sh b/MCwrapper/MakeMC.sh index e4ffc6b0..3252b53d 100755 --- a/MCwrapper/MakeMC.sh +++ b/MCwrapper/MakeMC.sh @@ -177,6 +177,15 @@ if [[ "$BKGFOLDSTR" == "DEFAULT" ]]; then fi fi + +recon_pre=`echo $CUSTOM_PLUGINS | cut -c1-4` +jana_config_file=`echo $CUSTOM_PLUGINS | sed -r 's/^.{5}//'` + +if [[ -f $jana_config_file ]]; then +echo "gathering jana config file" +cp $jana_config_file ./jana_config.cfg +fi + gen_pre="" if [[ "$GENR" != "0" ]]; then @@ -371,13 +380,10 @@ if [[ "$GENR" != "0" ]]; then if [[ "$RECON" != "0" ]]; then echo "RUNNING RECONSTRUCTION" - - recon_pre=`echo $CUSTOM_PLUGINS | cut -c1-4` if [[ "$recon_pre" == "file" ]]; then - jana_config_file=`echo $CUSTOM_PLUGINS | sed -r 's/^.{5}//'` echo "using config file: "$jana_config_file - hd_root ./$STANDARD_NAME'_geant'$GEANTVER'_smeared.hddm' --config=$jana_config_file -PNTHREADS=$NUMTHREADS + hd_root ./$STANDARD_NAME'_geant'$GEANTVER'_smeared.hddm' --config=jana_config.cfg -PNTHREADS=$NUMTHREADS else declare -a pluginlist=("danarest" "monitoring_hists") diff --git a/MCwrapper/examples/MC.config b/MCwrapper/examples/MC.config old mode 100644 new mode 100755