Skip to content

Commit

Permalink
Merge both yields and eff
Browse files Browse the repository at this point in the history
  • Loading branch information
saganatt committed Dec 11, 2024
1 parent 07b8dd9 commit 910cf31
Showing 1 changed file with 48 additions and 33 deletions.
81 changes: 48 additions & 33 deletions PWGHF/D2H/Macros/merge-fdd-inputs-sept-approvals.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,54 @@
FD_12=(0.00 0.21 0.24 0.27 0.30 0.33 0.35 0.37 0.39 0.41 0.44 0.46 0.48 0.50 0.52 0.54 0.56 0.58)
FD_12_OLD=(0.00 0.21 0.24 0.27 0.30 0.33 0.35 0.37 0.39 0.41 0.44 0.46 0.48 0.50 0.52 0.54 0.55 0.58)

PTRN_212="/data8/majak/MLHEP/input-fd-23082024/yields-fd_precise_rebin4_bkg_0.20_0.60_fd_"
SUFFIX_212="-fixed-sigma.root"
PTRN_1224="/data8/majak/MLHEP/input-fd-10092024/yields-fd_precise_1224_split_bkg_0.60_0.60_fd_"
SUFFIX_1224="-fixed-sigma.root"

for i in "${!FD_12[@]}" ; do
INPUT_12="/data8/majak/MLHEP/input-fd-23082024/yields-bkg_0.20_0.60_fd_${FD_12[i]}-rebin-1-fixed-sigma.root"
INPUT_212=${PTRN_212}${FD_12_OLD[i]}*[0-9][0-9]${SUFFIX_212}

# dummy loop to get shell expansion in INPUT_1224
for f in ${PTRN_1224}${FD_12_OLD[i]}*[0-9][0-9]${SUFFIX_1224} ; do
INPUT_1224=${f}
suffix=${INPUT_1224[0]##${PTRN_1224}}
suffix=${suffix%%${SUFFIX_1224}}
OUTFILE=merged_yields_fdd_approvals_fd_${suffix}.root

echo "${i}"
echo "INPUT_12: ${INPUT_12}"
echo "INPUT_212: " ${INPUT_212}
echo "INPUT_1224: " ${INPUT_1224}
echo "suffix: " ${suffix}
echo "outfile: " ${OUTFILE}

python merge_histos.py -o /data8/majak/crosssec/${OUTFILE} \
-i ${INPUT_12} \
-i ${INPUT_212} \
-i ${INPUT_212} \
-i ${INPUT_212} \
-i ${INPUT_212} \
-i ${INPUT_212} \
-i ${INPUT_212} \
-i ${INPUT_1224} \
-i ${INPUT_1224}
DIR_12="/data8/majak/MLHEP/input-fd-23082024"
PTRN_12=("${DIR_12}/yields-bkg_0.20_0.60_fd_" "${DIR_12}/efficienciesLcpKpiRun3analysis_pt-weight_bkg_0.20_0.60_fd_")
SUFFIX_12=("-rebin-1-fixed-sigma.root" ".root")
DIR_212="/data8/majak/MLHEP/input-fd-23082024"
PTRN_212=("${DIR_212}/yields-fd_precise_rebin4_bkg_0.20_0.60_fd_" "${DIR_212}/efficienciesLcpKpiRun3analysis_fd_precise_rebin4_bkg_0.20_0.60_fd_")
SUFFIX_212=("-fixed-sigma.root" ".root")
DIR_1224="/data8/majak/MLHEP/input-fd-10092024"
PTRN_1224=("${DIR_1224}/yields-fd_precise_1224_split_bkg_0.60_0.60_fd_" "${DIR_1224}/efficienciesLcpKpiRun3analysis_1224_split_bkg_0.60_0.60_fd_")
SUFFIX_1224=("-fixed-sigma.root" ".root")

OUTFILE_PTRN=("merged_yields_fdd_approvals_fd_" "merged_eff_fdd_approvals_fd_")

for k in "${!PTRN_12[@]}" ; do
echo "k ${k}"
echo "PTRN_12: ${PTRN_12}"
echo "PTRN_12[k]: ${PTRN_12[k]}"
echo "PTRN_212[k]: ${PTRN_212[k]}"
echo "PTRN_1224[k]: ${PTRN_1224[k]}"

for i in "${!FD_12[@]}" ; do
INPUT_12=${PTRN_12[k]}${FD_12[i]}${SUFFIX_12[k]}
INPUT_212=${PTRN_212[k]}${FD_12_OLD[i]}*[0-9][0-9]${SUFFIX_212[k]}

# dummy loop to get shell expansion in INPUT_1224
for f in ${PTRN_1224[k]}${FD_12_OLD[i]}*[0-9][0-9]${SUFFIX_1224[k]} ; do
INPUT_1224=${f}
suffix=${INPUT_1224[0]##${PTRN_1224[k]}}
suffix=${suffix%%${SUFFIX_1224[k]}}
OUTFILE=${OUTFILE_PTRN[k]}${suffix}.root

echo "i ${i} k ${k}"
echo "INPUT_12: ${INPUT_12}"
echo "INPUT_212: " ${INPUT_212}
echo "INPUT_1224: " ${INPUT_1224}
echo "suffix: " ${suffix}
echo "outfile: " ${OUTFILE}

python merge_histos.py -o /data8/majak/crosssec/${OUTFILE} \
-i ${INPUT_12} \
-i ${INPUT_212} \
-i ${INPUT_212} \
-i ${INPUT_212} \
-i ${INPUT_212} \
-i ${INPUT_212} \
-i ${INPUT_212} \
-i ${INPUT_1224} \
-i ${INPUT_1224}
done
done
done

Expand Down

0 comments on commit 910cf31

Please sign in to comment.