Last active
August 29, 2015 14:06
-
-
Save pn11/98d0eea88d0bfd18f4a5 to your computer and use it in GitHub Desktop.
指定したROOTファイルに含まれるTTreeの中身を表示するだけのプログラム。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<TList.h> | |
#include<TFile.h> | |
int main(int argc, char* argv[]){ | |
using namespace std; | |
TFile *f1 = new TFile(argv[1]); | |
TList *l1 = f1->GetListOfKeys(); | |
const Int_t nentry = l1->GetEntries(); | |
TObject *obj[nentry]; | |
for (int ientry = 0; ientry < nentry; ientry++){ | |
obj[ientry] = f1->Get(l1->At(ientry)->GetName()); | |
string clstr = obj[ientry]->ClassName(); | |
// cout << clstr << endl; | |
if (clstr == "TTree"){ | |
// cout << "TTree: " << obj[ientry]->GetName() <<endl; | |
obj[ientry]->Print(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment