Roosh problems with user-defined data-types

39 views
Skip to first unread message

Joseph McCartin

unread,
Mar 24, 2013, 3:21:26 PM3/24/13
to rootpy...@googlegroups.com
Hi, 

I'm new to rootpy, and I wanted to get started by making a simple histogram from an ntuple I need for my analysis.  I like the idea of using something like roosh to browse the available directories inside a file (it helps me get the naming right later in in a plotting script), but I'm having trouble doing this with the data-type that I have to work with.  I can get the libraries to load fine, but I am unable to browse inside each tree, or even list their contents.

I've pasted the output I get when I try and list the directories here: http://pastebin.com/s1QiFtDt  And I link the libraries and root files I use below:


Can anyone say if I'm doing something obviously wrong here?  I'm not new to root, but I'll freely admit that I'm not 100% familiar with how dictionaries work.  I should add that the root version I use to generate files with is 5.32.00, and this is the same environment that I use to view them.

Cheers,
Joseph

Noel Dawe

unread,
Mar 25, 2013, 6:24:06 PM3/25/13
to rootpy...@googlegroups.com

Hi Joseph,

It seems "tree" is actually a TTree and not a directory:

23:21|neutrino:0/3 ~> roosh 172_5_smeared_JES1.00.root
WARNING:ROOT.TClass.TClass] no dictionary for class beag::MET is available
WARNING:ROOT.TClass.TClass] no dictionary for class beag::Particle is available
WARNING:ROOT.TClass.TClass] no dictionary for class beag::Electron is available
WARNING:ROOT.TClass.TClass] no dictionary for class beag::Lepton is available
WARNING:ROOT.TClass.TClass] no dictionary for class beag::Muon is available
WARNING:ROOT.TClass.TClass] no dictionary for class beag::Jet is available
WARNING:ROOT.TClass.TClass] no dictionary for class beag::Trigger is available
WARNING:ROOT.TClass.TClass] no dictionary for class beag::Conversion is available
WARNING:ROOT.TClass.TClass] no dictionary for class beag::EventInformation is available
WARNING:ROOT.TClass.TClass] no dictionary for class beag::PrimaryVertex is available
WARNING:ROOT.TClass.TClass] no dictionary for class beag::TTbarGenEvent is available
Welcome to the ROOSH terminal
type help for help
172_5_smea..S1.00.root > ls
tag_name_mapping  tree  trigger_name_mapping
172_5_smea..S1.00.root > load tree
172_5_smea..S1.00.root > tree
Tree('tree')
172_5_smea..S1.00.root >

If you have termcolor installed trees should be green in your terminal.

Cheers,
Noel

Joseph McCartin

unread,
Mar 26, 2013, 9:24:48 AM3/26/13
to rootpy...@googlegroups.com
Hi,

Thanks for clearing this up.  I was just following the only example I could find on the rootpy.org documentation and couldn't see much about loading trees there.  Either way, I use green on black terminal text, so it's no surprise that I didn't see it show up differently :)

Cheers,
Joseph

--
You received this message because you are subscribed to the Google Groups "rootpy users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rootpy-users...@googlegroups.com.
To post to this group, send email to rootpy...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rootpy-users/-/t1GZ1Y3wFoEJ.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

Noel Dawe

unread,
Mar 26, 2013, 9:45:43 AM3/26/13
to rootpy...@googlegroups.com
Hi Joseph,

Documentation for the command-line tools is something we are currently lacking. Hopefully coming soon! Help is also welcome :)

roosh does have some built-in help with the "help" command:

172_5_smea..S1.00.root > help

Documented commands (type help <topic>):
========================================
EOF  canvas  cd  env  exit  help  load  ls  pwd  python  roosh  shell

Undocumented commands:
======================
mkdir

172_5_smea..S1.00.root > help load
load the specified object into the current namespace
TTrees are not loaded automatically when cd'ing into a directory
Use this command to load TTrees or other objects not in current directory
Use 'load foo as bar' to alias the object named foo as bar

Cheers,
Noel


Vancouver: +1 778 373 9738
Geneva: +41 76 631 44 50 (cell)
Skype: noel.dawe
Reply all
Reply to author
Forward
0 new messages