This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| root:troubleshooting [2010/11/06 15:08] – 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* inputFile = TFile:: | + | |
| TFile* outputFile = new TFile(" | TFile* outputFile = new TFile(" | ||
| + | TFile* inputFile = TFile:: | ||
| // your code | // your code | ||
| outputFile-> | outputFile-> | ||
| </ | </ | ||
| - | but don't | + | |
| - | < | + | but instead do: |
| - | TFile* outputFile = new TFile(" | + | < |
| TFile* inputFile = TFile:: | TFile* inputFile = TFile:: | ||
| + | TFile* outputFile = new TFile(" | ||
| // your code | // your code | ||
| outputFile-> | outputFile-> | ||
| </ | </ | ||
| - | ===== Change Marker Style ===== | + | |
| - | To change the marker style, you have to do: | + | |
| - | <code C++> | + | |
| - | TGraph* myGraph = TGraph(); | + | |
| - | ... | + | |
| - | myGraph-> | + | |
| - | myGraph-> | + | |
| - | </ | + | |
| - | but it will not work if the marker style is set before the graph is drawn. | + | |
| - | as your file will be empty. | + | |