25int main(
int argc,
char **argv)
41 zap[
'n'] =
make_field(numberOfEvents,
"number of events, if applicable") = 1;
46 catch(
const exception &error) {
47 FATAL(error.what() << endl);
50 gErrorIgnoreLevel = kError;
53 TFile* in = TFile::Open(inputFile.c_str());
55 if (in == NULL || !in->IsOpen()) {
56 FATAL(
"Error opening file " << inputFile << endl);
59 const TRegexp regexp(
target.c_str());
63 TIter iter(in->GetListOfKeys());
65 for (TKey* key; (key = (TKey*) iter.Next()) != NULL; ) {
67 const TString tag(key->GetName());
69 DEBUG(
"Key: " << tag <<
" match = " << tag.Contains(regexp) << endl);
73 if (tag.Contains(regexp) && TClass::GetClass(key->GetClassName())->IsTObject()) {
75 TClass* cs = TClass::GetClass(key->GetClassName());
79 DEBUG(
"TClass " << cs->GetName() << endl);
80 DEBUG(
"TKey::ReadObjectAny(..)" << endl);
82 void* ps = key->ReadObjectAny(cs);
84 if (cs == TTree::Class()) {
86 TTree* ts = (TTree*) ps;
88 DEBUG(
"TTree " << ts->GetName() << endl);
92 for (TIter next(ts->GetListOfBranches()); TBranch*
p1 =
dynamic_cast<TBranch*
>(next()); ) {
99 ts->GetBranch(tp.getName())->SetAddress(tp.getAddress());
104 cout << ts->GetName() <<
"[" << i <<
"]:" << endl;
106 DEBUG(
"TTree::GetEvent(" << i <<
")" << endl);
110 for (
auto& tp :
ls) {
117 printer(cout, cs->GetStreamerInfo(), (
const char*) ps);