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 revisionBoth sides next revision
root:troubleshooting [2010/11/06 15:08] decianmroot:troubleshooting [2010/11/09 16:02] nchiap
Line 1: Line 1:
-====== Troubleshooting in ROOT ====== +====== Writing Root-files ====== 
-===== Empty Files ===== +<code C>
-When you write a ROOT-file in a method with: +
-<code> +
-file->Write() +
-</code> +
-and the file exists, but is empty, check the right order of the files: Do +
-<code>+
 TFile* inputFile = TFile::Open("myInputFile.root"); TFile* inputFile = TFile::Open("myInputFile.root");
 TFile* outputFile = new TFile("myOutputFile.root", "RECREATE"); TFile* outputFile = new TFile("myOutputFile.root", "RECREATE");
Line 12: Line 6:
 outputFile->Write(); outputFile->Write();
 </code> </code>
-but don't + 
-<code>+===== Empty Files ===== 
 + 
 +When you get an an empty ROOT-file, check the right order of the files. 
 +Don'do  
 +<code C>
 TFile* outputFile = new TFile("myOutputFile.root", "RECREATE"); TFile* outputFile = new TFile("myOutputFile.root", "RECREATE");
 TFile* inputFile = TFile::Open("myInputFile.root"); TFile* inputFile = TFile::Open("myInputFile.root");
Line 19: Line 17:
 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