#!/usr/bin/python -i # This script shows how to use the TTree::Draw to do # simple (but sometimes quite fancy) analysis. # import aa ; nb: this example can be run without loading any libraries from ROOT import * filename = "/sps/km3net/users/heijboer/example_files/km3_v4_nueCC_1.JTE.root.aa.root" c = TCanvas("c","c",600,600) c.Divide(2,2) f = TFile( filename ) # ============================================================== # neutrino directions c.cd(1) E.Draw("acos(mc_trks[0].dir.z):atan2(mc_trks[0].dir.y, mc_trks[0].dir.x)") # ============================================================== # plot track multiplicity c.cd(2) E.Draw("@mc_trks.size()-1") # subtract 1 (=the neutrino) # ============================================================== # energy of highest energy track (not including the neutrino) c.cd(3) E.Draw("log10(MaxIf$(mc_trks[].E,Iteration$>0))") # ======================================= # neutrino energy, for an E-2 spectrum E.Draw("log10(mc_trks[0].E)","w[1]*mc_trks[0].E**-2") c.Update()