User Tools

Site Tools


root:troubleshooting

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
root:troubleshooting [2009/06/24 11:54] decianmroot:troubleshooting [2013/06/14 12:14] (current) nchiap
Line 1: Line 1:
-====== Troubleshooting in ROOT ======+====== Root-files ====== 
 + 
 +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 in a method with: + 
-<code> +When you get an an empty ROOT-file, check the right order of the files
-file->Write() +Don't do  
-</code> +<code C> 
-and the file exists, but is empty, check the right order of the files: Do +TFile* outputFile = new TFile("myOutputFile.root", "RECREATE");
-<code>+
 TFile* inputFile = TFile::Open("myInputFile.root"); TFile* inputFile = TFile::Open("myInputFile.root");
-TFile* outputFile = new TFile("myOutputFile.root", "RECREATE"); 
 // your code // your code
 outputFile->Write(); outputFile->Write();
 </code> </code>
-but don't + 
-<code>+but instead do: 
 +<code C> 
 +TFile* inputFile = TFile::Open("myInputFile.root");
 TFile* outputFile = new TFile("myOutputFile.root", "RECREATE"); TFile* outputFile = new TFile("myOutputFile.root", "RECREATE");
-TFile* inputFile = TFile::Open("myInputFile.root"); 
 // your code // your code
 outputFile->Write(); outputFile->Write();
 </code> </code>
-as your file will be empty.+ 
 + 
root/troubleshooting.1245837292.txt.gz · Last modified: 2009/06/24 11:54 by decianm