28 public std::unique_ptr<TChain>
41 JChain(
const char*
const name) :
42 std::unique_ptr<TChain>(new TChain(name))
52 friend inline bool operator<(
const JChain& first,
const JChain& second)
54 return strcmp(first->GetName(), second->GetName()) < 0;
66 int main(
int argc,
char **argv)
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;
General purpose messaging.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
int main(int argc, char **argv)
Utility class to parse command line options.
bool operator<(const Head &first, const Head &second)
Less than operator.
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.