Skip to content

Commit

Permalink
Adding in some new scripts that are actually functioning within the W…
Browse files Browse the repository at this point in the history
…AC's make_grand_plots.sh scripts. Probably should have made the differences come as a command line argument, but this was the easiest hack at the time
  • Loading branch information
cameronc137 authored and Parity Account committed Apr 29, 2020
1 parent ef7304a commit 3e64b90
Show file tree
Hide file tree
Showing 9 changed files with 306 additions and 0 deletions.
34 changes: 34 additions & 0 deletions rootScripts/merger/smartHadd_miniruns_AT_regression.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#! /bin/sh
ROOTFILEDIR="/chafs2/work1/apar/aggRootfiles/AT/minirun_aggregator_#_#.root"
OUTPUTROOTFILEDIR="/chafs2/work1/apar/aggRootfiles/AT/slugRootfiles/"
#OUTPUTROOTFILEDIR="./"
if [ "$#" -lt 1 ]; then
echo "Error: Need to pass a list file name"
echo "Usage: ./smartHadd_miniruns_regression.sh list.txt (input file list, \\n separated) outputFileName (a name..., optional argument)"
else
IFS=$'\n' read -d '' -r -a lines < ${1}
# all lines
echo "Hadding all runs: ${lines[@]}"
#minirun_lines=("${lines[@]}")
minirun_lines=()
#run_lines=("${lines[@]}")
num_lines=0
num_miniruns=0

# Do miniruns
for i in "${!lines[@]}"; do
# run_temp="${ROOTFILEDIR}/grandRootfile_${lines[$i]}/grand_aggregator.root"
#run_lines[$i]=$run_temp
num_lines=$i
done

