Auxiliary program to print ROOT TChain information.
More...
#include <string>
#include <iostream>
#include <iomanip>
#include <set>
#include <memory>
#include <string.h>
#include "TError.h"
#include "TROOT.h"
#include "TFile.h"
#include "TKey.h"
#include "TTree.h"
#include "TChain.h"
#include "JSystem/JGlob.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
Auxiliary program to print ROOT TChain information.
- Author
- mdejong
Definition in file JPrintChain.cc.
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 66 of file JPrintChain.cc.
76 JParser<> zap(
"Auxiliary program to print ROOT TChain information.");
83 catch(
const exception &error) {
84 FATAL(error.what() << endl);
87 gErrorIgnoreLevel = kFatal;
95 TFile* file = TFile::Open(file_name->c_str());
99 TIter iter(file->GetListOfKeys(), kIterBackward);
101 for (TKey* key; (key = (TKey*) iter.Next()) != NULL; ) {
103 TKey* p =
dynamic_cast<TKey*
>(file->GetListOfKeys()->Before(key));
105 if (p == NULL || strcmp(key->GetName(), p->GetName()) != 0) {
107 TTree* tree =
dynamic_cast<TTree*
>(key->ReadObj());
110 buffer.insert(JChain(tree->GetName()));
121 for (
auto& chain : buffer) {
124 chain->Add(file_name->c_str());
127 cout << setw(24) << left << chain->GetName() <<
' '
128 << setw(10) << right << chain->GetEntries() << endl;
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Utility class to parse command line options.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
static JGlob getFilenames
Function object to get list of files for given pattern.