#include <string>
#include <iostream>
#include "TObject.h"
#include "TFile.h"
#include "TError.h"
#include "TKey.h"
#include "TClass.h"
#include "TTree.h"
#include "JROOT/JRootClass.hh"
#include "JROOT/JRootTypewriter.hh"
#include "JSupport/JLimit.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
Go to the source code of this file.
|
| int | main (int argc, char **argv) |
| | Example application to test printing of objects using ROOT dictionary.
|
| |
◆ main()
| int main |
( |
int | argc, |
|
|
char ** | argv ) |
Example application to test printing of objects using ROOT dictionary.
Definition at line 23 of file JRootTypewriter.cc.
24{
27
28 string inputFile;
32
33 try {
34
36
39 zap[
'n'] =
make_field(numberOfEvents,
"number of events, if applicable") = 1;
41
43 }
44 catch(const exception &error) {
46 }
47
49
50
51 TFile* in = TFile::Open(inputFile.c_str());
52
53 if (in ==
NULL || !in->IsOpen()) {
54 FATAL(
"Error opening file " << inputFile <<
endl);
55 }
56
57 if (
debug >= debug_t) {
58 for (
TIter i(in->GetListOfKeys());
TKey*
key =
dynamic_cast<TKey*
>(i.Next()); ) {
59 cout <<
"key: " <<
key->GetName() <<
' ' <<
key->GetClassName() <<
endl;
60 }
61 }
62
64
67 }
68
70
71 TClass* cs = TClass::GetClass(
key->GetClassName());
72
74
75 void* ps =
key->ReadObjectAny(cs);
76
77 if (cs == TTree::Class()) {
78
79 TTree* ts = (TTree*) ps;
80
82
85 }
86
87
88
90 ts->GetBranch(tp.getName())->SetAddress(tp.getAddress());
91 }
92
94
95 cout << ts->GetName() <<
"[" << i <<
"]:" <<
endl;
96
97 ts->GetEvent(i);
98
101 }
102 }
103
104 } else {
105
106 printer(
cout, cs->GetStreamerInfo(), (
const char*) ps);
107 }
108 }
109}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Template definition of a multi-dimensional oscillation probability interpolation table.
Utility class to parse command line options.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
ROOT readable class for TBranch.
Auxiliary class for defining the range of iterations of objects.
Auxiliary data structure to list files in directory.