Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changes/135.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add functionality to handle XGB cuts and stereo reconstruction.
10 changes: 8 additions & 2 deletions scripts/ANALYSIS.anasum_parallel_from_runlist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,14 @@ elif [[ $CUTS = "BDTExtended040hard2tel" ]]; then
CUT="NTel2-Extended040-Hard-TMVA-BDT"
elif [[ $CUTS = "BDTExtended050moderate2tel" ]]; then
CUT="NTel2-Extended050-Moderate-TMVA-BDT"
elif [[ $CUTS = "moderate2telXGB" ]]; then
CUT="NTel2-PointSource-Moderate-XGB-BDT"
elif [[ $CUTS = "soft2telXGB" ]]; then
CUT="NTel2-PointSource-Soft-XGB-BDT"
elif [[ $CUTS = "hard2telXGB" ]]; then
CUT="NTel2-PointSource-Hard-XGB-BDT"
elif [[ $CUTS = "hard3telXGB" ]]; then
CUT="NTel3-PointSource-Hard-XGB-BDT"
else
echo "ERROR: unknown cut definition: $CUTS"
exit 1
Expand Down Expand Up @@ -300,8 +308,6 @@ for RUN in ${RUNS[@]}; do
elif [[ $SUBC == *condor* ]]; then
$(dirname "$0")/helper_scripts/UTILITY.condorSubmission.sh $FSCRIPT.sh $h_vmem $tmpdir_size
echo
echo "-------------------------------------------------------------------------------"
echo "Job submission using HTCondor - run the following script to submit jobs at once:"
echo "$EVNDISPSCRIPTS/helper_scripts/submit_scripts_to_htcondor.sh ${TMPLOGDIR} submit 50"
echo "-------------------------------------------------------------------------------"
echo
Expand Down
9 changes: 5 additions & 4 deletions scripts/IRF.generate_effective_area_parts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ SIMTYPE="$8"
ANALYSIS_TYPE="${9:-}"
DISPBDT="${10:-0}"
UUID="${11:-$(date +"%y%m%d")-$(uuidgen)}"
XGBVERSION="None" --> no XGB applied
# XGBVERSION="xgb"
XGBSTEREOFILESUFFIX="xgb_stereo"
XGBGAMMAHADRONFILESUFFIX="xgb_gh"

echo "IRF.generate_effective_area_parts for epoch $EPOCH, atmo $ATM, zenith $ZA, wobble $WOBBLE, noise $NOISE (DISP: $DISPBDT, XGB $XGBVERSION)"
echo "IRF.generate_effective_area_parts for epoch $EPOCH, atmo $ATM, zenith $ZA, wobble $WOBBLE, noise $NOISE (DISP: $DISPBDT, XGB $XGBSTEREOFILESUFFIX $XGBGAMMAHADRONFILESUFFIX)"


if [[ -z "$VERITAS_IRFPRODUCTION_DIR" ]]; then
Expand Down Expand Up @@ -109,7 +109,8 @@ sed -e "s|OUTPUTDIR|$ODIR|" \
-e "s|EFFFILE|$EFFAREAFILE|" \
-e "s|USEDISP|${DISPBDT}|" \
-e "s|VERSIONIRF|$IRFVERSION|" \
-e "s|VERSIONXGB|$XGBVERSION|" \
-e "s|STEREOXGB|$XGBSTEREOFILESUFFIX|" \
-e "s|GHXGB|$XGBGAMMAHADRONFILESUFFIX|" \
-e "s|DATAFILE|$MCFILE|" \
-e "s|GAMMACUTS|${CUTSFILE}|" $SUBSCRIPT.sh > $FSCRIPT

Expand Down
1 change: 1 addition & 0 deletions scripts/IRF.production.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ required parameters:
Main types: GRISU, CARE_24_20, CARE_RedHV_Feb2024, CARE_UV_2212
CARE_RedHV_Feb2024, CARE_202404, CARE_24_20)
V6 basic types: CARE_202404, CARE_RedHV_Feb2024
Other types: CARE_June2020, CARE_RedHV, CARE_UV

