lcsim/src/org/lcsim/contrib/JanStrube/standalone
diff -N fitPullDist.py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ fitPullDist.py 9 Oct 2006 16:40:39 -0000 1.1
@@ -0,0 +1,22 @@
+#! /usr/bin/env jython
+from hep.aida import IAnalysisFactory
+import sys
+
+filename = sys.argv[1]
+
+af = IAnalysisFactory.create()
+tf = af.createTreeFactory()
+ff = af.createFitFactory('jminuit')
+
+fitter = ff.createFitter('chi2')
+
+tree = tf.create(filename)
+
+
+for pull in 'pull_x', 'pull_y', 'pull_z':
+ p = tree.find(pull)
+ p.convertToHistogram()
+ h = p.histogram()
+ result = fitter.fit(h, 'g')
+ print result.fitStatus(), result.fittedParameterNames(), result.fittedParameters()
+