-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrun_TimingStudy.sh
More file actions
executable file
·46 lines (45 loc) · 1.99 KB
/
run_TimingStudy.sh
File metadata and controls
executable file
·46 lines (45 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash -f
echo " ---------------------------------------------------"
for arg in "$@"; do
if [[ ! $arg == *".py" ]]; then
echo "$arg is not a crab script"
else
CRAB_CFG=$arg
# read infos from crab config file
LFN=`grep "config.Data.outLFNDirBase" $CRAB_CFG | sed "s;';;g" | awk '{ print $3 }' | sed 's;/$;;'`
TASKNAME=`grep "config.Data.outputDatasetTag" $CRAB_CFG | sed "s;';;g" | awk '{ print $3 }'`
AUTONAME=`echo $CRAB_CFG | sed "s;crab3_;;;s;.py;;"`
# decide if it is needed to create an SEU list first (BADROC list)
cd /data/jkarancs/CMSSW/PixelHistoMaker_git
if [ -f PHM_out/HitEffMonitoring_"$AUTONAME"_BADROC.root ]; then BADROC=0; else BADROC=1; fi
PHM=1
# Set input/output directories
DL_DIR=`echo $LFN/$TASKNAME | sed "s;/store/user;/data/gridout;"`
echo
echo "Using crab config file: $CRAB_CFG"
echo " Input dir: $DL_DIR/*.root"
echo
if (( $BADROC )); then
echo "- Start creating BADROC list"
echo " Output file: PHM_out/HitEffMonitoring_"$AUTONAME"_BADROC.root"
echo " Log file: PHM_out/HitEffMonitoring_"$AUTONAME"_BADROC.log"
if (( $PHM )); then
# Wait for BADROC list to finish, before running plotting
./PixelHistoMaker -o PHM_out/HitEffMonitoring_"$AUTONAME"_BADROC.root "$DL_DIR/*.root" -b > PHM_out/HitEffMonitoring_"$AUTONAME"_BADROC.log 2>&1
else
# Otherwise run in background
nohup ./PixelHistoMaker -o PHM_out/HitEffMonitoring_"$AUTONAME"_BADROC.root "$DL_DIR/*.root" -b > PHM_out/HitEffMonitoring_"$AUTONAME"_BADROC.log 2>&1 &
fi
fi
if (( $PHM )); then
echo "- Start running PixelHistoMaker (in background)"
echo " Output file: PHM_out/HitEffMonitoring_"$AUTONAME".root"
echo " Log file: PHM_out/HitEffMonitoring_"$AUTONAME".log"
nohup ./PixelHistoMaker -o PHM_out/HitEffMonitoring_"$AUTONAME".root "$DL_DIR/*.root" > PHM_out/HitEffMonitoring_"$AUTONAME".log 2>&1 &
fi
echo
echo " --------------- "$AUTONAME" Done. -----------------"
echo
cd - > /dev/null
fi
done