<IRF type> type of instrument response function to produce.
EVNDISP,
Expand Down
7 changes: 4 additions & 3 deletions scripts/helper_scripts/ANALYSIS.dispXGB_sub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,12 @@ if [[ ! -d "${DISPDIR}" ]]; then
fi
OFIL=$(basename $MSCW_FILE .root)
if [[ "${XGB_TYPE}" == "stereo_analysis" ]]; then
if [[ "${ZA}" -lt "38" ]]; then
# requires bc as printRunParameter returns a float
if (( $(echo "$ZA < 38" | bc -l) )); then
DISPDIR="${DISPDIR}/SZE/"
elif [[ "${ZA}" -lt "48" ]]; then
elif (( $(echo "$ZA < 48" | bc -l) )); then
DISPDIR="${DISPDIR}/MZE/"
elif [[ "${ZA}" -lt "58" ]]; then
elif (( $(echo "$ZA < 58" | bc -l) )); then
DISPDIR="${DISPDIR}/LZE/"
else
DISPDIR="${DISPDIR}/XZE/"
Expand Down
9 changes: 5 additions & 4 deletions scripts/helper_scripts/ANALYSIS.mscw_energy_sub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,13 @@ get_disp_dir()
else
DISPDIR="DispBDTs//${ANATYPE}/${EPOCH}_ATM${ATMO}/"
fi
ZA=$($EVNDISPSYS/bin/printRunParameter $INFILEPATH -elevation | awk '{print $3}')
if (( $(echo "90.-$ZA < 38" |bc -l) )); then
ZA=$($EVNDISPSYS/bin/printRunParameter $INFILEPATH -zenith | awk '{print $4}')
# requires bc as printRunParameter returns a float
if (( $(echo "$ZA < 38" | bc -l) )); then
DISPDIR="${DISPDIR}/SZE/"
elif (( $(echo "90.-$ZA < 48" |bc -l) )); then
elif (( $(echo "$ZA < 48" | bc -l) )); then
DISPDIR="${DISPDIR}/MZE/"
elif (( $(echo "90.-$ZA < 58" |bc -l) )); then
elif (( $(echo "$ZA < 58" | bc -l) )); then
DISPDIR="${DISPDIR}/LZE/"
else
DISPDIR="${DISPDIR}/XZE/"
Expand Down
31 changes: 22 additions & 9 deletions scripts/helper_scripts/IRF.effective_area_parallel_sub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ CUTSFILE="GAMMACUTS"
EFFAREAFILE=EFFFILE
REDO3TEL="15"
IRFVERSION="VERSIONIRF"
XGBVERSION="VERSIONXGB"
XGBSTEREOFILESUFFIX="STEREOXGB"
XGBGAMMAHADRONFILESUFFIX="GHXGB"

# output directory
[[ ! -d "$ODIR" ]] && mkdir -p "$ODIR" && chmod g+w "$ODIR"
Expand Down Expand Up @@ -52,13 +53,16 @@ inspect_executables()
fi
}

# cp XGB version to TMPDIR (if available)
echo "XGB VERSION: $XGBVERSION"
if [[ -n $XGBVERSION ]] && [[ $XGBVERSION != "None" ]]; then
XGBFIL=$(basename $MCFILE .root)
XGBFIL="$(dirname $MCFILE)/${XGBFIL}.${XGBVERSION}.root"
cp -f -v "$XGBFIL" "$DDIR"/
fi
# cp XGB files to TMPDIR (if available)
for XGB in "$XGBSTEREOFILESUFFIX" "$XGBGAMMAHADRONFILESUFFIX"
do
echo "XGB $XGB"
if [[ -n $XGB ]] && [[ $XGB != "None" ]]; then
XGBFIL=$(basename $MCFILE .root)
XGBFIL="$(dirname $MCFILE)/${XGBFIL}.${XGB}.root"
cp -f -v "$XGBFIL" "$DDIR"/
fi
done
# cp MC file to TMPDIR
cp -f -v "$MCFILE" "$DDIR"/
MCFILE=`basename $MCFILE`
Expand Down Expand Up @@ -91,10 +95,18 @@ if [[ $IRFVERSION == *"v490"* ]]; then
ENERGYRECONSTRUCTIONMETHOD="1"
fi

# XGB Reconstruction settings
DIRECTIONRECONSTRUCTIONMETHOD="0"
if [[ $CUTSFILE == *"XGB"* ]]; then
DIRECTIONRECONSTRUCTIONMETHOD="2"
ENERGYRECONSTRUCTIONMETHOD="2"
fi

# parameter file template, include "* IGNOREFRACTIONOFEVENTS 0.5" when doing BDT effective areas
PARAMFILE="
* FILLINGMODE 0
* ENERGYRECONSTRUCTIONMETHOD $ENERGYRECONSTRUCTIONMETHOD
* DIRECTIONRECONSTRUCTIONMETHOD $DIRECTIONRECONSTRUCTIONMETHOD
* ENERGYAXISBINS 60
* ENERGYAXISBINHISTOS 30
* EBIASBINHISTOS 75
Expand All @@ -107,7 +119,8 @@ PARAMFILE="
* CUTFILE $DDIR/$(basename $CUTSFILE)
IGNOREFRACTIONOFEVENTS 0.5
* SIMULATIONFILE_DATA $MCFILE
* XGBFILESUFFIX $XGBVERSION"
* XGBSTEREOFILESUFFIX $XGBSTEREOFILESUFFIX
* XGBGAMMAHADRONFILESUFFIX $XGBGAMMAHADRONFILESUFFIX"

# create makeEffectiveArea parameter file
EAPARAMS="$EFFAREAFILE-${CUTS_NAME}"
Expand Down