Welcome to Mephisto’s documentation!¶
Mephisto aims to deliver a smoother and more intuitive workflow for making plots with the python extension of the ROOT Data Analysis Framework. By enhancing the functionality of the fundamental classes implemented in ROOT and offering simple and efficient I/O solutions for frequent tasks the user can hopefully dedicate more time to make pretty histograms!
Mephisto contains core classes that offer the same basic functionality as their ROOT pendants from which they inherit. In addition both new methods are added and some existing ones are enhanced.
Let’s consider an example: The Histo1D class for example inherits from ROOT’s
TH1D class. The
Fill() method is
now extended to also allow filling the histogram with events from a TTree in a given
TFile. If you want to save the histogram as a PDF file for example, you can just use
Print() method to do so. It even lets you change any property of the object
by simply adding it as a keyword argument.
All together it would look something like this:
h = Histo1D("name", "title", 100, 0.0 100.0) h.Fill("path/to/file.root", tree="treename", varexp="tau1Pt", cuts=["MET>150", "jet1Btag==1"], weight="evt_weight") h.Print("tau1Pt.pdf", linewidth=5)
Wait, what’s a property?¶
Basically anything you can access and change with getter and setter method of the form
Set<PropertyName>(). In the light of above’s example
then `linewidth’ would be a property of a Histo1D object, since it has the methods
SetLineWidth() (as it inherits from TH1D). So make sure
to check out the official ROOT documentation to find out which properties are
available for any of the core classes parents!