82 |
|
my $dir = $file; |
83 |
|
$dir =~ s/^(.*)\/[^\/]*$/$1/; |
84 |
|
my $badJob = 0; |
85 |
+ |
my $jobNumber; |
86 |
|
if ($file =~ m/^.*_[^_]*\.root$/) |
87 |
|
{ |
88 |
< |
my $jobNumber = $file; |
88 |
> |
$jobNumber = $file; |
89 |
|
$jobNumber =~ s/^.*_([^_]*)\.root$/$1/; |
90 |
|
$badJob = (defined $signals{$dir} && defined $signals{$dir}{$jobNumber}) || (defined $partial{$dir} && defined $partial{$dir}{$jobNumber}); |
91 |
|
} |
97 |
|
if (substr ($file, 0, length ($arg)) eq $arg) |
98 |
|
{ |
99 |
|
$dirs{$arg} = $dir; |
100 |
+ |
if (countEvents ($file, $cutFlow) < 0) |
101 |
+ |
{ |
102 |
+ |
$nGoodJobs--; |
103 |
+ |
$nBadJobs++; |
104 |
+ |
print "WARNING: Skipping job $jobNumber. (bad ROOT file)\n"; |
105 |
+ |
last; |
106 |
+ |
} |
107 |
|
push (@{$rootFiles{$arg}}, $file); |
108 |
|
push (@weights, $opt{"weight"}) if $opt{"weight"}; |
109 |
|
push (@weights, $opt{"xsection"} * $integratedLuminosity) if !$opt{"weight"} && $opt{"xsection"}; |
147 |
|
} |
148 |
|
print "=============================================\n"; |
149 |
|
my $output = sprintf "Effective luminosities of samples:\n"; |
150 |
< |
my $printOutput = 1; |
150 |
> |
my $printOutput = 0; |
151 |
|
foreach my $arg (keys %weights) |
152 |
|
{ |
153 |
|
my $shortArg = $arg; |
154 |
|
$shortArg =~ s/^.*\/([^\/]*)$/$1/; |
155 |
< |
$output = sprintf "%s $shortArg: %.5g/fb\n", $output, ($integratedLuminosity / (1000.0 * $weights{$arg})); |
155 |
> |
$output = sprintf "%s $shortArg: %.5g/fb\n", $output, ($integratedLuminosity / (1000.0 * $weights{$arg})) if $weights{$arg} != 1; |
156 |
> |
$printOutput = 1 if $weights{$arg} != 1; |
157 |
|
} |
158 |
|
print $output if $printOutput; |
159 |
|
$output = sprintf "Weights for target luminosity of %g/fb:\n", ($integratedLuminosity / 1000.0); |
162 |
|
{ |
163 |
|
my $shortArg = $arg; |
164 |
|
$shortArg =~ s/^.*\/([^\/]*)$/$1/; |
165 |
< |
$output = sprintf "%s $shortArg: %.5g\n", $output, $weights{$arg}; |
165 |
> |
$output = sprintf "%s $shortArg: %.5g\n", $output, $weights{$arg} if $weights{$arg} != 1; |
166 |
|
$printOutput = 1 if $weights{$arg} != 1; |
167 |
|
} |
168 |
|
print $output if $printOutput; |