173{
176
178 tree_info ta;
179 tree_info tb;
182
184
191
192 try {
193
195
198
199 JParser<> zap(
"Auxiliary program to print ROOT TTree information.");
200
205
206 zap(argc, argv);
207 }
208 catch(const exception &error) {
209 FATAL(error.what() << endl);
210 }
211
212 gErrorIgnoreLevel = kFatal;
213
214 int number_of_errors = 0;
215
216 for (vector<string>::const_iterator file_name = inputFile.begin(); file_name != inputFile.end(); ++file_name) {
217
218 TFile* file = TFile::Open(file_name->c_str());
219
220 if (file == NULL) {
221
222 ++number_of_errors;
223
224 cerr << *file_name << " not opened." << endl;
225
226 continue;
227 }
228
229 if (key == "") {
230 cout << *file_name << endl;
231 }
232
233 TIter iter(file->GetListOfKeys(), kIterBackward);
234
235 for (TKey* _key; (_key = (TKey*) iter.Next()) != NULL; ) {
236
237 TKey* p = dynamic_cast<TKey*>(file->GetListOfKeys()->Before(_key));
238
239 DEBUG(
"Key: " << _key->GetName() <<
' ' << (p == NULL || strcmp(_key->GetName(), p->GetName()) != 0) << endl);
240
241 if (p == NULL || strcmp(_key->GetName(), p->GetName()) != 0) {
242
243 tb = tree_info(dynamic_cast<TTree*>(_key->ReadObj()));
244
246
247 if (tb.is_valid() && ta == tb) {
248
249 if (key == "")
250 cout << tb << endl;
251 else
252 format.
write(cout, key) <<
' ';
253 }
254 }
255 }
256
257 file->Close();
258
259 delete file;
260 }
261
262 return (number_of_errors == 0 ? 0 : 1);
263}
#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)...
Auxiliary base class for list of file names.