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
Next revisionBoth sides next revision
root:troubleshooting [2010/11/06 15:08] decianmroot:troubleshooting [2010/11/26 14:42] decianm
Line 1: Line 1:
-====== Troubleshooting in ROOT ======+====== Writing Root-files ====== 
 ===== 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 +
-<code> +
-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>
-but don't + 
-<code> +but instead do: 
-TFile* outputFile = new TFile("myOutputFile.root", "RECREATE");+<code C>
 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>
- 
-===== Change Marker Style ===== 
-To change the marker style, you have to do: 
-<code C++> 
-TGraph* myGraph = TGraph(); 
-... 
-myGraph->Draw(); 
-myGraph->SetMarkerStyle(20); 
-</code> 
-but it will not work if the marker style is set before the graph is drawn. 
-as your file will be empty. 
root/troubleshooting.txt · Last modified: 2013/06/14 12:14 by nchiap