ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/HiggsAnalysis/EarlyDataStudy/scripts/skimreport
Revision: 1.1
Committed: Thu May 6 15:14:20 2010 UTC (14 years, 11 months ago) by mangano
Branch: MAIN
CVS Tags: V00-02-00, V00-01-03, V00-01-02, V00-01-01, V00-01-00, V00-00-01, V00-00-00, HEAD
Log Message:
first commit

File Contents

# User Rev Content
1 mangano 1.1 #!/usr/bin/env perl
2     use strict; use warnings;
3     my %ps=();
4     my %ms=();
5     my @psorted = ();
6     my @msorted = ();
7     my $ml=20;
8     while(<>) {
9     if (m/TrigReport ---------- Path Summary ------------/) {
10     $_=<>; # skip one line
11     while(<>) {
12     last unless m/TrigReport\s+\d+\s+\d+\s+(\d+)\s+(\d+)\s+\d+\s+(\d+)\s+(\w+)/;
13     if (!defined($ps{$4})) { $ps{$4} = {}; push @psorted, $4; }
14     $ps{$4}->{'try' } += $1;
15     $ps{$4}->{'pass'} += $2;
16     $ps{$4}->{'err' } += $3;
17     if (length($4) > $ml) { $ml = length($4); }
18     }
19     }
20     if (m/TrigReport ---------- Module Summary ------------/) {
21     $_=<>; # skip one line
22     while(<>) {
23     last unless m/TrigReport\s+\d+\s+(\d+)\s+(\d+)\s+\d+\s+(\d+)\s+(\w+)/;
24     #next if ($1 == $2); # skip pass through
25     if (!defined($ms{$4})) { $ms{$4} = {}; push @msorted, $4; }
26     $ms{$4}->{'try' } += $1;
27     $ms{$4}->{'pass'} += $2;
28     $ms{$4}->{'err' } += $3;
29     if (length($4) > $ml) { $ml = length($4); }
30     }
31     }
32     }
33     if (@psorted) {
34     print sprintf('%-'.$ml.'s %7s %7s %7s', " CMSSW Path", "Try", "Pass", "Err")."\n";
35     print sprintf('%-'.$ml.'s %7s %7s %7s', " --------------", "----", "----", "----") . "\n";
36     foreach (@psorted) {
37     print sprintf('%-'.$ml.'s %7d %7d %7d', $_, $ps{$_}->{'try'}, $ps{$_}->{'pass'}, $ps{$_}->{'err'}). "\n";
38     }
39     }
40     if (@msorted) {
41     print "\n";
42     print sprintf('%-'.$ml.'s %7s %7s %7s', " CMSSW Filter", "Try", "Pass", "Err")."\n";
43     print sprintf('%-'.$ml.'s %7s %7s %7s', " --------------", "----", "----", "----") . "\n";
44     foreach (@msorted) {
45     next if ($ms{$_}->{'try'} == $ms{$_}->{'pass'}); # skip modules that didn't filter anything
46     print sprintf('%-'.$ml.'s %7d %7d %7d', $_, $ms{$_}->{'try'}, $ms{$_}->{'pass'}, $ms{$_}->{'err'}). "\n";
47     }
48     }
49