ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/HiggsAnalysis/EarlyDataStudy/scripts/parseDumperOutput.sh
Revision: 1.1
Committed: Thu May 6 15:14:20 2010 UTC (14 years, 11 months ago) by mangano
Content type: application/x-sh
Branch: MAIN
Log Message:
first commit

File Contents

# User Rev Content
1 mangano 1.1 #!/bin/bash
2    
3     ##########################################
4     # $1 option
5     # 1 --> make parsing
6     # 2 --> move files
7     ##########################################
8     option=$1
9    
10    
11     case $option in
12     1)
13     foundRecordBegin=0
14     counter=0
15     #
16     IFS=$'\n'
17     grep -v "Begin processing" $HEDS_LABEL.dumperLog| \
18     grep -v "Closed file" > lighter.log
19    
20     for line in $(cat lighter.log);
21     do
22    
23     if [[ "$line" =~ "RUN.*LS.*EVENT" ]] #found new event block
24     then
25     counter=`expr $counter + 1`
26     echo "found new event block. Total: " $counter;
27     foundRecordBegin=1
28    
29     run=$(echo $line |awk '{print $3}')
30     ls=$(echo $line |awk '{print $5}')
31     evt=$(echo $line |awk '{print $7}')
32    
33     fi
34     if [ $foundRecordBegin == 1 ]
35     then
36     echo $line >> $run.$ls.$evt.log
37     fi
38    
39     if [[ "$line" =~ "RECORD SEPARATOR" ]]
40     then
41     foundRecordBegin=0
42     fi
43    
44     # if [ $counter == 10 ]
45     # then
46     # break
47     # fi
48     done
49    
50     rm lighter.log
51     if [ -d $HEDS_LABEL.dumperLogs ]
52     then rm -r $HEDS_LABEL.dumperLogs
53     fi
54     mkdir $HEDS_LABEL.dumperLogs
55     mv *.log $HEDS_LABEL.dumperLogs
56     ;;
57    
58     2)
59     echo "..copying detailed dumps to " $HEDS_FINALAREA
60     mv $HEDS_LABEL.dumperLogs \
61     $HEDS_FINALAREA/logs.SkimV$HEDS_SKIMVERSION/${HEDS_LABEL}.listSkimmedEvents
62     ;;
63     esac