Skip to content

Commit e811839

Browse files
authored
Merge pull request #22 from Eventdisplay/prod5-v10
Prod5 v10
2 parents 3ef8f53 + 41ef32c commit e811839

33 files changed

+1341
-505
lines changed

CTA.runAnalysis.sh

Lines changed: 209 additions & 192 deletions
Large diffs are not rendered by default.

analysis/CTA.DISPTRAINING.qsub_analyse.sh

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
ODIR=OFILE
1010
RECID=RECONSTRUCTIONID
1111
TTYPE=TELTYPE
12-
BDT=BDTTYPE
12+
BDT=MLPTYPE
1313
TLIST=ILIST
1414
TMVAO=TTT
1515
DSET="DATASET"
@@ -62,12 +62,6 @@ $EVNDISPSYS/bin/trainTMVAforAngularReconstruction $TLIST $ODIR 0.5 ${RECID} ${TT
6262
##############
6363
# cleanup
6464

65-
# remove root output file of no telescope of this type is fine (declutter)
66-
if grep -Fxq "Number of telescope types: 0" $ODIR/${BDT}-${TTYPE}.training.log
67-
then
68-
rm -f -v $ODIR/${BDT}"_"${TTYPE}.root
69-
fi
70-
7165
# pipe file list into log file
7266
if [ -e $TLIST ]
7367
then
@@ -76,8 +70,29 @@ then
7670
cat $TLIST >> $ODIR/${BDT}-${TTYPE}.training.log
7771
rm -f $TLIST
7872
fi
79-
# cleanup
80-
bzip2 -v -f $ODIR/${BDT}-${TTYPE}.training.log
8173

74+
# remove everything if telescope type is not found
75+
if grep -Fxq "Number of telescope types: 0" $ODIR/${BDT}-${TTYPE}.training.log
76+
then
77+
echo "No telescopes found of type ${TTYPE}"
78+
rm -f -v $ODIR/${BDT}"_"${TTYPE}.root
79+
rm -f $ODIR/${BDT}-${TTYPE}.training.log
80+
fi
81+
# move everything into root files
82+
if [[ -e $ODIR/${BDT}_BDT_${TTYPE}.weights.xml ]]; then
83+
$EVNDISPSYS/bin/logFile dispXML-BDT-${TTYPE} $ODIR/${BDT}-${TTYPE}.disptmva.root $ODIR/${BDT}_BDT_${TTYPE}.weights.xml
84+
rm -f $ODIR/${BDT}_BDT_${TTYPE}.weights.xml
85+
fi
86+
if [[ -e $ODIR/${BDT}_MLP_${TTYPE}.weights.xml ]]; then
87+
$EVNDISPSYS/bin/logFile dispXML-MLP-${TTYPE} $ODIR/${BDT}-${TTYPE}.disptmva.root $ODIR/${BDT}_MLP_${TTYPE}.weights.xml
88+
rm -f $ODIR/${BDT}_MLP_${TTYPE}.weights.xml
89+
fi
90+
if [[ -e $ODIR/${BDT}-${TTYPE}.training.log ]]; then
91+
$EVNDISPSYS/bin/logFile dispLog-${TTYPE} $ODIR/${BDT}-${TTYPE}.disptmva.root $ODIR/${BDT}-${TTYPE}.training.log
92+
rm -f $ODIR/${BDT}-${TTYPE}.training.log
93+
fi
94+
95+
rm -f $ODIR/${BDT}_${TTYPE}.root
96+
rm -f $ODIR/${BDT}_${TTYPE}.tmva.root
8297

8398
exit

analysis/CTA.DISPTRAINING.sub_analyse.sh

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,16 @@ else
131131
exit
132132
fi
133133

134+
if [[ $TMVAP == *"MLP"* ]]; then
135+
declare -a MLPLIST=( "MLPDisp" "MLPDispEnergy" "MLPDispError" "MLPDispCore" )
136+
else
137+
declare -a MLPLIST=( "BDTDisp" "BDTDispEnergy" "BDTDispError" "BDTDispCore" )
138+
fi
139+
134140
#########################################
135141
#
136142
#########################################
137-
for BDT in BDTDisp BDTDispEnergy BDTDispError BDTDispCore BDTDispPhi
143+
for MLP in "${MLPLIST[@]}"
138144
do
139145
for MCAZ in 0deg 180deg
140146
do
@@ -150,13 +156,13 @@ do
150156
OFFDIR=${ODIR}.T${NSTEP}
151157
####################
152158
# output directory
153-
TDIR="${OFFDIR}/${BDT}/${MCAZ}/"
159+
TDIR="${OFFDIR}/${MLP}/${MCAZ}/"
154160
mkdir -p $TDIR
155161

156162
for TELTYPE in $TELTYPELIST
157163
do
158164
echo
159-
echo "STARTING BDT TRAINING FOR AZ DIRECTION $MCAZ AND TELESCOPE TYPE $TELTYPE"
165+
echo "STARTING ${MLP} TRAINING FOR AZ DIRECTION $MCAZ AND TELESCOPE TYPE $TELTYPE"
160166
echo " training options: ${T}"
161167
echo " $DSET $ARRAY"
162168
echo "=========================================================================="
@@ -187,19 +193,19 @@ do
187193
then
188194
k=$(echo $NFIL | awk '{printf "%d\n",$1*0.50}')
189195
fi
190-
TLIST="$SHELLDIR/EDISP-$DSET-$ARRAY-$SCALING-$MCAZ-$TELTYPE-$BDT-$NSTEP.list"
196+
TLIST="$SHELLDIR/EDISP-$DSET-$ARRAY-$SCALING-$MCAZ-$TELTYPE-$MLP-$NSTEP.list"
191197
rm -f $TLIST
192198
shuf -n $k $SHELLDIR/tempList.list > $TLIST
193199
echo "List of $k input files for training: $TLIST"
194200

195201
####################
196202
# prepare run scripts
197-
FNAM="$SHELLDIR/EDISP-$ARRAY-$SCALING-$MCAZ-$TELTYPE-$BDT-$NSTEP"
198-
cp $FSCRIPT.sh $FNAM.sh
203+
FNAM="$SHELLDIR/EDISP-$ARRAY-$SCALING-$MCAZ-$TELTYPE-$MLP-$NSTEP"
204+
cp $FSCRIPT.sh $FNAM.sh
199205

200206
sed -i -e "s|OFILE|$TDIR|" \
201207
-e "s|TELTYPE|$TELTYPE|" \
202-
-e "s|BDTTYPE|$BDT|" \
208+
-e "s|MLPTYPE|$MLP|" \
203209
-e "s|RECONSTRUCTIONID|$RECID|" \
204210
-e "s|ILIST|$TLIST|" \
205211
-e "s|TTT|$T|" \
@@ -209,7 +215,7 @@ do
209215

210216
chmod u+x $FNAM.sh
211217
echo "shell script " $FNAM.sh
212-
218+
213219
# submit the job
214220
qsub $QSUBOPT -l h_cpu=47:45:00 -l h_rss=12000M -V -o $QLOG/ -e $QLOG/ "$FNAM.sh"
215221
done

0 commit comments

Comments
 (0)