<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://wiki.physik.uzh.ch/cms/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://wiki.physik.uzh.ch/cms/feed.php">
        <title>CMS Wiki Pages - root</title>
        <description></description>
        <link>https://wiki.physik.uzh.ch/cms/</link>
        <image rdf:resource="https://wiki.physik.uzh.ch/cms/_media/wiki:dokuwiki.svg" />
       <dc:date>2026-05-21T13:41:56+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://wiki.physik.uzh.ch/cms/root:example_ttree?rev=1498137941&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.physik.uzh.ch/cms/root:fit?rev=1505145169&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.physik.uzh.ch/cms/root:pyroot_tfile?rev=1504600665&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.physik.uzh.ch/cms/root:pyroot_th1?rev=1504600553&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.physik.uzh.ch/cms/root:pyroot_ttree?rev=1519823003&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.physik.uzh.ch/cms/root:pyroot?rev=1504616733&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.physik.uzh.ch/cms/root:root?rev=1504802792&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://wiki.physik.uzh.ch/cms/_media/wiki:dokuwiki.svg">
        <title>CMS Wiki Pages</title>
        <link>https://wiki.physik.uzh.ch/cms/</link>
        <url>https://wiki.physik.uzh.ch/cms/_media/wiki:dokuwiki.svg</url>
    </image>
    <item rdf:about="https://wiki.physik.uzh.ch/cms/root:example_ttree?rev=1498137941&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2017-06-22T13:25:41+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>example_ttree</title>
        <link>https://wiki.physik.uzh.ch/cms/root:example_ttree?rev=1498137941&amp;do=diff</link>
        <description>Below is an example on the use of TTree in pyROOT. Run in the command line with


$ python trees.py


and check output with


$ root -l tree.root
root [1] TBrowser a



#! /usr/bin/env python

import time
start = time.time()

from ROOT import gRandom, TFile, TTree, TH1D
from array import array
import numpy # alternative to array

# Add branch to existing tree:
#    https://root.cern.ch/phpBB3/viewtopic.php?t=9661
#
# Write directories into root files:
#    https://root.cern.ch/root/html/tutorial…</description>
    </item>
    <item rdf:about="https://wiki.physik.uzh.ch/cms/root:fit?rev=1505145169&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2017-09-11T15:52:49+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>fit</title>
        <link>https://wiki.physik.uzh.ch/cms/root:fit?rev=1505145169&amp;do=diff</link>
        <description>[in progress]

Fitting in ROOT

Useful material on fitting in ROOT:

	*  Fitting guide by ROOT.

Useful materials on `RooFit`:

	*  RooFit Manual (python) and RooFit Quick Start
	*  Official RooFit tutorials in C++ (python).
	*  TWiki on RooFit &amp; RooStats.</description>
    </item>
    <item rdf:about="https://wiki.physik.uzh.ch/cms/root:pyroot_tfile?rev=1504600665&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2017-09-05T08:37:45+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>pyroot_tfile</title>
        <link>https://wiki.physik.uzh.ch/cms/root:pyroot_tfile?rev=1504600665&amp;do=diff</link>
        <description>Getting started with ROOT -&gt; Useful pyROOT snippets → Handling TFile files

Handling TFile files

Class references for:

	*  TDirectory,
	*  TFile.

Adding a directory to a TFile

Here is a basic example creating a file with on directory. If you want to create and save an object in this directory, e.g. a tree or histogram, use dir.cd()</description>
    </item>
    <item rdf:about="https://wiki.physik.uzh.ch/cms/root:pyroot_th1?rev=1504600553&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2017-09-05T08:35:53+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>pyroot_th1</title>
        <link>https://wiki.physik.uzh.ch/cms/root:pyroot_th1?rev=1504600553&amp;do=diff</link>
        <description>Getting started with ROOT -&gt; Useful pyROOT snippets → Handling TH1 histograms

Handling TH1 histograms

Here is the class reference for TH1.

Importing ROOT classes

To use TH1D in python, you can either only import a TH1D class:


from ROOT import TH1D
hist = TH1D(&quot;hist_name&quot;,&quot;hist_title&quot;,100,0,100)


or all classes:


from ROOT import * # loads all classes, and thus takes longer
hist = TH1D(&quot;hist_name&quot;,&quot;hist_title&quot;,100,0,100)</description>
    </item>
    <item rdf:about="https://wiki.physik.uzh.ch/cms/root:pyroot_ttree?rev=1519823003&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2018-02-28T13:03:23+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>pyroot_ttree</title>
        <link>https://wiki.physik.uzh.ch/cms/root:pyroot_ttree?rev=1519823003&amp;do=diff</link>
        <description>Getting started with ROOT -&gt; Useful pyROOT snippets → Handling TTree trees

Handling TTree trees

Here is the class reference for TTree.

Here is one file containing multiple examples.

Creating a TTree with branches and writing it to a TFile

Below is an example of creating and saving a tree with two branches (variables) each containing a randomly distributed variable for each event.</description>
    </item>
    <item rdf:about="https://wiki.physik.uzh.ch/cms/root:pyroot?rev=1504616733&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2017-09-05T13:05:33+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>pyroot</title>
        <link>https://wiki.physik.uzh.ch/cms/root:pyroot?rev=1504616733&amp;do=diff</link>
        <description>Getting started with ROOT -&gt; Useful pyROOT snippets

Useful pyROOT snippets

Here are some loose examples of ROOT in python that may be useful:

	*  handling TTree trees,
	*  handling TH1 histograms,
	*  handling TFile files and TDirectory directories,
	*  RooFit and RooStats tutorials, RooFit manual.
	*  more by the LHCb group.

(More snippets to follow.)</description>
    </item>
    <item rdf:about="https://wiki.physik.uzh.ch/cms/root:root?rev=1504802792&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2017-09-07T16:46:32+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>root</title>
        <link>https://wiki.physik.uzh.ch/cms/root:root?rev=1504802792&amp;do=diff</link>
        <description>Getting started with ROOT

ROOT is a framework based on C++ that is specialized in processing data in High Energy Physics. Some of its central classes are

	*  TTree to store data; typically variables are stored in branches for each entry/event (e.g. a proton-proton collision),</description>
    </item>
</rdf:RDF>
