1 |
#!/bin/bash
|
2 |
#
|
3 |
# by Gena Kukartsev
|
4 |
#
|
5 |
# This script counts the number of the original events that correspond to
|
6 |
# the "secondary" root file.
|
7 |
#
|
8 |
# 1. The log file from the secondary processing (Analyzer) gets parsed, and
|
9 |
# all Layer1 input files are found.
|
10 |
# 2. The corresponding CRAB stderr files are searched for the number of
|
11 |
# processed events
|
12 |
#
|
13 |
|
14 |
|
15 |
echo ''
|
16 |
echo -n 'According to the CRAB log files, number of events processed: '
|
17 |
|
18 |
list=`grep 'Successfully opened file' $1/secondary/ljets_muon-08apr2009.log | sed 's/\(.*\)\(Success\).*Layer1_\(.*\)\.root/\3/'`
|
19 |
#for num in `grep 'Successfully opened file' $1/secondary/ljmet_*log | sed 's/\(.*\)\(Success\).*Layer1_\(.*\)\.root/\3/'`
|
20 |
|
21 |
missing=0
|
22 |
|
23 |
tempfile=`mktemp`
|
24 |
|
25 |
|
26 |
for num in $list
|
27 |
do
|
28 |
|
29 |
if [ -f $1/crab/res/CMSSW_$num.stderr ]
|
30 |
then
|
31 |
tail -1000 $1/crab/res/CMSSW_$num.stderr
|
32 |
fi;
|
33 |
if [ ! -f $1/crab/res/CMSSW_$num.stderr ]
|
34 |
then
|
35 |
missing=$((missing+1))
|
36 |
fi;
|
37 |
done > $tempfile
|
38 |
|
39 |
cat $tempfile | grep 'TrigReport Events total' | sed 's/.*total\ =\ \([0-9]*\)\ .*/\1/' | (tr '\n' +; echo 0) | bc
|
40 |
|
41 |
echo -n 'According to the CRAB log files, number of events selected: '
|
42 |
cat $tempfile | grep 'TrigReport Events total' | sed 's/.*total\ =\ \([0-9]*\)\ passed\ =\ \([0-9]*\)\ .*/\2/' | (tr '\n' +; echo 0) | bc
|
43 |
|
44 |
#echo $nevents
|
45 |
echo ''
|
46 |
echo 'Missing log files: '$missing
|
47 |
|
48 |
rm $tempfile
|