174{
177
179 tree_info ta;
180 tree_info tb;
183
185
192
193 try {
194
196
199
200 JParser<> zap(
"Auxiliary program to print ROOT TTree information.");
201
206
207 zap(argc, argv);
208 }
209 catch(const exception &error) {
210 FATAL(error.what() << endl);
211 }
212
213 gErrorIgnoreLevel = kFatal;
214
215 inputFile = getFilenames(inputFile);
216
217 int number_of_errors = 0;
218
219 for (vector<string>::const_iterator file_name = inputFile.begin(); file_name != inputFile.end(); ++file_name) {
220
221 TFile* file = TFile::Open(file_name->c_str());
222
223 if (file == NULL) {
224
225 ++number_of_errors;
226
227 cerr << *file_name << " not opened." << endl;
228
229 continue;
230 }
231
232 if (key == "") {
233 cout << *file_name << endl;
234 }
235
236 TIter iter(file->GetListOfKeys(), kIterBackward);
237
238 for (TKey* _key; (_key = (TKey*) iter.Next()) != NULL; ) {
239
240 TKey* p = dynamic_cast<TKey*>(file->GetListOfKeys()->Before(_key));
241
242 DEBUG(
"Key: " << _key->GetName() <<
' ' << (p == NULL || strcmp(_key->GetName(), p->GetName()) != 0) << endl);
243
244 if (p == NULL || strcmp(_key->GetName(), p->GetName()) != 0) {
245
246 tb = tree_info(dynamic_cast<TTree*>(_key->ReadObj()));
247
249
250 if (tb.is_valid() && ta == tb) {
251
252 if (key == "")
253 cout << tb << endl;
254 else
255 format.
write(cout, key) <<
' ';
256 }
257 }
258 }
259
260 file->Close();
261
262 delete file;
263 }
264
265 return (number_of_errors == 0 ? 0 : 1);
266}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
#define gmake_property(A)
macros to convert (template) parameter to JPropertiesElement object
Utility class to parse parameter values.
std::ostream & write(std::ostream &out) const
Write the current parameter values.
Utility class to parse command line options.
const array_type< JKey_t > & get_keys(const std::map< JKey_t, JValue_t, JComparator_t, JAllocator_t > &data)
Method to create array of keys of map.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Empty structure for specification of parser element that is initialised (i.e. does not require input)...