Skip to content

Commit

Permalink
Merge pull request #24 from JeffersonLab/DEV
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
T-Britton authored Sep 5, 2017
2 parents 032a327 + 0553959 commit 024831a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 9 deletions.
16 changes: 15 additions & 1 deletion MCwrapper/MakeMC.csh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ setenv CALIBTIME $1
set wholecontext = $VERSION
if($CALIBTIME != "notime") then
set wholecontext = "variation=$VERSION calibtime=$CALIBTIME"
else
set wholecontext = "variation=$VERSION"
endif
setenv JANA_CALIB_CONTEXT "$wholecontext"
shift
Expand Down Expand Up @@ -124,12 +126,12 @@ endif
setenv COHERENT_PEAK $copeak
setenv eBEAM_ENERGY $elecE


# PRINT INPUTS
echo "Job started: " `date`
echo "sqlite path: " $SQLITEPATH
echo "Producing file number: "$FILE_NUMBER
echo "Containing at most "$PER_FILE" events"
echo "Running location:" $RUNNING_DIR
echo "Output location: "$OUTDIR
echo "Environment file: " $ENVIRONMENT
echo "Context: "$JANA_CALIB_CONTEXT
Expand All @@ -153,8 +155,20 @@ echo "=============================================="
echo ""
echo ""


if (! -d $RUNNING_DIR) then
mkdir $RUNNING_DIR
endif

cd $RUNNING_DIR

if(! -d $RUNNING_DIR/${RUN_NUMBER}_${FILE_NUMBER}) then
mkdir $RUNNING_DIR/${RUN_NUMBER}_${FILE_NUMBER}
endif

cd $RUNNING_DIR/${RUN_NUMBER}_${FILE_NUMBER}


#necessary to run swif, uses local directory if swif=0 is used
if ( "$BATCHRUN" != "0" ) then
# ENVIRONMENT
Expand Down
25 changes: 19 additions & 6 deletions MCwrapper/MakeMC.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ export FILE_NUMBER=$1
shift
export EVT_TO_GEN=$1
shift
export VERSION $1
export VERSION=$1
shift
export CALIBTIME $1
export CALIBTIME=$1
wholecontext=$VERSION
if [[ $CALIBTIME != "notime" ]]; then
if [[ "$CALIBTIME" != "notime" ]]; then
wholecontext="variation=$VERSION calibtime=$CALIBTIME"
else
wholecontext="variation=$VERSION"
fi
setenv JANA_CALIB_CONTEXT "$wholecontext"
export JANA_CALIB_CONTEXT="$wholecontext"
shift
export GENR=$1
shift
Expand Down Expand Up @@ -127,6 +129,7 @@ export eBEAM_ENERGY=$elecE
echo "Job started: " `date`
echo "Producing file number: "$FILE_NUMBER
echo "Containing at most "$PER_FILE" events"
echo "Running location:" $RUNNING_DIR
echo "Output location: "$OUTDIR
echo "Environment file: " $ENVIRONMENT
echo "Context: "$JANA_CALIB_CONTEXT
Expand All @@ -149,8 +152,18 @@ echo "=============================================="
echo ""
echo ""

if [[ ! -d $RUNNING_DIR ]]; then
mkdir $RUNNING_DIR
fi

cd $RUNNING_DIR

if [[ ! -d $RUNNING_DIR/${RUN_NUMBER}_${FILE_NUMBER} ]]; then
mkdir $RUNNING_DIR/${RUN_NUMBER}_${FILE_NUMBER}
fi

cd $RUNNING_DIR/${RUN_NUMBER}_${FILE_NUMBER}

#printenv
#necessary to run swif, uses local directory if swif=0 is used
if [[ "$BATCHRUN" != "0" ]]; then
Expand Down Expand Up @@ -541,7 +554,7 @@ if [[ "$GENR" != "0" ]]; then

if [[ -f dana_rest.hddm ]]; then
mv dana_rest.hddm dana_rest_$STANDARD_NAME.hddm
fi
fi


if [[ "$CLEANGEANT" == "1" ]]; then
Expand Down Expand Up @@ -578,7 +591,7 @@ if [[ "$GENR" != "0" ]]; then
done
fi
fi
fi
fi
fi
if [[ "$gen_pre" != "file" ]]; then
mv $PWD/*.conf $OUTDIR/configurations/generation/
Expand Down
4 changes: 2 additions & 2 deletions MCwrapper/gluex_MC.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def main(argv):

print "*********************************"
print "Welcome to v1.8.0 of the MCwrapper"
print "Thomas Britton 09/1/17"
print "Thomas Britton 09/4/17"
print "*********************************"

#load all argument passed in and set default options
Expand Down Expand Up @@ -461,7 +461,7 @@ def main(argv):

COMMAND=ENVFILE+" "+GENCONFIG+" "+str(outdir)+" "+str(RUNNUM)+" "+str(FILENUM-1)+" "+str(num)+" "+str(VERSION)+" "+str(CALIBTIME)+" "+str(GENR)+" "+str(GEANT)+" "+str(SMEAR)+" "+str(RECON)+" "+str(CLEANGENR)+" "+str(CLEANGEANT)+" "+str(CLEANSMEAR)+" "+str(CLEANRECON)+" "+str(BATCHRUN)+" "+str(BATCHRUN)+" "+str(NCORES).split(':')[-1]+" "+str(GENERATOR)+" "+str(GEANTVER)+" "+str(BGFOLD)+" "+str(CUSTOM_GCONTROL)+" "+str(eBEAM_ENERGY)+" "+str(COHERENT_PEAK)+" "+str(MIN_GEN_ENERGY)+" "+str(MAX_GEN_ENERGY)+" "+str(TAGSTR)+" "+str(CUSTOM_PLUGINS)+" "+str(PERFILE)+" "+str(RUNNING_DIR)+" "+str(SQLITEPATH)

#print COMMAND
#print COMMAND
#either call MakeMC.csh or add a job depending on swif flag
if BATCHRUN == 0 or BATCHSYS=="NULL":
os.system(str(indir)+" "+COMMAND)
Expand Down

0 comments on commit 024831a

Please sign in to comment.