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.22 by jbrinson, Mon Apr 8 12:40: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 +
159 + foreach my $arg (keys %weights)
160 + {
161 +    my $shortArg = $arg;
162 +    $shortArg =~ s/^.*\/([^\/]*)$/$1/;
163 +    $output = sprintf "%s  $shortArg: CrossSection =  %.5g/pb\n", $output, ($crossSections{$dirs{$arg}});
164 +    $printOutput = 1 if $weights{$arg} != 1;
165 + }
166 +
167   print $output if $printOutput;
168   $output = sprintf "Weights for target luminosity of %g/fb:\n", ($integratedLuminosity / 1000.0);
169   $printOutput = 0;
# Line 153 | Line 171 | foreach my $arg (keys %weights)
171    {
172      my $shortArg = $arg;
173      $shortArg =~ s/^.*\/([^\/]*)$/$1/;
174 <    $output = sprintf "%s  $shortArg: %.5g\n", $output, $weights{$arg};
174 >    $output = sprintf "%s  $shortArg: %.5g\n", $output, $weights{$arg} if $weights{$arg} != 1;
175      $printOutput = 1 if $weights{$arg} != 1;
176    }
177   print $output if $printOutput;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines