Skip to content

Commit aac5396

Browse files
authored
Merge pull request #47 from Eventdisplay/prod6-tests
Script additions for Prod6 North
2 parents 3f651f1 + d5ec1e1 commit aac5396

13 files changed

+117
-81
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
repos:
22
# https://pycqa.github.io/isort/docs/configuration/black_compatibility.html#integration-with-pre-commit
33
- repo: https://github.com/pycqa/isort
4-
rev: 5.12.0
4+
rev: 5.13.2
55
hooks:
66
- id: isort
77
args: ["--profile", "black", "--filter-files"]
88
- repo: https://github.com/psf/black
9-
rev: 23.7.0
9+
rev: 24.8.0
1010
hooks:
1111
- id: black
1212
args: ["--line-length=100"]
1313
# https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html?highlight=other%20tools#flake8
1414
- repo: https://github.com/PyCQA/flake8
15-
rev: 6.1.0
15+
rev: 7.1.1
1616
hooks:
1717
- id: flake8
1818
args: ["--max-line-length=100", "--extend-ignore=E203,E712"]
1919
# https://github.com/pre-commit/pre-commit-hooks
2020
- repo: https://github.com/pre-commit/pre-commit-hooks
21-
rev: v4.4.0
21+
rev: v4.6.0
2222
hooks:
2323
- id: trailing-whitespace
2424
- id: end-of-file-fixer

CTA.mainRunScriptsReduced.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
if [ $# -lt 2 ]; then
99
echo "
1010
./CTA.mainRunScripts.sh <data set> <run mode>
11-
11+
1212
data sets:
1313
1414
Prod3b analysis:
@@ -19,7 +19,7 @@ if [ $# -lt 2 ]; then
1919
prod5b-North-20deg prod5b-North-40deg prod5b-North-60deg
2020
prod5b-North-20deg-moon prod5b-North-40deg-moon prod5b-North-60deg-moon
2121
Prod6 analysis:
22-
prod6-North-20deg
22+
prod6-North-20deg prod6-North-40deg prod6-North-52deg prod6-North-60deg
2323
prod6-South-20deg
2424
2525
run modes:
@@ -34,7 +34,7 @@ P2="$1"
3434
RUN="$2"
3535

3636
SITE="South"
37-
if [[ $P2 == *"North"* ]]; then
37+
if [[ $P2 == *"North"* ]]; then
3838
SITE="North"
3939
fi
4040

@@ -43,10 +43,10 @@ RECID="0"
4343
# run scripts are collected here
4444
RUNSCRIPTDIR="${CTA_USER_LOG_DIR}/jobs/$(uuidgen)"
4545
mkdir -p ${RUNSCRIPTDIR}
46-
46+
4747
if [[ ${RUN} == "MAKETABLES" ]] || [[ ${RUN} == "DISPBDT" ]] || [[ ${RUN} == "ANATABLES" ]] || [[ ${RUN} == "PREPARETMVA" ]]; then
4848
./CTA.runAnalysis.sh ${P2} ${RUN} ${RECID} 2 2 2 2 ${RUNSCRIPTDIR}
49-
if [[ $SITE == "South" ]]; then
49+
if [[ $SITE == "South" ]] || [[ $P2 == *"prod6"* ]]; then
5050
./CTA.runAnalysis.sh ${P2}-sub ${RUN} ${RECID} 2 2 2 2 ${RUNSCRIPTDIR}
5151
elif [[ $SITE == *"North"* ]]; then
5252
./CTA.runAnalysis.sh ${P2}-LST ${RUN} ${RECID} 2 2 2 2 ${RUNSCRIPTDIR}
@@ -60,7 +60,7 @@ else
6060
while IFS= read -r mult
6161
do
6262
./CTA.runAnalysis.sh ${P2}-sub ${RUN} ${RECID} $mult ${RUNSCRIPTDIR}
63-
done < NIM-South-sub.dat
63+
done < NIM-${SITE}-sub.dat
6464
elif [[ $SITE == "North" ]]; then
6565
./CTA.runAnalysis.sh ${P2}-LST ${RUN} ${RECID} 2 2 2 2 ${RUNSCRIPTDIR}
6666
fi

CTA.runAnalysis.sh

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ then
2525
add 'moon' for NSB5x data sets
2626
prod3b-S20-SCT156Tel
2727
Prod6 analysis:
28-
prod6-North-20deg
28+
prod6-North-20deg prod6-North-40deg prod6-North-52deg prod6-North-60deg
2929
prod6-South-20deg
3030
3131
possible run modes are EVNDISP MAKETABLES DISPBDT/DISPMLP ANATABLES PREPARETMVA TRAIN ANGRES QC CUTS PHYS
@@ -274,10 +274,12 @@ then
274274
if [[ $P2 == *"SV0"* ]]; then
275275
ARRAY=( "subArray.prod5.South-SV0.list" )
276276
elif [[ $P2 == *"SV"* ]]; then
277-
ARRAY=( "subArray.prod5.South-Alpha-SV.list" )
277+
ARRAY=( "subArray.prod5.South-Alpha-SV-2MSTs.list" )
278278
if [[ $P2 == *"sub"* ]]; then
279279
ARRAY=( "subArray.prod5.South-Alpha-SV-sub.list" )
280280
fi
281+
elif [[ $P2 == *"MSTF"* ]]; then
282+
ARRAY=( "subArray.prod5.South-MSTF.list" )
281283
fi
282284
ARRAYDIR="prod5"
283285
TDATE="g20230823"
@@ -317,17 +319,23 @@ then
317319
else
318320
SITE="${SITE}-dark"
319321
fi
320-
EDM="-sq20-LL"
322+
EDM="-sq30-LL"
323+
if [[ $P2 == "prod6-N"* ]]; then
324+
EDM="-lin30-LL"
325+
EDM="-sq230-LL"
326+
fi
321327
if [[ $P2 == *"DL2plus"* ]]; then
322328
EDM="-sq10-LL-DL2plus"
323329
fi
324-
# ARRAY=( "subArray.prod6.${NS}Hyper${SCT}.list" )
325330
ARRAY=( "subArray.prod6.${NS}Alpha${SCT}.list" )
326331
if [[ $P2 == *"sub"* ]]; then
327332
ARRAY=( "subArray.prod6.${NS}Alpha-sub.list" )
328333
fi
334+
if [[ $P2 == *"Hyper"* ]] || [[ $P2 == *"hyper"* ]]; then
335+
ARRAY=( "subArray.prod6.NorthHyper.list" )
336+
fi
329337
ARRAYDIR="prod6"
330-
TDATE="g20220901"
338+
TDATE="g20240826"
331339
ANADATE="${TDATE}"
332340
TMVADATE="${ANADATE}"
333341
EFFDATE="${ANADATE}"
@@ -360,11 +368,12 @@ NIMAGESMIN=$((SCMST<NIMAGESMIN ? SCMST : NIMAGESMIN))
360368
# (note that all steps except CUTS and PHYS are done only for 50h)
361369
OBSTIME=( "50h" "5h" "30m" "10m" "10h" "20h" "100h" "500h" "5m" "1m" "2h" )
362370
OBSTIME=( "10s" "30s" "300s" "1000s" "3000s" "10000s" "30000s" )
363-
OBSTIME=( "50h" "30m" )
364371
OBSTIME=( "50h" "5h" )
365372
OBSTIME=( "50h" "5h" "30m" "100s" )
366373
OBSTIME=( "5h" "30m" "100s" )
367374
OBSTIME=( "500h" "250h" "100h" "50h" "20h" "10h" "5h" "1h" "5m" "30m" "100s" )
375+
OBSTIME=( "50h" "30m" )
376+
OBSTIME=( "5h" )
368377
OBSTIME=( "50h" )
369378

370379
echo "$RUN" "$SITE"
@@ -565,7 +574,7 @@ do
565574
fi
566575
echo "OFFAXISFINEBINNING $BFINEBINNING" >> "$PARA"
567576
if [[ ${RUN} == "CUTS" ]] && [[ ${OOTIME} == "50h" ]]; then
568-
if [[ $P2 == *"DL2plus"* ]] || [[ $EDM == *"sq51"* ]] || [[ $EDM == *"lin51"* ]]; then
577+
if [[ $P2 == *"DL2plus"* ]] || [[ $EDM == *"prod6"* ]]; then
569578
echo "DL2FILLING FULLTREES" >> "$PARA"
570579
else
571580
echo "DL2FILLING DL2" >> "$PARA"

analysis/CTA.DISPTRAINING.sub_analyse.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#
2020
SUBC="condor"
2121
h_cpu="47:29:00"
22-
h_vmem="12000M"
22+
h_vmem="24000M"
2323
tmpdir_size="1G"
2424

2525
if [ $# -lt 5 ]
@@ -34,7 +34,7 @@ then
3434
echo " <TMVA parameters> file name of list of TMVA parameter file"
3535
echo " <scaling> layout scaling (e.g. 5); give 99 to ignore scaling"
3636
echo
37-
echo " (note 1: hardwired telescope types in this script)"
37+
echo " (note 1: hardwired telescope types in this script)"
3838
echo " (note 2: disp core training switched off)"
3939
echo
4040
exit
@@ -62,8 +62,8 @@ if [ -n $8 ]
6262
then
6363
QSUBOPT="$8"
6464
fi
65-
QSUBOPT=${QSUBOPT//_X_/ }
66-
QSUBOPT=${QSUBOPT//_M_/-}
65+
QSUBOPT=${QSUBOPT//_X_/ }
66+
QSUBOPT=${QSUBOPT//_M_/-}
6767

6868
#########################################
6969
# TMVA options
@@ -153,7 +153,7 @@ else
153153
fi
154154

155155
#########################################
156-
#
156+
#
157157
#########################################
158158
for MLP in "${MLPLIST[@]}"
159159
do

analysis/CTA.EFFAREA.qsub_analyse_list.sh

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ echo "PROCESSING PARTICLE $PART"
4545
# read analysis values from parameter file
4646
if [ ! -e $ANAPAR ]
4747
then
48-
echo "error: analysis parameter file not found: $ANAPAR"
48+
echo "error: analysis parameter file not found: $ANAPAR"
4949
exit
5050
fi
5151
cp -f $ANAPAR $TMPDIR
@@ -54,7 +54,7 @@ ANAPAR="${TMPDIR}/${ANAPARF}"
5454
# check again than runparameter file is available
5555
if [ ! -e $ANAPAR ]
5656
then
57-
echo "error: analysis parameter file not found in tmp directory: $ANAPAR"
57+
echo "error: analysis parameter file not found in tmp directory: $ANAPAR"
5858
exit
5959
fi
6060
echo "reading analysis parameter from $ANAPAR"
@@ -74,7 +74,7 @@ then
7474
fi
7575

7676
NIMAGESMIN=`grep NIMAGESMIN $ANAPAR | awk {'print $2'}`
77-
# get telescope type dependent cuts
77+
# get telescope type dependent cuts
7878
NCUTLST=`grep NLST $ANAPAR | awk {'print $2'}`
7979
NCUTMST=`grep NMST $ANAPAR | awk {'print $2'}`
8080
NCUTSST=`grep NSST $ANAPAR | awk {'print $2'}`
@@ -100,7 +100,7 @@ else
100100
fi
101101
THETA2MINENEERGY=`grep THETA2MINENEERGY $ANAPAR | awk {'print $2'}`
102102

103-
for T in LST MST SST SCMST
103+
for T in LST MST SST SCMST
104104
do
105105
NCUT="NCUT${T}"
106106
if [ -z "${!NCUT}" ]
@@ -140,7 +140,7 @@ echo " Analysis parameters: $NIMAGESMIN $ANADIR $TMVACUT $EFFAREABASEDIR $OBSTI
140140

141141
if [ -z "$ANADIR" ] || [ -z "$NIMAGESMIN" ] || [ -z "$TMVACUT" ] || [ -z "$EFFAREABASEDIR" ] || [ -z "$OBSTIME" ]
142142
then
143-
echo "error: analysis parameter file not correct: $ANAPAR"
143+
echo "error: analysis parameter file not correct: $ANAPAR"
144144
echo " one variable missing"
145145
exit
146146
fi
@@ -259,18 +259,18 @@ then
259259
THETA2MIN=( 0. )
260260
THETA2MAX=( 1. )
261261
OFFMEA=( 0.5 )
262-
fi
262+
fi
263263
ISOTROPY="1"
264264
DIRECTIONCUT="0"
265-
fi
265+
fi
266266
if [ $PART = "proton" ] || [ $PART = "proton_onSource" ]
267267
then
268268
if [[ ${DSET:0:2} == "GR" ]]
269269
then
270270
MSCFILE=$DDIR/proton*"deg$MCAZ"*mscw.root
271271
else
272272
MSCFILE=$DDIR/proton*."$ARRAY"_ID"$RECID$MCAZ"*.mscw.root
273-
fi
273+
fi
274274
if [ $ARRAY = "V5" ]
275275
then
276276
MSCFILE=$DDIR/proton."$ARRAY"_ID"$RECID$MCAZ".mscw.root
@@ -279,7 +279,7 @@ then
279279
OFFMIN=( 0. )
280280
OFFMAX=( 100000. )
281281
# NOTE: this is theta and not theta2
282-
if [ $PART = "proton" ]
282+
if [ $PART = "proton" ]
283283
then
284284
OFIL=proton."$ARRAY"_ID"$RECID".eff
285285
if [ $BFINEBINNING = "TRUE" ]
@@ -389,8 +389,8 @@ do
389389
fi
390390
###############################################################################
391391
# create cut file
392-
iCBFILE=`basename $CFIL`
393-
if [ $PART = "gamma_onSource" ] || [ $PART = "gamma_cone" ]
392+
iCBFILE=`basename $CFIL`
393+
if [ $PART = "gamma_onSource" ] || [ $PART = "gamma_cone" ]
394394
then
395395
CFILP="${CFIL}.gamma.dat"
396396
else
@@ -407,14 +407,14 @@ do
407407
cp -f $CFILP $iCFIL
408408

409409
# wobble offset
410-
if [ $PART = "gamma_onSource" ] || [ $PART = "gamma_cone" ]
410+
if [ $PART = "gamma_onSource" ] || [ $PART = "gamma_cone" ]
411411
then
412412
WOBBLEOFFSET=${OFFMEA[$i]}
413413
else
414414
WOBBLEOFFSET=${OFFMEA[$j]}
415415
fi
416416
# angular resolution file
417-
if [ $PART = "gamma_onSource" ]
417+
if [ $PART = "gamma_onSource" ]
418418
then
419419
ANGRESFILE=${PRODBASEDIR}/EffectiveAreas/${EFFMCAZDIR}/AngularResolution/gamma_onSource."$ARRAY"_ID"$RECID".eff-0.root
420420
else
@@ -522,9 +522,9 @@ do
522522
echo "* ENERGYSPECTRUMINDEX 1 2.5 0.1" >> $MSCF
523523
echo "* ESPECTRUM_FOR_WEIGHTING $CTA_EVNDISP_AUX_DIR/AstroData/TeV_data/EnergySpectrum_literatureValues_CR.dat 0" >> $MSCF
524524
if [ $GETXOFFYOFFAFTERCUTS = "yes" ]
525-
then
525+
then
526526
echo "* GETXOFFYOFFAFTERCUTS 1" >> $MSCF
527-
fi
527+
fi
528528

529529
fi
530530
if [ $PART = "electron" ] || [ $PART = "electron_onSource" ]
@@ -624,8 +624,3 @@ do
624624
mv -v $OFIX.root ${ODIR}/
625625
done
626626
done
627-
628-
exit
629-
630-
631-
exit

analysis/CTA.EVNDISP.qsub_convert_and_analyse_MC_VDST_ArrayJob.sh

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,17 @@ fi
2626
# set array
2727
FIELD=$SUBA
2828

29+
# TMPDIR - usually set on cluster nodes; useful for testing
30+
if [[ ! -n "$TMPDIR" ]]; then
31+
TMPDIR="$CTA_USER_DATA_DIR/tmp/${DSET}"
32+
mkdir -p "${TMPDIR}"
33+
fi
34+
2935
###################################
3036
# converter command line parameter
3137
COPT="-pe"
3238
# prod3(b): read effective focal lengths from external file
33-
if [[ $DSET == *"prod3"* ]]
39+
if [[ $DSET == *"prod3"* ]]
3440
then
3541
COPT="-rfile ${CTA_EVNDISP_AUX_DIR}/DetectorGeometry/CTA.prod3b.EffectiveFocalLength.dat"
3642
COPT="$COPT -pe"
@@ -42,7 +48,7 @@ COPT="$COPT -c $PEDFILE"
4248
# OPT="-averagetzerofiducialradius=0.5 -reconstructionparameter $ACUT"
4349
OPT="-imagesquared -averagetzerofiducialradius=0.5 -reconstructionparameter $ACUT"
4450
OPT="$OPT -writeimagepixellist"
45-
if [[ $DSET == *"prod3"* ]]
51+
if [[ $DSET == *"prod3"* ]]
4652
then
4753
# needs to be the same as used for IPR graph preparation
4854
OPT="$OPT -ignoredstgains"
@@ -114,7 +120,7 @@ do
114120
# input sim_telarray file: $SIMFIL
115121
# ($SIMFIL should be set then to the zero suppressed file)
116122
#
117-
# best to write to output (zero suppressed file) to the temporary disk on the
123+
# best to write to output (zero suppressed file) to the temporary disk on the
118124
# current note: $TMPDIR/<zerosuppressed file>
119125
#
120126
# $HESSIOSYS/bin/ ....
@@ -123,7 +129,7 @@ do
123129
# execute converter
124130
SIMFIL=`ls $TMPDIR/*.simtel.${EXTE}`
125131
echo "TMPDIR FILES " $SIMFIL
126-
if [[ $DSET == *"prod3"* ]]
132+
if [[ $DSET == *"prod3"* ]]
127133
then
128134
if [[ $DSET == *"paranal"* ]] && [[ $DSET != *"prod3b"* ]]
129135
then
@@ -137,13 +143,13 @@ do
137143
else
138144
DETGEO=${CTA_EVNDISP_AUX_DIR}/DetectorGeometry/CTA.prod3Sb${N:1}.lis
139145
fi
140-
elif [[ $DSET == *"prod4"* ]]
146+
elif [[ $DSET == *"prod4"* ]]
141147
then
142148
DETGEO=${CTA_EVNDISP_AUX_DIR}/DetectorGeometry/CTA.prod4${N}.lis
143-
elif [[ $DSET == *"prod5"* ]]
149+
elif [[ $DSET == *"prod5"* ]]
144150
then
145151
DETGEO=${CTA_EVNDISP_AUX_DIR}/DetectorGeometry/CTA.prod5${N}.lis
146-
elif [[ $DSET == *"prod6"* ]]
152+
elif [[ $DSET == *"prod6"* ]]
147153
then
148154
DETGEO=${CTA_EVNDISP_AUX_DIR}/DetectorGeometry/CTA.prod6${N}.lis
149155
fi
@@ -185,7 +191,7 @@ do
185191
fi
186192
cp -v -f $TMPDIR/[0-9]*.root ${ODIR}/${RUNN}HD_${ILINE}_${MCAZ}deg.root
187193
else
188-
echo "No root files found!"
194+
echo "No root files found!"
189195
if [ -e $TMPDIR/$OFIL.$N.convert.log ]; then
190196
cp -f -v $TMPDIR/$OFIL.$N.convert.log $ODIR/
191197
fi
@@ -202,7 +208,7 @@ do
202208
cp -v -f $TMPDIR/$OFIL.root $ODIR/VDST/
203209
fi
204210
ls -lh $TMPDIR/*.root
205-
# clean up
211+
# clean up
206212
rm -f $TMPDIR/$OFIL.root
207213
rm -f $TMPDIR/[0-9]*.root
208214
echo "==================================================================="

0 commit comments

Comments
 (0)