User Tools

Site Tools


root:pyroot_tfile

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
root:pyroot_tfile [2017/06/13 09:39] โ€“ iwnroot:pyroot_tfile [2017/09/01 16:27] โ€“ iwn
Line 1: Line 1:
 +[[root:root|Getting started with ROOT]] -> [[root:pyroot|Useful pyROOT snippets]] โ†’ [[root:pyroot_tfile|Handling TFile files]]
 +
 ====== Handling TFile files ====== ====== Handling TFile files ======
  
Line 28: Line 30:
 ===== gDirectory ===== ===== gDirectory =====
  
-Note that ''gDirectory'' is the current directory containing all newly created saved objects, or those saved to this directory. If you just opened a file, this will be your current directory until you close it or use ''cd()''. Test the behavior:+Note that ''gDirectory'' is the current directory containing all newly created saved objects, or those saved to this directory. If you just opened a file, this will be your current directory until you close it or use ''cd()'' on some ''TDirectory'' or other ''TFile''. Test the behavior with this macro:
  
 <file python gDirectory.py> <file python gDirectory.py>
Line 44: Line 46:
 printGDirectory() printGDirectory()
  
-print ">>> creating some file with some contents"+print ">>> creating file with some contents"
 file = TFile("test.root","recreate") file = TFile("test.root","recreate")
 tree = TTree("tree","tree") tree = TTree("tree","tree")
Line 63: Line 65:
 printGDirectory() printGDirectory()
 </file> </file>
- 
  
root/pyroot_tfile.txt ยท Last modified: 2017/09/05 10:37 by iwn