ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/OSUT3Analysis/Configuration/scripts/fitMCToData.py
(Generate patch)

Comparing UserCode/OSUT3Analysis/Configuration/scripts/fitMCToData.py (file contents):
Revision 1.4 by lantonel, Fri Aug 23 16:07:32 2013 UTC vs.
Revision 1.5 by ahart, Fri Aug 23 16:22:50 2013 UTC

# Line 366 | Line 366 | def MakeOneDHist(pathToDir,distribution)
366      def fitf (x, par):
367          xBin = HistogramsToFit[0].FindBin (x[0])
368          value = 0.0
369 +        sumOfWeights = 0.0
370          
371          for i in range (0, len (HistogramsToFit)):
372 <            value += par[i] * HistogramsToFit[i].GetBinContent (xBin)
372 >            weight = 1.0 / (HistogramsToFit[i].GetBinError (xBin) * HistogramsToFit[i].GetBinError (xBin))
373 >            sumOfWeights += weight
374 >            value += weight * par[i] * HistogramsToFit[i].GetBinContent (xBin)
375 >        value /= sumOfWeights
376              
377          return value
378  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines