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.14 by ahart, Fri Jan 4 07:35:41 2013 UTC vs.
Revision 1.16 by ahart, Wed Jan 9 17:13:31 2013 UTC

# Line 88 | Line 88 | foreach my $file (@$files)
88          foreach my $arg (@ARGV)
89            {
90              $dirs{$arg} = $dir;
91 <            if (substr ($file, 0, length ($arg)) eq $arg)
91 >            if (substr ($file, 0, length ($arg)) eq $arg && countEvents ($file) >= 0)
92                {
93                  push (@{$rootFiles{$arg}}, $file);
94                  push (@weights, $opt{"weight"}) if $opt{"weight"};
# Line 126 | Line 126 | foreach my $arg (@ARGV)
126    }
127   my $mergedFiles = join (" ", @mergedFiles);
128   my $mergedWeights = join (",", @mergedWeights);
129 + system ("mergeTFileServiceHistograms -i $mergedFiles -o $opt{'prefix'}_Unweighted.root");
130   system ("mergeTFileServiceHistograms -i $mergedFiles -o $opt{'prefix'}.root -w $mergedWeights");
131   foreach my $mergedFile (@mergedFiles)
132    {
# Line 232 | Line 233 | countEvents
233    my $cutFlow = shift;
234  
235    my $output = `getEventsFromCutFlow $file $cutFlow`;
236 <  if ($output =~ m/Did not find a histogram named/)
236 >  if ($output =~ m/Did not find a histogram named/ || $output =~ m/appears to be empty/ || $output =~ m/Failed to open/)
237      {
238        print $output;
239        return -1;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines