11 int main(
int argc,
char *argv[]){
12 for(
int arg = 1; arg < argc; ++arg){
13 TFile file(argv[arg],
"read");
14 if(file.IsZombie() || !file.IsOpen()){
15 cerr <<
"Could not open " << argv[arg] <<
'\n' << endl;
20 file.GetObject(
"treeglobal", tree);
22 cerr <<
"Could not find \"treeglobal\" in " << argv[arg] <<
'\n' << endl;
26 TString *model = NULL;
27 TString *commit = NULL;
32 tree->SetBranchAddress(
"model", &model);
33 tree->SetBranchAddress(
"type", &type);
34 tree->SetBranchAddress(
"nev_file", &nev_file);
35 tree->SetBranchAddress(
"nev_sample", &nev_sample);
36 tree->SetBranchAddress(
"commit", &commit);
38 const int num_entries = tree->GetEntries();
40 cerr <<
"\"treeglobal\" has no entries in " << argv[arg] <<
'\n' << endl;
42 }
else if(num_entries > 1){
43 cerr <<
"\"treeglobal has multiple entries in " << argv[arg] <<
'\n' << endl;
47 const int bytes_read = tree->GetEntry(0);
49 cerr <<
"\"Could not get entry 0 from \"treeglobal\" in " << argv[arg] <<
'\n' << endl;
54 cerr <<
"Read a null pointer for model string in " << argv[arg] <<
'\n' << endl;
59 cerr <<
"Read a null pointer for commit string in " << argv[arg] <<
'\n' << endl;
64 cerr <<
"Read a null pointer for type string in " << argv[arg] <<
'\n' << endl;
68 cout <<
" File: " << argv[arg] << endl;
70 cout <<
" File Entries: " << nev_file << endl;
71 cout <<
"Sample Entries: " << nev_sample << endl;
std::string RemoveTrailingNewlines(std::string str)
int main(int argc, char *argv[])