source: fact/tools/pyscripts/simulation/030/template_working_folder/notes.txt@ 15446

Last change on this file since 15446 was 14805, checked in by neise, 12 years ago
initial commit
File size: 599 bytes
Line 
1
2Hi,
3
4in order to get the data out of these root files I did:
5
6open root file on the command line
7 :~> root filename.root
8
9in root I checked the contents of the file using
10 .ls
11
12I see that there is a TH1F inside and I can also see its name --> histname
13then I get a pointer to that histo
14
15 TH1F *h = _file0.Get("histname");
16
17then I open an output text file:
18
19 ofstream myfile;
20 myfile.open("output_file_name.txt");
21
22now just loop over the histogram bins...
23 for (int i = 1; 1<301; i++) {
24 myfile << i << "\t" << h->GetBinContent(i) << endl;
25 }
26 myfile.close();
27
28
29that's it ...
Note: See TracBrowser for help on using the repository browser.