#!/usr/bin/env bash

echo "starting run at " $(date)
pwd
ls -la

config="analysis/config.yaml"
release="build"
cmshome="/home/dominguez/cfangmeier/EGamma/CMSSW_9_2_8/src/"

job_dir="job_${1}"
mkdir -p $job_dir

source /cvmfs/cms.cern.ch/cmsset_default.sh
cd $cmshome
pwd
# cmsenv
eval `scramv1 runtime -sh`
cd -

cp ./$release/tracking_eff $job_dir
cp ${config} ${job_dir}/config.yaml

./${job_dir}/tracking_eff -b -c ${job_dir}/config.yaml source-file-key=${1}
