root2data

This module provides the root2data class.

class mATLASplotlib.converters.root2data.root2data(root_object, remove_zeros=False)

Bases: object

Interpreter for ROOT objects.

__init__(root_object, remove_zeros=False)

Extract x/y/z information from a ROOT object.

Parameters:
  • root_object (ROOT.TObject) – ROOT input to interpret
  • remove_zeros (bool) – whether to remove points with a value of 0
construct_from_TF1(input_TF1)

Read TF1 into x, y dimensions.

Parameters:input_TF1 (ROOT.TF1) – input TF1
construct_from_TGraph(input_TGraph)

Read TGraph into x, y dimensions.

Parameters:input_TGraph (ROOT.TGraph) – input TGraph
construct_from_TGraphAsymmErrors(input_TGraphAsymmErrors)

Read TGraphErrors into x, y dimensions.

Parameters:input_TGraphAsymmErrors (ROOT.TGraphAsymmErrors) – input TGraphAsymmErrors
construct_from_TGraphErrors(input_TGraphErrors)

Read TGraphErrors into x, y dimensions.

Parameters:input_TGraphErrors (ROOT.TGraphErrors) – input TGraphErrors
construct_from_TH1(input_TH1)

Read TH1 into x, y dimensions.

Parameters:input_TH1 (ROOT.TH1) – input TH1
construct_from_TH2(input_TH2)

Read TH2 into x, y, z dimensions.

Parameters:input_TH2 (ROOT.TH2) – input TH2
do_zero_removal()

Remove points with zero y-value.

static valid_input(test_object)

Check that the input object is a valid ROOT TObject.

Parameters:test_object (object) – input object to invesigate
Returns:whether the input object is a ROOT TObject
Return type:bool