User Tools

Site Tools


software:root:tfile

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
software:root:tfile [2022/06/26 15:41]
odagawa
software:root:tfile [2022/07/29 12:44] (current)
odagawa
Line 5: Line 5:
  
   * ''file->Close()'' を忘れていた   * ''file->Close()'' を忘れていた
 +
 +  * ファイルに TObject を詰めた際に,ROOT セッションで開いたファイル中のオブジェクトをうまく指定できない
 +  * 例えば, TGraph が ''Graph;1'' のように現れてうまく開けない \\ これはオブジェクトの名前をつけていないのが原因だった.
 +<code>
 +  TFile *file = new TFile("test,root", "recreate");
 +  TGraph *g = new TGraph();
 +  g->SetName("g"); // これが必要
 +  file->cd();
 +  g->Write();
 +  file->Close();  
 +</code>
software/root/tfile.1656258079.txt.gz · Last modified: 2022/06/26 15:41 by odagawa