[ROOT] loopin'

From: Kevin M. Rhodes (kmr@alizarin.physics.wisc.edu)
Date: Fri Jun 30 2000 - 19:19:12 MEST


Suppose I have a file named tenhistograms.root
In this are ten histograms: { h1,h2,h3,h4,h6,h7,h8,h11,h12,h13 }

I have a loop that analyses the histograms.
However, I want to add a for/else statement so that if a histogram is not
present, the loop will not execute, and will simply go on to check the
next histogram that does exist.  Something like:

if(! 'histogram with that particular name in the file tenhistograms.root')
  cout << "Error!";
else
  'the loop'

Any ideas, anyone?

Kevin Rhodes
UW-Madison
Amanda Project



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:29 MET