ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/OSUT3Analysis/AnaTools/scripts/mergeHists
(Generate patch)

Comparing UserCode/OSUT3Analysis/AnaTools/scripts/mergeHists (file contents):
Revision 1.19 by ahart, Mon Feb 4 09:11:37 2013 UTC vs.
Revision 1.21 by ahart, Wed Mar 6 17:01:01 2013 UTC

# Line 82 | Line 82 | foreach my $file (@$files)
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        }
# Line 96 | Line 97 | foreach my $file (@$files)
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"};
# Line 139 | Line 147 | foreach my $mergedFile (@mergedFiles)
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);
# Line 153 | Line 162 | foreach my $arg (keys %weights)
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;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines