Skip to content

Tutorial IV: Analysis Modules

Thomas Mueller edited this page Aug 19, 2019 · 20 revisions

This tutorial is based on the ROOT files generated in the first step.

Preparation

Fast creation of dummy inputs for testing

The input module InputInteractive can create ROOT histogram, graph and function objects on the fly without any need for complicated input files. These objects are ideal for quickly checking the implementation and usage of analysis modules. They might be less useful for real scientific work. The module is steered with a minimal set of parameters

  • -x/y/z or --x/y/z-expressions
  • --x/y/z-bins
  • --x/y/z-errors
  • --x/y-errors-up
  • -w or --weights
  • --scale-factors

and their values define the mode of the module for a given input. The mode can be different for each input object.

Histograms

Histograms are created if --x-bins is provided and the value of -x contains more than one element (split by whitespaces). Currently, no profile histograms are supported at this level, but higher-dimension histograms can be profiled lateron in analysis modules.

  • TH1D:

     harry.py --input-modules InputInteractive --x-bins 3,0.5,3.5 -x "1 2 3 2 1 2 3" "2 1 2" -m LINE
     harry.py --input-modules InputInteractive --x-bins 3,0.5,3.5 -x "1 2 3 2 1" -w "0.5 1 2 0.5 1" -m E
     harry.py --input-modules InputInteractive --x-bins 3,0.5,3.5 -x "1 2 3" -y "3 2 1" --y-errors "2 1 0.5" -m E

    plots/dummy_histogram_1d_fill.png plots/dummy_histogram_1d_weights.png plots/dummy_histogram_1d_bin_contents.png

  • TH2D:

     harry.py --input-modules InputInteractive --x-bins 2,0.5,2.5 --y-bins 2,0.5,2.5 -x "1 1 2 2 2" -y "1 1 1 2 2" -w "1 1 1 1 0.5"
     harry.py --input-modules InputInteractive --x-bins 2,0.5,2.5 --y-bins 2,0.5,2.5 -x "1 1 2 2" -y "1 2 1 2" -z "1 2 3 4"

    plots/dummy_histogram_2d_fill.png plots/dummy_histogram_2d_bin_contents.png

  • TH3D: This module can fill 3D histograms in an analog way, but HarryPlotter is ont (yet) optimised for the display of 3D objects. However, these histograms can make sense in studies with further processing such as projections on one or two axes.

Graphs

Graphs are created if at least -x and -y but no binning is provided.

  • TGraphErrors:

     harry.py --input-modules InputInteractive -x "1 2 3 4 5" -y "5 3 1 2 4" -m LP --filename dummy_graph
     harry.py --input-modules InputInteractive -x "1 2 3 4 5" -y "5 3 1 2 4" --x-errors "0.5 0.5 0.5 0.5 0.5" --y-errors "2 2 1 1 2" -m P --filename dummy_graph_errors

    plots/dummy_graph.png plots/dummy_graph.png

  • TGraphAsymmErrors:

     harry.py --input-modules InputInteractive -x "1 2 3 4 5" -y "5 3 1 2 4" --x-errors "0.5 0.5 0.5 0.5 0.5" --x-errors-up "0.7 0.7 0.7 0.7 0.7" --y-errors "2 2 1 1 2" --y-errors-up "1 1 2 2 1" -m P --filename dummy_graph_asymmerrors

    plots/dummy_graph_asymmerrors.png

  • TGraph2DErrors: This module can fill 3D graphs in an analog way, but HarryPlotter is ont (yet) optimised for the display of 3D objects.

Functions

Commonly used analysis modules

All available analysis modules are shown with

harry.py --list-available-modules
harry.py --li # the python argument parser completes long arguments in case the mapping is unique

Normalisation of histograms

Ratios of histograms

Sum of histograms

Fitting functions to histograms

Efficiencies and cuts

Implementing new analysis modules

Accessing Inputs

Saving outputs

Customizations

Clone this wiki locally