From 910cf31c607cd1d8d7d79f5baf55b8b4e467efb4 Mon Sep 17 00:00:00 2001 From: saganatt <8majak8@gmail.com> Date: Tue, 10 Dec 2024 14:46:55 +0100 Subject: [PATCH] Merge both yields and eff --- .../Macros/merge-fdd-inputs-sept-approvals.sh | 81 +++++++++++-------- 1 file changed, 48 insertions(+), 33 deletions(-) diff --git a/PWGHF/D2H/Macros/merge-fdd-inputs-sept-approvals.sh b/PWGHF/D2H/Macros/merge-fdd-inputs-sept-approvals.sh index 02c81797d24..b8c9d191a7a 100755 --- a/PWGHF/D2H/Macros/merge-fdd-inputs-sept-approvals.sh +++ b/PWGHF/D2H/Macros/merge-fdd-inputs-sept-approvals.sh @@ -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