From a453c9fdb810dd2673a9ce6d4b2dc752809c733b Mon Sep 17 00:00:00 2001 From: Louis Moureaux Date: Fri, 22 Jun 2018 17:52:25 +0200 Subject: [PATCH 01/14] Add man page for gemTreeDrawWrapper.py Currently only Synopsis and Description --- doc/conf.py | 2 ++ doc/macros.rst | 8 ++++---- doc/man/gemTreeDrawWrapper.rst | 4 ++++ macros/gemTreeDrawWrapper.py | 31 ++++++++++++++++++++++++++++--- 4 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 doc/man/gemTreeDrawWrapper.rst diff --git a/doc/conf.py b/doc/conf.py index b0a64aba..4274cfe0 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -222,6 +222,8 @@ [u'Cameron Bravo, Mykhailo Dalchenko, Brian Dorney, Louis Moureaux, Jared Sturdy'], 1), ('man/gemPlotter', 'gemPlotter.py', u'Plot time evolution of scan results', [u'Cameron Bravo, Mykhailo Dalchenko, Brian Dorney, Louis Moureaux, Jared Sturdy'], 1), + ('man/gemTreeDrawWrapper', 'gemTreeDrawWrapper.py', u'Make X-Y plots for each scan date', + [u'Cameron Bravo, Mykhailo Dalchenko, Brian Dorney, Louis Moureaux, Jared Sturdy'], 1), ] # If true, show URL addresses after external links. diff --git a/doc/macros.rst b/doc/macros.rst index b724f586..25c30948 100644 --- a/doc/macros.rst +++ b/doc/macros.rst @@ -46,10 +46,10 @@ Macros :undoc-members: :show-inheritance: -.. automodule:: gemTreeDrawWrapper - :members: - :undoc-members: - :show-inheritance: +.. toctree:: + :maxdepth: 1 + + man/gemTreeDrawWrapper .. automodule:: packageFiles4Docker :members: diff --git a/doc/man/gemTreeDrawWrapper.rst b/doc/man/gemTreeDrawWrapper.rst new file mode 100644 index 00000000..684dce92 --- /dev/null +++ b/doc/man/gemTreeDrawWrapper.rst @@ -0,0 +1,4 @@ +.. automodule:: gemTreeDrawWrapper + :members: + :undoc-members: + :show-inheritance: diff --git a/macros/gemTreeDrawWrapper.py b/macros/gemTreeDrawWrapper.py index 0422785c..aa42259a 100755 --- a/macros/gemTreeDrawWrapper.py +++ b/macros/gemTreeDrawWrapper.py @@ -1,8 +1,33 @@ #!/bin/env python -""" -gemTreeDrawWrapper -================== +r""" +``gemTreeDrawWrapper.py`` --- Make X-Y plots for each scan date +=============================================================== + +Synopsis +-------- + +**gemTreeDrawWrapper.py** :token:`--anaType` <*ANALYSIS TYPE*> :token:`--treeExpress` <*EXPRESSION*> :token:`-i` <*INPUT FILE*> [*OPTIONS*] + +Description +----------- + +The :program:`gemTreeDrawWrapper.py` tool is for making a given 'Y vs. X' plot +for each scandate of interest. Here Y and X are quantities stored in +``TBranches`` of one of the ``TTree`` objects produced by the (ana-) ultra scan +scripts. This is designed to complement :program:`gemPlotter.py` and should +speed up plotting in general. This tool is essesntially a wrapper for the +``TTree::Draw()`` method. To make full use of this tool you should familiarize +yourself with the ``TTree::Draw()`` `documentation`_. + +.. _documentation: https://root.cern.ch/doc/master/classTTree.html#a73450649dc6e54b5b94516c468523e45 + +Additionally :program:`gemTreeDrawWrapper.py` can also fit produced plots with a +function defined at runtime through the command line arguments. + +Each plot produced will be stored as an output ``*.png`` file. Additionally an +output ``TFile`` will be produced which will contain each of the plots, stored +as ``TGraph`` objects, canvases, and fits produced. """ def getPlotFromTree(filename, treeName, expression, selection=""): From 70e2350bb3e18d6fe5c978ffef8884982422cf4f Mon Sep 17 00:00:00 2001 From: Louis Moureaux Date: Fri, 22 Jun 2018 18:09:52 +0200 Subject: [PATCH 02/14] Document arguments of gemTreeDrawWrapper.py --- macros/gemTreeDrawWrapper.py | 108 +++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) diff --git a/macros/gemTreeDrawWrapper.py b/macros/gemTreeDrawWrapper.py index aa42259a..01392e33 100755 --- a/macros/gemTreeDrawWrapper.py +++ b/macros/gemTreeDrawWrapper.py @@ -28,6 +28,114 @@ Each plot produced will be stored as an output ``*.png`` file. Additionally an output ``TFile`` will be produced which will contain each of the plots, stored as ``TGraph`` objects, canvases, and fits produced. + +Mandatory arguments +------------------- + +The following list shows the mandatory inputs that must be supplied to execute +the script. + +.. program:: gemTreeDrawWrapper.py + +.. option:: --anaType + + Analysis type to be executed, see :any:`utils.anaInfo.tree_names` for + possible inputs. + +.. option:: --treeExpress + + Expression to be drawn, corresponds to the ``varexp`` argument of + ``TTree::Draw()``. + +.. option:: -i, --infilename + + Physical filename of the input file to be passed to + :program:`gemPlotter.py`. See :any:`Two Column Format` for details on the + format and contents of this file. + +Note for those :option:`--anaType` values which have the substring ``Ana`` in +their names it is expected that the user has already run :program:`ana_scans.py` +on the corresponding ``scandate`` to produce the necessary input file for +:program:`gemPlotter.py`. + +Optional arguments +------------------ + +.. option:: --axisMaxX + + Maximum value for X-axis range. + +.. option:: --axisMinX + + Maximum value for Y-axis range. + +.. option:: --axisMinY + + Minimum value for Y-axis range, note this parameter will default to 0 + :option:`--axisMaxY` is given. + +.. option:: --drawLeg + + When used with :option:`--summary` option draws a ``TLegend`` on the output + plot. + +.. option:: --fitFunc + + Expression following the `TFormula syntax`_ for defining a ``TF1`` to be + fitted to the plot. + + .. _TFormula syntax: https://root.cern.ch/doc/master/classTFormula.html + +.. option:: --fitGuess + + Initial guess for fit parameters defined in :option:`--fitFunc`. Note, order + of params here should match that of :option:`--fitFunc`. + +.. option:: --fitOpt