slug=`rcnd ${lines[0]} slug`
name=minirun_slug${slug}.root
if [ "$#" -ge 2 ]; then
name=$2
fi
root -l -b -q ~/PREX/japan/rootScripts/merger/smartHadd_miniruns.C\(\"${1}\",\"${ROOTFILEDIR}\",\"${OUTPUTROOTFILEDIR}/${name}\",\"run_number\",\"minirun_n\",\"agg\"\)

# Add units
root -l -b -q ~/PREX/prompt/Aggregator/wrapper/addUnits.C\(\"${OUTPUTROOTFILEDIR}/${name}\"\)
fi
33 changes: 33 additions & 0 deletions rootScripts/merger/smartHadd_miniruns_CREX_regression.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#! /bin/sh
ROOTFILEDIR="/chafs2/work1/apar/aggRootfiles/slugRootfiles/minirun_slug#.root"
OUTPUTROOTFILEDIR="/chafs2/work1/apar/aggRootfiles/slugRootfiles/grandRootfile/"
#OUTPUTROOTFILEDIR="./"
if [ "$#" -lt 1 ]; then
echo "Error: Need to pass a list file name \"....\".list"
echo "Usage: ./smartHadd_slug_regression.sh list.txt (input file list, \\n separated) outputFileName (a name..., optional argument)"
else
IFS=$'\n' read -d '' -r -a lines < ${1}
# all lines
echo "Hadding all runs: ${lines[@]}"
#minirun_lines=("${lines[@]}")
minirun_lines=()
#run_lines=("${lines[@]}")
num_lines=0
num_miniruns=0

# Do miniruns
for i in "${!lines[@]}"; do
# run_temp="${ROOTFILEDIR}/grandRootfile_${lines[$i]}/grand_aggregator.root"
#run_lines[$i]=$run_temp
num_lines=$i
done

name="${lines[0]}-${lines[$num_lines]}"
if [ "$#" -ge 2 ]; then
name=$2
fi
root -l -b -q ~/PREX/japan/rootScripts/merger/smartHadd.C\(\"${1}\",\"${ROOTFILEDIR}\",\"${OUTPUTROOTFILEDIR}/grand_CREX_${name}.root\",\"run_number\",\"minirun_n\",\"agg\"\)

# Add units
root -l -b -q ~/PREX/prompt/Aggregator/wrapper/addUnits.C\(\"${OUTPUTROOTFILEDIR}/grand_CREX_${name}.root\"\)
fi
34 changes: 34 additions & 0 deletions rootScripts/merger/smartHadd_miniruns_PQB.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#! /bin/sh
ROOTFILEDIR="/chafs2/work1/apar/aggRootfiles/PQB/minirun_aggregator_#_#.root"
OUTPUTROOTFILEDIR="/chafs2/work1/apar/aggRootfiles/slugRootfiles/PQB/"
#OUTPUTROOTFILEDIR="./"
if [ "$#" -lt 1 ]; then
echo "Error: Need to pass a list file name"
echo "Usage: ./smartHadd_miniruns_dithering.sh list.txt (input file list, \\n separated) outputFileName (a name..., optional argument)"
else
IFS=$'\n' read -d '' -r -a lines < ${1}
# all lines
echo "Hadding all runs: ${lines[@]}"
#minirun_lines=("${lines[@]}")
minirun_lines=()
#run_lines=("${lines[@]}")
num_lines=0
num_miniruns=0

# Do miniruns
for i in "${!lines[@]}"; do
# run_temp="${ROOTFILEDIR}/grandRootfile_${lines[$i]}/grand_aggregator.root"
#run_lines[$i]=$run_temp
num_lines=$i
done

slug=`rcnd ${lines[0]} slug`
name=minirun_slug${slug}.root
if [ "$#" -ge 2 ]; then
name=$2
fi
root -l -b -q ~/PREX/japan/rootScripts/merger/smartHadd_miniruns.C\(\"${1}\",\"${ROOTFILEDIR}\",\"${OUTPUTROOTFILEDIR}/${name}\",\"run_number\",\"minirun_n\",\"agg\"\)

# Add units
root -l -b -q ~/PREX/prompt/Aggregator/wrapper/addUnits.C\(\"${OUTPUTROOTFILEDIR}/${name}\"\)
fi
33 changes: 33 additions & 0 deletions rootScripts/merger/smartHadd_miniruns_PREX_regression.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#! /bin/sh
ROOTFILEDIR="/chafs2/work1/apar/aggRootfiles/PREXII_slugRootfiles/minirun_slug#.root"
OUTPUTROOTFILEDIR="/chafs2/work1/apar/aggRootfiles/PREXII_slugRootfiles/grandRootfile/"
#OUTPUTROOTFILEDIR="./"
if [ "$#" -lt 1 ]; then
echo "Error: Need to pass a list file name \"....\".list"
echo "Usage: ./smartHadd_slug_regression.sh list.txt (input file list, \\n separated) outputFileName (a name..., optional argument)"
else
IFS=$'\n' read -d '' -r -a lines < ${1}
# all lines
echo "Hadding all runs: ${lines[@]}"
#minirun_lines=("${lines[@]}")
minirun_lines=()
#run_lines=("${lines[@]}")
num_lines=0
num_miniruns=0

# Do miniruns
for i in "${!lines[@]}"; do
# run_temp="${ROOTFILEDIR}/grandRootfile_${lines[$i]}/grand_aggregator.root"
#run_lines[$i]=$run_temp
num_lines=$i
done

name="${lines[0]}-${lines[$num_lines]}"
if [ "$#" -ge 2 ]; then
name=$2
fi
root -l -b -q ~/PREX/japan/rootScripts/merger/smartHadd.C\(\"${1}\",\"${ROOTFILEDIR}\",\"${OUTPUTROOTFILEDIR}/grand_PREX_${name}.root\",\"run_number\",\"minirun_n\",\"agg\"\)

# Add units
root -l -b -q ~/PREX/prompt/Aggregator/wrapper/addUnits.C\(\"${OUTPUTROOTFILEDIR}/grand_PREX_${name}.root\"\)
fi
34 changes: 34 additions & 0 deletions rootScripts/merger/smartHadd_miniruns_burp_regression.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#! /bin/sh
ROOTFILEDIR="/chafs2/work1/apar/aggRootfiles/burp/minirun_aggregator_#_#.root"
OUTPUTROOTFILEDIR="/chafs2/work1/apar/aggRootfiles/burp/slugRootfiles/"
#OUTPUTROOTFILEDIR="./"
if [ "$#" -lt 1 ]; then
echo "Error: Need to pass a list file name"
echo "Usage: ./smartHadd_miniruns_regression.sh list.txt (input file list, \\n separated) outputFileName (a name..., optional argument)"
else
IFS=$'\n' read -d '' -r -a lines < ${1}
# all lines
echo "Hadding all runs: ${lines[@]}"
#minirun_lines=("${lines[@]}")
minirun_lines=()
#run_lines=("${lines[@]}")
num_lines=0
num_miniruns=0

# Do miniruns
for i in "${!lines[@]}"; do
# run_temp="${ROOTFILEDIR}/grandRootfile_${lines[$i]}/grand_aggregator.root"
#run_lines[$i]=$run_temp
num_lines=$i
done

slug=`rcnd ${lines[0]} slug`
name=minirun_slug${slug}.root
if [ "$#" -ge 2 ]; then
name=$2
fi
root -l -b -q ~/PREX/japan/rootScripts/merger/smartHadd_miniruns.C\(\"${1}\",\"${ROOTFILEDIR}\",\"${OUTPUTROOTFILEDIR}/${name}\",\"run_number\",\"minirun_n\",\"agg\"\)

# Add units
root -l -b -q ~/PREX/prompt/Aggregator/wrapper/addUnits.C\(\"${OUTPUTROOTFILEDIR}/${name}\"\)
fi
38 changes: 38 additions & 0 deletions rootScripts/merger/smartHadd_miniruns_dithering.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#! /bin/sh
stub=""
if [ "$#" -ge 3 ]; then
stub=$3
fi
ROOTFILEDIR="/chafs2/work1/apar/aggRootfiles/dithering${stub}/minirun_aggregator_#_#.root"
OUTPUTROOTFILEDIR="/chafs2/work1/apar/aggRootfiles/slugRootfiles/dithering${stub}/"
#OUTPUTROOTFILEDIR="./"
if [ "$#" -lt 1 ]; then
echo "Error: Need to pass a list file name"
echo "Usage: ./smartHadd_miniruns_dithering.sh list.txt (input file list, \\n separated) outputFileName (a name..., optional argument) stub (a stub argument for dithering analysis... i.e. \"_1X\")"
else
IFS=$'\n' read -d '' -r -a lines < ${1}
# all lines
echo "Hadding all runs: ${lines[@]}"
#minirun_lines=("${lines[@]}")
minirun_lines=()
#run_lines=("${lines[@]}")
num_lines=0
num_miniruns=0

# Do miniruns
for i in "${!lines[@]}"; do
# run_temp="${ROOTFILEDIR}/grandRootfile_${lines[$i]}/grand_aggregator.root"
#run_lines[$i]=$run_temp
num_lines=$i
done

slug=`rcnd ${lines[0]} slug`
name=minirun_slug${slug}.root
if [ "$#" -ge 2 ]; then
name=$2
fi
root -l -b -q ~/PREX/japan/rootScripts/merger/smartHadd_miniruns.C\(\"${1}\",\"${ROOTFILEDIR}\",\"${OUTPUTROOTFILEDIR}/${name}\",\"run_number\",\"minirun_n\",\"agg\"\)

# Add units
root -l -b -q ~/PREX/prompt/Aggregator/wrapper/addUnits.C\(\"${OUTPUTROOTFILEDIR}/${name}\"\)
fi
34 changes: 34 additions & 0 deletions rootScripts/merger/smartHadd_miniruns_regression.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#! /bin/sh
ROOTFILEDIR="/chafs2/work1/apar/aggRootfiles/minirun_aggregator_#_#.root"
OUTPUTROOTFILEDIR="/chafs2/work1/apar/aggRootfiles/slugRootfiles/"
#OUTPUTROOTFILEDIR="./"
if [ "$#" -lt 1 ]; then
echo "Error: Need to pass a list file name"
echo "Usage: ./smartHadd_miniruns_regression.sh list.txt (input file list, \\n separated) outputFileName (a name..., optional argument)"
else
IFS=$'\n' read -d '' -r -a lines < ${1}
# all lines
echo "Hadding all runs: ${lines[@]}"
#minirun_lines=("${lines[@]}")
minirun_lines=()
#run_lines=("${lines[@]}")
num_lines=0
num_miniruns=0

# Do miniruns
for i in "${!lines[@]}"; do
# run_temp="${ROOTFILEDIR}/grandRootfile_${lines[$i]}/grand_aggregator.root"
#run_lines[$i]=$run_temp
num_lines=$i
done

slug=`rcnd ${lines[0]} slug`
name=minirun_slug${slug}.root
if [ "$#" -ge 2 ]; then
name=$2
fi
root -l -b -q ~/PREX/japan/rootScripts/merger/smartHadd_miniruns.C\(\"${1}\",\"${ROOTFILEDIR}\",\"${OUTPUTROOTFILEDIR}/${name}\",\"run_number\",\"minirun_n\",\"agg\"\)

# Add units
root -l -b -q ~/PREX/prompt/Aggregator/wrapper/addUnits.C\(\"${OUTPUTROOTFILEDIR}/${name}\"\)
fi
33 changes: 33 additions & 0 deletions rootScripts/merger/smartHadd_slug_AT_regression.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#! /bin/sh
ROOTFILEDIR="/chafs2/work1/apar/aggRootfiles/AT/slugRootfiles/grandRootfile_#/grand_aggregator.root"
OUTPUTROOTFILEDIR="/chafs2/work1/apar/aggRootfiles/AT/slugRootfiles/grandRootfile/"
#OUTPUTROOTFILEDIR="./"
if [ "$#" -lt 1 ]; then
echo "Error: Need to pass a list file name number \"slug##\".list"
echo "Usage: ./smartHadd_slug_regression.sh list.txt (input file list, \\n separated) outputFileName (a name..., optional argument)"
else
IFS=$'\n' read -d '' -r -a lines < ${1}
# all lines
echo "Hadding all runs: ${lines[@]}"
#minirun_lines=("${lines[@]}")
minirun_lines=()
#run_lines=("${lines[@]}")
num_lines=0
num_miniruns=0

# Do miniruns
for i in "${!lines[@]}"; do
# run_temp="${ROOTFILEDIR}/grandRootfile_${lines[$i]}/grand_aggregator.root"
#run_lines[$i]=$run_temp
num_lines=$i
done

name="${lines[0]}-${lines[$num_lines]}"
if [ "$#" -ge 2 ]; then
name=$2
fi
root -l -b -q ~/PREX/japan/rootScripts/merger/smartHadd.C\(\"${1}\",\"${ROOTFILEDIR}\",\"${OUTPUTROOTFILEDIR}/grand_${name}.root\",\"n_runs\",\"run_number\",\"agg\"\)

# Add units
root -l -b -q ~/PREX/prompt/Aggregator/wrapper/addUnits.C\(\"${OUTPUTROOTFILEDIR}/grand_${name}.root\"\)
fi
33 changes: 33 additions & 0 deletions rootScripts/merger/smartHadd_slug_burp_regression.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#! /bin/sh
ROOTFILEDIR="/chafs2/work1/apar/aggRootfiles/burp/slugRootfiles/grandRootfile_#/grand_aggregator.root"
OUTPUTROOTFILEDIR="/chafs2/work1/apar/aggRootfiles/burp/slugRootfiles/grandRootfile/"
#OUTPUTROOTFILEDIR="./"
if [ "$#" -lt 1 ]; then
echo "Error: Need to pass a list file name number \"slug##\".list"
echo "Usage: ./smartHadd_slug_regression.sh list.txt (input file list, \\n separated) outputFileName (a name..., optional argument)"
else
IFS=$'\n' read -d '' -r -a lines < ${1}
# all lines
echo "Hadding all runs: ${lines[@]}"
#minirun_lines=("${lines[@]}")
minirun_lines=()
#run_lines=("${lines[@]}")
num_lines=0
num_miniruns=0

# Do miniruns
for i in "${!lines[@]}"; do
# run_temp="${ROOTFILEDIR}/grandRootfile_${lines[$i]}/grand_aggregator.root"
#run_lines[$i]=$run_temp
num_lines=$i
done

name="${lines[0]}-${lines[$num_lines]}"
if [ "$#" -ge 2 ]; then
name=$2
fi
root -l -b -q ~/PREX/japan/rootScripts/merger/smartHadd.C\(\"${1}\",\"${ROOTFILEDIR}\",\"${OUTPUTROOTFILEDIR}/grand_${name}.root\",\"n_runs\",\"run_number\",\"agg\"\)

# Add units
root -l -b -q ~/PREX/prompt/Aggregator/wrapper/addUnits.C\(\"${OUTPUTROOTFILEDIR}/grand_${name}.root\"\)
fi

0 comments on commit 3e64b90

Please sign in to comment.