This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
root:troubleshooting [2009/06/24 11:54] – created decianm | root:troubleshooting [2013/06/14 12:14] (current) – nchiap | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
+ | |||
+ | Root-files can be the source of various problems. | ||
+ | Usually they are caused by hidden changes in the internal state of ROOT. | ||
+ | ROOT stores the active directory and uses this to create new objects and look for existing ones. | ||
+ | The active directory is changed when a new file is opened. | ||
+ | This can lead to unexpected behaviours and hard to trace bugs. | ||
===== Empty Files ===== | ===== Empty Files ===== | ||
- | When you write a ROOT-file | + | |
- | < | + | When you get an an empty ROOT-file, check the right order of the files. |
- | file-> | + | Don't do |
- | </ | + | < |
- | and the file exists, but is empty, check the right order of the files: Do | + | TFile* outputFile = new TFile(" |
- | < | + | |
TFile* inputFile = TFile:: | TFile* inputFile = TFile:: | ||
- | TFile* outputFile = new TFile(" | ||
// your code | // your code | ||
outputFile-> | outputFile-> | ||
</ | </ | ||
- | but don't | + | |
- | < | + | but instead do: |
+ | < | ||
+ | TFile* inputFile = TFile:: | ||
TFile* outputFile = new TFile(" | TFile* outputFile = new TFile(" | ||
- | TFile* inputFile = TFile:: | ||
// your code | // your code | ||
outputFile-> | outputFile-> | ||
</ | </ | ||
- | as your file will be empty. | + | |
+ |