ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/LJMet/MultivariateAnalysis/test/count.sh
Revision: 1.2
Committed: Wed May 6 08:04:30 2009 UTC (15 years, 11 months ago) by kukartse
Content type: application/x-sh
Branch: MAIN
CVS Tags: V00-03-01, ZMorph_BASE_20100408, gak040610_morphing, V00-02-02, gak011410, gak010310, ejterm2010_25nov2009, V00-02-01, V00-02-00, gak112409, CMSSW_22X_branch_base, segala101609, V00-01-15, V00-01-14, V00-01-13, HEAD
Branch point for: ZMorph-V00-03-01, CMSSW_22X_branch
Changes since 1.1: +4 -1 lines
Error occurred while calculating annotation data.
Log Message:
*** empty log message ***

File Contents

# Content
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