Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| root:pyroot_tfile [2017/07/11 11:28] – iwn | root:pyroot_tfile [2017/09/05 10:37] (current) – [Handling TFile files] iwn |
|---|
| | [[root:root|Getting started with ROOT]] -> [[root:pyroot|Useful pyROOT snippets]] → [[root:pyroot_tfile|Handling TFile files]] |
| | |
| ====== Handling TFile files ====== | ====== Handling TFile files ====== |
| |
| | Class references for: |
| | * ''[[https://root.cern.ch/doc/master/classTDirectory.html|TDirectory]]'', |
| | * ''[[https://root.cern.ch/doc/master/classTFile.html|TFile]]''. |
| ===== Adding a directory to a TFile ===== | ===== Adding a directory to a TFile ===== |
| |
| ===== 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()'' on some ''TDirectory'' or other ''TFile''. 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> |
| printGDirectory() | printGDirectory() |
| </file> | </file> |
| |
| |