Re: Turn error on opening file using Process and TSelector in Fatal

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Wed, 17 Feb 2010 15:44:44 +0100


In your analysis code (TSelector or whatever) you call something like

    mychain->LoadTree(entry);
The LoadTree will return a negative value (should be -3) if the file cannot be connected.

Rene

Constantin Loizides wrote:
> Hi Rene,
> yes one can do this of course, but it
> does not guarantee that when "at analysis
> time" (x mins laters) the file can be opened.
> Constantin
>
> On 02/17/2010 03:34 PM, Rene Brun wrote:
>> Hi Constantin,
>>
>> Why don't you make a test when adding the file to the chain? in this
>> case, you can take the appropriate action yourself and not include the
>> file in the chain if the file does not exist, or timeout or any of the
>> zillion possibilities that you can imagine.
>>
>> Rene Brun
>>
>> Constantin Loizides wrote:
>>> Dear all,
>>> is it possible to intercept failing open commands
>>> (in a TChain) when using a TSelector?
>>>
>>> In many cases the standard behavior of ROOT to skip and
>>> go on to the next file is ok, but there are cases where
>>> you really want to abort your analysis when the file
>>> could not be opened? (In the case I am talking about
>>> it is a file on castor that simply timed-out and was
>>> later accessible again, so opening all files beforehand
>>> is not fool proof).
>>>
>>> To me, the only (easy) way seems to overload the default
>>> error handler or set the gErrorAbortLevel = kError.
>>> But this would then treat all errors as fatal.
>>>
>>> Any ideas?
>>>
>>> Thanks,
>>> Constantin
>>>
>>
>
Received on Wed Feb 17 2010 - 15:41:40 CET

This archive was generated by hypermail 2.2.0 : Wed Feb 17 2010 - 17:50:01 CET