Difference: TimothyBrooks (10 vs. 11)

Revision 1108 Apr 2010 - TimothyBrooks

Line: 1 to 1
 
META TOPICPARENT name="TWikiUsers"

My Links

Deleted:
<
<
 

ATLAS Links

Line: 12 to 11
 

Programming Tips

Added:
>
>

PyROOT

Basic script

import user 
import ROOT
import PyCintex
import AthenaROOTAccess.transientTree

# a bit less ugly ROOT style...
ROOT.gROOT.SetStyle("Plain")

f = ROOT.TFile.Open('/scratch0/brooks/MC09/mc09_7TeV.105200.T1_McAtNlo_Jimmy.recon.AOD.e510_s765_s767_r1205_tid123042_00/AOD.123042._000001.pool.root.1')
tt = AthenaROOTAccess.transientTree.makeTree(f)

Save this as something like tutorial.py and run it using python -i tutorial.py

Some things to play around with

  • from PyAnalysisUtils import PDG Lets you use PDG. instead of remembering pdgIds. Cool feature -> PDG.root_names[-PDG.nu_mu] returns a string with the ROOT syntax for an anti-muon-neutrino.
  • import AthenaCommon.SystemOfUnits as Units Gives you a Units object with most units in the ATLAS base units. e.g. Units.TeV = 1000000.0
  • ROOT.gROOT.SetBatch(True) Switches Root to batch mode.
 

Root

Deleted:
<
<
 

Installing Root

Changed:
<
<
Root can be downloaded from root.cern.ch There are a few packages you will need on your system; on ubuntu 9.10, I needed libx11-dev, libxft-dev, libxpm-dev and libxext-dev. All the requirements the root page recommends can be had using:
>
>
The easiest method is if your distro has a root package. These don't seem to be kept very up-to-date, but I think Root is stable enough to use older versions for most features. On Ubuntu, there is a package called root-system so you can simply run:
sudo apt-get install root-system
This dumps the root binarys into /usr/bin and the libraries into /usr/lib/root, but I think the relevant paths get set up for you in the installation, so you needn't worry about the 'Setting up root' section below.

Installing Root from source

The Root source code can be downloaded from root.cern.ch There are a few packages you will need on your system; on ubuntu 9.10, I needed libx11-dev, libxft-dev, libxpm-dev and libxext-dev. All the requirements the root page recommends can be had using:
 
sudo apt-get install make g++ gcc binutils libx11-dev libxpm-dev libxft-dev libxext-dev
Once that's done; untar the root package and in the unzipped folder run ./configure --prefix=/usr/local --enable-soversion then make (or, if you want; make -j n where j is the number of cores in your machine)
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding RHUL Physics Department TWiki? Send feedback